public class ExpressionConsolidator extends DeepCopyVisitor
Constructor and Description |
---|
ExpressionConsolidator(Jep j)
Default constructor, Add and Multiply are consolidated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Operator op)
Adds an addition operator to be consolidated.
|
Node |
consolidate(Node node) |
protected Node[] |
consolidateChildren(Operator op,
Node[] children)
Creates an array of Nodes, if the child is an ASTOpNode
whose operator is op, then the children of that child will be added
otherwise the child is added.
|
java.util.List<Operator> |
getOps()
The list of operators which are consolidated
|
java.lang.Object |
visit(ASTOpNode node,
java.lang.Object data)
Visit a operator node.
|
deepCopy, visit, visit, visit
childrenHaveChanged, copyChildrenIfNeeded, getFunctionTable, getLightWeightInstance, getNodeFactory, getOperatorTable, getVariableTable, init, visit, visitChildren, visitNode
protected java.util.List<Operator> ops
public ExpressionConsolidator(Jep j)
j
- public Node consolidate(Node node) throws JepException
JepException
protected Node[] consolidateChildren(Operator op, Node[] children)
op
- children
- public java.lang.Object visit(ASTOpNode node, java.lang.Object data) throws JepException
DoNothingVisitor
visit
in interface ParserVisitor
visit
in class DeepCopyVisitor
JepException
public boolean add(Operator op)
op
- operator to usepublic java.util.List<Operator> getOps()
Copyright © 2018 Singular Systems http://www.singularsys.com/jep