|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.data.expr.AbstractParseTreeVisitor
ptolemy.data.expr.ParseTreeEvaluator
ptolemy.actor.gt.GTParameter.Evaluator
public static class GTParameter.Evaluator
The evaluator used in a transformation rule. It differs from other evaluators in that it uses a pattern and a match result to resolve names in both the pattern and the host model that the pattern matches in the match result. If a name is found in the host model, its value in the host model is returned, regardless of whether the same name exists in the pattern or not (even if this evaluator is used to evaluate a parameter specified in the pattern).
Red (tfeng) |
Yellow (tfeng) |
Field Summary | |
---|---|
private MatchResult |
_matchResult
The match result. |
private Pattern |
_pattern
The pattern. |
Fields inherited from class ptolemy.data.expr.ParseTreeEvaluator |
---|
_evaluatedChildToken, _typeInference |
Constructor Summary | |
---|---|
GTParameter.Evaluator(Pattern pattern,
MatchResult matchResult)
Construct an evaluator. |
Method Summary | |
---|---|
protected ParserScope |
_createScope(Pattern pattern,
MatchResult matchResult,
ParserScope superScope)
Create the scope to be used for name resolution. |
Token |
evaluateParseTree(ASTPtRootNode node,
ParserScope scope)
Evaluate the parse tree with a scope that can resolve more names than the given scope. |
void |
visitMethodCallNode(ASTPtMethodCallNode node)
Apply a method to the children of the specified node, where the first child is the object on which the method is defined and the rest of the children are arguments. |
Methods inherited from class ptolemy.data.expr.AbstractParseTreeVisitor |
---|
_unsupportedVisitException, _visitAllChildren, _visitChild, visitAssignmentNode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private MatchResult _matchResult
private Pattern _pattern
Constructor Detail |
---|
public GTParameter.Evaluator(Pattern pattern, MatchResult matchResult)
pattern
- The pattern.matchResult
- The match result for the match between the
pattern and a host model.Method Detail |
---|
public Token evaluateParseTree(ASTPtRootNode node, ParserScope scope) throws IllegalActionException
evaluateParseTree
in class ParseTreeEvaluator
node
- The node to be evaluated.scope
- The scope to be used as a fallback.
IllegalActionException
- If an error occurs during
evaluation.public void visitMethodCallNode(ASTPtMethodCallNode node) throws IllegalActionException
visitMethodCallNode
in interface ParseTreeVisitor
visitMethodCallNode
in class ParseTreeEvaluator
node
- The specified node.
IllegalActionException
- If an evaluation error occurs.protected ParserScope _createScope(Pattern pattern, MatchResult matchResult, ParserScope superScope)
pattern
- The pattern.matchResult
- The match result.superScope
- The scope to fall back on if a name cannot be
resolved.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |