Parse UTF-8 ACL2 string into a CST.
(parse-from-string+ leo-string) → (mv tree lexemes)
Lexes, tokenizes, and parses a Leo source file expressed
as a string of ACL2 characters whose char-codes are UTF-8 bytes.
Returns a
If any step fails, returns a reserr. The parse consumes the entire string or a reserr is returned.
Since ACL2 strings are sequences of characters with codes from 0 to 255,
Function:
(defun parse-from-string+ (leo-string) (declare (xargs :guard (stringp leo-string))) (let ((__function__ 'parse-from-string+)) (declare (ignorable __function__)) (b* ((lexemes-or-err (lexemize-leo-from-string leo-string))) (lexemes-to-cst+ "file" lexemes-or-err))))
Theorem:
(defthm tree-resultp-of-parse-from-string+.tree (b* (((mv ?tree ?lexemes) (parse-from-string+ leo-string))) (abnf::tree-resultp tree)) :rule-classes :rewrite)
Theorem:
(defthm tree-listp-of-parse-from-string+.lexemes (b* (((mv ?tree ?lexemes) (parse-from-string+ leo-string))) (abnf::tree-listp lexemes)) :rule-classes :rewrite)