public class Rule extends Objectimplements AttributeResolver
| Modifier and Type | Field and Description |
|---|---|
int |
actionIndex
|
List |
actions
Track all executable actions other than named actions like @init and catch/finally (not in an alt).
|
Alternative |
alt
1..n alts
|
AttributeDict |
args
|
RuleAST |
ast
|
List |
exceptions
Track exception handlers; points at "catch" node of (catch exception action) don't track finally action
|
ActionAST |
finallyAction
|
Grammar |
g
In which grammar does this rule live?
|
int |
index
All rules have unique index 0..n-1
|
boolean |
isStartRule
|
AttributeDict |
locals
|
String |
mode
If we're in a lexer grammar, we might be in a mode
|
List |
modifiers
|
String |
name
|
Map |
namedActions
Map a name to an action for this rule like @init {...}.
|
int |
numberOfAlts
|
static AttributeDict |
predefinedRulePropertiesDict
Rule refs have a predefined set of attributes as well as the return values and args.
|
AttributeDict |
retvals
|
static Set |
validLexerCommands
|
| Constructor and Description |
|---|
Rule(Grammar
|
public static final AttributeDictpredefinedRulePropertiesDict
public Stringname
public List<GrammarAST > modifiers
public RuleASTast
public AttributeDictargs
public AttributeDictretvals
public AttributeDictlocals
public Grammarg
public Stringmode
public Map<String ,ActionAST > namedActions
public List<GrammarAST > exceptions
public List<ActionAST > actions
public ActionASTfinallyAction
public int numberOfAlts
public boolean isStartRule
public Alternative[] alt
public int index
public int actionIndex
public void defineActionInAlt(int currentAlt,
ActionAST actionAST) public void defineLexerAction(ActionASTactionAST)
public void definePredicateInAlt(int currentAlt,
PredAST predAST) public <any> getElementLabelDefs()
public boolean hasAltSpecificContexts()
public int getOriginalNumberOfAlts()
public Map<String ,List <<any> >> getAltLabels()
# labels. The keys of the map are the labels applied to outer alternatives of a lexer rule, and the values are collections of pairs (alternative number and
AltAST) identifying the alternatives with this label. Unlabeled alternatives are not included in the result.
public AttributeresolveToAttribute(String x, ActionAST node)
public AttributeresolveToAttribute(String x, String y, ActionAST node)
public LabelElementPairgetAnyLabelDef(String x)
public AttributeDictgetPredefinedScope(LabelType ltype)
public boolean isFragment()
public int hashCode()
public boolean equals(Objectobj)
public StringtoString()