public class Alternative extends Object implements AttributeResolver
| Modifier and Type | Field and Description |
|---|---|
List<ActionAST> |
actions
Track all executable actions other than named actions like @init
and catch/finally (not in an alt).
|
int |
altNum
What alternative number is this outermost alt? 1..n
|
AltAST |
ast |
org.stringtemplate.v4.misc.MultiMap<String,LabelElementPair> |
labelDefs
A list of all LabelElementPair attached to tokens like id=ID, ids+=ID
|
Rule |
rule |
org.stringtemplate.v4.misc.MultiMap<String,GrammarAST> |
ruleRefs |
org.stringtemplate.v4.misc.MultiMap<String,GrammarAST> |
ruleRefsInActions |
org.stringtemplate.v4.misc.MultiMap<String,TerminalAST> |
tokenRefs |
org.stringtemplate.v4.misc.MultiMap<String,GrammarAST> |
tokenRefsInActions |
| Constructor and Description |
|---|
Alternative(Rule r,
int altNum) |
| Modifier and Type | Method and Description |
|---|---|
LabelElementPair |
getAnyLabelDef(String x) |
boolean |
resolvesToAttributeDict(String x,
ActionAST node) |
boolean |
resolvesToLabel(String x,
ActionAST node) |
boolean |
resolvesToListLabel(String x,
ActionAST node) |
boolean |
resolvesToToken(String x,
ActionAST node) |
Attribute |
resolveToAttribute(String x,
ActionAST node)
$x Attribute: rule arguments, return values, predefined rule prop.
|
Attribute |
resolveToAttribute(String x,
String y,
ActionAST node)
$x.y, x can be surrounding rule, token/rule/label ref.
|
Rule |
resolveToRule(String x)
x can be ruleref or rule label.
|
public Rule rule
public AltAST ast
public int altNum
public org.stringtemplate.v4.misc.MultiMap<String,TerminalAST> tokenRefs
public org.stringtemplate.v4.misc.MultiMap<String,GrammarAST> tokenRefsInActions
public org.stringtemplate.v4.misc.MultiMap<String,GrammarAST> ruleRefs
public org.stringtemplate.v4.misc.MultiMap<String,GrammarAST> ruleRefsInActions
public org.stringtemplate.v4.misc.MultiMap<String,LabelElementPair> labelDefs
public List<ActionAST> actions
public Alternative(Rule r, int altNum)
public boolean resolvesToToken(String x, ActionAST node)
resolvesToToken in interface AttributeResolverpublic boolean resolvesToAttributeDict(String x, ActionAST node)
resolvesToAttributeDict in interface AttributeResolverpublic Attribute resolveToAttribute(String x, ActionAST node)
resolveToAttribute in interface AttributeResolverpublic Attribute resolveToAttribute(String x, String y, ActionAST node)
resolveToAttribute in interface AttributeResolverpublic boolean resolvesToLabel(String x, ActionAST node)
resolvesToLabel in interface AttributeResolverpublic boolean resolvesToListLabel(String x, ActionAST node)
resolvesToListLabel in interface AttributeResolverpublic LabelElementPair getAnyLabelDef(String x)
Copyright © 1992–2020 ANTLR. All rights reserved.