| Modifier and Type | Field and Description |
|---|---|
| public int | |
| public List | actions
Track all executable actions other than named actions like @init and catch/finally (not in an alt). |
| public Alternative[] | alt
1..n alts |
| public AttributeDict | |
| public RuleAST | |
| public final boolean | caseInsensitive
If null then use value from global option that is false by default |
| public List | exceptions
Track exception handlers; points at "catch" node of (catch exception action) don't track finally action |
| public ActionAST | |
| public final Grammar | g
In which grammar does this rule live? |
| public int | index
All rules have unique index 0..n-1 |
| public boolean | |
| public AttributeDict | |
| public final String | mode
If we're in a lexer grammar, we might be in a mode |
| public List | |
| public final String | |
| public Map | namedActions
Map a name to an action for this rule like @init {...}. |
| public final int | |
| public static final AttributeDict | predefinedRulePropertiesDict
Rule refs have a predefined set of attributes as well as the return values and args. |
| public AttributeDict | |
| public static final Set |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. |
| public Map | |
| public LabelElementPair | |
| public MultiMap | |
| public Set | |
| public int | getOriginalNumberOfAlts()
Used for recursive rules (subclass), which have 1 alt, but many original alts |
| public AttributeDict | |
| public Set | |
| public List | |
| public boolean | |
| public int | |
| public boolean | |
| public Attribute | |
| public boolean | |
| public boolean | resolvesToLabel(String x, ActionAST node)
Implements org. |
| public boolean | resolvesToListLabel(String x, ActionAST node)
Implements org. |
| public boolean | resolvesToToken(String x, ActionAST node)
Implements org. |
| public Attribute | resolveToAttribute(String x, ActionAST node)
Implements org. |
| public Attribute | resolveToAttribute(String x, String y, ActionAST node)
Implements org. |
| public Rule | |
| public String |
| actionIndex | back to summary |
|---|---|
| public int actionIndex | |
| actions | back to summary |
|---|---|
| public List<ActionAST> actions Track all executable actions other than named actions like @init and catch/finally (not in an alt). Also tracks predicates, rewrite actions. We need to examine these actions before code generation so that we can detect refs to $rule.attr etc... This tracks per rule; Alternative objs also track per alt. | |
| alt | back to summary |
|---|---|
| public Alternative[] alt 1..n alts | |
| args | back to summary |
|---|---|
| public AttributeDict args | |
| ast | back to summary |
|---|---|
| public RuleAST ast | |
| caseInsensitive | back to summary |
|---|---|
| public final boolean caseInsensitive If null then use value from global option that is false by default | |
| exceptions | back to summary |
|---|---|
| public List<GrammarAST> exceptions Track exception handlers; points at "catch" node of (catch exception action) don't track finally action | |
| finallyAction | back to summary |
|---|---|
| public ActionAST finallyAction | |
| g | back to summary |
|---|---|
| public final Grammar g In which grammar does this rule live? | |
| index | back to summary |
|---|---|
| public int index All rules have unique index 0..n-1 | |
| isStartRule | back to summary |
|---|---|
| public boolean isStartRule | |
| locals | back to summary |
|---|---|
| public AttributeDict locals | |
| mode | back to summary |
|---|---|
| public final String mode If we're in a lexer grammar, we might be in a mode | |
| modifiers | back to summary |
|---|---|
| public List<GrammarAST> modifiers | |
| name | back to summary |
|---|---|
| public final String name | |
| namedActions | back to summary |
|---|---|
| public Map<String, ActionAST> namedActions Map a name to an action for this rule like @init {...}. The code generator will use this to fill holes in the rule template. I track the AST node for the action in case I need the line number for errors. | |
| numberOfAlts | back to summary |
|---|---|
| public final int numberOfAlts | |
| predefinedRulePropertiesDict | back to summary |
|---|---|
| public static final AttributeDict predefinedRulePropertiesDict Rule refs have a predefined set of attributes as well as the return values and args. These must be consistent with ActionTranslator.rulePropToModelMap, ... | |
| retvals | back to summary |
|---|---|
| public AttributeDict retvals | |
| validLexerCommands | back to summary |
|---|---|
| public static final Set<String> validLexerCommands | |
| Rule | back to summary |
|---|---|
| public Rule(Grammar g, String name, RuleAST ast, int numberOfAlts) | |
| Rule | back to summary |
|---|---|
| public Rule(Grammar g, String name, RuleAST ast, int numberOfAlts, String lexerMode, boolean caseInsensitive) | |
| defineActionInAlt | back to summary |
|---|---|
| public void defineActionInAlt(int currentAlt, ActionAST actionAST) | |
| defineLexerAction | back to summary |
|---|---|
| public void defineLexerAction(ActionAST actionAST) Lexer actions are numbered across rules 0..n-1 | |
| definePredicateInAlt | back to summary |
|---|---|
| public void definePredicateInAlt(int currentAlt, PredAST predAST) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getAltLabels | back to summary |
|---|---|
| public Map Get | |
| getAnyLabelDef | back to summary |
|---|---|
| public LabelElementPair getAnyLabelDef(String x) | |
| getElementLabelDefs | back to summary |
|---|---|
| public MultiMap | |
| getElementLabelNames | back to summary |
|---|---|
| public Set | |
| getOriginalNumberOfAlts | back to summary |
|---|---|
| public int getOriginalNumberOfAlts() Used for recursive rules (subclass), which have 1 alt, but many original alts | |
| getPredefinedScope | back to summary |
|---|---|
| public AttributeDict getPredefinedScope(LabelType ltype) | |
| getTokenRefs | back to summary |
|---|---|
| public Set | |
| getUnlabeledAltASTs | back to summary |
|---|---|
| public List | |
| hasAltSpecificContexts | back to summary |
|---|---|
| public boolean hasAltSpecificContexts() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isFragment | back to summary |
|---|---|
| public boolean isFragment() | |
| resolveRetvalOrProperty | back to summary |
|---|---|
| public Attribute resolveRetvalOrProperty(String y) | |
| resolvesToAttributeDict | back to summary |
|---|---|
| public boolean resolvesToAttributeDict(String x, ActionAST node) Implements org.
| |
| resolvesToLabel | back to summary |
|---|---|
| public boolean resolvesToLabel(String x, ActionAST node) Implements org.
| |
| resolvesToListLabel | back to summary |
|---|---|
| public boolean resolvesToListLabel(String x, ActionAST node) Implements org.
| |
| resolvesToToken | back to summary |
|---|---|
| public boolean resolvesToToken(String x, ActionAST node) Implements org.
| |
| resolveToAttribute | back to summary |
|---|---|
| public Attribute resolveToAttribute(String x, ActionAST node) Implements org. $x Attribute: rule arguments, return values, predefined rule prop.
| |
| resolveToAttribute | back to summary |
|---|---|
| public Attribute resolveToAttribute(String x, String y, ActionAST node) Implements org. $x.y Attribute: x is surrounding rule, label ref (in any alts)
| |
| resolveToRule | back to summary |
|---|---|
| public Rule resolveToRule(String x) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |