antlr4:antlr4

Full name:

org.antlr:antlr4-maven-plugin:4.3:antlr4

Description:

Parses ANTLR 4 grammar files *.g4 and transforms them into Java source files.

Attributes:

  • Requires a Maven 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
arguments List - A list of additional command line arguments to pass to the ANTLR tool.
atn boolean - If set to true then the ANTLR tool will generate a description of the ATN for each rule in Dot format.
Default value is: false.
User property is: antlr4.atn.
encoding String - specify grammar file encoding; e.g., euc-jp
User property is: project.build.sourceEncoding.
excludes Set - A set of Ant-like exclusion patterns used to prevent certain files from being processed. By default, this set is empty such that no files are excluded.
forceATN boolean - Use the ATN simulator for all predictions.
Default value is: false.
User property is: antlr4.forceATN.
includes Set - Provides an explicit list of all the grammars that should be included in the generate phase of the plugin. Note that the plugin is smart enough to realize that imported grammars should be included but not acted upon directly by the ANTLR Tool. A set of Ant-like inclusion patterns used to select files from the source directory for processing. By default, the pattern **/*.g4 is used to select grammar files.
libDirectory File - Specify location of imported grammars and tokens files.
Default value is: ${basedir}/src/main/antlr4/imports.
listener boolean - Generate parse tree listener interface and base class.
Default value is: true.
User property is: antlr4.listener.
options Map - A list of grammar options to explicitly specify to the tool. These options are passed to the tool using the -D<option>=<value> syntax.
outputDirectory File - Specify output directory where the Java files are generated.
Default value is: ${project.build.directory}/generated-sources/antlr4.
sourceDirectory File - The directory where the ANTLR grammar files (*.g4) are located.
Default value is: ${basedir}/src/main/antlr4.
treatWarningsAsErrors boolean - Treat warnings as errors.
Default value is: false.
User property is: antlr4.treatWarningsAsErrors.
visitor boolean - Generate parse tree visitor interface and base class.
Default value is: false.
User property is: antlr4.visitor.

Parameter Details

arguments:

A list of additional command line arguments to pass to the ANTLR tool.
  • Type: java.util.List
  • Required: No

atn:

If set to true then the ANTLR tool will generate a description of the ATN for each rule in Dot format.
  • Type: boolean
  • Required: No
  • User Property: antlr4.atn
  • Default: false

encoding:

specify grammar file encoding; e.g., euc-jp
  • Type: java.lang.String
  • Required: No
  • User Property: project.build.sourceEncoding

excludes:

A set of Ant-like exclusion patterns used to prevent certain files from being processed. By default, this set is empty such that no files are excluded.
  • Type: java.util.Set
  • Required: No

forceATN:

Use the ATN simulator for all predictions.
  • Type: boolean
  • Required: No
  • User Property: antlr4.forceATN
  • Default: false

includes:

Provides an explicit list of all the grammars that should be included in the generate phase of the plugin. Note that the plugin is smart enough to realize that imported grammars should be included but not acted upon directly by the ANTLR Tool. A set of Ant-like inclusion patterns used to select files from the source directory for processing. By default, the pattern **/*.g4 is used to select grammar files.
  • Type: java.util.Set
  • Required: No

libDirectory:

Specify location of imported grammars and tokens files.
  • Type: java.io.File
  • Required: No
  • Default: ${basedir}/src/main/antlr4/imports

listener:

Generate parse tree listener interface and base class.
  • Type: boolean
  • Required: No
  • User Property: antlr4.listener
  • Default: true

options:

A list of grammar options to explicitly specify to the tool. These options are passed to the tool using the -D<option>=<value> syntax.
  • Type: java.util.Map
  • Required: No

outputDirectory:

Specify output directory where the Java files are generated.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/generated-sources/antlr4

sourceDirectory:

The directory where the ANTLR grammar files (*.g4) are located.
  • Type: java.io.File
  • Required: No
  • Default: ${basedir}/src/main/antlr4

treatWarningsAsErrors:

Treat warnings as errors.
  • Type: boolean
  • Required: No
  • User Property: antlr4.treatWarningsAsErrors
  • Default: false

visitor:

Generate parse tree visitor interface and base class.
  • Type: boolean
  • Required: No
  • User Property: antlr4.visitor
  • Default: false