Parse UTF-8 bytes into a CST.
(parse-from-bytes+ leo-bytes) → (mv tree lexemes)
Lexes, tokenizes, and parses a Leo source file expressed
as a list of UTF-8 bytes. Returns a
If any step fails, returns a reserr. The parse consumes all the bytes or a reserr is returned.
Function:
(defun parse-from-bytes+ (leo-bytes) (declare (xargs :guard (nat-listp leo-bytes))) (let ((__function__ 'parse-from-bytes+)) (declare (ignorable __function__)) (b* ((lexemes-or-err (lexemize-leo-from-bytes leo-bytes))) (lexemes-to-cst+ "file" lexemes-or-err))))
Theorem:
(defthm tree-resultp-of-parse-from-bytes+.tree (b* (((mv ?tree ?lexemes) (parse-from-bytes+ leo-bytes))) (abnf::tree-resultp tree)) :rule-classes :rewrite)
Theorem:
(defthm tree-listp-of-parse-from-bytes+.lexemes (b* (((mv ?tree ?lexemes) (parse-from-bytes+ leo-bytes))) (abnf::tree-listp lexemes)) :rule-classes :rewrite)