public final class AutumnPrettyPrinter
extends java.lang.Object
Note: The output of this pretty-printer is version-specific.
| Constructor and Description |
|---|
AutumnPrettyPrinter()
Constructor.
|
AutumnPrettyPrinter(java.io.PrintStream out)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static java.io.PrintStream |
createStreamASCII(java.lang.StringBuilder builder)
This method creates a PrintStream that prints to a StringBuilder using ASCII.
|
static java.util.List<IConstruct> |
nodesOf(IConstruct node)
This method linearizes the nodes in a given abstract-syntax-tree.
|
void |
print(IConstruct node)
This method prints an abstract-syntax-tree node to the underlying stream.
|
java.io.PrintStream |
stream()
This method retrieves the stream that is being printed to.
|
public AutumnPrettyPrinter()
Equivalent:
AutumnPrettyPrinter(System.out)
public AutumnPrettyPrinter(java.io.PrintStream out)
out - is the stream to print to.public java.io.PrintStream stream()
public void print(IConstruct node) throws UnprintableNodeException, IncompleteNodeException, RepeatedNodeException
node - is the AST node to print, which may be the root of an entire tree.UnprintableNodeException - if the AST contains a node that is unprintable.IncompleteNodeException - if the AST is incomplete.RepeatedNodeException - if the AST contains the same node more than once.public static java.io.PrintStream createStreamASCII(java.lang.StringBuilder builder)
Note: The returned stream throws an IOException, when non-ASCII encoded text is encountered.
Note: The returned stream cannot be used to print null characters (i.e. ASCII(0)).
builder - is the builder to print ASCII encoded characters to.public static java.util.List<IConstruct> nodesOf(IConstruct node)
node - is the root of the AST.