public class Rats extends Tool
| Constructor and Description |
|---|
Rats()
Create a new instance of Rats!.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCopy()
Get this tool's copyright.
|
java.lang.String |
getExplanation()
Get this tool's explanation.
|
java.lang.String |
getName()
Get this tool's name.
|
void |
init()
Initialize this tool.
|
static void |
main(java.lang.String[] args)
Run the packrat parser generator with the specified arguments.
|
Node |
parse(java.io.Reader in,
java.io.File file)
Parse the specified file.
|
void |
prepare()
Prepare for processing.
|
void |
process(Node node)
Process the specified AST node.
|
diagnose, getVersion, locate, printHeader, process, run, wrapUppublic java.lang.String getName()
Toolpublic java.lang.String getCopy()
ToolConstants.FULL_COPY.public java.lang.String getExplanation()
Toolnull to indicate that there is no explanation.getExplanation in class Toolpublic void init()
TooloptionSilent for silent
operation,optionVerbose for verbose
operation,optionNoExit for not exiting
the Java virtual machine,Runtime.INPUT_DIRECTORY
for the file search path,Runtime.OUTPUT_DIRECTORY for the
output directory,Runtime.INPUT_ENCODING for the
character encoding when reading files,Runtime.OUTPUT_ENCODING for the
character encoding when writing files,optionDiagnostics for printing
tool diagnostics,optionPerformance for
collecting performance statistics,optionMeasureParser for
measuring parser performance only.optionMeasureProcessing for
measuring processing performance only.optionGC for performing
GC,runsWarmUp with a default of 2
for the number of warm-up runs,runsTotal with a default
of 12 for the total number of runs.public void prepare()
ToolRuntime.initDefaultValues(). It
also checks that the optionSilent and
optionVerbose flags are not both set at the same
time.prepare in class ToolTool.wrapUp()public Node parse(java.io.Reader in, java.io.File file) throws java.io.IOException, ParseException
Toolparse in class Toolin - The input stream for the file.file - The corresponding file.null if no tree has been generated.java.io.IOException - Signals an I/O error.ParseException - Signals a parse error.public void process(Node node)
ToolTool.parse(Reader,File) has completed successfuly, has
returned a node (and not null), and no errors have
been reported through Runtime.error(), Runtime.error(String), or Runtime.error(String,Node)
while parsing. The default implementation of this method does
nothing.public static void main(java.lang.String[] args)
args - The command line arguments.Copyright © 2014. All Rights Reserved.