public static class GTParameter.Scope extends java.lang.Object implements ParserScope
GTParameter.Evaluator
to resolve names with a pattern and
a match result.Red (tfeng) |
Yellow (tfeng) |
Modifier and Type | Field and Description |
---|---|
protected MatchResult |
_matchResult
The match result.
|
protected Pattern |
_pattern
The pattern.
|
protected ParserScope |
_superscope
The scope used to resolve a name if it cannot be resolved in this
scope.
|
Constructor and Description |
---|
Scope(Pattern pattern,
MatchResult matchResult,
ParserScope superscope)
Construct a scope.
|
Modifier and Type | Method and Description |
---|---|
Token |
get(java.lang.String name)
Look up and return the value with the specified name in the
scope.
|
Type |
getType(java.lang.String name)
Look up and return the type of the value with the specified
name in the scope.
|
InequalityTerm |
getTypeTerm(java.lang.String name)
Look up and return the type term for the specified name
in the scope.
|
java.util.Set<?> |
identifierSet()
Return a list of names corresponding to the identifiers
defined by this scope.
|
protected MatchResult _matchResult
protected Pattern _pattern
protected ParserScope _superscope
public Scope(Pattern pattern, MatchResult matchResult, ParserScope superscope)
pattern
- The pattern.matchResult
- The match result for the match between the
pattern and a host model.superscope
- The scope to fall back on if a name cannot be
resolved.public Token get(java.lang.String name) throws IllegalActionException
get
in interface ParserScope
name
- The name of the variable to be looked up.IllegalActionException
- If a value in the scope
exists with the given name, but cannot be evaluated.public Type getType(java.lang.String name) throws IllegalActionException
getType
in interface ParserScope
name
- The name of the variable to be looked up.IllegalActionException
- If a value in the scope
exists with the given name, but cannot be evaluated.public InequalityTerm getTypeTerm(java.lang.String name) throws IllegalActionException
getTypeTerm
in interface ParserScope
name
- The name of the variable to be looked up.IllegalActionException
- If a value in the scope
exists with the given name, but cannot be evaluated.public java.util.Set<?> identifierSet() throws IllegalActionException
identifierSet
in interface ParserScope
IllegalActionException
- If constructing the list causes
it.