• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
          • Syntax-for-tools
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Compilation-database
            • Printer
            • Output-files
            • Abstract-syntax-operations
            • Implementation-environments
            • Abstract-syntax
            • Concrete-syntax
            • Disambiguation
            • Validation
            • Gcc-builtins
            • Preprocessing
              • Preprocessor
                • Pproc
                • Preprocessor-states
                • Preprocessor-printer
                • Pproc-directive
                • Pread-token
                • Pproc-files
                • Pread-token/newline
                • Pproc-group-part
                  • Preprocessor-lexer
                  • Pproc-file
                  • Pproc-include-directive
                  • Pproc-text-line
                  • Pproc-*-group-part
                  • Punread-token
                  • *pproc-files-max*
                  • String-plexeme-list-alist-to-filepath-filedata-map
                  • String-plexeme-list-alist
                  • Read-input-file-to-preproc
                  • Preprocessor-reader
                  • Preprocessor-messages
                • External-preprocessing
              • Parsing
            • Atc
            • Transformation-tools
            • Language
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Preprocessor
    • Pproc

    Pproc-group-part

    Preprocess a group part.

    Signature
    (pproc-group-part path file preprocessed 
                      preprocessing rev-lexemes ppstate state) 
     
      → 
    (mv erp new-rev-lexemes new-ppstate new-preprocessed state)
    Arguments
    path — Guard (stringp path).
    file — Guard (stringp file).
    preprocessed — Guard (string-plexeme-list-alistp preprocessed).
    preprocessing — Guard (string-listp preprocessing).
    rev-lexemes — Guard (plexeme-listp rev-lexemes).
    ppstate — Guard (ppstatep ppstate).
    Returns
    new-rev-lexemes — Type (plexeme-listp new-rev-lexemes).
    new-ppstate — Type (ppstatep new-ppstate), given (ppstatep ppstate).
    new-preprocessed — Type (string-plexeme-list-alistp new-preprocessed).

    We read the next token or new line, skipping over white space and comments. If we find no token or new line, it is an error, because it means that the file has some white space or comments without a terminating new line; this function is called (by pproc-*-group-part) only if we are not at the end of file.

    If we find a new line, it means that we have a text line (see grammar) without tokens. In this case we have finished the group part and we return all the lexemes. For example, this could contain comments, which we therefore preserve.

    If we find a hash, we have a directive, which we handle in a separate function. We discard any white space and comments preceding the hash.

    If we do not find a hash, we have a text line with tokens: we put back the token and we call a separate function. We pass any preceding white space and comments to that function.