Package ptolemy.data.ontologies
Class ExpressionConceptFunctionParseTreeTypeInference
- java.lang.Object
-
- ptolemy.data.expr.AbstractParseTreeVisitor
-
- ptolemy.data.expr.ParseTreeTypeInference
-
- ptolemy.data.ontologies.ExpressionConceptFunctionParseTreeTypeInference
-
- All Implemented Interfaces:
ParseTreeVisitor
public class ExpressionConceptFunctionParseTreeTypeInference extends ParseTreeTypeInference
A type inference subclass for the parser for expression concept functions.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Charles Shelton
- See Also:
ASTPtRootNode- Pt.AcceptedRating:
- Red (cshelton)
- Pt.ProposedRating:
- Green (cshelton)
-
-
Field Summary
-
Fields inherited from class ptolemy.data.expr.ParseTreeTypeInference
_inferredChildType, _scope
-
-
Constructor Summary
Constructors Constructor Description ExpressionConceptFunctionParseTreeTypeInference()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvisitFunctionApplicationNode(ASTPtFunctionApplicationNode node)Set the type of the given node to be the return type of the function determined for the given node.voidvisitLeafNode(ASTPtLeafNode node)Set the type of the given node.-
Methods inherited from class ptolemy.data.expr.ParseTreeTypeInference
_assert, _getMethodReturnType, _getTypeForName, _inferAllChildren, _inferChild, _isValidName, _methodCall, _setType, inferTypes, inferTypes, visitArrayConstructNode, visitBitwiseNode, visitFunctionalIfNode, visitFunctionDefinitionNode, visitLogicalNode, visitMatrixConstructNode, visitMethodCallNode, visitPowerNode, visitProductNode, visitRecordConstructNode, visitRelationalNode, visitShiftNode, visitSumNode, visitUnaryNode
-
Methods inherited from class ptolemy.data.expr.AbstractParseTreeVisitor
_unsupportedVisitException, _visitAllChildren, _visitChild, visitAssignmentNode, visitUnionConstructNode
-
-
-
-
Method Detail
-
visitFunctionApplicationNode
public void visitFunctionApplicationNode(ASTPtFunctionApplicationNode node) throws IllegalActionException
Set the type of the given node to be the return type of the function determined for the given node. Since all functions in a Concept function expression are also Concept functions, the return type is always a Concept.- Specified by:
visitFunctionApplicationNodein interfaceParseTreeVisitor- Overrides:
visitFunctionApplicationNodein classParseTreeTypeInference- Parameters:
node- The specified node.- Throws:
IllegalActionException- Not thrown in this overridden method.
-
visitLeafNode
public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException
Set the type of the given node. Since the expression concept function leaf nodes are all tokens containing Concept objects, always set the type of the leaf node to be a token that holds a concept object.- Specified by:
visitLeafNodein interfaceParseTreeVisitor- Overrides:
visitLeafNodein classParseTreeTypeInference- Parameters:
node- The specified node.- Throws:
IllegalActionException- Not thrown in this overridden method.
-
-