• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • 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
          • Vl-loadstate
          • Parser
            • Parse-expressions
            • Parse-udps
            • Vl-genelements
            • Parse-paramdecls
            • Parse-blockitems
            • Parse-utils
              • Defparser
              • Vl-endinfo-p
              • Vl-match-token
              • Vl-match-some-token
              • Vl-match-any-except
              • Vl-type-of-matched-token
              • Vl-maybe-match-token
              • Vl-tokstream-backup-p
              • Vl-parse-error
                • Vl-match
                • Vl-parse-warning
                • Vl-match-any
                • Vl-current-loc
                • Vl-parse-endblock-name
                • Vl-tokenlist-fix
                • Vl-lookahead-is-some-token?
                • Vl-is-some-token?
                • Vl-is-token?
                • Vl-tokstream-save
                • Vl-tokstream-restore
                • Vl-tokstream-fix
                • Vl-lookahead-is-token?
                • Vl-tokstream->tokens
                • Vl-tokstream-add-warning
                • Vl-tokstream->pstate
                • Expand-defparsers
                • *vl-default-token*
              • Parse-insts
              • Parse-datatype
              • Parse-functions
              • Parse-datatypes
              • Parse-strengths
              • Vl-parse-genvar-declaration
              • Vl-parse
              • Parse-ports
              • Seq
              • Parse-packages
            • 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
    • Parse-utils

    Vl-parse-error

    Compatible with seq. Produce an error message (stopping execution) that includes the current location.

    Signature
    (vl-parse-error description 
                    &key (function '__function__) 
                    (tokstream 'tokstream)) 
     
      → 
    (mv errmsg value new-tokstream)
    Arguments
    description — Short description of what went wrong.
        Guard (stringp description).
    function — Guard (symbolp function).
    Returns
    errmsg — Type (vl-warning-p errmsg).
    value — Always just nil.
        Type (equal value nil).
    new-tokstream — Type (equal new-tokstream tokstream).

    Definitions and Theorems

    Function: vl-parse-error-fn

    (defun vl-parse-error-fn (description function tokstream)
     (declare (xargs :stobjs (tokstream)))
     (declare (xargs :guard (and (stringp description)
                                 (symbolp function))))
     (let ((__function__ 'vl-parse-error))
      (declare (ignorable __function__))
      (b* ((tokens (vl-tokstream->tokens)))
       (mv (make-vl-warning :type :vl-parse-error
                            :msg "Parse error at ~a0: ~s1"
                            :args (list (if (consp tokens)
                                            (vl-token->loc (car tokens))
                                          "EOF")
                                        description)
                            :fn function
                            :fatalp t)
           nil tokstream))))

    Theorem: vl-warning-p-of-vl-parse-error.errmsg

    (defthm vl-warning-p-of-vl-parse-error.errmsg
      (b* (((mv ?errmsg acl2::?value ?new-tokstream)
            (vl-parse-error-fn description function tokstream)))
        (vl-warning-p errmsg))
      :rule-classes :rewrite)

    Theorem: return-type-of-vl-parse-error.value

    (defthm return-type-of-vl-parse-error.value
      (b* (((mv ?errmsg acl2::?value ?new-tokstream)
            (vl-parse-error-fn description function tokstream)))
        (equal value nil))
      :rule-classes :rewrite)

    Theorem: return-type-of-vl-parse-error.new-tokstream

    (defthm return-type-of-vl-parse-error.new-tokstream
      (b* (((mv ?errmsg acl2::?value ?new-tokstream)
            (vl-parse-error-fn description function tokstream)))
        (equal new-tokstream tokstream))
      :rule-classes :rewrite)

    Theorem: vl-parse-error-0-under-iff

    (defthm vl-parse-error-0-under-iff
      (b* (((mv ?errmsg acl2::?value ?new-tokstream)
            (vl-parse-error-fn description function tokstream)))
        (iff errmsg t))
      :rule-classes :rewrite)