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.