Parses a Yul source program string into abstract syntax.
(parse-yul yul-string) → block?
Returns either a block or a reserrp. Yul object notation is not supported at this time.
Function:
(defun parse-yul (yul-string) (declare (xargs :guard (stringp yul-string))) (let ((__function__ 'parse-yul)) (declare (ignorable __function__)) (b* ((tokens (tokenize-yul yul-string)) ((when (reserrp tokens)) tokens) ((mv top-block tokens-after-ast) (parse-block tokens)) ((when (reserrp top-block)) top-block) ((unless (null tokens-after-ast)) (reserrf "after parsing top-level yul block, there should be no more tokens"))) top-block)))
Theorem:
(defthm block-resultp-of-parse-yul (b* ((block? (parse-yul yul-string))) (block-resultp block?)) :rule-classes :rewrite)