antlr:generate

Full name:

org.codehaus.mojo:antlr-maven-plugin:2.2:generate

Description:

Generates files based on grammar files with Antlr tool.

Attributes:

  • Requires a Maven 2.0 project to be executed.
  • Requires dependency resolution of artifacts in scope: compile.
  • Binds by default to the lifecycle phase: generate-sources.

Optional Parameters

Name Type Since Description
debug boolean - Launch the ParseView debugger upon parser invocation.
See Command Line Options
Default value is: false.
diagnostic boolean - Generate a text file from your grammar with a lot of debugging info.
See Command Line Options
Default value is: false.
grammarDefs Grammar[] - Grammar list presents in the sourceDirectory directory.
See Command Line Options
Example:
<grammarDefs>
  <grammar>
    <name>myGrammar.g</name>
    <glib>mySuperGrammar.g;myOtherSuperGrammar.g</glib>
  </grammar>
</grammarDefs>

grammars String - Comma separated grammar file names or grammar pattern file names present in the sourceDirectory directory.
See Command Line Options
outputDirectory File - Specifies the destination directory where Antlr should generate files.
See Command Line Options
Default value is: ${project.build.directory}/generated-sources/antlr.
sourceDirectory File - Specifies the Antlr directory containing grammar files.
Default value is: ${basedir}/src/main/antlr.
trace boolean - Have all rules call traceIn/traceOut.
See Command Line Options
Default value is: false.
traceLexer boolean - Have lexer rules call traceIn/traceOut.
See Command Line Options
Default value is: false.
traceParser boolean - Have parser rules call traceIn/traceOut.
See Command Line Options
Default value is: false.
traceTreeParser boolean - Have tree rules call traceIn/traceOut.
See Command Line Options
Default value is: false.

Parameter Details

debug:

Launch the ParseView debugger upon parser invocation.
See Command Line Options
  • Type: boolean
  • Required: No
  • Expression: ${debug}
  • Default: false

diagnostic:

Generate a text file from your grammar with a lot of debugging info.
See Command Line Options
  • Type: boolean
  • Required: No
  • Expression: ${diagnostic}
  • Default: false

grammarDefs:

Grammar list presents in the sourceDirectory directory.
See Command Line Options
Example:
<grammarDefs>
  <grammar>
    <name>myGrammar.g</name>
    <glib>mySuperGrammar.g;myOtherSuperGrammar.g</glib>
  </grammar>
</grammarDefs>
  • Type: org.codehaus.mojo.antlr.options.Grammar[]
  • Required: No
  • Expression: ${grammarDefs}

grammars:

Comma separated grammar file names or grammar pattern file names present in the sourceDirectory directory.
See Command Line Options
  • Type: java.lang.String
  • Required: No
  • Expression: ${grammars}

outputDirectory:

Specifies the destination directory where Antlr should generate files.
See Command Line Options
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/generated-sources/antlr

sourceDirectory:

Specifies the Antlr directory containing grammar files.
  • Type: java.io.File
  • Required: No
  • Default: ${basedir}/src/main/antlr

trace:

Have all rules call traceIn/traceOut.
See Command Line Options
  • Type: boolean
  • Required: No
  • Expression: ${trace}
  • Default: false

traceLexer:

Have lexer rules call traceIn/traceOut.
See Command Line Options
  • Type: boolean
  • Required: No
  • Expression: ${traceLexer}
  • Default: false

traceParser:

Have parser rules call traceIn/traceOut.
See Command Line Options
  • Type: boolean
  • Required: No
  • Expression: ${traceParser}
  • Default: false

traceTreeParser:

Have tree rules call traceIn/traceOut.
See Command Line Options
  • Type: boolean
  • Required: No
  • Expression: ${traceTreeParser}
  • Default: false