public abstract class AbstractAntlrMojo extends org.apache.maven.plugin.AbstractMojo implements Environment
Modifier and Type | Class and Description |
---|---|
static class |
AbstractAntlrMojo.NoAntlrDependencyDefinedException |
Modifier and Type | Field and Description |
---|---|
private boolean |
debug
Launch the ParseView debugger upon parser invocation.
|
private boolean |
diagnostic
Generate a text file from your grammar with a lot of debugging info.
|
protected Grammar[] |
grammarDefs
Grammar list presents in the
sourceDirectory directory. |
protected java.lang.String |
grammars
Comma separated grammar file names or grammar pattern file names present in the
sourceDirectory
directory. |
protected java.io.File |
outputDirectory
Specifies the destination directory where Antlr should generate files.
|
protected org.apache.maven.project.MavenProject |
project
The Maven Project Object
|
private org.apache.maven.project.MavenProjectHelper |
projectHelper
The maven project's helper.
|
protected java.io.File |
sourceDirectory
Specifies the Antlr directory containing grammar files.
|
private boolean |
trace
Have all rules call traceIn/traceOut.
|
private boolean |
traceLexer
Have lexer rules call traceIn/traceOut.
|
private boolean |
traceParser
Have parser rules call traceIn/traceOut.
|
private boolean |
traceTreeParser
Have tree rules call traceIn/traceOut.
|
Constructor and Description |
---|
AbstractAntlrMojo() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addArgIf(java.util.List arguments,
boolean b,
java.lang.String value)
Convenience method to add an argument
|
protected abstract void |
addArgs(java.util.List arguments)
Add arguments to be included in Antlr call
|
protected void |
executeAntlr() |
private void |
executeAntlrInIsolatedClassLoader(java.lang.String[] args,
org.apache.maven.artifact.Artifact antlrArtifact) |
private java.lang.String |
generateClasspathForProcessSpawning(org.apache.maven.artifact.Artifact antlrArtifact) |
private java.io.File |
getGeneratedFile(java.lang.String grammar,
java.io.File outputDir) |
private Grammar[] |
getGrammars()
Get the list of all grammars to be compiled.
|
java.io.File |
getOutputDirectory() |
java.io.File |
getSourceDirectory() |
protected org.apache.maven.artifact.Artifact |
locateAntlrArtifact() |
protected void |
performGeneration(GenerationPlan plan,
org.apache.maven.artifact.Artifact antlrArtifact) |
private void |
validateParameters()
grammars or grammarDefs parameters is required
|
getLog, getPluginContext, setLog, setPluginContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLog
protected java.io.File sourceDirectory
protected org.apache.maven.project.MavenProject project
private org.apache.maven.project.MavenProjectHelper projectHelper
protected java.io.File outputDirectory
protected java.lang.String grammars
sourceDirectory
directory. protected Grammar[] grammarDefs
sourceDirectory
directory. <grammarDefs>
<grammar>
<name>myGrammar.g</name>
<glib>mySuperGrammar.g;myOtherSuperGrammar.g</glib>
</grammar>
</grammarDefs>
private boolean debug
private boolean diagnostic
private boolean trace
private boolean traceParser
private boolean traceLexer
private boolean traceTreeParser
public java.io.File getSourceDirectory()
getSourceDirectory
in interface Environment
public java.io.File getOutputDirectory()
getOutputDirectory
in interface Environment
protected void executeAntlr() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected final org.apache.maven.artifact.Artifact locateAntlrArtifact() throws AbstractAntlrMojo.NoAntlrDependencyDefinedException
protected void performGeneration(GenerationPlan plan, org.apache.maven.artifact.Artifact antlrArtifact) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
private java.lang.String generateClasspathForProcessSpawning(org.apache.maven.artifact.Artifact antlrArtifact)
private void executeAntlrInIsolatedClassLoader(java.lang.String[] args, org.apache.maven.artifact.Artifact antlrArtifact) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected abstract void addArgs(java.util.List arguments)
arguments
- protected static void addArgIf(java.util.List arguments, boolean b, java.lang.String value)
arguments
- b
- value
- private java.io.File getGeneratedFile(java.lang.String grammar, java.io.File outputDir) throws java.io.IOException
grammar
- outputDir
- java.io.IOException
private void validateParameters() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
private Grammar[] getGrammars()
grammars
and grammarDefs
variables