Package ptolemy.data.expr
Class AbstractParseTreeVisitor
- java.lang.Object
-
- ptolemy.data.expr.AbstractParseTreeVisitor
-
- All Implemented Interfaces:
ParseTreeVisitor
- Direct Known Subclasses:
CParseTreeCodeGenerator
,ParseTreeAnnotationEvaluator
,ParseTreeASTNodeAdapterCollector
,ParseTreeDumper
,ParseTreeEvaluator
,ParseTreeFreeVariableCollector
,ParseTreeFreeVariableRenamer
,ParseTreeSpecializer
,ParseTreeTypeInference
,ParseTreeWriter
,ProceduralParseTreeCodeGenerator
,RTMExpTranslator
public class AbstractParseTreeVisitor extends java.lang.Object implements ParseTreeVisitor
This class implements a base class visitor for parse trees in the expression language. Primarily this class exists to give nice error messages for visitors that are partly implemented, and to allow us to extend the expression language without completely breaking existing code.- Since:
- Ptolemy II 2.1
- Version:
- $Id$
- Author:
- Steve Neuendorffer
- See Also:
ASTPtRootNode
- Pt.AcceptedRating:
- Red (cxh)
- Pt.ProposedRating:
- Red (neuendor)
-
-
Constructor Summary
Constructors Constructor Description AbstractParseTreeVisitor()
-
Method Summary
-
-
-
Method Detail
-
visitArrayConstructNode
public void visitArrayConstructNode(ASTPtArrayConstructNode node) throws IllegalActionException
- Specified by:
visitArrayConstructNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitAssignmentNode
public void visitAssignmentNode(ASTPtAssignmentNode node) throws IllegalActionException
- Specified by:
visitAssignmentNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitBitwiseNode
public void visitBitwiseNode(ASTPtBitwiseNode node) throws IllegalActionException
- Specified by:
visitBitwiseNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitFunctionApplicationNode
public void visitFunctionApplicationNode(ASTPtFunctionApplicationNode node) throws IllegalActionException
- Specified by:
visitFunctionApplicationNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitFunctionDefinitionNode
public void visitFunctionDefinitionNode(ASTPtFunctionDefinitionNode node) throws IllegalActionException
- Specified by:
visitFunctionDefinitionNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitFunctionalIfNode
public void visitFunctionalIfNode(ASTPtFunctionalIfNode node) throws IllegalActionException
- Specified by:
visitFunctionalIfNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitLeafNode
public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException
- Specified by:
visitLeafNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitLogicalNode
public void visitLogicalNode(ASTPtLogicalNode node) throws IllegalActionException
- Specified by:
visitLogicalNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitMatrixConstructNode
public void visitMatrixConstructNode(ASTPtMatrixConstructNode node) throws IllegalActionException
- Specified by:
visitMatrixConstructNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitMethodCallNode
public void visitMethodCallNode(ASTPtMethodCallNode node) throws IllegalActionException
- Specified by:
visitMethodCallNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitPowerNode
public void visitPowerNode(ASTPtPowerNode node) throws IllegalActionException
- Specified by:
visitPowerNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitProductNode
public void visitProductNode(ASTPtProductNode node) throws IllegalActionException
- Specified by:
visitProductNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitRecordConstructNode
public void visitRecordConstructNode(ASTPtRecordConstructNode node) throws IllegalActionException
- Specified by:
visitRecordConstructNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitRelationalNode
public void visitRelationalNode(ASTPtRelationalNode node) throws IllegalActionException
- Specified by:
visitRelationalNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitShiftNode
public void visitShiftNode(ASTPtShiftNode node) throws IllegalActionException
- Specified by:
visitShiftNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitSumNode
public void visitSumNode(ASTPtSumNode node) throws IllegalActionException
- Specified by:
visitSumNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitUnaryNode
public void visitUnaryNode(ASTPtUnaryNode node) throws IllegalActionException
- Specified by:
visitUnaryNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
visitUnionConstructNode
public void visitUnionConstructNode(ASTPtUnionConstructNode node) throws IllegalActionException
- Specified by:
visitUnionConstructNode
in interfaceParseTreeVisitor
- Throws:
IllegalActionException
-
_unsupportedVisitException
protected IllegalActionException _unsupportedVisitException(java.lang.String name)
Return an exception that describes an unsupported node type.- Parameters:
name
- The name of the node type.- Returns:
- An exception that describes an unsupported node type.
-
_visitAllChildren
protected void _visitAllChildren(ASTPtRootNode node) throws IllegalActionException
Loop through all of the children of this node, visiting each one of them, which will cause their token value to be determined.- Parameters:
node
- The node whose children are to be looped through.- Throws:
IllegalActionException
- If thrown while visiting a child node.
-
_visitChild
protected void _visitChild(ASTPtRootNode node, int i) throws IllegalActionException
Visit the child with the given index of the given node. This is usually called while visiting the given node.- Parameters:
node
- The node.i
- The index of the child to be visited.- Throws:
IllegalActionException
- If thrown while visiting a child node.
-
-