• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
      • Io
      • Defttag
      • Sys-call
      • Save-exec
      • Quicklisp
      • Oslib
      • Std/io
      • Bridge
      • Clex
        • Example-lexer
          • Token-p
          • Lex-punctuation
          • Lex-id/keyword
          • Lex-string
          • Lex-comment
          • Lex-whitespace
          • Lex1
          • Lex-main
          • Lex*
          • Tokenlist-p
          • Idtail-char-p
          • Letter-char-p
          • Whitespace-char-p
          • Number-char-p
          • Tokentype-p
          • Lex*-exec
            • Newline-string
          • Sin
          • Matching-functions
          • Def-sin-progress
        • Tshell
        • Unsound-eval
        • Hacker
        • Startup-banner
        • Command-line
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Example-lexer

    Lex*-exec

    Tail-recursive version of lex* (to prevent stack overflows).

    Signature
    (lex*-exec sin acc) → (mv okp new-acc sin)

    Definitions and Theorems

    Function: lex*-exec

    (defun lex*-exec (sin acc)
           (declare (xargs :stobjs (sin)))
           (declare (xargs :guard t))
           (let ((__function__ 'lex*-exec))
                (declare (ignorable __function__))
                (b* (((when (sin-endp sin)) (mv t acc sin))
                     ((mv tok1 sin) (lex1 sin))
                     ((unless tok1) (mv nil acc sin)))
                    (lex*-exec sin (cons tok1 acc)))))