Uses of Class
org.antlr.v4.tool.Grammar
-
-
Uses of Grammar in org.antlr.v4
Methods in org.antlr.v4 that return Grammar Modifier and Type Method Description Grammar
Tool. createGrammar(GrammarRootAST ast)
Given the raw AST of a grammar, create a grammar object associated with the AST.Grammar
Tool. loadGrammar(String fileName)
Convenience method to load and process an ANTLR grammar.Grammar
Tool. loadImportedGrammar(Grammar g, GrammarAST nameNode)
Try current dir then dir of g then lib dirMethods in org.antlr.v4 with parameters of type Grammar Modifier and Type Method Description boolean
Tool. checkForRuleIssues(Grammar g)
Important enough to avoid multiple definitions that we do very early, right after AST construction.void
Tool. generateATNs(Grammar g)
static String
Tool. generateInterpreterData(Grammar g)
File
Tool. getImportedGrammarFile(Grammar g, String fileName)
Writer
Tool. getOutputFileWriter(Grammar g, String fileName)
This method is used by all code generators to create new output files.Grammar
Tool. loadImportedGrammar(Grammar g, GrammarAST nameNode)
Try current dir then dir of g then lib dirvoid
Tool. process(Grammar g, boolean gencode)
To process a grammar, we load all of its imported grammars into subordinate grammar objects.void
Tool. processNonCombinedGrammar(Grammar g, boolean gencode)
protected void
Tool. writeDOTFile(Grammar g, String name, String dot)
protected void
Tool. writeDOTFile(Grammar g, Rule r, String dot)
-
Uses of Grammar in org.antlr.v4.analysis
Fields in org.antlr.v4.analysis declared as Grammar Modifier and Type Field Description Grammar
AnalysisPipeline. g
Grammar
LeftRecursiveRuleTransformer. g
Methods in org.antlr.v4.analysis with parameters of type Grammar Modifier and Type Method Description RuleAST
LeftRecursiveRuleTransformer. parseArtificialRule(Grammar g, String ruleText)
Constructors in org.antlr.v4.analysis with parameters of type Grammar Constructor Description AnalysisPipeline(Grammar g)
LeftRecursionDetector(Grammar g, ATN atn)
LeftRecursiveRuleTransformer(GrammarRootAST ast, Collection<Rule> rules, Grammar g)
-
Uses of Grammar in org.antlr.v4.automata
Fields in org.antlr.v4.automata declared as Grammar Modifier and Type Field Description Grammar
ParserATNFactory. g
Methods in org.antlr.v4.automata with parameters of type Grammar Modifier and Type Method Description static RangeBorderCharactersData
RangeBorderCharactersData. getAndCheckCharactersData(int from, int to, Grammar grammar, org.antlr.runtime.tree.CommonTree tree, boolean reportRangeContainsNotImpliedCharacters)
static void
ATNOptimizer. optimize(Grammar g, ATN atn)
Constructors in org.antlr.v4.automata with parameters of type Grammar Constructor Description ATNPrinter(Grammar g, ATNState start)
ParserATNFactory(Grammar g)
-
Uses of Grammar in org.antlr.v4.codegen
Fields in org.antlr.v4.codegen declared as Grammar Modifier and Type Field Description Grammar
CodeGenerator. g
Grammar
DefaultOutputModelFactory. g
Methods in org.antlr.v4.codegen that return Grammar Modifier and Type Method Description Grammar
DefaultOutputModelFactory. getGrammar()
Grammar
OutputModelController. getGrammar()
Grammar
OutputModelFactory. getGrammar()
Methods in org.antlr.v4.codegen with parameters of type Grammar Modifier and Type Method Description static CodeGenerator
CodeGenerator. create(Grammar g)
static CodeGenerator
CodeGenerator. create(Tool tool, Grammar g, String language)
protected void
Target. genFile(Grammar g, org.stringtemplate.v4.ST outputFileST, String fileName)
String
Target. getTokenTypeAsTargetLabel(Grammar g, int ttype)
Get a meaningful name for a token type useful during code generation.String[]
Target. getTokenTypesAsTargetLabels(Grammar g, int[] ttypes)
Constructors in org.antlr.v4.codegen with parameters of type Grammar Constructor Description CodeGenPipeline(Grammar g, CodeGenerator gen)
-
Uses of Grammar in org.antlr.v4.codegen.model
Methods in org.antlr.v4.codegen.model with parameters of type Grammar Modifier and Type Method Description Map<String,Action>
OutputFile. buildNamedActions(Grammar g)
Map<String,Action>
OutputFile. buildNamedActions(Grammar g, Predicate<ActionAST> filter)
-
Uses of Grammar in org.antlr.v4.codegen.target
Methods in org.antlr.v4.codegen.target with parameters of type Grammar Modifier and Type Method Description protected void
GoTarget. genFile(Grammar g, org.stringtemplate.v4.ST outputFileST, String fileName)
-
Uses of Grammar in org.antlr.v4.gui
Subclasses of Grammar in org.antlr.v4.gui Modifier and Type Class Description protected static class
Interpreter.IgnoreTokenVocabGrammar
Constructors in org.antlr.v4.gui with parameters of type Grammar Constructor Description IgnoreTokenVocabGrammar(String fileName, String grammarText, Grammar tokenVocabSource, ANTLRToolListener listener)
-
Uses of Grammar in org.antlr.v4.parse
Fields in org.antlr.v4.parse declared as Grammar Modifier and Type Field Description Grammar
BlockSetTransformer. g
Grammar
GrammarToken. g
protected Grammar
TokenVocabParser. g
Methods in org.antlr.v4.parse with parameters of type Grammar Modifier and Type Method Description static Pair<Integer,Integer>
ScopeParser. _parsePostfixDecl(Attribute attr, String decl, ActionAST a, Grammar g)
static Pair<Integer,Integer>
ScopeParser. _parsePrefixDecl(Attribute attr, String decl, ActionAST a, Grammar g)
static AttributeDict
ScopeParser. parse(ActionAST action, String s, char separator, Grammar g)
static Attribute
ScopeParser. parseAttributeDef(ActionAST action, Pair<String,Integer> decl, Grammar g)
For decls like "String foo" or "char *foo32[]" compute the ID and type declarations.static AttributeDict
ScopeParser. parseTypedArgList(ActionAST action, String s, Grammar g)
Given an arg or retval scope definition list likeConstructors in org.antlr.v4.parse with parameters of type Grammar Constructor Description BlockSetTransformer(org.antlr.runtime.tree.TreeNodeStream input, Grammar g)
GrammarToken(Grammar g, org.antlr.runtime.Token oldToken)
TokenVocabParser(Grammar g)
-
Uses of Grammar in org.antlr.v4.semantics
Fields in org.antlr.v4.semantics declared as Grammar Modifier and Type Field Description Grammar
ActionSniffer. g
Grammar
AttributeChecks. g
Grammar
BasicSemanticChecks. g
Grammar
RuleCollector. g
which grammar are we checkingGrammar
SemanticPipeline. g
Grammar
SymbolCollector. g
which grammar are we checkingMethods in org.antlr.v4.semantics with parameters of type Grammar Modifier and Type Method Description static void
AttributeChecks. checkAllAttributeExpressions(Grammar g)
void
SymbolChecks. checkForModeConflicts(Grammar g)
void
SymbolChecks. checkForQualifiedRuleIssues(Grammar g, List<GrammarAST> qualifiedRuleRefs)
void
SymbolChecks. checkForUnreachableTokens(Grammar g)
Algorithm steps: 1.void
SymbolChecks. checkRuleArgs(Grammar g, List<GrammarAST> rulerefs)
static Map<Rule,Set<Rule>>
UseDefAnalyzer. getRuleDependencies(Grammar g)
Find all rules reachable from r directly or indirectly for all r in gstatic Map<Rule,Set<Rule>>
UseDefAnalyzer. getRuleDependencies(Grammar g, Collection<Rule> rules)
static void
UseDefAnalyzer. trackTokenRuleRefsInActions(Grammar g)
Constructors in org.antlr.v4.semantics with parameters of type Grammar Constructor Description ActionSniffer(Grammar g, Rule r, Alternative alt, ActionAST node, org.antlr.runtime.Token actionToken)
AttributeChecks(Grammar g, Rule r, Alternative alt, ActionAST node, org.antlr.runtime.Token actionToken)
BasicSemanticChecks(Grammar g, RuleCollector ruleCollector)
RuleCollector(Grammar g)
SemanticPipeline(Grammar g)
SymbolChecks(Grammar g, SymbolCollector collector)
SymbolCollector(Grammar g)
-
Uses of Grammar in org.antlr.v4.tool
Subclasses of Grammar in org.antlr.v4.tool Modifier and Type Class Description class
LexerGrammar
Fields in org.antlr.v4.tool declared as Grammar Modifier and Type Field Description Grammar
ANTLRMessage. g
protected Grammar
BuildDependencyGenerator. g
protected Grammar
GrammarParserInterpreter. g
The grammar associated with this interpreter.Grammar
GrammarTransformPipeline. g
Grammar
Rule. g
In which grammar does this rule live?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 grammarGrammar
Grammar. parent
If we're imported, who imported us? If null, implies grammar is rootFields in org.antlr.v4.tool with type parameters of type Grammar Modifier and Type Field Description List<Grammar>
Grammar. importedGrammars
Methods in org.antlr.v4.tool that return Grammar Modifier and Type Method Description Grammar
Grammar. getImportedGrammar(String name)
Return grammar directly imported by this grammarGrammar
Grammar. getOutermostGrammar()
Return the grammar that imported us and our parents.static Grammar
Grammar. load(String fileName)
convenience method for Tool.loadGrammar()Methods in org.antlr.v4.tool that return types with arguments of type Grammar Modifier and Type Method Description List<Grammar>
Grammar. getAllImportedGrammars()
Get list of all imports from all grammars in the delegate subtree of g.List<Grammar>
Grammar. getGrammarAncestors()
Return list of imported grammars from root down to our parent.List<Grammar>
Grammar. getImportedGrammars()
Methods in org.antlr.v4.tool with parameters of type Grammar Modifier and Type Method Description static void
GrammarTransformPipeline. augmentTokensWithOriginalPosition(Grammar g, GrammarAST tree)
static ParserInterpreter
GrammarParserInterpreter. deriveTempParserInterpreter(Grammar g, Parser originalParser, TokenStream tokens)
Derive a new parser from an old one that has knowledge of the grammar.GrammarRootAST
GrammarTransformPipeline. extractImplicitLexer(Grammar combinedGrammar)
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<ParserRuleContext>
GrammarParserInterpreter. getAllPossibleParseTrees(Grammar g, Parser originalParser, TokenStream tokens, int decision, BitSet alts, int startIndex, int stopIndex, int startRuleIndex)
Given an ambiguous parse information, return the list of ambiguous parse trees.static List<ParserRuleContext>
GrammarParserInterpreter. getLookaheadParseTrees(Grammar g, ParserInterpreter originalParser, TokenStream tokens, int startRuleIndex, int decision, int startIndex, int stopIndex)
Return a list of parse trees, one for each alternative in a decision given the same input.void
Grammar. importVocab(Grammar importG)
void
GrammarTransformPipeline. integrateImportedGrammars(Grammar rootGrammar)
Merge all the rules, token definitions, and named actions from imported grammars into the root grammar tree.static void
GrammarTransformPipeline. setGrammarPtr(Grammar g, GrammarAST tree)
Utility visitor that sets grammar ptr in each nodeConstructors in org.antlr.v4.tool with parameters of type Grammar Constructor Description BuildDependencyGenerator(Tool tool, Grammar g)
DOTGenerator(Grammar grammar)
This aspect is associated with a grammarGrammar(String fileName, String grammarText, Grammar tokenVocabSource, ANTLRToolListener listener)
For testing; builds trees, does sem analGrammarParserInterpreter(Grammar g, String grammarFileName, Vocabulary vocabulary, Collection<String> ruleNames, ATN atn, TokenStream input)
GrammarParserInterpreter(Grammar g, ATN atn, TokenStream input)
GrammarTransformPipeline(Grammar g, Tool tool)
LabelElementPair(Grammar g, GrammarAST label, GrammarAST element, int labelOp)
LeftRecursiveRule(Grammar g, String name, RuleAST ast)
Rule(Grammar g, String name, RuleAST ast, int numberOfAlts)
Rule(Grammar g, String name, RuleAST ast, int numberOfAlts, String lexerMode, boolean caseInsensitive)
-
Uses of Grammar in org.antlr.v4.tool.ast
Fields in org.antlr.v4.tool.ast declared as Grammar Modifier and Type Field Description Grammar
GrammarAST. g
For error msgs, nice to know which grammar this AST lives in
-