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, setPluginContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLogprotected 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 Environmentpublic java.io.File getOutputDirectory()
getOutputDirectory in interface Environmentprotected void executeAntlr()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected 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.MojoExecutionExceptionprivate 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.MojoExecutionExceptionprotected 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.IOExceptionprivate void validateParameters()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate Grammar[] getGrammars()
grammars and grammarDefs variables