• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Lexer
            • Lex-strings
            • Lex-identifiers
              • Vl-printable-not-whitespace-p
              • Vl-simple-id-tail-p
              • Vl-simple-id-head-p
              • Vl-read-escaped-identifier
              • Vl-lex-system-identifier
                • Vl-lex-system-identifier-token/remainder-thms
              • Vl-lex-simple-identifier-or-keyword
              • Vl-printable-not-whitespace-list-p
              • Vl-simple-id-tail-list-p
              • Vl-simple-id-head-list-p
              • Vl-read-simple-identifier
              • Vl-lex-escaped-identifier
            • Vl-typo-uppercase-p
            • Vl-typo-number-p
            • Vl-typo-lowercase-p
            • Lex-numbers
            • Chartypes
            • Vl-lex
            • Defchar
            • Tokens
            • Lex-keywords
            • Lexstate
            • Make-test-tokens
            • Lexer-utils
            • Lex-comments
            • Vl-typo-uppercase-list-p
            • Vl-typo-lowercase-list-p
            • Vl-typo-number-list-p
          • Vl-loadstate
          • Parser
          • Vl-load-merge-descriptions
          • Scope-of-defines
          • Vl-load-file
          • Vl-flush-out-descriptions
          • Vl-description
          • Vl-loadresult
          • Vl-read-file
          • Vl-find-basename/extension
          • Vl-find-file
          • Vl-read-files
          • Extended-characters
          • Vl-load
          • Vl-load-main
          • Vl-load-description
          • Vl-descriptions-left-to-load
          • Inject-warnings
          • Vl-load-descriptions
          • Vl-load-files
          • Vl-load-summary
          • Vl-collect-modules-from-descriptions
          • Vl-descriptionlist
        • Transforms
        • Lint
        • Mlib
        • Server
        • Kit
        • Printer
        • Esim-vl
        • Well-formedness
      • Sv
      • Fgl
      • Vwsim
      • Vl
      • X86isa
      • Svl
      • Rtl
    • Software-verification
    • Math
    • Testing-utilities
  • Lex-identifiers

Vl-lex-system-identifier

Try to match a system identifier (or some other special token like $ or $root.

Signature
(vl-lex-system-identifier echars dollarops) 
  → 
(mv token/nil remainder)
Arguments
echars — The characters we're lexing.
    Guard (vl-echarlist-p echars).
dollarops — Any special $ tokens.
    Guard (vl-plaintoken-alistp dollarops).

The order here is subtle. We check for a hit in dollarops first, before even checking if there are any characters at all in the tail, because $ is a valid token with special meaning in SystemVerilog, but is just invalid in Verilog-2005.

Definitions and Theorems

Function: vl-lex-system-identifier

(defun vl-lex-system-identifier (echars dollarops)
  (declare (xargs :guard (and (vl-echarlist-p echars)
                              (vl-plaintoken-alistp dollarops))))
  (let ((__function__ 'vl-lex-system-identifier))
    (declare (ignorable __function__))
    (b* (((unless (and (consp echars)
                       (eql (vl-echar->char (car echars))
                            #\$)))
          (mv nil echars))
         ((mv tail remainder)
          (vl-read-while-simple-id-tail (cdr echars)))
         (etext (cons (car echars) tail))
         (name (hons-copy (vl-echarlist->string etext)))
         (look (hons-assoc-equal name dollarops))
         ((when look)
          (mv (make-vl-plaintoken :type (cdr look)
                                  :etext etext)
              remainder))
         ((unless tail) (mv nil echars)))
      (mv (make-vl-sysidtoken :etext etext
                              :name name)
          remainder))))

Subtopics

Vl-lex-system-identifier-token/remainder-thms
Token and remainder theorems for vl-lex-system-identifier, automatically generated by def-token/remainder-thms.