Usage:
java org.antlr.Tool [args] file.g [file2.g file3.g ...]
| Option | description |
|---|---|
| -o outputDir | specify output directory where all output is generated; search for token vocabularies in here also |
| -fo outputDir | same as -o but force even files with relative paths to dir |
| -depend | generate file dependencies; don't actually run antlr |
| -lib dir | specify location of token files and important grammars |
| -report | print out a report about the grammar(s) processed |
| print out the grammar without actions | |
| -trace | generate a parser with trace output - if the default output is not enough, you can override the traceIn and traceOut methods |
| -debug | generate a parser that emits debugging events |
| -profile | generate a parser that computes profiling information |
| -nfa | generate an NFA for each rule |
| -dfa | generate a DFA for each decision point |
| -message-format name | specify output style for messages |
| -X | display extended option list |
There are a bunch of less often used "extended" options as well.
| Extended option | description |
|---|---|
| -Xgrtree | print the grammar AST |
| -Xdfa | print DFA as text |
| -Xnoprune | do not test EBNF block exit branches |
| -Xnocollapse | collapse incident edges into DFA states |
| -Xdbgconversion | dump lots of info during NFA conversion |
| -Xmultithreaded | run the analysis in 2 threads |
| -Xnomergestopstates | do not merge stop states |
| -Xdfaverbose | generate DFA states in DOT with NFA configs |
| -Xwatchconversion | print a message for each NFA before converting |
| -XdbgST | put tags at start/stop of all templates in output |
| -Xm m | max number of rule invocations during conversion |
| -Xmaxdfaedges m | max "comfortable" number of edges for single DFA state |
| -Xconversiontimeout t | set NFA conversion timeout for each decision |
| -Xmaxinlinedfastates m | max DFA states before table used rather than inlining |
| -Xnfastates | for nondeterminisms, list NFA states for each path |