Support the -listener and -visitor options

This commit is contained in:
Sam Harwell 2012-12-01 15:30:12 -06:00
parent 5ed1a6aebf
commit 37e67f4224
1 changed files with 28 additions and 0 deletions

View File

@ -85,6 +85,18 @@ public class Antlr4Mojo extends AbstractMojo {
@Parameter(defaultValue = "false")
protected boolean atn;
/**
* generate parse tree listener (default)
*/
@Parameter(defaultValue = "true")
protected boolean listener;
/**
* generate parse tree visitor
*/
@Parameter(defaultValue = "false")
protected boolean visitor;
/**
* add config set to DFA states
*/
@ -282,9 +294,25 @@ public class Antlr4Mojo extends AbstractMojo {
if (atn) {
args.add("-atn");
}
if (listener) {
args.add("-listener");
}
else {
args.add("-no-listener");
}
if (visitor) {
args.add("-visitor");
}
else {
args.add("-no-visitor");
}
if (verbose_dfa) {
args.add("-Xverbose-dfa");
}
if (force_atn) {
args.add("-Xforce-atn");
}