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:
visitArrayConstructNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitAssignmentNode
public void visitAssignmentNode(ASTPtAssignmentNode node) throws IllegalActionException
- Specified by:
visitAssignmentNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitBitwiseNode
public void visitBitwiseNode(ASTPtBitwiseNode node) throws IllegalActionException
- Specified by:
visitBitwiseNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitFunctionApplicationNode
public void visitFunctionApplicationNode(ASTPtFunctionApplicationNode node) throws IllegalActionException
- Specified by:
visitFunctionApplicationNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitFunctionDefinitionNode
public void visitFunctionDefinitionNode(ASTPtFunctionDefinitionNode node) throws IllegalActionException
- Specified by:
visitFunctionDefinitionNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitFunctionalIfNode
public void visitFunctionalIfNode(ASTPtFunctionalIfNode node) throws IllegalActionException
- Specified by:
visitFunctionalIfNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitLeafNode
public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException
- Specified by:
visitLeafNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitLogicalNode
public void visitLogicalNode(ASTPtLogicalNode node) throws IllegalActionException
- Specified by:
visitLogicalNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitMatrixConstructNode
public void visitMatrixConstructNode(ASTPtMatrixConstructNode node) throws IllegalActionException
- Specified by:
visitMatrixConstructNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitMethodCallNode
public void visitMethodCallNode(ASTPtMethodCallNode node) throws IllegalActionException
- Specified by:
visitMethodCallNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitPowerNode
public void visitPowerNode(ASTPtPowerNode node) throws IllegalActionException
- Specified by:
visitPowerNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitProductNode
public void visitProductNode(ASTPtProductNode node) throws IllegalActionException
- Specified by:
visitProductNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitRecordConstructNode
public void visitRecordConstructNode(ASTPtRecordConstructNode node) throws IllegalActionException
- Specified by:
visitRecordConstructNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitRelationalNode
public void visitRelationalNode(ASTPtRelationalNode node) throws IllegalActionException
- Specified by:
visitRelationalNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitShiftNode
public void visitShiftNode(ASTPtShiftNode node) throws IllegalActionException
- Specified by:
visitShiftNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitSumNode
public void visitSumNode(ASTPtSumNode node) throws IllegalActionException
- Specified by:
visitSumNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitUnaryNode
public void visitUnaryNode(ASTPtUnaryNode node) throws IllegalActionException
- Specified by:
visitUnaryNodein interfaceParseTreeVisitor- Throws:
IllegalActionException
-
visitUnionConstructNode
public void visitUnionConstructNode(ASTPtUnionConstructNode node) throws IllegalActionException
- Specified by:
visitUnionConstructNodein 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.
-
-