• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • 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
            • 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
              • Vl-parse-package-declaration
              • Vl-parse-genelements-or-classes-until
              • Vl-skip-through-endpackage
                • Vl-parse-genelement-or-class
                • Vl-make-package-with-parse-error
              • 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-packages

    Vl-skip-through-endpackage

    Special error recovery for parse errors encountered during packages.

    Signature
    (vl-skip-through-endpackage pkgname &key (tokstream 'tokstream) 
                                (config 'config)) 
     
      → 
    (mv errmsg? value new-tokstream)
    Arguments
    config — Guard (vl-loadconfig-p config).

    Definitions and Theorems

    Function: vl-skip-through-endpackage-fn

    (defun vl-skip-through-endpackage-fn (pkgname tokstream config)
      (declare (xargs :stobjs (tokstream)))
      (declare (xargs :guard (vl-loadconfig-p config)))
      (declare (ignorable config))
      (declare (xargs :guard (stringp pkgname)))
      (let ((__function__ 'vl-skip-through-endpackage))
        (declare (ignorable __function__))
        (seq tokstream
             (unless (vl-is-token? :vl-kwd-endpackage)
                     (:s= (vl-match-any))
                     (endkwd := (vl-skip-through-endpackage pkgname))
                     (return endkwd))
             (endkwd := (vl-match))
             (:= (vl-parse-endblock-name pkgname "package/endpackage"))
             (return endkwd))))

    Theorem: vl-skip-through-endpackage-fails-gracefully

    (defthm vl-skip-through-endpackage-fails-gracefully
      (implies (mv-nth 0 (vl-skip-through-endpackage pkgname))
               (not (mv-nth 1
                            (vl-skip-through-endpackage pkgname)))))

    Theorem: vl-warning-p-of-vl-skip-through-endpackage

    (defthm vl-warning-p-of-vl-skip-through-endpackage
     (iff (vl-warning-p (mv-nth 0 (vl-skip-through-endpackage pkgname)))
          (mv-nth 0
                  (vl-skip-through-endpackage pkgname))))

    Theorem: vl-skip-through-endpackage-result

    (defthm vl-skip-through-endpackage-result
     (implies
       (and (force (stringp pkgname)))
       (equal
            (vl-token-p (mv-nth 1 (vl-skip-through-endpackage pkgname)))
            (not (mv-nth 0
                         (vl-skip-through-endpackage pkgname))))))

    Theorem: vl-skip-through-endpackage-count-strong

    (defthm vl-skip-through-endpackage-count-strong
     (and
      (<=
        (vl-tokstream-measure
             :tokstream (mv-nth 2 (vl-skip-through-endpackage pkgname)))
        (vl-tokstream-measure))
      (implies
       (not (mv-nth 0 (vl-skip-through-endpackage pkgname)))
       (<
        (vl-tokstream-measure
             :tokstream (mv-nth 2 (vl-skip-through-endpackage pkgname)))
        (vl-tokstream-measure))))
     :rule-classes ((:rewrite) (:linear)))