public class RewriteVisitor extends DoNothingVisitor
JEP j = ...; Node in = ...; SimplificationVisitor sv = new SimplificationVisitor(tu); Node out = sv.simplify(in);
Its intended to completely rewrite this class to that simplification rules can be specified by strings in a way similar to DiffRulesI. It also would be nice to change the rules depending on the type of arguments, for example matrix multiplication is not commutative. But some of the in built rules exploit commutativity.
Constructor and Description |
---|
RewriteVisitor() |
Modifier and Type | Method and Description |
---|---|
Node |
rewrite(Node node,
XJep xjep,
RewriteRuleI[] inrules,
boolean simplify)
must be implemented for subclasses.
|
Object |
visit(ASTFunNode node,
Object data) |
visit, visit, visit, visit
public Node rewrite(Node node, XJep xjep, RewriteRuleI[] inrules, boolean simplify) throws ParseException, IllegalArgumentException
public Object visit(ASTFunNode node, Object data) throws ParseException
visit
in interface ParserVisitor
visit
in class DoNothingVisitor
ParseException
Jas4pp 1.5 © Java Analysis Studio for Particle Physics