|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.hql.ast.util.ASTPrinter
public class ASTPrinter
Utility for generating pretty "ASCII art" representations of syntax trees.
Constructor Summary | |
---|---|
ASTPrinter(boolean showClassNames)
|
|
ASTPrinter(java.lang.Class tokenTypeConstants)
Constructs a printer. |
|
ASTPrinter(java.lang.Class tokenTypeConstants,
boolean showClassNames)
Constructs a printer. |
Method Summary | |
---|---|
static void |
appendEscapedMultibyteChars(java.lang.String text,
java.lang.StringBuffer buf)
|
static java.lang.String |
escapeMultibyteChars(java.lang.String text)
|
java.lang.String |
getTokenTypeName(int type)
Returns the token type name for the given token type. |
boolean |
isShowClassNames()
Getter for property 'showClassNames'. |
java.lang.String |
nodeToString(antlr.collections.AST ast,
boolean showClassName)
|
java.lang.String |
showAsString(antlr.collections.AST ast,
java.lang.String header)
Renders the AST into 'ASCII art' form and returns that string representation. |
void |
showAst(antlr.collections.AST ast,
java.io.PrintStream out)
Prints the AST in 'ASCII art' form to the specified print stream. |
void |
showAst(antlr.collections.AST ast,
java.io.PrintWriter pw)
Prints the AST in 'ASCII art' tree form to the specified print writer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ASTPrinter(java.lang.Class tokenTypeConstants)
ASTPrinter(Class, boolean)
with showClassNames
as true
tokenTypeConstants
- The token types to use during printing; typically the {vocabulary}TokenTypes.java
interface generated by ANTLR.public ASTPrinter(boolean showClassNames)
public ASTPrinter(java.lang.Class tokenTypeConstants, boolean showClassNames)
tokenTypeConstants
- The token types to use during printing; typically the {vocabulary}TokenTypes.java
interface generated by ANTLR.showClassNames
- Should the AST class names be shown.Method Detail |
---|
public boolean isShowClassNames()
public java.lang.String showAsString(antlr.collections.AST ast, java.lang.String header)
ast
- The AST to display.header
- The header for the display.
public void showAst(antlr.collections.AST ast, java.io.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, java.io.PrintWriter pw)
ast
- The AST to print.pw
- The print writer to which the AST should be written.public java.lang.String getTokenTypeName(int type)
type
- The token type.
public java.lang.String nodeToString(antlr.collections.AST ast, boolean showClassName)
public static void appendEscapedMultibyteChars(java.lang.String text, java.lang.StringBuffer buf)
public static java.lang.String escapeMultibyteChars(java.lang.String text)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |