org.lsmp.djep.rewrite
Class RewriteVisitor
java.lang.Object
org.lsmp.djep.xjep.DoNothingVisitor
org.lsmp.djep.rewrite.RewriteVisitor
- All Implemented Interfaces:
- ParserVisitor
public class RewriteVisitor
- extends DoNothingVisitor
Simplifies an expression.
To use
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.
- Author:
- Rich Morris
Created on 20-Jun-2003
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RewriteVisitor
public RewriteVisitor()
rewrite
public Node rewrite(Node node,
XJep xjep,
RewriteRuleI[] inrules,
boolean simplify)
throws ParseException,
java.lang.IllegalArgumentException
- must be implemented for subclasses.
- Throws:
ParseException
java.lang.IllegalArgumentException
visit
public java.lang.Object visit(ASTFunNode node,
java.lang.Object data)
throws ParseException
- Specified by:
visit
in interface ParserVisitor
- Overrides:
visit
in class DoNothingVisitor
- Throws:
ParseException
http://www.singularsys.com/jep Copyright © 2007 Singular Systems