Matches
(vl-parse-port-reference &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
Note: We assume that if a bracket follows the identifier, it
belongs to this port reference. This is safe in port-expressions since only a
comma or end curly-brace will follow them. Since
Function:
(defun vl-parse-port-reference-fn (tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (let ((__function__ 'vl-parse-port-reference)) (declare (ignorable __function__)) (seq tokstream (id := (vl-match-token :vl-idtoken)) (unless (vl-is-token? :vl-lbrack) (return (make-vl-atom :guts (make-vl-id :name (vl-idtoken->name id))))) (:= (vl-match)) (range := (vl-parse-range-expression)) (unless (or (eq (vl-erange->type range) :vl-index) (eq (vl-erange->type range) :vl-colon)) (return-raw (vl-parse-error "The +: or -: operators are not allowed in port expressions."))) (:= (vl-match-token :vl-rbrack)) (return (vl-build-range-select (make-vl-atom :guts (make-vl-id :name (vl-idtoken->name id))) range)))))
Theorem:
(defthm vl-parse-port-reference-fails-gracefully (implies (mv-nth 0 (vl-parse-port-reference)) (not (mv-nth 1 (vl-parse-port-reference)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-port-reference (iff (vl-warning-p (mv-nth 0 (vl-parse-port-reference))) (mv-nth 0 (vl-parse-port-reference))))
Theorem:
(defthm vl-parse-port-reference-result (implies (and t) (equal (vl-expr-p (mv-nth 1 (vl-parse-port-reference))) (not (mv-nth 0 (vl-parse-port-reference))))))
Theorem:
(defthm vl-parse-port-reference-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-port-reference))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-port-reference))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-port-reference))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))