Parse source string for a supported grammar rule name.
(parse-fragment-to-cst rule-name source-code) → tree
Supported grammar rule names are
If the given rule cannot be parsed or if there are tokens left over, then a reserr is returned.
Since ACL2 strings are sequences of characters with codes from 0 to 255,
Function:
(defun parse-fragment-to-cst (rule-name source-code) (declare (xargs :guard (and (stringp rule-name) (stringp source-code)))) (let ((__function__ 'parse-fragment-to-cst)) (declare (ignorable __function__)) (b* (((mv cst ?lexemes) (parse-fragment-to-cst+ rule-name source-code))) cst)))
Theorem:
(defthm tree-resultp-of-parse-fragment-to-cst (b* ((tree (parse-fragment-to-cst rule-name source-code))) (abnf::tree-resultp tree)) :rule-classes :rewrite)