Package org.antlr.v4.tool
Class AttributeDict
- java.lang.Object
-
- org.antlr.v4.tool.AttributeDict
-
public class AttributeDict extends Object
Track the attributes within retval, arg lists etc...Each rule has potentially 3 scopes: return values, parameters, and an implicitly-named scope (i.e., a scope defined in a rule). Implicitly-defined scopes are named after the rule; rules and scopes then must live in the same name space--no collisions allowed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AttributeDict.DictType
-
Field Summary
Fields Modifier and Type Field Description GrammarAST
ast
LinkedHashMap<String,Attribute>
attributes
The list ofAttribute
objects.String
name
static AttributeDict
predefinedTokenDict
AllToken
scopes (token labels) share the same fixed scope of of predefined attributes.AttributeDict.DictType
type
-
Constructor Summary
Constructors Constructor Description AttributeDict()
AttributeDict(AttributeDict.DictType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Attribute
add(Attribute a)
Attribute
get(String name)
String
getName()
Set<String>
intersection(AttributeDict other)
Return the set of keys that collide fromthis
andother
.int
size()
String
toString()
-
-
-
Field Detail
-
name
public String name
-
ast
public GrammarAST ast
-
type
public AttributeDict.DictType type
-
predefinedTokenDict
public static final AttributeDict predefinedTokenDict
-
attributes
public final LinkedHashMap<String,Attribute> attributes
The list ofAttribute
objects.
-
-
Constructor Detail
-
AttributeDict
public AttributeDict()
-
AttributeDict
public AttributeDict(AttributeDict.DictType type)
-
-
Method Detail
-
getName
public String getName()
-
size
public int size()
-
intersection
public Set<String> intersection(AttributeDict other)
Return the set of keys that collide fromthis
andother
.
-
-