java.lang.Object
dev.civl.abc.util.IF.ANTLRUtils
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidlex(PrintStream out, ANTLRUtils.LexerFactory lf, String filename) static voidprint(PrintStream out, org.antlr.runtime.TokenSource ts) Prints all tokens from the token source.static voidprintTree(PrintStream out, org.antlr.runtime.tree.Tree tree) Pretty-prints a parse tree.static voidsource(PrintStream out, File file) Prints the original text file to the give output stream, unaltered.static voidsource(PrintStream out, String filename) Applies method source to the file with the given filename.
-
Constructor Details
-
ANTLRUtils
public ANTLRUtils()
-
-
Method Details
-
printTree
Pretty-prints a parse tree.- Parameters:
out- the stream to which output should be senttree- the tree to print. May be null.
-
source
Applies method source to the file with the given filename.- Parameters:
out- a PrintStream to which the output is sentfilename- name of a file- Throws:
IOException
-
source
Prints the original text file to the give output stream, unaltered.- Parameters:
out- a PrintStream to which the output is sentfile- the file to read- Throws:
IOException- if an I/O exception occurs while reading the file
-
print
Prints all tokens from the token source.- Parameters:
out- where to printts- token source
-
lex
public static void lex(PrintStream out, ANTLRUtils.LexerFactory lf, String filename) throws IOException - Throws:
IOException
-