@Mojo(name="antlr",
defaultPhase=PROCESS_SOURCES,
requiresDependencyResolution=COMPILE,
requiresProject=true)
public class Antlr4Mojo
extends org.apache.maven.plugin.AbstractMojo
target/generated-sources/antlr4.| Modifier and Type | Field and Description |
|---|---|
protected List<String> |
arguments
A list of additional command line arguments to pass to the ANTLR tool.
|
protected boolean |
atn
If set to true then the ANTLR tool will generate a description of the atn
for each rule in Dot format
|
protected String |
encoding
specify grammar file encoding; e.g., euc-jp
|
protected Set<String> |
excludes
Provides an explicit list of any grammars that should be excluded from
the generate phase of the plugin.
|
protected boolean |
forceATN
use the ATN simulator for all predictions
|
protected Set<String> |
includes
Provides an explicit list of all the grammars that should
be included in the generate phase of the plugin.
|
protected boolean |
listener
generate parse tree listener (default)
|
protected Map<String,String> |
options
A list of grammar options to explicitly specify to the tool.
|
protected org.apache.maven.project.MavenProject |
project |
protected Tool |
tool
An instance of the ANTLR tool build
|
protected boolean |
treatWarningsAsErrors
treat warnings as errors
|
protected boolean |
visitor
generate parse tree visitor
|
| Constructor and Description |
|---|
Antlr4Mojo() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute()
The main entry point for this Mojo, it is responsible for converting
ANTLR 4.x grammars into the target language specified by the grammar.
|
Set<String> |
getIncludesPatterns() |
File |
getLibDirectory() |
File |
getOutputDirectory() |
File |
getSourceDirectory() |
@Parameter(property="antlr4.atn",
defaultValue="false")
protected boolean atn
@Parameter protected String encoding
@Parameter(property="antlr4.listener",
defaultValue="true")
protected boolean listener
@Parameter(property="antlr4.visitor",
defaultValue="false")
protected boolean visitor
@Parameter(property="antlr4.treatWarningsAsErrors",
defaultValue="false")
protected boolean treatWarningsAsErrors
@Parameter(property="antlr4.forceATN",
defaultValue="false")
protected boolean forceATN
@Parameter protected Map<String,String> options
-D<option>=<value> syntax.@Parameter protected List<String> arguments
@Parameter protected Set<String> includes
@Parameter protected Set<String> excludes
@Parameter(property="project",
required=true,
readonly=true)
protected org.apache.maven.project.MavenProject project
protected Tool tool
public File getSourceDirectory()
public File getOutputDirectory()
public File getLibDirectory()
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException - When something is discovered such as a missing sourceorg.apache.maven.plugin.MojoFailureException - When something really bad happens such as not being able to create the ANTLR ToolCopyright © 2009-2012. All Rights Reserved.