-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Terence Parr <[email protected]>
- Loading branch information
Showing
3 changed files
with
65 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,10 +56,10 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
* Parses ANTLR grammar files {@code *.g} and transforms them into Java source | ||
* files. | ||
* | ||
* @goal antlr | ||
* @phase generate-sources | ||
* @requiresDependencyResolution compile | ||
* @requiresProject true | ||
* goal antlr | ||
* phase generate-sources | ||
* requiresDependencyResolution compile | ||
* requiresProject true | ||
* | ||
* @author <a href="mailto:[email protected]">Jim Idle</a> | ||
*/ | ||
|
@@ -74,52 +74,52 @@ public class Antlr3Mojo | |
* it will report various statistics about the parser, such as information | ||
* on cyclic DFAs, which rules may use backtracking, and so on. | ||
* | ||
* @parameter default-value="false" | ||
* default-value="false" | ||
*/ | ||
protected boolean report; | ||
/** | ||
* If set to true, then the ANTLR tool will print a version of the input | ||
* grammar(s) which are stripped of any embedded actions. | ||
* | ||
* @parameter default-value="false" | ||
* default-value="false" | ||
*/ | ||
protected boolean printGrammar; | ||
/** | ||
* If set to true, then the code generated by the ANTLR code generator will | ||
* be set to debug mode. This means that when run, the code will 'hang' and | ||
* wait for a debug connection on a TCP port (49100 by default). | ||
* | ||
* @parameter default-value="false" | ||
* default-value="false" | ||
*/ | ||
protected boolean debug; | ||
/** | ||
* If set to true, then the generated parser will compute and report profile | ||
* information at runtime. | ||
* | ||
* @parameter default-value="false" | ||
* default-value="false" | ||
*/ | ||
protected boolean profile; | ||
/** | ||
* If set to true, then the ANTLR tool will generate a description of the | ||
* NFA for each rule in <a href="http://www.graphviz.org">Dot format</a> | ||
* | ||
* @parameter default-value="false" | ||
* default-value="false" | ||
*/ | ||
protected boolean nfa; | ||
/** | ||
* If set to true, then the ANTLR tool will generate a description of the | ||
* DFA for each decision in the grammar in | ||
* <a href="http://www.graphviz.org">Dot format</a>. | ||
* | ||
* @parameter default-value="false" | ||
* default-value="false" | ||
*/ | ||
protected boolean dfa; | ||
/** | ||
* If set to true, the generated parser code will log rule entry and exit | ||
* points to stdout ({@link System#out} for the Java target) as an aid to | ||
* debugging. | ||
* | ||
* @parameter default-value="false" | ||
* default-value="false" | ||
*/ | ||
protected boolean trace; | ||
/** | ||
|
@@ -128,23 +128,23 @@ public class Antlr3Mojo | |
* ANTLR supports the built-in formats {@code antlr}, {@code gnu} and | ||
* {@code vs2005}. | ||
* | ||
* @parameter default-value="antlr" | ||
* default-value="antlr" | ||
*/ | ||
protected String messageFormat; | ||
/** | ||
* If set to true, then ANTLR will report verbose messages during the code | ||
* generation process. This includes the names of files, the version of | ||
* ANTLR, and more. | ||
* | ||
* @parameter default-value="true" | ||
* default-value="true" | ||
*/ | ||
protected boolean verbose; | ||
|
||
/** | ||
* The maximum number of alternatives allowed in an inline switch statement. | ||
* Beyond this, ANTLR will not generate a switch statement for the DFA. | ||
* | ||
* @parameter default-value="300" | ||
* default-value="300" | ||
*/ | ||
private int maxSwitchCaseLabels; | ||
|
||
|
@@ -153,7 +153,7 @@ public class Antlr3Mojo | |
* statement. For decisions with fewer alternatives, an if/else if/else | ||
* statement will be used instead. | ||
* | ||
* @parameter default-value="3" | ||
* default-value="3" | ||
*/ | ||
private int minSwitchAlts; | ||
|
||
|
@@ -171,30 +171,26 @@ public class Antlr3Mojo | |
* A set of Ant-like inclusion patterns used to select files from the source | ||
* directory for processing. By default, the pattern <code>**/*.g</code> | ||
* is used to select grammar files.</p> | ||
* | ||
* @parameter | ||
*/ | ||
protected Set<String> includes = new HashSet<String>(); | ||
/** | ||
* 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. | ||
* | ||
* @parameter | ||
*/ | ||
protected Set<String> excludes = new HashSet<String>(); | ||
/** | ||
* The current Maven project. | ||
* | ||
* @parameter expression="${project}" | ||
* @required | ||
* @readonly | ||
* expression="${project}" | ||
* required | ||
* readonly | ||
*/ | ||
protected MavenProject project; | ||
/** | ||
* The directory where the ANTLR grammar files ({@code *.g}) are located. | ||
* | ||
* @parameter default-value="${basedir}/src/main/antlr3" | ||
* default-value="${basedir}/src/main/antlr3" | ||
*/ | ||
private File sourceDirectory; | ||
/** | ||
|
@@ -203,7 +199,7 @@ public class Antlr3Mojo | |
* such that the generated files will participate in later build phases like | ||
* compiling and packaging. | ||
* | ||
* @parameter default-value="${project.build.directory}/generated-sources/antlr3" | ||
* default-value="${project.build.directory}/generated-sources/antlr3" | ||
* @required | ||
*/ | ||
private File outputDirectory; | ||
|
@@ -212,7 +208,7 @@ public class Antlr3Mojo | |
* grammars. Note that ANTLR will not try to process grammars that it finds | ||
* to be imported into other grammars (in the same processing session). | ||
* | ||
* @parameter default-value="${basedir}/src/main/antlr3/imports" | ||
* default-value="${basedir}/src/main/antlr3/imports" | ||
*/ | ||
private File libDirectory; | ||
|
||
|
@@ -398,14 +394,6 @@ public void execute() | |
|
||
} | ||
|
||
|
||
/** | ||
* | ||
* @param sourceDirectory | ||
* @param outputDirectory | ||
* @throws IOException | ||
* @throws InclusionScanException | ||
*/ | ||
private void processGrammarFiles(File sourceDirectory, File outputDirectory) | ||
throws IOException, InclusionScanException { | ||
// Which files under the source set should we be looking for as grammar files | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters