Class RuleFunction
java.lang.Object
org.antlr.v4.codegen.model.OutputModelObject
org.antlr.v4.codegen.model.RuleFunction
- Direct Known Subclasses:
LeftRecursiveRuleFunction
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal AltLabelStructDecl[]final Stringbooleanfinal intfinal Stringfinal Rulefinal Collection<String> final ATNStatefinal Collection<String> Fields inherited from class OutputModelObject
ast, factory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContextDecl(String altLabel, Decl d) Add decl to struct ctx for rule or alt if labeledvoidaddContextGetters(OutputModelFactory factory, Rule r) voidaddLocalDecl(Decl d) Add local var declvoidfillNamedActions(OutputModelFactory factory, Rule r) getDeclForAltElement(GrammarAST t, String refLabelName, boolean needList, boolean optional) getDeclsForAllElements(List<AltAST> altASTs) for all alts, find which ref X or r needs List Must see across alts.protected Pair<FrequencySet<String>, FrequencySet<String>> Given list of X and r refs in alt, compute how many of each there areprivate StringgetName(GrammarAST token) private List<GrammarAST> getRuleTokens(List<GrammarAST> refs)
-
Field Details
-
name
-
escapedName
-
modifiers
-
ctxType
-
ruleLabels
-
tokenLabels
-
startState
-
index
public final int index -
rule
-
altToContext
-
hasLookaheadBlock
public boolean hasLookaheadBlock -
code
-
locals
-
args
-
ruleCtx
-
altLabelCtxs
-
namedActions
-
finallyAction
-
exceptions
-
postamble
-
-
Constructor Details
-
RuleFunction
-
-
Method Details
-
addContextGetters
-
fillNamedActions
-
getDeclsForAllElements
-
getRuleTokens
-
getName
-
getElementFrequenciesForAlt
Given list of X and r refs in alt, compute how many of each there are -
getDeclForAltElement
public List<Decl> getDeclForAltElement(GrammarAST t, String refLabelName, boolean needList, boolean optional) -
addLocalDecl
Add local var decl -
addContextDecl
-