Package org.antlr.v4.tool
Class Alternative
java.lang.Object
org.antlr.v4.tool.Alternative
- All Implemented Interfaces:
AttributeResolver
An outermost alternative for a rule. We don't track inner alternatives.
-
Field Summary
FieldsModifier and TypeFieldDescriptionTrack all executable actions other than named actions like @init and catch/finally (not in an alt).intWhat alternative number is this outermost alt? 1..norg.stringtemplate.v4.misc.MultiMap<String, LabelElementPair> A list of all LabelElementPair attached to tokens like id=ID, ids+=IDorg.stringtemplate.v4.misc.MultiMap<String, GrammarAST> org.stringtemplate.v4.misc.MultiMap<String, GrammarAST> org.stringtemplate.v4.misc.MultiMap<String, TerminalAST> org.stringtemplate.v4.misc.MultiMap<String, GrammarAST> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanresolvesToAttributeDict(String x, ActionAST node) booleanresolvesToLabel(String x, ActionAST node) booleanresolvesToListLabel(String x, ActionAST node) booleanresolvesToToken(String x, ActionAST node) resolveToAttribute(String x, String y, ActionAST node) $x.y, x can be surrounding rule, token/rule/label ref.resolveToAttribute(String x, ActionAST node) $x Attribute: rule arguments, return values, predefined rule prop.x can be ruleref or rule label.
-
Field Details
-
rule
-
ast
-
altNum
public int altNumWhat alternative number is this outermost alt? 1..n -
tokenRefs
-
tokenRefsInActions
-
ruleRefs
-
ruleRefsInActions
-
labelDefs
A list of all LabelElementPair attached to tokens like id=ID, ids+=ID -
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 alt
-
-
Constructor Details
-
Alternative
-
-
Method Details
-
resolvesToToken
- Specified by:
resolvesToTokenin interfaceAttributeResolver
-
resolvesToAttributeDict
- Specified by:
resolvesToAttributeDictin interfaceAttributeResolver
-
resolveToAttribute
$x Attribute: rule arguments, return values, predefined rule prop.- Specified by:
resolveToAttributein interfaceAttributeResolver
-
resolveToAttribute
$x.y, x can be surrounding rule, token/rule/label ref. y is visible attr in that dictionary. Can't see args on rule refs.- Specified by:
resolveToAttributein interfaceAttributeResolver
-
resolvesToLabel
- Specified by:
resolvesToLabelin interfaceAttributeResolver
-
resolvesToListLabel
- Specified by:
resolvesToListLabelin interfaceAttributeResolver
-
getAnyLabelDef
-
resolveToRule
x can be ruleref or rule label.
-