ptolemy.data.expr
Class AbstractParseTreeVisitor
java.lang.Object
ptolemy.data.expr.AbstractParseTreeVisitor
- All Implemented Interfaces:
- ParseTreeVisitor
- Direct Known Subclasses:
- CParseTreeCodeGenerator, CParseTreeCodeGenerator, JavaParseTreeCodeGenerator, ParseTreeDumper, ParseTreeEvaluator, ParseTreeFreeVariableCollector, ParseTreeFreeVariableRenamer, ParseTreeSpecializer, ParseTreeTypeInference, ParseTreeWriter, RTMaudeParseTreeCodeGenerator, 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: AbstractParseTreeVisitor.java 57040 2010-01-27 20:52:32Z cxh $
- Author:
- Steve Neuendorffer
- See Also:
ASTPtRootNode
- Accepted Rating:
- Proposed Rating:
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractParseTreeVisitor
public AbstractParseTreeVisitor()
visitArrayConstructNode
public void visitArrayConstructNode(ASTPtArrayConstructNode node)
throws IllegalActionException
- Specified by:
visitArrayConstructNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitAssignmentNode
public void visitAssignmentNode(ASTPtAssignmentNode node)
throws IllegalActionException
- Specified by:
visitAssignmentNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitBitwiseNode
public void visitBitwiseNode(ASTPtBitwiseNode node)
throws IllegalActionException
- Specified by:
visitBitwiseNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitFunctionApplicationNode
public void visitFunctionApplicationNode(ASTPtFunctionApplicationNode node)
throws IllegalActionException
- Specified by:
visitFunctionApplicationNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitFunctionDefinitionNode
public void visitFunctionDefinitionNode(ASTPtFunctionDefinitionNode node)
throws IllegalActionException
- Specified by:
visitFunctionDefinitionNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitFunctionalIfNode
public void visitFunctionalIfNode(ASTPtFunctionalIfNode node)
throws IllegalActionException
- Specified by:
visitFunctionalIfNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitLeafNode
public void visitLeafNode(ASTPtLeafNode node)
throws IllegalActionException
- Specified by:
visitLeafNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitLogicalNode
public void visitLogicalNode(ASTPtLogicalNode node)
throws IllegalActionException
- Specified by:
visitLogicalNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitMatrixConstructNode
public void visitMatrixConstructNode(ASTPtMatrixConstructNode node)
throws IllegalActionException
- Specified by:
visitMatrixConstructNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitMethodCallNode
public void visitMethodCallNode(ASTPtMethodCallNode node)
throws IllegalActionException
- Specified by:
visitMethodCallNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitPowerNode
public void visitPowerNode(ASTPtPowerNode node)
throws IllegalActionException
- Specified by:
visitPowerNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitProductNode
public void visitProductNode(ASTPtProductNode node)
throws IllegalActionException
- Specified by:
visitProductNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitRecordConstructNode
public void visitRecordConstructNode(ASTPtRecordConstructNode node)
throws IllegalActionException
- Specified by:
visitRecordConstructNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitRelationalNode
public void visitRelationalNode(ASTPtRelationalNode node)
throws IllegalActionException
- Specified by:
visitRelationalNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitShiftNode
public void visitShiftNode(ASTPtShiftNode node)
throws IllegalActionException
- Specified by:
visitShiftNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitSumNode
public void visitSumNode(ASTPtSumNode node)
throws IllegalActionException
- Specified by:
visitSumNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitUnaryNode
public void visitUnaryNode(ASTPtUnaryNode node)
throws IllegalActionException
- Specified by:
visitUnaryNode in interface ParseTreeVisitor
- Throws:
IllegalActionException
visitUnionConstructNode
public void visitUnionConstructNode(ASTPtUnionConstructNode node)
throws IllegalActionException
- Specified by:
visitUnionConstructNode in interface ParseTreeVisitor
- 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.