AttributeResolver
public class Alternative extends Object implements AttributeResolver
Modifier and Type | Field | 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 | Description |
---|---|
Alternative(Rule r,
int altNum) |
Modifier and Type | Method | 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,
String y,
ActionAST node) |
$x.y, x can be surrounding rule, token/rule/label ref.
|
Attribute |
resolveToAttribute(String x,
ActionAST node) |
$x Attribute: rule arguments, return values, predefined rule prop.
|
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 AttributeResolver
public boolean resolvesToAttributeDict(String x, ActionAST node)
resolvesToAttributeDict
in interface AttributeResolver
public Attribute resolveToAttribute(String x, ActionAST node)
resolveToAttribute
in interface AttributeResolver
public Attribute resolveToAttribute(String x, String y, ActionAST node)
resolveToAttribute
in interface AttributeResolver
public boolean resolvesToLabel(String x, ActionAST node)
resolvesToLabel
in interface AttributeResolver
public boolean resolvesToListLabel(String x, ActionAST node)
resolvesToListLabel
in interface AttributeResolver
public LabelElementPair getAnyLabelDef(String x)
Copyright © 1992–2019 ANTLR. All rights reserved.