Package org.codehaus.mojo.javacc
Class JJTreeMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.javacc.AbstractPreprocessorMojo
-
- org.codehaus.mojo.javacc.JJTreeMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="jjtree", defaultPhase=GENERATE_SOURCES) public class JJTreeMojo extends AbstractPreprocessorMojoDeprecated.As of version 2.4, use thejjtree-javaccgoal instead.Parses a JJTree grammar file (*.jjt) and transforms it to Java source files and a JavaCC grammar file. Please see the JJTree Reference Documentation for more information.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.BooleanbuildNodeFilesDeprecated.A flag whether to generate sample implementations forSimpleNodeand any other nodes used in the grammar.private java.lang.String[]excludesDeprecated.A set of Ant-like exclusion patterns used to prevent certain files from being processed.private java.lang.String[]includesDeprecated.A set of Ant-like inclusion patterns used to select files from the source directory for processing.private java.lang.BooleanisStaticDeprecated.A flag whether to generate code for a static parser.private java.lang.StringjdkVersionDeprecated.The Java version for which to generate source code.private java.lang.BooleanmultiDeprecated.A flag whether to generate a multi mode parse tree or a single mode parse tree.private java.lang.StringnodeClassDeprecated.The name of a custom class that extendsSimpleNodeand will be used as the super class for the generated tree node classes.private java.lang.BooleannodeDefaultVoidDeprecated.A flag whether to make each non-decorated production void instead of an indefinite node.private java.lang.StringnodeFactoryDeprecated.The name of a custom factory class used to createNodeobjects.private java.lang.StringnodePackageDeprecated.The package to generate the AST node classes into.private java.lang.StringnodePrefixDeprecated.The prefix used to construct node class names from node identifiers in multi mode.private java.lang.BooleannodeScopeHookDeprecated.A flag whether user-defined parser methods should be called on entry and exit of every node scope.private java.lang.BooleannodeUsesParserDeprecated.A flag whether the node construction routines need an additional method parameter to receive the parser object.private java.io.FileoutputDirectoryDeprecated.Directory where the output Java files for the node classes and the JavaCC grammar file will be located.private java.io.FilesourceDirectoryDeprecated.Directory where the input JJTree files (*.jjt) are located.private intstaleMillisDeprecated.The granularity in milliseconds of the last modification date for testing whether a source needs recompilation.private java.io.FiletimestampDirectoryDeprecated.The directory to store the processed input files for later detection of stale sources.private java.lang.BooleantrackTokensDeprecated.A flag whether to insert the methodsjjtGetFirstToken(),jjtSetFirstToken(),getLastToken()andjjtSetLastToken()into the classSimpleNode.private java.lang.BooleanvisitorDeprecated.A flag whether to insert ajjtAccept()method in the node classes and to generate a visitor implementation with an entry for every node type used in the grammar.private java.lang.StringvisitorDataTypeDeprecated.The name of a class to use for the data argument of thejjtAccept()andvisit()methods.private java.lang.StringvisitorExceptionDeprecated.The name of an exception class to include in the signature of the generatedjjtAccept()andvisit()methods.private java.lang.StringvisitorReturnTypeDeprecated.The name of a class to use as the return type of thejjtAccept()andvisit()methods.
-
Constructor Summary
Constructors Constructor Description JJTreeMojo()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddCompileSourceRoot()Deprecated.Prevents registration of our output or a following invocation of the javacc mojo will cause duplicate sources which in turn will make compilation fail.protected java.lang.String[]getExcludes()Deprecated.Gets a set of Ant-like exclusion patterns used to unselect files from the source directory for processing.protected java.lang.String[]getIncludes()Deprecated.Gets a set of Ant-like inclusion patterns used to select files from the source directory for processing.protected java.io.FilegetOutputDirectory()Deprecated.Gets the absolute path to the directory where the generated Java files for the parser will be stored.protected java.io.FilegetSourceDirectory()Deprecated.Gets the absolute path to the directory where the grammar files are located.protected intgetStaleMillis()Deprecated.Gets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.protected java.io.FilegetTimestampDirectory()Deprecated.Gets the absolute path to the directory where the processed input files will be stored for later detection of stale sources.protected JJTreenewJJTree()Deprecated.Creates a new facade to invoke JJTree.protected voidprocessGrammar(GrammarInfo grammarInfo)Deprecated.Passes the specified grammar file through the tool.-
Methods inherited from class org.codehaus.mojo.javacc.AbstractPreprocessorMojo
createTimestamp, execute
-
-
-
-
Field Detail
-
jdkVersion
@Parameter(property="javacc.jdkVersion") private java.lang.String jdkVersion
Deprecated.The Java version for which to generate source code. Default value is1.4.- Since:
- 2.4
-
buildNodeFiles
@Parameter(property="javacc.buildNodeFiles") private java.lang.Boolean buildNodeFiles
Deprecated.A flag whether to generate sample implementations forSimpleNodeand any other nodes used in the grammar. Default value istrue.
-
multi
@Parameter(property="javacc.multi") private java.lang.Boolean multi
Deprecated.A flag whether to generate a multi mode parse tree or a single mode parse tree. Default value isfalse.
-
nodeDefaultVoid
@Parameter(property="javacc.nodeDefaultVoid") private java.lang.Boolean nodeDefaultVoid
Deprecated.A flag whether to make each non-decorated production void instead of an indefinite node. Default value isfalse.
-
nodeClass
@Parameter(property="javacc.nodeClass") private java.lang.String nodeClass
Deprecated.The name of a custom class that extendsSimpleNodeand will be used as the super class for the generated tree node classes. By default, the tree node classes will directly extend the classSimpleNode.- Since:
- 2.5
-
nodeFactory
@Parameter(property="javacc.nodeFactory") private java.lang.String nodeFactory
Deprecated.The name of a custom factory class used to createNodeobjects. This class must have a method with the signaturepublic static Node jjtCreate(int id). By default, the classSimpleNodewill be used as the factory class.
-
nodePackage
@Parameter(property="javacc.nodePackage") private java.lang.String nodePackage
Deprecated.The package to generate the AST node classes into. This value may use a leading asterisk to reference the package of the corresponding parser. For example, if the parser package isorg.apacheand this parameter is set to*.demo, the tree node classes will be located in the packageorg.apache.demo. By default, the package of the corresponding parser is used.
-
nodePrefix
@Parameter(property="javacc.nodePrefix") private java.lang.String nodePrefix
Deprecated.The prefix used to construct node class names from node identifiers in multi mode. Default value isAST.
-
nodeScopeHook
@Parameter(property="javacc.nodeScopeHook") private java.lang.Boolean nodeScopeHook
Deprecated.A flag whether user-defined parser methods should be called on entry and exit of every node scope. Default value isfalse.
-
nodeUsesParser
@Parameter(property="javacc.nodeUsesParser") private java.lang.Boolean nodeUsesParser
Deprecated.A flag whether the node construction routines need an additional method parameter to receive the parser object. Default value isfalse.
-
isStatic
@Parameter(property="javacc.isStatic", alias="javacc.staticOption") private java.lang.Boolean isStaticDeprecated.A flag whether to generate code for a static parser. Note that this setting must match the corresponding option for thejavaccmojo. Default value istrue.
-
trackTokens
@Parameter(property="javacc.trackTokens") private java.lang.Boolean trackTokens
Deprecated.A flag whether to insert the methodsjjtGetFirstToken(),jjtSetFirstToken(),getLastToken()andjjtSetLastToken()into the classSimpleNode. Default value isfalse.- Since:
- 2.5
-
visitor
@Parameter(property="javacc.visitor") private java.lang.Boolean visitor
Deprecated.A flag whether to insert ajjtAccept()method in the node classes and to generate a visitor implementation with an entry for every node type used in the grammar. Default value isfalse.
-
visitorDataType
@Parameter(property="javacc.visitorDataType") private java.lang.String visitorDataType
Deprecated.The name of a class to use for the data argument of thejjtAccept()andvisit()methods. Default value isjava.lang.Object.- Since:
- 2.5
-
visitorReturnType
@Parameter(property="javacc.visitorReturnType") private java.lang.String visitorReturnType
Deprecated.The name of a class to use as the return type of thejjtAccept()andvisit()methods. Default value isjava.lang.Object.- Since:
- 2.5
-
visitorException
@Parameter(property="javacc.visitorException") private java.lang.String visitorException
Deprecated.The name of an exception class to include in the signature of the generatedjjtAccept()andvisit()methods. By default, thethrowsclause of the generated methods is empty such that only unchecked exceptions can be thrown.
-
sourceDirectory
@Parameter(property="javacc.sourceDirectory", defaultValue="${basedir}/src/main/jjtree") private java.io.File sourceDirectoryDeprecated.Directory where the input JJTree files (*.jjt) are located.
-
outputDirectory
@Parameter(property="javacc.outputDirectory", defaultValue="${project.build.directory}/generated-sources/jjtree") private java.io.File outputDirectoryDeprecated.Directory where the output Java files for the node classes and the JavaCC grammar file will be located.
-
timestampDirectory
@Parameter(property="javacc.timestampDirectory", defaultValue="${project.build.directory}/generated-sources/jjtree-timestamp") private java.io.File timestampDirectoryDeprecated.The directory to store the processed input files for later detection of stale sources.
-
staleMillis
@Parameter(property="javacc.lastModGranularityMs", defaultValue="0") private int staleMillisDeprecated.The granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
-
includes
@Parameter private java.lang.String[] includes
Deprecated.A set of Ant-like inclusion patterns used to select files from the source directory for processing. By default, the patterns**/*.jjtand**/*.JJTare used to select grammar files.
-
excludes
@Parameter private java.lang.String[] excludes
Deprecated.A set of Ant-like exclusion patterns used to prevent certain files from being processed. By default, this set is empty such that no files are excluded.
-
-
Method Detail
-
getSourceDirectory
protected java.io.File getSourceDirectory()
Deprecated.Gets the absolute path to the directory where the grammar files are located.- Specified by:
getSourceDirectoryin classAbstractPreprocessorMojo- Returns:
- The absolute path to the directory where the grammar files are located, never
null.
-
getIncludes
protected java.lang.String[] getIncludes()
Deprecated.Gets a set of Ant-like inclusion patterns used to select files from the source directory for processing.- Specified by:
getIncludesin classAbstractPreprocessorMojo- Returns:
- A set of Ant-like inclusion patterns used to select files from the source directory for processing, can
be
nullif all files should be included.
-
getExcludes
protected java.lang.String[] getExcludes()
Deprecated.Gets a set of Ant-like exclusion patterns used to unselect files from the source directory for processing.- Specified by:
getExcludesin classAbstractPreprocessorMojo- Returns:
- A set of Ant-like inclusion patterns used to unselect files from the source directory for processing, can
be
nullif no files should be excluded.
-
getOutputDirectory
protected java.io.File getOutputDirectory()
Deprecated.Gets the absolute path to the directory where the generated Java files for the parser will be stored.- Specified by:
getOutputDirectoryin classAbstractPreprocessorMojo- Returns:
- The absolute path to the directory where the generated Java files for the parser will be stored, never
null.
-
getTimestampDirectory
protected java.io.File getTimestampDirectory()
Deprecated.Gets the absolute path to the directory where the processed input files will be stored for later detection of stale sources.- Specified by:
getTimestampDirectoryin classAbstractPreprocessorMojo- Returns:
- The absolute path to the directory where the processed input files will be stored for later detection of
stale sources, never
null.
-
getStaleMillis
protected int getStaleMillis()
Deprecated.Gets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.- Specified by:
getStaleMillisin classAbstractPreprocessorMojo- Returns:
- The granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
-
processGrammar
protected void processGrammar(GrammarInfo grammarInfo) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
Deprecated.Passes the specified grammar file through the tool.- Specified by:
processGrammarin classAbstractPreprocessorMojo- Parameters:
grammarInfo- The grammar info describing the grammar file to process, must not benull.- Throws:
org.apache.maven.plugin.MojoExecutionException- If the invocation of the tool failed.org.apache.maven.plugin.MojoFailureException- If the tool reported a non-zero exit code.
-
newJJTree
protected JJTree newJJTree()
Deprecated.Creates a new facade to invoke JJTree. Most options for the invocation are derived from the current values of the corresponding mojo parameters. The caller is responsible to set the input file, output directory and package on the returned facade.- Returns:
- The facade for the tool invocation, never
null.
-
addCompileSourceRoot
protected void addCompileSourceRoot()
Deprecated.Prevents registration of our output or a following invocation of the javacc mojo will cause duplicate sources which in turn will make compilation fail.- Overrides:
addCompileSourceRootin classAbstractPreprocessorMojo
-
-