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.xjep
Class CommandVisitor

    java.lang.Object
      org.lsmp.djep.xjep.DoNothingVisitor
          org.lsmp.djep.xjep.CommandVisitor

All Implemented Interfaces:
  ParserVisitor

    public class CommandVisitor

extends DoNothingVisitor

Executes commands like diff and eval embedded in expression trees. For example you could do

    eval(diff(x^3,x),x,2)

to differentiate x^3 and then substitute x=2 to get the value 12. To use do

     JEP j = ...; Node in = ...;
     TreeUtils tu = new TreeUtils(j);
     CommandVisitor cv = new CommandVisitor(tu);
     Node out = cv.process(in);

Commands to be executed must implement `CommandVisitorI` and `PostfixMathCommandI`. See `Eval` for an example of this. See `ParserVisitor` for details on the VisitorPattern.

Author:
  R Morris Created on 19-Jun-2003

Constructor Summary
`CommandVisitor()` private default constructor to prevent init without a tree utils

Method Summary
`Node` | `process(Node node, XJep xj)` Descends the tree processing all diff, eval and simplify options
`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

### CommandVisitor

    public CommandVisitor()

  private default constructor to prevent init without a tree utils

Method Detail

### process

    public Node process(Node node,
                        XJep xj)
                 throws ParseException

  Descends the tree processing all diff, eval and simplify options

  Throws:
    `ParseException`

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