Check if an optional token may start a type specifier.
(token-type-specifier-start-p token?) → yes/no
Looking at the grammar, a type specifier may start with certain keywords, or it could be an identifier.
Function:
(defun token-type-specifier-start-p (token?) (declare (xargs :guard (token-optionp token?))) (let ((__function__ 'token-type-specifier-start-p)) (declare (ignorable __function__)) (or (token-type-specifier-keyword-p token?) (token-keywordp token? "_Atomic") (token-keywordp token? "struct") (token-keywordp token? "union") (token-keywordp token? "enum") (token-keywordp token? "typeof") (token-keywordp token? "__typeof") (token-keywordp token? "__typeof__") (and token? (token-case token? :ident)))))
Theorem:
(defthm booleanp-of-token-type-specifier-start-p (b* ((yes/no (token-type-specifier-start-p token?))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm non-nil-when-token-type-specifier-start-p (implies (token-type-specifier-start-p token?) token?) :rule-classes :compound-recognizer)