Parse a list of one or more attributes, separated by commas.
(parse-attribute-list pstate) → (mv erp attrs span new-pstate)
This is only used if GCC extensions are supported.
See the ABNF grammar rule for
Function:
(defun parse-attribute-list (pstate) (declare (xargs :guard (parstatep pstate))) (let ((__function__ 'parse-attribute-list)) (declare (ignorable __function__)) (b* (((reterr) nil (irr-span) (irr-parstate)) ((erp attr span pstate) (parse-attribute pstate)) ((erp token & pstate) (read-token pstate))) (cond ((equal token (token-punctuator ",")) (b* (((erp attrs last-span pstate) (parse-attribute-list pstate))) (retok (cons attr attrs) (span-join span last-span) pstate))) (t (b* ((pstate (if token (unread-token pstate) pstate))) (retok (list attr) span pstate)))))))
Theorem:
(defthm attrib-listp-of-parse-attribute-list.attrs (b* (((mv acl2::?erp ?attrs ?span ?new-pstate) (parse-attribute-list pstate))) (attrib-listp attrs)) :rule-classes :rewrite)
Theorem:
(defthm spanp-of-parse-attribute-list.span (b* (((mv acl2::?erp ?attrs ?span ?new-pstate) (parse-attribute-list pstate))) (spanp span)) :rule-classes :rewrite)
Theorem:
(defthm parstatep-of-parse-attribute-list.new-pstate (b* (((mv acl2::?erp ?attrs ?span ?new-pstate) (parse-attribute-list pstate))) (parstatep new-pstate)) :rule-classes :rewrite)
Theorem:
(defthm parsize-of-parse-attribute-list-uncond (b* (((mv acl2::?erp ?attrs ?span ?new-pstate) (parse-attribute-list pstate))) (<= (parsize new-pstate) (parsize pstate))) :rule-classes :linear)
Theorem:
(defthm parsize-of-parse-attribute-list-cond (b* (((mv acl2::?erp ?attrs ?span ?new-pstate) (parse-attribute-list pstate))) (implies (not erp) (<= (parsize new-pstate) (1- (parsize pstate))))) :rule-classes :linear)