public class RuleFunction extends OutputModelObject
Modifier and Type | Field and Description |
---|---|
Map<String,AltLabelStructDecl> |
altLabelCtxs |
AltLabelStructDecl[] |
altToContext |
Collection<AttributeDecl> |
args |
List<SrcOp> |
code |
String |
ctxType |
List<ExceptionClause> |
exceptions |
Action |
finallyAction |
boolean |
hasLookaheadBlock |
int |
index |
OrderedHashSet<Decl> |
locals |
List<String> |
modifiers |
String |
name |
Map<String,Action> |
namedActions |
List<SrcOp> |
postamble |
Rule |
rule |
StructDecl |
ruleCtx |
Collection<String> |
ruleLabels |
ATNState |
startState |
Collection<String> |
tokenLabels |
ast, factory
Constructor and Description |
---|
RuleFunction(OutputModelFactory factory,
Rule r) |
Modifier and Type | Method and Description |
---|---|
void |
addContextDecl(String altLabel,
Decl d)
Add decl to struct ctx for rule or alt if labeled
|
void |
addContextGetters(OutputModelFactory factory,
Rule r) |
void |
addLocalDecl(Decl d)
Add local var decl
|
void |
fillNamedActions(OutputModelFactory factory,
Rule r) |
List<Decl> |
getDeclForAltElement(GrammarAST t,
String refLabelName,
boolean needList,
boolean optional) |
Set<Decl> |
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>> |
getElementFrequenciesForAlt(AltAST ast)
Given list of X and r refs in alt, compute how many of each there are
|
public String name
public String ctxType
public Collection<String> ruleLabels
public Collection<String> tokenLabels
public ATNState startState
public int index
public Rule rule
public AltLabelStructDecl[] altToContext
public boolean hasLookaheadBlock
public OrderedHashSet<Decl> locals
public Collection<AttributeDecl> args
public StructDecl ruleCtx
public Map<String,AltLabelStructDecl> altLabelCtxs
public Action finallyAction
public List<ExceptionClause> exceptions
public RuleFunction(OutputModelFactory factory, Rule r)
public void addContextGetters(OutputModelFactory factory, Rule r)
public void fillNamedActions(OutputModelFactory factory, Rule r)
public Set<Decl> getDeclsForAllElements(List<AltAST> altASTs)
protected Pair<FrequencySet<String>,FrequencySet<String>> getElementFrequenciesForAlt(AltAST ast)
public List<Decl> getDeclForAltElement(GrammarAST t, String refLabelName, boolean needList, boolean optional)
public void addLocalDecl(Decl d)
Copyright © 1992–2020 ANTLR. All rights reserved.