Parse a
(vl-parse-tf-call &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
Original grammar rules:
tf_call ::= ps_or_hierarchical_tf_identifier { attribute_instance } [ '(' list_of_arguments ')' ] ps_or_hierarchical_tf_identifier ::= [package_scope] tf_identifier | hierarchical_tf_identifier hierarchical_tf_identifier ::= hierarchical_identifier tf_identifier ::= identifier
So this is just:
tf_call ::= [package_scope] identifier {attribute_instance} [ '(' list_of_arguments ')' ] | hierarchical_identifier {attribute_instance} [ '(' list_of_arguments ')' ]
Function:
(defun vl-parse-tf-call-fn (tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (let ((__function__ 'vl-parse-tf-call)) (declare (ignorable __function__)) (seq tokstream (loc := (vl-current-loc)) (id :s= (vl-parse-scoped-hid)) (atts := (vl-parse-0+-attribute-instances)) (unless (vl-is-token? :vl-lparen) (return (make-vl-callstmt :id id :typearg nil :systemp nil :voidp nil :args nil :atts atts :loc loc))) (:= (vl-match)) (when (vl-is-token? :vl-rparen) (:= (vl-match)) (return (make-vl-callstmt :id id :typearg nil :systemp nil :voidp nil :args nil :atts atts :loc loc))) (args := (vl-parse-1+-expressions-separated-by-commas)) (:= (vl-match-token :vl-rparen)) (return (make-vl-callstmt :id id :typearg nil :systemp nil :voidp nil :args args :atts atts :loc loc)))))
Theorem:
(defthm vl-parse-tf-call-fails-gracefully (implies (mv-nth 0 (vl-parse-tf-call)) (not (mv-nth 1 (vl-parse-tf-call)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-tf-call (iff (vl-warning-p (mv-nth 0 (vl-parse-tf-call))) (mv-nth 0 (vl-parse-tf-call))))
Theorem:
(defthm vl-parse-tf-call-result (implies (and t) (equal (vl-stmt-p (mv-nth 1 (vl-parse-tf-call))) (not (mv-nth 0 (vl-parse-tf-call))))))
Theorem:
(defthm vl-parse-tf-call-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-tf-call))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-tf-call))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-tf-call))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm vl-stmt-kind-of-vl-parse-tf-call (b* (((mv err stmt ?tokstream) (vl-parse-tf-call))) (implies (not err) (equal (vl-stmt-kind stmt) :vl-callstmt))))