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 classAttributeDict.DictType
-
Field Summary
Fields Modifier and Type Field Description GrammarASTastLinkedHashMap<String,Attribute>attributesThe list ofAttributeobjects.Stringnamestatic AttributeDictpredefinedTokenDictAllTokenscopes (token labels) share the same fixed scope of of predefined attributes.AttributeDict.DictTypetype
-
Constructor Summary
Constructors Constructor Description AttributeDict()AttributeDict(AttributeDict.DictType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Attributeadd(Attribute a)Attributeget(String name)StringgetName()Set<String>intersection(AttributeDict other)Return the set of keys that collide fromthisandother.intsize()StringtoString()
-
-
-
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 ofAttributeobjects.
-
-
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 fromthisandother.
-
-