| Package | Description |
|---|---|
| org.antlr.v4 | |
| org.antlr.v4.analysis | |
| org.antlr.v4.automata | |
| org.antlr.v4.codegen | |
| org.antlr.v4.parse | |
| org.antlr.v4.semantics | |
| org.antlr.v4.tool | |
| org.antlr.v4.tool.ast |
| Modifier and Type | Method and Description |
|---|---|
Grammar |
Tool.createGrammar(GrammarRootAST
Given the raw AST of a grammar, create a grammar object associated with the AST.
|
Grammar |
Tool.loadGrammar(String
Convenience method to load and process an ANTLR grammar.
|
Grammar |
Tool.loadImportedGrammar(Grammar
Try current dir then dir of g then lib dir
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
Tool.checkForRuleIssues(Grammar
Important enough to avoid multiple definitions that we do very early, right after AST construction.
|
void |
Tool.generateATNs(Grammar
|
File |
Tool.getImportedGrammarFile(Grammar
|
Writer |
Tool.getOutputFileWriter(Grammar
This method is used by all code generators to create new output files.
|
Grammar |
Tool.loadImportedGrammar(Grammar
Try current dir then dir of g then lib dir
|
void |
Tool.process(Grammar
To process a grammar, we load all of its imported grammars into subordinate grammar objects.
|
void |
Tool.processNonCombinedGrammar(Grammar
|
protected void |
Tool.writeDOTFile(Grammar
|
protected void |
Tool.writeDOTFile(Grammar
|
| Modifier and Type | Field and Description |
|---|---|
Grammar |
LeftRecursiveRuleTransformer.g
|
Grammar |
AnalysisPipeline.g
|
| Modifier and Type | Method and Description |
|---|---|
RuleAST |
LeftRecursiveRuleTransformer.parseArtificialRule(Grammar
|
| Constructor and Description | |
|---|---|
AnalysisPipeline(Grammar
|
|
LeftRecursionDetector(Grammar
|
|
LeftRecursiveRuleTransformer(GrammarRootAST
|
| Modifier and Type | Field and Description |
|---|---|
Grammar |
ParserATNFactory.g
|
| Modifier and Type | Method and Description |
|---|---|
static void |
ATNOptimizer.optimize(Grammar
|
| Constructor and Description | |
|---|---|
ATNPrinter(Grammar
|
|
ParserATNFactory(Grammar
|
| Modifier and Type | Field and Description |
|---|---|
Grammar |
DefaultOutputModelFactory.g
|
Grammar |
CodeGenerator.g
|
| Modifier and Type | Method and Description |
|---|---|
Grammar |
DefaultOutputModelFactory.getGrammar()
|
Grammar |
OutputModelFactory.getGrammar()
|
Grammar |
OutputModelController.getGrammar()
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
Target.genFile(Grammar
|
protected void |
Target.genListenerFile(Grammar
|
protected void |
Target.genRecognizerHeaderFile(Grammar
|
String |
Target.getTokenTypeAsTargetLabel(Grammar
Get a meaningful name for a token type useful during code generation.
|
String |
Target.getTokenTypesAsTargetLabels(Grammar
|
| Constructor and Description | |
|---|---|
CodeGenerator(Grammar
|
|
CodeGenerator(Tool
|
|
CodeGenPipeline(Grammar
|
| Modifier and Type | Field and Description |
|---|---|
Grammar |
GrammarToken.g
|
protected Grammar |
TokenVocabParser.g
|
Grammar |
BlockSetTransformer.g
|
| Modifier and Type | Method and Description |
|---|---|
static AttributeDict |
ScopeParser.parse(ActionAST
|
static Attribute |
ScopeParser.parseAttributeDef(ActionAST
For decls like "String foo" or "char *foo32[]" compute the ID and type declarations.
|
static AttributeDict |
ScopeParser.parseTypedArgList(ActionAST
Given an arg or retval scope definition list like Map
|
| Constructor and Description | |
|---|---|
BlockSetTransformer(TreeNodeStream input, Grammar
|
|
GrammarToken(Grammar
|
|
TokenVocabParser(Grammar
|
| Modifier and Type | Field and Description |
|---|---|
Grammar |
AttributeChecks.g
|
Grammar |
RuleCollector.g
which grammar are we checking
|
Grammar |
BasicSemanticChecks.g
|
Grammar |
ActionSniffer.g
|
Grammar |
SymbolCollector.g
which grammar are we checking
|
Grammar |
SemanticPipeline.g
|
| Modifier and Type | Method and Description |
|---|---|
static void |
AttributeChecks.checkAllAttributeExpressions(Grammar
|
void |
SymbolChecks.checkForModeConflicts(Grammar
|
void |
SymbolChecks.checkForQualifiedRuleIssues(Grammar
|
void |
SymbolChecks.checkRuleArgs(Grammar
|
static Map |
UseDefAnalyzer.getRuleDependencies(Grammar
Find all rules reachable from r directly or indirectly for all r in g
|
static Map |
UseDefAnalyzer.getRuleDependencies(Grammar
|
static void |
UseDefAnalyzer.trackTokenRuleRefsInActions(Grammar
|
| Constructor and Description | |
|---|---|
ActionSniffer(Grammar
|
|
AttributeChecks(Grammar
|
|
BasicSemanticChecks(Grammar
|
|
RuleCollector(Grammar
|
|
SemanticPipeline(Grammar
|
|
SymbolChecks(Grammar
|
|
SymbolCollector(Grammar
|
| Modifier and Type | Class and Description |
|---|---|
class |
LexerGrammar
|
| Modifier and Type | Field and Description |
|---|---|
Grammar |
ANTLRMessage.g
|
Grammar |
GrammarTransformPipeline.g
|
protected Grammar |
GrammarParserInterpreter.g
The grammar associated with this interpreter.
|
Grammar |
Rule.g
In which grammar does this rule live?
|
protected Grammar |
BuildDependencyGenerator.g
|
protected Grammar |
DOTGenerator.grammar
|
Grammar |
LexerGrammar.implicitLexerOwner
The grammar from which this lexer grammar was derived (if implicit)
|
Grammar |
Grammar.originalGrammar
If this is an extracted/implicit lexer, we point at original grammar
|
Grammar |
Grammar.parent
If we're imported, who imported us? If null, implies grammar is root
|
| Modifier and Type | Field and Description |
|---|---|
List |
Grammar.importedGrammars
|
| Modifier and Type | Method and Description |
|---|---|
Grammar |
Grammar.getImportedGrammar(String
Return grammar directly imported by this grammar
|
Grammar |
Grammar.getOutermostGrammar()
Return the grammar that imported us and our parents.
|
static Grammar |
Grammar.load(String
convenience method for Tool.loadGrammar()
|
| Modifier and Type | Method and Description |
|---|---|
List |
Grammar.getAllImportedGrammars()
Get list of all imports from all grammars in the delegate subtree of g.
|
List |
Grammar.getGrammarAncestors()
Return list of imported grammars from root down to our parent.
|
List |
Grammar.getImportedGrammars()
|
| Modifier and Type | Method and Description |
|---|---|
static void |
GrammarTransformPipeline.augmentTokensWithOriginalPosition(Grammar
|
static ParserInterpreter |
GrammarParserInterpreter.deriveTempParserInterpreter(Grammar
Derive a new parser from an old one that has knowledge of the grammar.
|
GrammarRootAST |
GrammarTransformPipeline.extractImplicitLexer(Grammar
Build lexer grammar from combined grammar that looks like: (COMBINED_GRAMMAR A (tokens { X (= Y 'y')) (OPTIONS (= x 'y')) (@ members {foo}) (@ lexer header {package jj;}) (RULES (RULE .+))) Move rules and actions to new tree, don't dup.
|
static List |
GrammarParserInterpreter.getAllPossibleParseTrees(Grammar
Given an ambiguous parse information, return the list of ambiguous parse trees.
|
static List |
GrammarParserInterpreter.getLookaheadParseTrees(Grammar
Return a list of parse trees, one for each alternative in a decision given the same input.
|
void |
Grammar.importVocab(Grammar
|
void |
GrammarTransformPipeline.integrateImportedGrammars(Grammar
Merge all the rules, token definitions, and named actions from imported grammars into the root grammar tree.
|
static void |
GrammarTransformPipeline.setGrammarPtr(Grammar
Utility visitor that sets grammar ptr in each node
|
| Constructor and Description | |
|---|---|
BuildDependencyGenerator(Tool
|
|
DOTGenerator(Grammar
This aspect is associated with a grammar
|
|
Grammar(String
For testing; builds trees, does sem anal
|
|
GrammarParserInterpreter(Grammar
|
|
GrammarParserInterpreter(Grammar
|
|
GrammarTransformPipeline(Grammar
|
|
LabelElementPair(Grammar
|
|
LeftRecursiveRule(Grammar
|
|
Rule(Grammar
|
| Modifier and Type | Field and Description |
|---|---|
Grammar |
GrammarAST.g
For error msgs, nice to know which grammar this AST lives in
|