Package com.singularsys.jep.walkers
Class GenericDeepCopyVisitor<D>
java.lang.Object
com.singularsys.jep.walkers.GenericDoNothingVisitor<D>
com.singularsys.jep.walkers.GenericDeepCopyVisitor<D>
- Type Parameters:
D- the type of the data passed to the visit methods
- All Implemented Interfaces:
GenericVisitor<Node,,D, ParseException> JepComponent,Serializable
- Direct Known Subclasses:
ExpressionConsolidator,ImportationVisitor,LightWeightImportationVisitor
A Visitor which returns an exact copy of the tree,
creating new nodes for each type.
This class should be extended by visitors which
modify trees and creates a new tree.
- Since:
- Jep 4.1
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.jep.walkers.GenericDoNothingVisitor
ft, nf, ot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a light-weight instance suitable for using in multiple threads.visit(ASTConstant node, D data) Visit a constant nodevisit(ASTFunNode node, D data) Visit a function nodeVisit an operator nodevisit(ASTVarNode node, D data) Visit a variable nodeVisit a node calling the appropriate overloaded method.Methods inherited from class com.singularsys.jep.walkers.GenericDoNothingVisitor
childrenHaveChanged, copyChildrenIfNeeded, copyChildrenIfNeeded, init, makeExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.singularsys.jep.GenericVisitor
makeException, visitChildren
-
Constructor Details
-
GenericDeepCopyVisitor
public GenericDeepCopyVisitor()Constructor to use as a JepComponent.GenericDoNothingVisitor.init(Jep)must be called later.
-
-
Method Details
-
visit
Description copied from interface:GenericVisitorVisit a node calling the appropriate overloaded method.- Parameters:
node- current nodedata- context data passed to each child- Returns:
- result of visiting the node
- Throws:
ParseException
-
visit
Description copied from interface:GenericVisitorVisit a constant node- Specified by:
visitin interfaceGenericVisitor<Node,D, ParseException> - Overrides:
visitin classGenericDoNothingVisitor<D>- Parameters:
node- current nodedata- context data- Returns:
- the result of visiting the node
- Throws:
ParseException
-
visit
Description copied from interface:GenericVisitorVisit a function node- Specified by:
visitin interfaceGenericVisitor<Node,D, ParseException> - Overrides:
visitin classGenericDoNothingVisitor<D>- Parameters:
node- current nodedata- context data- Returns:
- the result of visiting the node
- Throws:
ParseException
-
visit
Description copied from interface:GenericVisitorVisit an operator node- Specified by:
visitin interfaceGenericVisitor<Node,D, ParseException> - Overrides:
visitin classGenericDoNothingVisitor<D>- Parameters:
node- current nodedata- context data- Returns:
- the result of visiting the node
- Throws:
ParseException
-
visit
Description copied from interface:GenericVisitorVisit a variable node- Specified by:
visitin interfaceGenericVisitor<Node,D, ParseException> - Overrides:
visitin classGenericDoNothingVisitor<D>- Parameters:
node- current nodedata- context data- Returns:
- the result of visiting the node
- Throws:
ParseException
-
getLightWeightInstance
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Overrides:
getLightWeightInstancein classGenericDoNothingVisitor<D>- Returns:
- either a new instance, null or 'this'.
-