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`

public class DeepCopyVisitor extends DoNothingVisitor
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:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class com.singularsys.jep.walkers.DoNothingVisitor

  `ft, jep, nf, ot, vt`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DeepCopyVisitor()`
  Constructor to use as a JepComponent.
  `DeepCopyVisitor(Jep j)`
  Constructor to use in a standalone context.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Node`
  `deepCopy(Node node)`
  Creates a deepCopy of a Node
  `Object`
  `visit(ASTConstant node, Object data)`
  Visit a constant node.
  `Object`
  `visit(ASTFunNode node, Object data)`
  Visit a function node.
  `Object`
  `visit(ASTOpNode node, Object data)`
  Visit an operator node.
  `Object`
  `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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DeepCopyVisitor

    public DeepCopyVisitor(Jep j)
    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

    public Node deepCopy(Node node) throws ParseException
    Creates a deepCopy of a Node
    Throws:
      `ParseException`

  - ### visit

    public Object visit(ASTConstant node, Object data) throws JepException
    Description copied from class: `DoNothingVisitor`
    Visit a constant node. Can be overridden by subclasses.
    Specified by:
      `visit` in interface `ParserVisitor`
    Overrides:
      `visit` in class `DoNothingVisitor`
    Throws:
      `JepException`

  - ### visit

    public Object visit(ASTFunNode node, Object data) throws JepException
    Description copied from class: `DoNothingVisitor`
    Visit a function node. Can be overridden by subclasses.
    Specified by:
      `visit` in interface `ParserVisitor`
    Overrides:
      `visit` in class `DoNothingVisitor`
    Throws:
      `JepException`

  - ### visit

    public Object visit(ASTOpNode node, Object data) throws JepException
    Description copied from class: `DoNothingVisitor`
    Visit an operator node. Can be overridden by subclasses.
    Specified by:
      `visit` in interface `ParserVisitor`
    Overrides:
      `visit` in class `DoNothingVisitor`
    Throws:
      `JepException`

  - ### visit

    public Object visit(ASTVarNode node, Object data) throws JepException
    Description copied from class: `DoNothingVisitor`
    Visit a variable node. Can be overridden by subclasses.
    Specified by:
      `visit` in interface `ParserVisitor`
    Overrides:
      `visit` in class `DoNothingVisitor`
    Throws:
      `JepException`