• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Vl-loadstate
          • Lexer
          • Parser
            • Parse-expressions
            • Parse-udps
            • Parse-statements
            • Parse-property
            • Vl-genelements
            • Parse-paramdecls
            • Parse-blockitems
            • Parse-utils
              • Defparser
              • Vl-endinfo-p
              • Vl-match-token
              • Vl-match-some-token
              • Vl-match-any-except
              • Vl-parse-error
              • Vl-match
              • Vl-type-of-matched-token
              • Vl-tokstream-backup-p
              • Vl-maybe-match-token
              • Vl-parse-warning
              • Vl-match-any
              • Vl-linestart-indent
              • Vl-current-loc
              • Vl-choose-parse-error
              • Vl-parse-endblock-name
                • Vl-tokenlist-fix
                • Vl-lookahead-is-some-token?
                • Vl-tokstream-fix
                • Vl-is-token?
                • Vl-is-some-token?
                • Vl-add-context-to-parser-warning
                • Vl-lookahead-is-token?
                • Vl-tokstream-save
                • Vl-tokstream->tokens
                • Vl-tokstream-restore
                • Vl-tokstream-add-warning
                • Vl-tokstream->pstate
                • Vl-tokstream->position
                • Expand-defparsers
                • Vl-tokstream-pop
                • *vl-default-token*
              • Parse-insts
              • Parse-functions
              • Parse-assignments
              • Parse-clocking
              • Parse-strengths
              • Vl-parse-genvar-declaration
              • Vl-parse
              • Parse-netdecls
              • Parse-asserts
              • Vl-maybe-parse-lifetime
              • Parse-dpi-import-export
              • Parse-ports
              • Parse-timeunits
              • Seq
              • Parse-packages
              • Parse-eventctrl
            • Vl-load-merge-descriptions
            • Vl-find-basename/extension
            • Vl-load-file
            • Vl-loadresult
            • Scope-of-defines
            • Vl-find-file
            • Vl-flush-out-descriptions
            • Vl-description
            • Vl-read-file
            • Vl-includeskips-report-gather
            • Vl-load-main
            • Extended-characters
            • Vl-load
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-preprocess-debug
            • Vl-write-preprocessor-debug-file
            • Vl-read-file-report-gather
            • Vl-load-descriptions
            • Vl-load-files
            • Translate-off
            • Vl-load-read-file-hook
            • Vl-read-file-report
            • Vl-loadstate-pad
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-loadstate->warnings
            • Vl-iskips-report
            • Vl-descriptionlist
          • Warnings
          • Getting-started
          • Utilities
          • Printer
          • Kit
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Parse-utils

    Vl-parse-endblock-name

    Signature
    (vl-parse-endblock-name name blktype &key (tokstream 'tokstream) 
                            (config 'config)) 
     
      → 
    (mv errmsg? value new-tokstream)
    Arguments
    config — Guard (vl-loadconfig-p config).

    Definitions and Theorems

    Function: vl-parse-endblock-name-fn

    (defun vl-parse-endblock-name-fn (name blktype tokstream config)
     (declare (xargs :stobjs (tokstream)))
     (declare (xargs :guard (vl-loadconfig-p config)))
     (declare (ignorable config))
     (declare (xargs :guard (and (stringp name) (stringp blktype))))
     (let ((__function__ 'vl-parse-endblock-name))
      (declare (ignorable __function__))
      (seq
         tokstream
         (unless (and (not (eq (vl-loadconfig->edition config)
                               :verilog-2005))
                      (vl-is-token? :vl-colon))
                 (return nil))
         (:= (vl-match))
         (endname := (vl-match-token :vl-idtoken))
         (when (equal name (vl-idtoken->name endname))
               (return name))
         (return-raw
              (mv (make-vl-warning
                       :type :vl-parse-error
                       :msg "At ~a0: mismatched ~s1 names: ~s2 vs. ~s3."
                       :args (list (vl-token->loc endname)
                                   blktype
                                   name (vl-idtoken->name endname)))
                  nil tokstream)))))

    Theorem: vl-parse-endblock-name-fails-gracefully

    (defthm vl-parse-endblock-name-fails-gracefully
      (implies (mv-nth 0 (vl-parse-endblock-name name blktype))
               (not (mv-nth 1
                            (vl-parse-endblock-name name blktype)))))

    Theorem: vl-warning-p-of-vl-parse-endblock-name

    (defthm vl-warning-p-of-vl-parse-endblock-name
      (iff (vl-warning-p (mv-nth 0
                                 (vl-parse-endblock-name name blktype)))
           (mv-nth 0
                   (vl-parse-endblock-name name blktype))))

    Theorem: vl-parse-endblock-name-count-weak

    (defthm vl-parse-endblock-name-count-weak
     (<= (vl-tokstream-measure
              :tokstream (mv-nth 2
                                 (vl-parse-endblock-name name blktype)))
         (vl-tokstream-measure))
     :rule-classes ((:rewrite) (:linear)))