Package org.codehaus.mojo.javacc
Class JTBJavaCCMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.javacc.AbstractJavaCCMojo
-
- org.codehaus.mojo.javacc.JTBJavaCCMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
public class JTBJavaCCMojo extends AbstractJavaCCMojo
Preprocesses ordinary grammar files (*.jtb
) with JTB and passes the output to JavaCC in order to finally generate a parser with parse tree actions.
Note: JTB requires Java 1.5 or higher. This goal will not work with earlier versions of the JRE.- Since:
- 2.4
- Version:
- $Id: JTBJavaCCMojo.java 8156 2008-11-26 18:20:19Z bentmann $
- Author:
- Benjamin Bentmann
-
-
Constructor Summary
Constructors Constructor Description JTBJavaCCMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected File[]
getCompileSourceRoots()
Gets all the output directories to register with the project for compilation.protected String[]
getExcludes()
Gets a set of Ant-like exclusion patterns used to unselect files from the source directory for processing.protected String[]
getIncludes()
Gets a set of Ant-like inclusion patterns used to select files from the source directory for processing.protected File
getOutputDirectory()
Gets the absolute path to the directory where the generated Java files for the parser will be stored.protected File
getSourceDirectory()
Gets the absolute path to the directory where the grammar files are located.protected int
getStaleMillis()
Gets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.protected void
processGrammar(org.codehaus.mojo.javacc.GrammarInfo grammarInfo)
Passes the specified grammar file through the tool.-
Methods inherited from class org.codehaus.mojo.javacc.AbstractJavaCCMojo
copyGrammarOutput, deleteTempDirectory, execute, getGrammarEncoding, getIsStatic, getJdkVersion, getParserPackage, getTempDirectory, isSourceRoot, newJavaCC
-
-
-
-
Method Detail
-
getSourceDirectory
protected File getSourceDirectory()
Gets the absolute path to the directory where the grammar files are located.- Specified by:
getSourceDirectory
in classAbstractJavaCCMojo
- Returns:
- The absolute path to the directory where the grammar files are located, never
null
.
-
getIncludes
protected String[] getIncludes()
Gets a set of Ant-like inclusion patterns used to select files from the source directory for processing.- Specified by:
getIncludes
in classAbstractJavaCCMojo
- Returns:
- A set of Ant-like inclusion patterns used to select files from the source directory for processing, can
be
null
if all files should be included.
-
getExcludes
protected String[] getExcludes()
Gets a set of Ant-like exclusion patterns used to unselect files from the source directory for processing.- Specified by:
getExcludes
in classAbstractJavaCCMojo
- Returns:
- A set of Ant-like inclusion patterns used to unselect files from the source directory for processing, can
be
null
if no files should be excluded.
-
getOutputDirectory
protected File getOutputDirectory()
Gets the absolute path to the directory where the generated Java files for the parser will be stored.- Specified by:
getOutputDirectory
in classAbstractJavaCCMojo
- Returns:
- The absolute path to the directory where the generated Java files for the parser will be stored, never
null
.
-
getStaleMillis
protected int getStaleMillis()
Gets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.- Specified by:
getStaleMillis
in classAbstractJavaCCMojo
- Returns:
- The granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
-
getCompileSourceRoots
protected File[] getCompileSourceRoots()
Gets all the output directories to register with the project for compilation.- Specified by:
getCompileSourceRoots
in classAbstractJavaCCMojo
- Returns:
- The compile source roots to register with the project, never
null
.
-
processGrammar
protected void processGrammar(org.codehaus.mojo.javacc.GrammarInfo grammarInfo) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
Passes the specified grammar file through the tool.- Specified by:
processGrammar
in classAbstractJavaCCMojo
- 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.
-
-