public class ParseTreeAnnotationEvaluator extends AbstractParseTreeVisitor
ASTPtRootNode
Red (mankit) |
Red (mankit) |
Modifier and Type | Field and Description |
---|---|
protected OntologyAdapter |
_adapter
The property adapter that contains the top level model
component containing actors that could be referenced
by the node label.
|
protected java.lang.Object |
_evaluatedObject
The model component that the parse tree node refers to.
|
Constructor and Description |
---|
ParseTreeAnnotationEvaluator() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
_getNodeLabel(ASTPtLeafNode node)
Return the label for the leaf node.
|
protected IllegalActionException |
_unsupportedVisitException(java.lang.String name)
Return an exception that describes an unsupported node type.
|
void |
evaluate(ASTPtRootNode node,
OntologyAdapter adapter)
Infer the property of the parse tree with the specified root node using
the specified scope to resolve the values of variables.
|
void |
visitAssignmentNode(ASTPtAssignmentNode node)
Visit the assignment node when parsing a user-defined ontology annotation.
|
void |
visitLeafNode(ASTPtLeafNode node)
visitLeafNode method is called when parsing an Annotation for a manual constraint.
|
void |
visitMethodCallNode(ASTPtMethodCallNode node)
Visit the method node when parsing a user-defined ontology annotation.
|
_visitAllChildren, _visitChild, visitArrayConstructNode, visitBitwiseNode, visitFunctionalIfNode, visitFunctionApplicationNode, visitFunctionDefinitionNode, visitLogicalNode, visitMatrixConstructNode, visitPowerNode, visitProductNode, visitRecordConstructNode, visitRelationalNode, visitShiftNode, visitSumNode, visitUnaryNode, visitUnionConstructNode
protected OntologyAdapter _adapter
protected java.lang.Object _evaluatedObject
public void evaluate(ASTPtRootNode node, OntologyAdapter adapter) throws IllegalActionException
node
- The root of the parse tree.adapter
- The given property adapter.IllegalActionException
- If an error occurs during
evaluation.public void visitAssignmentNode(ASTPtAssignmentNode node) throws IllegalActionException
visitAssignmentNode
in interface ParseTreeVisitor
visitAssignmentNode
in class AbstractParseTreeVisitor
node
- The assignment node to be visited.IllegalActionException
- If the assignment is not possible.public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException
visitLeafNode
in interface ParseTreeVisitor
visitLeafNode
in class AbstractParseTreeVisitor
node
- The leaf node to be visitedIllegalActionException
- If the node label cannot be resolved to a
component in the modelpublic void visitMethodCallNode(ASTPtMethodCallNode node) throws IllegalActionException
visitMethodCallNode
in interface ParseTreeVisitor
visitMethodCallNode
in class AbstractParseTreeVisitor
node
- The method call node to be visitedIllegalActionException
- If the method label cannot be resolved.protected java.lang.String _getNodeLabel(ASTPtLeafNode node)
node
- The given leaf nodeprotected IllegalActionException _unsupportedVisitException(java.lang.String name)
_unsupportedVisitException
in class AbstractParseTreeVisitor
name
- The name of the node type.