| java.lang.Object org.antlr.tool.AttributeScope
All known Subclasses: org.antlr.tool.RuleLabelScope,
AttributeScope | public class AttributeScope (Code) | | Track the attributes within a scope. A named scoped has just its list
of attributes. 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.
|
derivedFromToken | public Token derivedFromToken(Code) | | This scope is associated with which input token (for error handling)?
|
isDynamicGlobalScope | public boolean isDynamicGlobalScope(Code) | | Not a rule scope, but visible to all rules "scope symbols { ...}"
|
isDynamicRuleScope | public boolean isDynamicRuleScope(Code) | | Visible to all rules, but defined in rule "scope { int i; }"
|
isParameterScope | public boolean isParameterScope(Code) | | |
isPredefinedLexerRuleScope | public boolean isPredefinedLexerRuleScope(Code) | | |
isPredefinedRuleScope | public boolean isPredefinedRuleScope(Code) | | |
isReturnScope | public boolean isReturnScope(Code) | | |
tokenScope | public static AttributeScope tokenScope(Code) | | All token scopes (token labels) share the same fixed scope of
of predefined attributes. I keep this out of the runtime.Token
object to avoid a runtime space burden.
|
AttributeScope | public AttributeScope(String name, Token derivedFromToken)(Code) | | |
AttributeScope | public AttributeScope(Grammar grammar, String name, Token derivedFromToken)(Code) | | |
addAttributes | public void addAttributes(String definitions, String separator)(Code) | | From a chunk of text holding the definitions of the attributes,
pull them apart and create an Attribute for each one. Add to
the list of attributes for this scope. Pass in the character
that terminates a definition such as ',' or ';'. For example,
scope symbols {
int n;
List names;
}
would pass in definitions equal to the text in between {...} and
separator=';'. It results in two Attribute objects.
|
getAttributes | public List getAttributes()(Code) | | Used by templates to get all attributes
|
intersection | public Set intersection(AttributeScope other)(Code) | | Return the set of keys that collide from
this and other.
|
|
|