|
||||||||||
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
An 'ASCII art' AST printer for debugging ANTLR grammars.
Constructor Summary | |
---|---|
ASTPrinter(java.lang.Class tokenTypeConstants)
Constructs an org.hibernate.hql.antlr.ASTPrinter, given the class that contains the token type constants (typically the '{grammar}TokenTypes' interface generated by ANTLR). |
Method Summary | |
---|---|
static void |
appendEscapedMultibyteChars(java.lang.String text,
java.lang.StringBuffer buf)
|
static java.lang.String |
escapeMultibyteChars(java.lang.String text)
|
static java.lang.String |
getConstantName(java.lang.Class tokenTypeConstants,
int type)
Get a single token type name in the specified set of token type constants (interface). |
boolean |
isShowClassNames()
Returns true if the node class names will be displayed. |
java.lang.String |
nodeToString(antlr.collections.AST ast,
boolean showClassName)
|
void |
setShowClassNames(boolean showClassNames)
Enables or disables AST node class name display. |
java.lang.String |
showAsString(antlr.collections.AST ast,
java.lang.String header)
Prints the AST in 'ASCII art' tree form into a string. |
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)
tokenTypeConstants
- The class with token type constants in it.Method Detail |
---|
public boolean isShowClassNames()
public void setShowClassNames(boolean showClassNames)
showClassNames
- true to enable class name display, false to disablepublic void showAst(antlr.collections.AST ast, java.io.PrintWriter pw)
ast
- The AST to print.pw
- The print writer.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 static java.lang.String getConstantName(java.lang.Class tokenTypeConstants, int type)
tokenTypeConstants
- Token type constants interface (e.g. HqlSqlTokenTypes.class).type
- The token type ( typically from ast.getType() ).
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 |