• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
        • Syntax-for-tools
        • Atc
          • Atc-implementation
            • Atc-abstract-syntax
            • Atc-pretty-printer
              • Pprint-expressions
              • Pprint-expr
              • Expr-grade
              • Pprint-obj-declor
              • Expr-grade-<=
              • Binop-expected-grades
              • Pprint-obj-declon
              • Expr->grade
              • Pprint-tyspecseq
              • Pprint-tag-declon
              • Pprint-struct-declon-list
              • Pprint-fun-declor
              • Pprint-file
              • Pprint-stmt
              • Pprint-struct-declon
              • Pprint-obj-adeclor
              • Pprint-initer
              • Pprint-fun-declon
              • Pprint-indent
              • Pprint-hex-const
              • Pprint-fileset
              • Pprint-dec-const
              • Pprinted-lines-to-file
              • Pprint-tyname
              • Pprint-param-declon-list
              • Pprint-oct-const
              • Pprint-iconst-length
              • Pprint-iconst
              • Pprint-const
              • Expr-grade-index
              • Pprint-param-declon
              • Pprint-label
              • Pprint-ident-list
              • Pprint-binop
              • Pprint-fundef
              • Pprint-file-to-filesystem
              • Pprint-ext-declon-list
              • Pprint-unop
              • Pprint-line
              • Pprint-ident
              • Pprint-ext-declon
              • Pprint-comma-sep
              • Pprint-transunit
              • Pprint-one-line
              • Pprinted-lines-to-channel
              • Pprint-one-line-blank
              • Pprint-line-blank
            • Atc-event-and-code-generation
            • Fty-pseudo-term-utilities
            • Atc-term-recognizers
            • Atc-input-processing
            • Atc-shallow-embedding
            • Atc-process-inputs-and-gen-everything
            • Atc-table
            • Atc-fn
            • Atc-pretty-printing-options
            • Atc-types
            • Atc-macro-definition
          • Atc-tutorial
        • Language
        • Representation
        • Transformation-tools
        • Insertion-sort
        • Pack
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Bigmems
      • Builtins
      • Execloader
      • Aleo
      • Solidity
      • Paco
      • Concurrent-programs
      • Bls12-377-curves
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Atc-implementation

Atc-pretty-printer

A pretty-printer of C abstract syntax for ATC.

This pretty-printer produces text in the form of msgp and msg-listp values. The latter generally consist of lines of text; that is always the case at the top level, i.e. a C file is turned into a list of lines. Some pretty-printing functions produce msgp values that other pretty-printing functions incorporate into larger text. In the pretty-printing functions, we consistently use the result names part for msgp values that are part of lines, parts for msg-listp values that are lists of parts of lines, line for msgp values that are individual lines, and lines for msg-listp values that are multiple lines.

A separate function writes the lines for a C (syntactic) file to an output channel, which is associated to a file in the file system.

We use some pretty-printing options that influence some aspects of the pretty-printing. For now only a simple option is supported, but more options may be supported.

Subtopics

Pprint-expressions
Pretty-printing of expressions.
Pprint-expr
Pretty-print an expression.
Expr-grade
Grades of expressions.
Pprint-obj-declor
Pretty-print an object declarator.
Expr-grade-<=
Total order over expression grades.
Binop-expected-grades
Expression grades of the operands of the binary operators.
Pprint-obj-declon
Pretty-print an object declaration.
Expr->grade
Grade of an abstract syntactic expression.
Pprint-tyspecseq
Pretty-print a sequence of type specifiers.
Pprint-tag-declon
Pretty-print a tag declaration.
Pprint-struct-declon-list
Pretty-print a list of structure declarations.
Pprint-fun-declor
Pretty-print a function declarator.
Pprint-file
Pretty-print a file.
Pprint-stmt
Pretty-print a statement.
Pprint-struct-declon
Pretty-print a structure declaration.
Pprint-obj-adeclor
Pretty-print an abstract object declarator.
Pprint-initer
Pretty-print an initializer.
Pprint-fun-declon
Pretty-print a function declaration.
Pprint-indent
Pretty-print identation spaces.
Pprint-hex-const
Pretty-print a hexadecimal constant.
Pprint-fileset
Pretty-print a file set to the file system.
Pprint-dec-const
Pretty-print a decimal constant.
Pprinted-lines-to-file
Write pretty-printed lines to a file.
Pprint-tyname
Pretty-print a type name.
Pprint-param-declon-list
Pretty-print a list of parameter declarations.
Pprint-oct-const
Pretty-print an octal constant.
Pprint-iconst-length
Pretty-print a length suffix of integer constants.
Pprint-iconst
Pretty-print an integer constant.
Pprint-const
Pretty-print a constant.
Expr-grade-index
Pprint-param-declon
Pretty-print a parameter declaration.
Pprint-label
Pretty-print a label.
Pprint-ident-list
Pretty-print a list of identifiers.
Pprint-binop
Pretty-print a binary operator.
Pprint-fundef
Pretty-print a function definition.
Pprint-file-to-filesystem
Pretty-print a file to the file system.
Pprint-ext-declon-list
Pretty-print a list of external declarations.
Pprint-unop
Pretty-print a unary operator.
Pprint-line
Pretty-print a (non-blank) line of code.
Pprint-ident
Pretty-print an identifier.
Pprint-ext-declon
Pretty-print an external declaration.
Pprint-comma-sep
Turn zero or more parts into a single part containing the zero or more parts, comma-separated.
Pprint-transunit
Pretty-print a translation units.
Pprint-one-line
Pretty-print a (non-blank) line of code, as a singleton list of lines.
Pprinted-lines-to-channel
Write pretty-printed lines to a channel.
Pprint-one-line-blank
Pretty-print a blank line of code, as a singleton list of lines.
Pprint-line-blank
Pretty-print a blank line of code.