| 
 | ||||||||||
| 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(Class tokenTypeConstants)Constructs a printer. | |
| ASTPrinter(Class tokenTypeConstants,
           boolean showClassNames)Constructs a printer. | |
| Method Summary | |
|---|---|
| static void | appendEscapedMultibyteChars(String text,
                            StringBuffer buf) | 
| static String | escapeMultibyteChars(String text) | 
|  String | getTokenTypeName(int type)Returns the token type name for the given token type. | 
|  boolean | isShowClassNames()Getter for property 'showClassNames'. | 
|  String | nodeToString(antlr.collections.AST ast,
             boolean showClassName) | 
|  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. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ASTPrinter(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(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 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,
                           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 | |||||||||