(vl-parse-enum-name-declaration &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
Function:
(defun vl-parse-enum-name-declaration-fn (tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (let ((__function__ 'vl-parse-enum-name-declaration)) (declare (ignorable __function__)) (seq tokstream (name := (vl-match-token :vl-idtoken)) (when (vl-is-token? :vl-lbrack) (:= (vl-match)) (left := (vl-match-token :vl-inttoken)) (when (or (not (vl-inttoken->value left)) (member #\' (vl-echarlist->chars (vl-inttoken->etext left)))) (return-raw (vl-parse-error "Illegal enum index"))) (when (vl-is-token? :vl-colon) (:= (vl-match)) (right := (vl-match-token :vl-inttoken)) (when (or (not (vl-inttoken->value right)) (member #\' (vl-echarlist->chars (vl-inttoken->etext right)))) (return-raw (vl-parse-error "Illegal enum index")))) (:= (vl-match-token :vl-rbrack))) (when (vl-is-token? :vl-equalsign) (:= (vl-match)) (value := (vl-parse-expression))) (return (make-vl-enumitem :name (vl-idtoken->name name) :range (cond ((not left) nil) ((not right) (make-vl-range :msb (vl-make-index (vl-inttoken->value left)) :lsb (vl-make-index (vl-inttoken->value left)))) (t (make-vl-range :msb (vl-make-index (vl-inttoken->value left)) :lsb (vl-make-index (vl-inttoken->value right))))) :value value)))))
Theorem:
(defthm vl-parse-enum-name-declaration-fails-gracefully (implies (mv-nth 0 (vl-parse-enum-name-declaration)) (not (mv-nth 1 (vl-parse-enum-name-declaration)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-enum-name-declaration (iff (vl-warning-p (mv-nth 0 (vl-parse-enum-name-declaration))) (mv-nth 0 (vl-parse-enum-name-declaration))))
Theorem:
(defthm vl-parse-enum-name-declaration-result (implies (and t) (equal (vl-enumitem-p (mv-nth 1 (vl-parse-enum-name-declaration))) (not (mv-nth 0 (vl-parse-enum-name-declaration))))))
Theorem:
(defthm vl-parse-enum-name-declaration-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-enum-name-declaration))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-enum-name-declaration))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-enum-name-declaration))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))