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?) (equal token? (token-keyword "_Atomic")) (equal token? (token-keyword "struct")) (equal token? (token-keyword "union")) (equal token? (token-keyword "enum")) (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)