Match as many
(vl-parse-0+-block-item-declarations &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
We use backtracking to know when to stop, because these declarations can be followed by arbitrary statements, hence it's not clear whether something like (* ... *) attributes are for the start of a new block item declaration or for a statement.
Function:
(defun vl-parse-0+-block-item-declarations-fn (tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (let ((__function__ 'vl-parse-0+-block-item-declarations)) (declare (ignorable __function__)) (b* ((backup (vl-tokstream-save)) ((mv erp first tokstream) (vl-parse-block-item-declaration)) ((when erp) (b* ((tokstream (vl-tokstream-restore backup))) (mv nil nil tokstream)))) (seq tokstream (rest := (vl-parse-0+-block-item-declarations)) (return (append first rest))))))
Theorem:
(defthm vl-parse-0+-block-item-declarations-never-fails (not (mv-nth 0 (vl-parse-0+-block-item-declarations))))
Theorem:
(defthm vl-parse-0+-block-item-declarations-result (implies (and (not (mv-nth 0 (vl-parse-0+-block-item-declarations))) (and t)) (vl-blockitemlist-p (mv-nth 1 (vl-parse-0+-block-item-declarations)))))
Theorem:
(defthm vl-parse-0+-block-item-declarations-true-listp (true-listp (mv-nth 1 (vl-parse-0+-block-item-declarations))) :rule-classes :type-prescription)
Theorem:
(defthm vl-parse-0+-block-item-declarations-count-strong-on-value (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-0+-block-item-declarations))) (vl-tokstream-measure)) (implies (mv-nth 1 (vl-parse-0+-block-item-declarations)) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-0+-block-item-declarations))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))