Package ptolemy.data.ontologies.lattice
Class ParseTreeConstraintAnnotationEvaluator
- java.lang.Object
-
- ptolemy.data.expr.AbstractParseTreeVisitor
-
- ptolemy.data.ontologies.ParseTreeAnnotationEvaluator
-
- ptolemy.data.ontologies.lattice.ParseTreeConstraintAnnotationEvaluator
-
- All Implemented Interfaces:
ParseTreeVisitor
public class ParseTreeConstraintAnnotationEvaluator extends ParseTreeAnnotationEvaluator
This class visits parse trees and infers a property for each node in the parse tree. This property is stored in the parse tree.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Man-Kit Leung
- See Also:
ASTPtRootNode
- Pt.AcceptedRating:
- Red (mankit)
- Pt.ProposedRating:
- Red (mankit)
-
-
Field Summary
-
Fields inherited from class ptolemy.data.ontologies.ParseTreeAnnotationEvaluator
_adapter, _evaluatedObject
-
-
Constructor Summary
Constructors Constructor Description ParseTreeConstraintAnnotationEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
visitLeafNode(ASTPtLeafNode node)
visitLeafNode method is called when parsing an Annotation for a manual constraint.void
visitRelationalNode(ASTPtRelationalNode node)
Visit the relational node when parsing a user-defined manual constraint doe the LatticeOntologySolver.-
Methods inherited from class ptolemy.data.ontologies.ParseTreeAnnotationEvaluator
_getNodeLabel, _unsupportedVisitException, evaluate, visitAssignmentNode, visitMethodCallNode
-
Methods inherited from class ptolemy.data.expr.AbstractParseTreeVisitor
_visitAllChildren, _visitChild, visitArrayConstructNode, visitBitwiseNode, visitFunctionalIfNode, visitFunctionApplicationNode, visitFunctionDefinitionNode, visitLogicalNode, visitMatrixConstructNode, visitPowerNode, visitProductNode, visitRecordConstructNode, visitShiftNode, visitSumNode, visitUnaryNode, visitUnionConstructNode
-
-
-
-
Method Detail
-
visitLeafNode
public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException
visitLeafNode method is called when parsing an Annotation for a manual constraint. 12/16/09 Charles Shelton This visitLeafNode method assumes the node will refer to either a component in the model or a Concept in the ontology. The _evaluatedObject will then be set to that component or Concept. If it is not, then an exception is thrown. This method calls the superclass method for model Components, and then catches the superclass' exception to check for a Concept.- Specified by:
visitLeafNode
in interfaceParseTreeVisitor
- Overrides:
visitLeafNode
in classParseTreeAnnotationEvaluator
- Parameters:
node
- The leaf node to be visited- Throws:
IllegalActionException
- If the node label cannot be resolved to a component in the model
-
visitRelationalNode
public void visitRelationalNode(ASTPtRelationalNode node) throws IllegalActionException
Visit the relational node when parsing a user-defined manual constraint doe the LatticeOntologySolver. It should be an operator that is either '==', '≥', or '≤'.- Specified by:
visitRelationalNode
in interfaceParseTreeVisitor
- Overrides:
visitRelationalNode
in classAbstractParseTreeVisitor
- Parameters:
node
- The relational node to be visited- Throws:
IllegalActionException
- If the operator is not supported (should be one of '==', '≥', or '≤')
-
-