|
Bond 0.9
C++ Bond Runtime Library API Documentation
|
A formatter for Bond parse trees. More...
#include <bond/tools/prettyprinter.h>
Public Types | |
| enum | Verbosity { VERBOSITY_NORMAL , VERBOSITY_MINIMAL } |
| Controls whitespace and layout verbosity in pretty-printed output. More... | |
| enum | ConstantFolding { CONSTANT_FOLDING_OFF , CONSTANT_FOLDING_ON } |
| Controls whether constant expressions are folded before printing. More... | |
Public Member Functions | |
| void | Print (const ParseNode *parseNode, OutputStream &stream, Verbosity verbosity=VERBOSITY_NORMAL, ConstantFolding folding=CONSTANT_FOLDING_OFF) const |
| Prints Bond source code for a parse tree rooted at a single parse node. | |
| void | PrintList (const ListParseNode *listNode, OutputStream &stream, Verbosity verbosity=VERBOSITY_NORMAL, ConstantFolding folding=CONSTANT_FOLDING_OFF) const |
| Prints Bond source code for a parse tree represented as a list of parse nodes. | |
A formatter for Bond parse trees.
PrettyPrinter converts parse trees back into Bond source code using consistent formatting rules. It can optionally emit minimal formatting and fold constant expressions.
| void Bond::PrettyPrinter::Print | ( | const ParseNode * | parseNode, |
| OutputStream & | stream, | ||
| Verbosity | verbosity = VERBOSITY_NORMAL, | ||
| ConstantFolding | folding = CONSTANT_FOLDING_OFF ) const |
| void Bond::PrettyPrinter::PrintList | ( | const ListParseNode * | listNode, |
| OutputStream & | stream, | ||
| Verbosity | verbosity = VERBOSITY_NORMAL, | ||
| ConstantFolding | folding = CONSTANT_FOLDING_OFF ) const |
Prints Bond source code for a parse tree represented as a list of parse nodes.
| listNode | Head of the parse node list to print. |
| stream | Output stream receiving the formatted Bond source. |
| verbosity | Controls output spacing and compactness. |
| folding | Controls whether constant expressions are folded before printing. |