Package org.antlr.v4.tool
Class AttributeDict
- java.lang.Object
-
- org.antlr.v4.tool.AttributeDict
-
public class AttributeDict extends java.lang.ObjectTrack 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 GrammarASTastjava.util.LinkedHashMap<java.lang.String,Attribute>attributesThe list ofAttributeobjects.java.lang.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(java.lang.String name)java.lang.StringgetName()java.util.Set<java.lang.String>intersection(AttributeDict other)Return the set of keys that collide fromthisandother.intsize()java.lang.StringtoString()
-
-
-
Field Detail
-
name
public java.lang.String name
-
ast
public GrammarAST ast
-
type
public AttributeDict.DictType type
-
predefinedTokenDict
public static final AttributeDict predefinedTokenDict
-
-
Constructor Detail
-
AttributeDict
public AttributeDict()
-
AttributeDict
public AttributeDict(AttributeDict.DictType type)
-
-
Method Detail
-
get
public Attribute get(java.lang.String name)
-
getName
public java.lang.String getName()
-
size
public int size()
-
intersection
public java.util.Set<java.lang.String> intersection(AttributeDict other)
Return the set of keys that collide fromthisandother.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-