Package org.antlr.v4.codegen.model
Class RuleFunction
java.lang.Object
org.antlr.v4.codegen.model.OutputModelObject
org.antlr.v4.codegen.model.RuleFunction
- Direct Known Subclasses:
LeftFactoredRuleFunction,LeftRecursiveRuleFunction,LeftUnfactoredRuleFunction
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanintFields inherited from class org.antlr.v4.codegen.model.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, Collection<RuleAST> contextASTs) 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.getEffectiveAltLabelContexts(OutputModelController controller) getEffectiveRuleContext(OutputModelController controller) protected Tuple2<FrequencySet<String>,FrequencySet<String>> Given list of X and r refs in alt, compute how many of each there arestatic StringgetLabelName(Grammar g, GrammarAST t) private List<GrammarAST>getRuleTokens(List<GrammarAST> refs)
-
Field Details
-
name
-
modifiers
-
ctxType
-
ruleLabels
-
tokenLabels
-
startState
-
index
public int index -
rule
-
hasLookaheadBlock
public boolean hasLookaheadBlock -
variantOf
-
code
-
locals
-
args
-
ruleCtx
-
altLabelCtxs
-
namedActions
-
finallyAction
-
exceptions
-
postamble
-
-
Constructor Details
-
RuleFunction
-
-
Method Details
-
getEffectiveRuleContext
-
getEffectiveAltLabelContexts
public Map<String,AltLabelStructDecl> getEffectiveAltLabelContexts(OutputModelController controller) -
addContextGetters
-
fillNamedActions
-
getDeclsForAllElements
for all alts, find which ref X or r needs List Must see across alts. If any alt needs X or r as list, then define as list. -
getRuleTokens
-
getLabelName
-
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
Add decl to struct ctx for rule or alt if labeled
-