| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| public static final List | |
| public final String[] | |
| pack-priv DefaultToolListener | defaultListener
Track separately so if someone adds a listener, it's the only one instead of it and the default stderr listener. |
| public ErrorManager | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public String | |
| public static final String | |
| public String | |
| protected List | |
| public Map | |
| protected boolean | |
| private final Map | |
| public File | |
| public boolean | |
| public static final String | |
| public String | |
| pack-priv List | |
| public boolean | |
| public LogManager | |
| public boolean | |
| public String | |
| public static final Tool. | |
| public String | |
| protected boolean | |
| public boolean | |
| public static final String | |
| public boolean |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | checkForRuleIssues(final Grammar g)
Important enough to avoid multiple definitions that we do very early, right after AST construction. |
| public Grammar | createGrammar(GrammarRootAST ast)
Given the raw AST of a grammar, create a grammar object associated with the AST. |
| public void | |
| public void | |
| public static GrammarAST | findOptionValueAST(GrammarRootAST root, String option)
Manually get option node from tree; return null if no defined. |
| public void | |
| public static String | |
| public File | |
| public List | |
| public int | |
| public File | getOutputDirectory(String
path to input source fileNameWithPath)Return the location where ANTLR will generate output files for a given file. |
| public Writer | getOutputFileWriter(Grammar g, String fileName)
This method is used by all code generators to create new output files. |
| protected void | |
| protected void | |
| public void | |
| public void | |
| public Grammar | |
| public Grammar | loadImportedGrammar(Grammar g, GrammarAST
The node associated with the imported grammar name. nameNode)Try current dir then dir of g then lib dir |
| public void | |
| public void | |
| public static void | |
| public File | |
| public void | |
| public GrammarRootAST | |
| public GrammarRootAST | |
| public GrammarRootAST | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public List | |
| public void | |
| public void | |
| protected void | |
| protected void |
| ALL_GRAMMAR_EXTENSIONS | back to summary |
|---|---|
| public static final List<String> ALL_GRAMMAR_EXTENSIONS | |
| args | back to summary |
|---|---|
| public final String[] args | |
| defaultListener | back to summary |
|---|---|
| pack-priv DefaultToolListener defaultListener Track separately so if someone adds a listener, it's the only one instead of it and the default stderr listener. | |
| errMgr | back to summary |
|---|---|
| public ErrorManager errMgr | |
| exact_output_dir | back to summary |
|---|---|
| public boolean exact_output_dir | |
| force_atn | back to summary |
|---|---|
| public boolean force_atn | |
| gen_dependencies | back to summary |
|---|---|
| public boolean gen_dependencies | |
| gen_listener | back to summary |
|---|---|
| public boolean gen_listener | |
| gen_visitor | back to summary |
|---|---|
| public boolean gen_visitor | |
| generate_ATN_dot | back to summary |
|---|---|
| public boolean generate_ATN_dot | |
| genPackage | back to summary |
|---|---|
| public String genPackage | |
| GRAMMAR_EXTENSION | back to summary |
|---|---|
| public static final String GRAMMAR_EXTENSION | |
| grammarEncoding | back to summary |
|---|---|
| public String grammarEncoding | |
| grammarFiles | back to summary |
|---|---|
| protected List<String> grammarFiles | |
| grammarOptions | back to summary |
|---|---|
| public Map<String, String> grammarOptions | |
| haveOutputDir | back to summary |
|---|---|
| protected boolean haveOutputDir | |
| importedGrammars | back to summary |
|---|---|
| private final Map<String, Grammar> importedGrammars | |
| inputDirectory | back to summary |
|---|---|
| public File inputDirectory | |
| launch_ST_inspector | back to summary |
|---|---|
| public boolean launch_ST_inspector | |
| LEGACY_GRAMMAR_EXTENSION | back to summary |
|---|---|
| public static final String LEGACY_GRAMMAR_EXTENSION | |
| libDirectory | back to summary |
|---|---|
| public String libDirectory | |
| listeners | back to summary |
|---|---|
| pack-priv List<ANTLRToolListener> listeners | |
| log | back to summary |
|---|---|
| public boolean log | |
| logMgr | back to summary |
|---|---|
| public LogManager logMgr | |
| longMessages | back to summary |
|---|---|
| public boolean longMessages | |
| msgFormat | back to summary |
|---|---|
| public String msgFormat | |
| optionDefs | back to summary |
|---|---|
| public static final Tool. | |
| outputDirectory | back to summary |
|---|---|
| public String outputDirectory | |
| return_dont_exit | back to summary |
|---|---|
| protected boolean return_dont_exit | |
| ST_inspector_wait_for_close | back to summary |
|---|---|
| public boolean ST_inspector_wait_for_close | |
| VERSION | back to summary |
|---|---|
| public static final String VERSION | |
| warnings_are_errors | back to summary |
|---|---|
| public boolean warnings_are_errors | |
| addListener | back to summary |
|---|---|
| public void addListener(ANTLRToolListener tl) | |
| checkForRuleIssues | back to summary |
|---|---|
| public boolean checkForRuleIssues(final Grammar g) Important enough to avoid multiple definitions that we do very early, right after AST construction. Also check for undefined rules in parser/lexer to avoid exceptions later. Return true if we find multiple definitions of the same rule or a reference to an undefined rule or parser rule ref in lexer rule. | |
| createGrammar | back to summary |
|---|---|
| public Grammar createGrammar(GrammarRootAST ast) Given the raw AST of a grammar, create a grammar object associated with the AST. Once we have the grammar object, ensure that all nodes in tree referred to this grammar. Later, we will use it for error handling and generally knowing from where a rule comes from. | |
| error | back to summary |
|---|---|
| public void error(ANTLRMessage msg) | |
| exit | back to summary |
|---|---|
| public void exit(int e) | |
| findOptionValueAST | back to summary |
|---|---|
| public static GrammarAST findOptionValueAST(GrammarRootAST root, String option) Manually get option node from tree; return null if no defined. | |
| generateATNs | back to summary |
|---|---|
| public void generateATNs(Grammar g) | |
| generateInterpreterData | back to summary |
|---|---|
| public static String generateInterpreterData(Grammar g) | |
| getImportedGrammarFile | back to summary |
|---|---|
| public File getImportedGrammarFile(Grammar g, String fileName) | |
| getListeners | back to summary |
|---|---|
| public List | |
| getNumErrors | back to summary |
|---|---|
| public int getNumErrors() | |
| getOutputDirectory | back to summary |
|---|---|
| public File getOutputDirectory(String fileNameWithPath) Return the location where ANTLR will generate output files for a given file. This is a base directory and output files will be relative to here in some cases such as when -o option is used and input files are given relative to the input directory.
| |
| getOutputFileWriter | back to summary |
|---|---|
| public Writer getOutputFileWriter(Grammar g, String fileName) throws IOException This method is used by all code generators to create new output files. If the outputDir set by -o is not present it will be created. The final filename is sensitive to the output directory and the directory where the grammar file was found. If -o is /tmp and the original grammar file was foo/t.g4 then output files go in /tmp/foo. The output dir -o spec takes precedence if it's absolute. E.g., if the grammar file dir is absolute the output dir is given precedence. "-o /tmp /usr/lib/t.g4" results in "/tmp/T.java" as output (assuming t.g4 holds T.java). If no -o is specified, then just write to the directory where the grammar file was found. If outputDirectory==null then write a String. | |
| handleArgs | back to summary |
|---|---|
| protected void handleArgs() | |
| handleOptionSetArg | back to summary |
|---|---|
| protected void handleOptionSetArg(String arg) | |
| help | back to summary |
|---|---|
| public void help() | |
| info | back to summary |
|---|---|
| public void info(String msg) | |
| loadGrammar | back to summary |
|---|---|
| public Grammar loadGrammar(String fileName) Convenience method to load and process an ANTLR grammar. Useful when creating interpreters. If you need to access to the lexer grammar created while processing a combined grammar, use getImplicitLexer() on returned grammar. | |
| loadImportedGrammar | back to summary |
|---|---|
| public Grammar loadImportedGrammar(Grammar g, GrammarAST nameNode) throws IOException Try current dir then dir of g then lib dir
| |
| log | back to summary |
|---|---|
| public void log(String component, String msg) | |
| log | back to summary |
|---|---|
| public void log(String msg) | |
| main | back to summary |
|---|---|
| public static void main(String[] args) | |
| new_getOutputDirectory | back to summary |
|---|---|
public File new_getOutputDirectory(String fileNameWithPath)
| |
| panic | back to summary |
|---|---|
| public void panic() | |
| parse | back to summary |
|---|---|
| public GrammarRootAST parse(String fileName, CharStream in) | |
| parseGrammar | back to summary |
|---|---|
| public GrammarRootAST parseGrammar(String fileName) | |
| parseGrammarFromString | back to summary |
|---|---|
| public GrammarRootAST parseGrammarFromString(String grammar) | |
| process | back to summary |
|---|---|
| public void process(Grammar g, boolean gencode) To process a grammar, we load all of its imported grammars into subordinate grammar objects. Then we merge the imported rules into the root grammar. If a root grammar is a combined grammar, we have to extract the implicit lexer. Once all this is done, we process the lexer first, if present, and then the parser grammar | |
| processGrammarsOnCommandLine | back to summary |
|---|---|
| public void processGrammarsOnCommandLine() | |
| processNonCombinedGrammar | back to summary |
|---|---|
| public void processNonCombinedGrammar(Grammar g, boolean gencode) | |
| removeListener | back to summary |
|---|---|
| public void removeListener(ANTLRToolListener tl) | |
| removeListeners | back to summary |
|---|---|
| public void removeListeners() | |
| sortGrammarByTokenVocab | back to summary |
|---|---|
| public List | |
| version | back to summary |
|---|---|
| public void version() | |
| warning | back to summary |
|---|---|
| public void warning(ANTLRMessage msg) | |
| writeDOTFile | back to summary |
|---|---|
| protected void writeDOTFile(Grammar g, Rule r, String dot) throws IOException | |
| writeDOTFile | back to summary |
|---|---|
| protected void writeDOTFile(Grammar g, String name, String dot) throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Tool. | |
| pack-priv String | |
| pack-priv String | |
| pack-priv String |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| argType | back to summary |
|---|---|
| pack-priv Tool. | |
| description | back to summary |
|---|---|
| pack-priv String description | |
| fieldName | back to summary |
|---|---|
| pack-priv String fieldName | |
| name | back to summary |
|---|---|
| pack-priv String name | |
| Option | back to summary |
|---|---|
| public Option(String fieldName, String name, String description) | |
| Option | back to summary |
|---|---|
| public Option(String fieldName, String name, Tool. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Tool. | |
| public static final Tool. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Tool. | |
| public static Tool. |
| NONE | back to summary |
|---|---|
| public static final Tool. | |
| STRING | back to summary |
|---|---|
| public static final Tool. | |
| OptionArgType | back to summary |
|---|---|
| private OptionArgType() | |
| valueOf | back to summary |
|---|---|
| public static Tool. | |
| values | back to summary |
|---|---|
| public static Tool. | |