Represent a preprocessing lexeme as a message.
(plexeme-to-msg lexeme) → msg
This is used in preprocessor error messages. It is similar to token-to-msg for the parser.
Function:
(defun plexeme-to-msg (lexeme) (declare (xargs :guard (plexeme-optionp lexeme))) (if lexeme (plexeme-case lexeme :header "a header name" :ident (msg "the identifier ~x0" (ident->unwrap lexeme.ident)) :number "a preprocessing number" :char "a character constant" :string "a string literal" :punctuator "a punctuator" :other "some other character" :block-comment "a block comment" :line-comment "a line comment" :newline "a new line" :spaces "one ore more spaces" :horizontal-tab "a horizontal tab" :vertical-tab "a vertical tab" :form-feed "a form feed") "end of file"))
Theorem:
(defthm msgp-of-plexeme-to-msg (b* ((msg (plexeme-to-msg lexeme))) (msgp msg)) :rule-classes :rewrite)
Theorem:
(defthm plexeme-to-msg-of-plexeme-option-fix-lexeme (equal (plexeme-to-msg (plexeme-option-fix lexeme)) (plexeme-to-msg lexeme)))
Theorem:
(defthm plexeme-to-msg-plexeme-option-equiv-congruence-on-lexeme (implies (plexeme-option-equiv lexeme lexeme-equiv) (equal (plexeme-to-msg lexeme) (plexeme-to-msg lexeme-equiv))) :rule-classes :congruence)