Matches
(vl-parse-tf-port-declaration atts &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
tf_port_declaration ::= { attribute_instance } tf_port_direction [ var ] data_type_or_implicit list_of_tf_variable_identifiers ';'
Function:
(defun vl-parse-tf-port-declaration-fn (atts tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (declare (xargs :guard (vl-atts-p atts))) (let ((__function__ 'vl-parse-tf-port-declaration)) (declare (ignorable __function__)) (seq tokstream (when (vl-is-token? :vl-kwd-const) (return-raw (vl-parse-error "BOZO implement 'const ref' task/function ports."))) (dir := (vl-match-some-token *vl-directions-kwds*)) (when (vl-is-token? :vl-kwd-var) (:= (vl-match))) (when (vl-is-some-token? '(:vl-kwd-signed :vl-kwd-unsigned)) (signing := (vl-match))) (when (vl-is-token? :vl-lbrack) (ranges := (vl-parse-0+-ranges))) (when (or signing ranges) (ids := (vl-parse-list-of-tf-variable-identifiers)) (:= (vl-match-token :vl-semi)) (return (vl-make-tf-ports-from-parsed-ids ids :atts atts :dir (cdr (assoc (vl-token->type dir) *vl-directions-kwd-alist*)) :type (make-vl-coretype :name :vl-logic :signedp (and signing (eq (vl-token->type signing) :vl-kwd-signed)) :pdims ranges)))) (when (and (vl-is-token? :vl-idtoken) (not (vl-parsestate-is-user-defined-type-p (vl-idtoken->name (car (vl-tokstream->tokens))) (vl-tokstream->pstate)))) (ids := (vl-parse-list-of-tf-variable-identifiers)) (:= (vl-match-token :vl-semi)) (return (vl-make-tf-ports-from-parsed-ids ids :atts atts :dir (cdr (assoc (vl-token->type dir) *vl-directions-kwd-alist*)) :type (make-vl-coretype :name :vl-logic :signedp nil :pdims nil)))) (type := (vl-parse-datatype)) (ids := (vl-parse-list-of-tf-variable-identifiers)) (:= (vl-match-token :vl-semi)) (return (vl-make-tf-ports-from-parsed-ids ids :atts atts :dir (cdr (assoc (vl-token->type dir) *vl-directions-kwd-alist*)) :type type)))))
Theorem:
(defthm vl-parse-tf-port-declaration-fails-gracefully (implies (mv-nth 0 (vl-parse-tf-port-declaration atts)) (not (mv-nth 1 (vl-parse-tf-port-declaration atts)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-tf-port-declaration (iff (vl-warning-p (mv-nth 0 (vl-parse-tf-port-declaration atts))) (mv-nth 0 (vl-parse-tf-port-declaration atts))))
Theorem:
(defthm vl-parse-tf-port-declaration-result (implies (and (force (vl-atts-p atts))) (vl-portdecllist-p (mv-nth 1 (vl-parse-tf-port-declaration atts)))))
Theorem:
(defthm vl-parse-tf-port-declaration-true-listp (true-listp (mv-nth 1 (vl-parse-tf-port-declaration atts))) :rule-classes :type-prescription)
Theorem:
(defthm vl-parse-tf-port-declaration-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-tf-port-declaration atts))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-tf-port-declaration atts))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-tf-port-declaration atts))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))