public static class GTParameter.Evaluator extends ParseTreeEvaluator
Red (tfeng) |
Yellow (tfeng) |
_evaluatedChildToken, _typeInference
Constructor and Description |
---|
Evaluator(Pattern pattern,
MatchResult matchResult)
Construct an evaluator.
|
Modifier and Type | Method and Description |
---|---|
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.
|
_assert, _evaluateAllChildren, _evaluateArrayIndex, _evaluateChild, _evaluateMatrixIndex, _functionCall, _methodCall, _trace, _traceEnter, _traceLeave, evaluateParseTree, traceParseTreeEvaluation, visitArrayConstructNode, visitBitwiseNode, visitFunctionalIfNode, visitFunctionApplicationNode, visitFunctionDefinitionNode, visitLeafNode, visitLogicalNode, visitMatrixConstructNode, visitPowerNode, visitProductNode, visitRecordConstructNode, visitRelationalNode, visitShiftNode, visitSumNode, visitUnaryNode, visitUnionConstructNode
_unsupportedVisitException, _visitAllChildren, _visitChild, visitAssignmentNode
public Evaluator(Pattern pattern, MatchResult matchResult)
pattern
- The pattern.matchResult
- The match result for the match between the
pattern and a host model.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.