class JJTree extends ToolFacade
Modifier and Type | Field and Description |
---|---|
private java.lang.Boolean |
buildNodeFiles
The option BUILD_NODE_FILES.
|
private java.lang.String |
grammarEncoding
The option GRAMMAR_ENCODING.
|
private java.io.File |
inputFile
The input grammar.
|
private java.lang.Boolean |
isStatic
The option STATIC.
|
private java.lang.String |
jdkVersion
The option JDK_VERSION.
|
private java.lang.Boolean |
multi
The option MULTI.
|
private java.lang.String |
nodeClass
The option NODE_CLASS.
|
private java.lang.Boolean |
nodeDefaultVoid
The option NODE_DEFAULT_VOID.
|
private java.lang.String |
nodeFactory
The option NODE_FACTORY.
|
private java.lang.String |
nodePackage
The option NODE_PACKAGE.
|
private java.lang.String |
nodePrefix
The option NODE_PREFIX.
|
private java.lang.Boolean |
nodeScopeHook
The option NODE_SCOPE_HOOK.
|
private java.lang.Boolean |
nodeUsesParser
The option NODE_USES_PARSER.
|
private java.io.File |
outputDirectory
The option OUTPUT_DIRECTORY.
|
private java.lang.Boolean |
trackTokens
The option TRACK_TOKENS.
|
private java.lang.Boolean |
visitor
The option VISITOR.
|
private java.lang.String |
visitorDataType
The option VISITOR_DATA_TYPE.
|
private java.lang.String |
visitorException
The option VISITOR_EXCEPTION.
|
private java.lang.String |
visitorReturnType
The option VISITOR_RETURN_TYPE.
|
Constructor and Description |
---|
JJTree() |
Modifier and Type | Method and Description |
---|---|
protected int |
execute()
Runs the tool using the previously set parameters.
|
private java.lang.String[] |
generateArguments()
Assembles the command line arguments for the invocation of JJTree according to the configuration.
Note: To prevent conflicts with JavaCC options that might be set directly in the grammar file, only those parameters that have been explicitly set are passed on the command line. |
java.io.File |
getOutputFile()
Gets the absolute path to the enhanced grammar file generated by JJTree.
|
void |
setBuildNodeFiles(java.lang.Boolean value)
Sets the option value BUILD_NODE_FILES.
|
void |
setGrammarEncoding(java.lang.String value)
Sets the option GRAMMAR_ENCODING.
|
void |
setInputFile(java.io.File value)
Sets the absolute path to the grammar file to pass into JJTree for preprocessing.
|
void |
setJdkVersion(java.lang.String value)
Sets the option JDK_VERSION.
|
void |
setMulti(java.lang.Boolean value)
Sets the option value MULTI.
|
void |
setNodeClass(java.lang.String value)
Sets the option value NODE_CLASS.
|
void |
setNodeDefaultVoid(java.lang.Boolean value)
Sets the option value NODE_DEFAULT_VOID.
|
void |
setNodeFactory(java.lang.String value)
Sets the option value NODE_FACTORY.
|
void |
setNodePackage(java.lang.String value)
Sets the option value NODE_PACKAGE.
|
void |
setNodePrefix(java.lang.String value)
Sets the option value NODE_PREFIX.
|
void |
setNodeScopeHook(java.lang.Boolean value)
Sets the option value NODE_SCOPE_HOOK.
|
void |
setNodeUsesParser(java.lang.Boolean value)
Sets the option value NODE_USES_PARSER.
|
void |
setOutputDirectory(java.io.File value)
Sets the absolute path to the output directory.
|
void |
setStatic(java.lang.Boolean value)
Sets the option STATIC.
|
void |
setTrackTokens(java.lang.Boolean value)
Sets the option value TRACK_TOKENS.
|
void |
setVisitor(java.lang.Boolean value)
Sets the option value VISITOR.
|
void |
setVisitorDataType(java.lang.String value)
Sets the option value VISITOR_DATA_TYPE.
|
void |
setVisitorException(java.lang.String value)
Sets the option value VISITOR_EXCEPTION.
|
void |
setVisitorReturnType(java.lang.String value)
Sets the option value VISITOR_RETURN_TYPE.
|
java.lang.String |
toString()
Gets a string representation of the command line arguments.
|
getLog, getToolName, run, setLog
private java.io.File inputFile
private java.io.File outputDirectory
private java.lang.String grammarEncoding
private java.lang.String jdkVersion
private java.lang.Boolean isStatic
private java.lang.Boolean buildNodeFiles
private java.lang.Boolean multi
private java.lang.Boolean nodeDefaultVoid
private java.lang.String nodeClass
private java.lang.String nodeFactory
private java.lang.String nodePackage
private java.lang.String nodePrefix
private java.lang.Boolean nodeScopeHook
private java.lang.Boolean nodeUsesParser
private java.lang.Boolean trackTokens
private java.lang.Boolean visitor
private java.lang.String visitorDataType
private java.lang.String visitorReturnType
private java.lang.String visitorException
public void setInputFile(java.io.File value)
value
- The absolute path to the grammar file to pass into JJTree for preprocessing.public void setOutputDirectory(java.io.File value)
value
- The absolute path to the output directory for the generated grammar file. If this directory does not
exist yet, it is created. Note that this path should already include the desired package hierarchy
because JJTree will not append the required sub directories automatically.public java.io.File getOutputFile()
null
if either the
input file or the output directory have not been set.public void setGrammarEncoding(java.lang.String value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setJdkVersion(java.lang.String value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setStatic(java.lang.Boolean value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setBuildNodeFiles(java.lang.Boolean value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setMulti(java.lang.Boolean value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setNodeDefaultVoid(java.lang.Boolean value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setNodeClass(java.lang.String value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setNodeFactory(java.lang.String value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setNodePackage(java.lang.String value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setNodePrefix(java.lang.String value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setNodeScopeHook(java.lang.Boolean value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setNodeUsesParser(java.lang.Boolean value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setTrackTokens(java.lang.Boolean value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setVisitor(java.lang.Boolean value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setVisitorDataType(java.lang.String value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setVisitorReturnType(java.lang.String value)
value
- The option value, may be null
to use the value provided in the grammar or the default.public void setVisitorException(java.lang.String value)
value
- The option value, may be null
to use the value provided in the grammar or the default.protected int execute() throws java.lang.Exception
execute
in class ToolFacade
java.lang.Exception
- If the tool could not be invoked.private java.lang.String[] generateArguments()
public java.lang.String toString()
toString
in class java.lang.Object