Add the encoding and treatWarningsAsErrors parameters

This commit is contained in:
Sam Harwell 2012-12-01 15:54:36 -06:00
parent 6b3bfdd9d8
commit 747e65a92c
1 changed files with 21 additions and 0 deletions

View File

@ -90,6 +90,12 @@ public class Antlr4Mojo extends AbstractMojo {
@Parameter(defaultValue = "false") @Parameter(defaultValue = "false")
protected boolean atn; protected boolean atn;
/**
* specify grammar file encoding; e.g., euc-jp
*/
@Parameter
protected String encoding;
/** /**
* generate parse tree listener (default) * generate parse tree listener (default)
*/ */
@ -102,6 +108,12 @@ public class Antlr4Mojo extends AbstractMojo {
@Parameter(defaultValue = "false") @Parameter(defaultValue = "false")
protected boolean visitor; protected boolean visitor;
/**
* treat warnings as errors
*/
@Parameter(defaultValue = "false")
protected boolean treatWarningsAsErrors;
/** /**
* add config set to DFA states * add config set to DFA states
*/ */
@ -300,6 +312,11 @@ public class Antlr4Mojo extends AbstractMojo {
args.add("-atn"); args.add("-atn");
} }
if (encoding != null && !encoding.isEmpty()) {
args.add("-encoding");
args.add(encoding);
}
if (listener) { if (listener) {
args.add("-listener"); args.add("-listener");
} }
@ -314,6 +331,10 @@ public class Antlr4Mojo extends AbstractMojo {
args.add("-no-visitor"); args.add("-no-visitor");
} }
if (treatWarningsAsErrors) {
args.add("-Werror");
}
if (verbose_dfa) { if (verbose_dfa) {
args.add("-Xverbose-dfa"); args.add("-Xverbose-dfa");
} }