(vl-parse-unpacked-dimension &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
Function:
(defun vl-parse-unpacked-dimension-fn (tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (let ((__function__ 'vl-parse-unpacked-dimension)) (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)) (when (vl-is-token? :vl-colon) (:= (vl-match)) (lsb := (vl-parse-expression))) (:= (vl-match-token :vl-rbrack)) (return (if lsb (make-vl-range :msb msb :lsb lsb) (make-vl-range :msb (vl-make-index 0) :lsb (make-vl-nonatom :op :vl-binary-minus :args (list msb (vl-make-index 1)))))))))
Theorem:
(defthm vl-parse-unpacked-dimension-fails-gracefully (implies (mv-nth 0 (vl-parse-unpacked-dimension)) (not (mv-nth 1 (vl-parse-unpacked-dimension)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-unpacked-dimension (iff (vl-warning-p (mv-nth 0 (vl-parse-unpacked-dimension))) (mv-nth 0 (vl-parse-unpacked-dimension))))
Theorem:
(defthm vl-parse-unpacked-dimension-result (implies (and t) (equal (vl-packeddimension-p (mv-nth 1 (vl-parse-unpacked-dimension))) (not (mv-nth 0 (vl-parse-unpacked-dimension))))))
Theorem:
(defthm vl-parse-unpacked-dimension-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-unpacked-dimension))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-unpacked-dimension))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-unpacked-dimension))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))