Package com.singularsys.extensions.xjep
Class EquationExtractor<D>
java.lang.Object
com.singularsys.jep.walkers.GenericDoNothingVisitor<D>
com.singularsys.jep.walkers.GenericDeepCopyVisitor<D>
com.singularsys.extensions.xjep.EquationExtractor<D>
- All Implemented Interfaces:
GenericVisitor<Node,,D, ParseException> JepComponent,Serializable
- Direct Known Subclasses:
DEquationExtractor
Extract equations for symbolic variables. If
y
is a variable which has an equation it will be replaced by its equation.
Since Jep 4.1, extensions 2.2 this is a generic class
extending GenericDeepCopyVisitor.
A typical implementation would use
new EquationExtractor<Void>().
This may generate warnings about unchecked conversions,
or raw type in older code.
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.jep.walkers.GenericDoNothingVisitor
ft, nf, ot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReplace variables on the right had side of an assignment by their equationsReplace all symbolic variable by their equationsvisit(ASTVarNode node, D data) Visit a variable nodeMethods inherited from class com.singularsys.jep.walkers.GenericDeepCopyVisitor
getLightWeightInstance, visit, visit, visit, visitMethods 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
-
EquationExtractor
public EquationExtractor() -
EquationExtractor
-
-
Method Details
-
replaceVariableByExpressions
Replace all symbolic variable by their equations- Parameters:
node- root of expression- Returns:
- copy of node with variables replaced by their equations
- Throws:
JepException
-
replaceRHSVariablesByEquations
Replace variables on the right had side of an assignment by their equations- Parameters:
node- an equation of the formg:=f^2-1- Returns:
- a copy of the node
- Throws:
ParseException- on error
-
visit
Description copied from interface:GenericVisitorVisit a variable node- Specified by:
visitin interfaceGenericVisitor<Node,D, ParseException> - Overrides:
visitin classGenericDeepCopyVisitor<D>- Parameters:
node- current nodedata- context data- Returns:
- the result of visiting the node
- Throws:
ParseException
-
visit
- Throws:
ParseException
-