public class ASTPrinter extends Object
Modifier and Type | Method and Description |
---|---|
static void |
appendEscapedMultibyteChars(String text,
StringBuilder buf) |
static String |
escapeMultibyteChars(String text) |
String |
getTokenTypeName(int type)
Returns the token type name for the given token type.
|
String |
nodeToString(antlr.collections.AST ast) |
String |
showAsString(antlr.collections.AST ast,
String header)
Renders the AST into 'ASCII art' form and returns that string representation.
|
void |
showAst(antlr.collections.AST ast,
PrintStream out)
Prints the AST in 'ASCII art' form to the specified print stream.
|
void |
showAst(antlr.collections.AST ast,
PrintWriter pw)
Prints the AST in 'ASCII art' tree form to the specified print writer.
|
public String showAsString(antlr.collections.AST ast, String header)
ast
- The AST to display.header
- The header for the display.public void showAst(antlr.collections.AST ast, PrintStream out)
ast
- The AST to print.out
- The print stream to which the AST should be printed.public void showAst(antlr.collections.AST ast, PrintWriter pw)
ast
- The AST to print.pw
- The print writer to which the AST should be written.public String getTokenTypeName(int type)
type
- The token type.public String nodeToString(antlr.collections.AST ast)
public static void appendEscapedMultibyteChars(String text, StringBuilder buf)
Copyright © 2021 JBoss by Red Hat. All rights reserved.