|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.hql.ast.util.ASTPrinter
public class ASTPrinter
An 'ASCII art' AST printer for debugging ANTLR grammars.
Constructor Summary | |
---|---|
ASTPrinter(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(String text,
StringBuffer buf)
|
static String |
escapeMultibyteChars(String text)
|
static String |
getConstantName(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. |
String |
nodeToString(antlr.collections.AST ast,
boolean showClassName)
|
void |
setShowClassNames(boolean showClassNames)
Enables or disables AST node class name display. |
String |
showAsString(antlr.collections.AST ast,
String header)
Prints the AST in 'ASCII art' tree form into a string. |
void |
showAst(antlr.collections.AST ast,
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(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, PrintWriter pw)
ast
- The AST to print.pw
- The print writer.public String showAsString(antlr.collections.AST ast, String header)
ast
- The AST to display.header
- The header for the display.
public static String getConstantName(Class tokenTypeConstants, int type)
tokenTypeConstants
- Token type constants interface (e.g. HqlSqlTokenTypes.class).type
- The token type ( typically from ast.getType() ).
public String nodeToString(antlr.collections.AST ast, boolean showClassName)
public static void appendEscapedMultibyteChars(String text, StringBuffer buf)
public static String escapeMultibyteChars(String text)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |