Lexes the Unicode codepoints
(lexemize-pfcs pfcs-codepoints) → pfcs-lexemes
A lexeme is a token or whitespace.
If the input cannot be fully lexed, a reserrp is returned.
Function:
(defun lexemize-pfcs (pfcs-codepoints) (declare (xargs :guard (nat-listp pfcs-codepoints))) (let ((__function__ 'lexemize-pfcs)) (declare (ignorable __function__)) (b* (((mv trees rest-input) (lex-*-lexeme pfcs-codepoints)) ((when (reserrp trees)) (reserrf (cons :unexpected-reserrp trees))) ((unless (null rest-input)) (reserrf (cons :cannot-fully-lex (cons trees rest-input))))) trees)))
Theorem:
(defthm tree-list-resultp-of-lexemize-pfcs (b* ((pfcs-lexemes (lexemize-pfcs pfcs-codepoints))) (abnf::tree-list-resultp pfcs-lexemes)) :rule-classes :rewrite)