(vl-parse-packeddimension &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
Function:
(defun vl-parse-packeddimension-fn (tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (let ((__function__ 'vl-parse-packeddimension)) (declare (ignorable __function__)) (seq tokstream (:= (vl-match-token :vl-lbrack)) (when (vl-is-token? :vl-rbrack) (:= (vl-match)) (return :vl-unsized-dimension)) (msb := (vl-parse-expression)) (:= (vl-match-token :vl-colon)) (lsb := (vl-parse-expression)) (:= (vl-match-token :vl-rbrack)) (return (make-vl-range :msb msb :lsb lsb)))))
Theorem:
(defthm vl-parse-packeddimension-fails-gracefully (implies (mv-nth 0 (vl-parse-packeddimension)) (not (mv-nth 1 (vl-parse-packeddimension)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-packeddimension (iff (vl-warning-p (mv-nth 0 (vl-parse-packeddimension))) (mv-nth 0 (vl-parse-packeddimension))))
Theorem:
(defthm vl-parse-packeddimension-result (implies (and t) (equal (vl-packeddimension-p (mv-nth 1 (vl-parse-packeddimension))) (not (mv-nth 0 (vl-parse-packeddimension))))))
Theorem:
(defthm vl-parse-packeddimension-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-packeddimension))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-packeddimension))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-packeddimension))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))