Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Constructor Summary
`RewriteVisitor()`

Method Summary
`Node` | `rewrite(Node node, XJep xjep, RewriteRuleI[] inrules, boolean simplify)` must be implemented for subclasses.
`java.lang.Object` | `visit(ASTFunNode node, java.lang.Object data)`

Methods inherited from class org.lsmp.djep.xjep.DoNothingVisitor
`acceptChildrenAsArray, visit, visit, visit, visit`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RewriteVisitor

    public RewriteVisitor()

Method Detail

### 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`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

http://www.singularsys.com/jep Copyright © 2007 Singular Systems