Package com.singularsys.jep.walkers
Class DeepCopyVisitor
java.lang.Object
com.singularsys.jep.walkers.DoNothingVisitor
com.singularsys.jep.walkers.DeepCopyVisitor
- All Implemented Interfaces:
JepComponent,ParserVisitor,Serializable
- Direct Known Subclasses:
ExpressionConsolidator,ImportationVisitor
A Visitor which returns an exact copy of the tree.
This class should be extended by visitors which
modify trees and creates a new tree.
- Author:
- Rich Morris Created on 16-Nov-2003
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor to use as a JepComponent.Constructor to use in a standalone context. -
Method Summary
Modifier and TypeMethodDescriptionCreates a deepCopy of a Nodevisit(ASTConstant node, Object data) Visit a constant node.visit(ASTFunNode node, Object data) Visit a function node.Visit an operator node.visit(ASTVarNode node, Object data) Visit a variable node.Methods inherited from class com.singularsys.jep.walkers.DoNothingVisitor
childrenHaveChanged, copyChildrenIfNeeded, getFunctionTable, getLightWeightInstance, getNodeFactory, getOperatorTable, getVariableTable, init, visit, visitChildren, visitNode
-
Constructor Details
-
DeepCopyVisitor
Constructor to use in a standalone context.- Parameters:
j- Jep instance to use.
-
DeepCopyVisitor
public DeepCopyVisitor()Constructor to use as a JepComponent.DoNothingVisitor.init(Jep)must be called later.
-
-
Method Details
-
deepCopy
Creates a deepCopy of a Node- Throws:
ParseException
-
visit
Description copied from class:DoNothingVisitorVisit a constant node. Can be overridden by subclasses.- Specified by:
visitin interfaceParserVisitor- Overrides:
visitin classDoNothingVisitor- Throws:
JepException
-
visit
Description copied from class:DoNothingVisitorVisit a function node. Can be overridden by subclasses.- Specified by:
visitin interfaceParserVisitor- Overrides:
visitin classDoNothingVisitor- Throws:
JepException
-
visit
Description copied from class:DoNothingVisitorVisit an operator node. Can be overridden by subclasses.- Specified by:
visitin interfaceParserVisitor- Overrides:
visitin classDoNothingVisitor- Throws:
JepException
-
visit
Description copied from class:DoNothingVisitorVisit a variable node. Can be overridden by subclasses.- Specified by:
visitin interfaceParserVisitor- Overrides:
visitin classDoNothingVisitor- Throws:
JepException
-