Package ptolemy.actor.gt
Class GTParameter.TypeInference
- java.lang.Object
-
- ptolemy.data.expr.AbstractParseTreeVisitor
-
- ptolemy.data.expr.ParseTreeTypeInference
-
- ptolemy.actor.gt.GTParameter.TypeInference
-
- All Implemented Interfaces:
ParseTreeVisitor
- Enclosing class:
- GTParameter
public static class GTParameter.TypeInference extends ParseTreeTypeInference
The type inference used to infer types of names in the host model and in the pattern, which is used inGTParameter.Evaluator
.- Since:
- Ptolemy II 7.1
- Version:
- $Id$
- Author:
- Thomas Huining Feng
- Pt.AcceptedRating:
- Red (tfeng)
- Pt.ProposedRating:
- Yellow (tfeng)
-
-
Field Summary
-
Fields inherited from class ptolemy.data.expr.ParseTreeTypeInference
_inferredChildType, _scope
-
-
Constructor Summary
Constructors Constructor Description TypeInference(Pattern pattern, MatchResult matchResult)
Construct a type inference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Type
inferTypes(ASTPtRootNode node, ParserScope scope)
Infer the type of the parse tree with the specified root node using the specified scope to resolve the values of variables.void
visitMethodCallNode(ASTPtMethodCallNode node)
Set the type of the given node to be the return type of the method determined for the given node.-
Methods inherited from class ptolemy.data.expr.ParseTreeTypeInference
_assert, _getMethodReturnType, _getTypeForName, _inferAllChildren, _inferChild, _isValidName, _methodCall, _setType, inferTypes, visitArrayConstructNode, visitBitwiseNode, visitFunctionalIfNode, visitFunctionApplicationNode, visitFunctionDefinitionNode, visitLeafNode, visitLogicalNode, visitMatrixConstructNode, visitPowerNode, visitProductNode, visitRecordConstructNode, visitRelationalNode, visitShiftNode, visitSumNode, visitUnaryNode
-
Methods inherited from class ptolemy.data.expr.AbstractParseTreeVisitor
_unsupportedVisitException, _visitAllChildren, _visitChild, visitAssignmentNode, visitUnionConstructNode
-
-
-
-
Constructor Detail
-
TypeInference
public TypeInference(Pattern pattern, MatchResult matchResult)
Construct a type inference.- Parameters:
pattern
- The pattern.matchResult
- The match result for the match between the pattern and a host model.
-
-
Method Detail
-
inferTypes
public Type inferTypes(ASTPtRootNode node, ParserScope scope) throws IllegalActionException
Infer the type of the parse tree with the specified root node using the specified scope to resolve the values of variables.- Overrides:
inferTypes
in classParseTreeTypeInference
- Parameters:
node
- The root of the parse tree.scope
- The scope for evaluation.- Returns:
- The result of evaluation.
- Throws:
IllegalActionException
- If an error occurs during evaluation.
-
visitMethodCallNode
public void visitMethodCallNode(ASTPtMethodCallNode node) throws IllegalActionException
Set the type of the given node to be the return type of the method determined for the given node.- Specified by:
visitMethodCallNode
in interfaceParseTreeVisitor
- Overrides:
visitMethodCallNode
in classParseTreeTypeInference
- Parameters:
node
- The specified node.- Throws:
IllegalActionException
- If an inference error occurs.
-
-