public class DoNothingVisitor extends java.lang.Object implements ParserVisitor, JepComponent
This class will always leave the original expression intact, but may reuse unchanged parts of the expression.
Modifier and Type | Field and Description |
---|---|
protected FunctionTable |
ft
Convenience reference to the FunctionTable
|
protected Jep |
jep
Jep instance
|
protected NodeFactory |
nf
Convenience reference to the NodeFactory
|
protected OperatorTableI |
ot
Convenience reference to the OperatorTableI
|
protected VariableTable |
vt
Convenience reference to the VariableTable
|
Constructor and Description |
---|
DoNothingVisitor()
Constructor to use with JepComponent mechanism, init method must be called.
|
DoNothingVisitor(Jep j) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
childrenHaveChanged(Node node,
Node[] children)
Tests if the children of a node have changed
|
protected Node |
copyChildrenIfNeeded(Node node,
Node[] children)
Sets the children of a node if they have changed for it current children.
|
FunctionTable |
getFunctionTable() |
JepComponent |
getLightWeightInstance()
Gets a light-weight instance suitable for using in multiple threads.
|
NodeFactory |
getNodeFactory() |
OperatorTableI |
getOperatorTable() |
VariableTable |
getVariableTable() |
void |
init(Jep j)
Initialize the component.
|
java.lang.Object |
visit(ASTConstant node,
java.lang.Object data)
Visit a constant node.
|
java.lang.Object |
visit(ASTFunNode node,
java.lang.Object data)
Visit a function node.
|
java.lang.Object |
visit(ASTOpNode node,
java.lang.Object data)
Visit a operator node.
|
java.lang.Object |
visit(ASTVarNode node,
java.lang.Object data)
Visit a variable node.
|
Node |
visit(Node node) |
protected Node[] |
visitChildren(Node node,
java.lang.Object data)
Gets the result of visiting children of a array of nodes.
|
Node |
visitNode(Node node,
java.lang.Object data)
Used to recursively visit the children of a node.
|
protected Jep jep
protected NodeFactory nf
protected VariableTable vt
protected FunctionTable ft
protected OperatorTableI ot
public DoNothingVisitor()
public DoNothingVisitor(Jep j)
public JepComponent getLightWeightInstance()
JepComponent
getLightWeightInstance
in interface JepComponent
public void init(Jep j)
JepComponent
init
in interface JepComponent
j
- the current Jep instancepublic Node visit(Node node) throws JepException
JepException
public Node visitNode(Node node, java.lang.Object data) throws JepException
node
- Node to visitdata
- user specified dataJepException
protected Node[] visitChildren(Node node, java.lang.Object data) throws JepException
node
- current node being visiteddata
- user specified dataJepException
public java.lang.Object visit(ASTConstant node, java.lang.Object data) throws JepException
visit
in interface ParserVisitor
JepException
public java.lang.Object visit(ASTVarNode node, java.lang.Object data) throws JepException
visit
in interface ParserVisitor
JepException
public java.lang.Object visit(ASTFunNode node, java.lang.Object data) throws JepException
visit
in interface ParserVisitor
JepException
public java.lang.Object visit(ASTOpNode node, java.lang.Object data) throws JepException
visit
in interface ParserVisitor
JepException
protected Node copyChildrenIfNeeded(Node node, Node[] children) throws JepException
JepException
protected boolean childrenHaveChanged(Node node, Node[] children)
node
- the original nodechildren
- the new set of children.public NodeFactory getNodeFactory()
public OperatorTableI getOperatorTable()
public VariableTable getVariableTable()
public FunctionTable getFunctionTable()
Copyright © 2018 Singular Systems http://www.singularsys.com/jep