“validators.” to validate an input. Grammars for validators don't use actions or rewrite rules.
“processors.” to validate an input and process it. Grammars for processors use actions, but not rewrite rules.
“translators.” to validate and translate the input data structure into another data structure. Grammars for translators use actions (containing printlns) and/or rewrite rules.
LifeCyle / Workflow
Write the grammar using one or more files with extension .g4
Test your grammar with grun (note that you can also type the input at the console)
antlr4 # generate the parser
grun <grammar-name> <rule-to-test> <input-filename(s)> # CTRL+D/CTRL+Z to quit without file name
Optionally write StringTemplate templates for producing output.
Generate the lexer and parser classes from the grammar along with: