Class CommandVisitor

  • All Implemented Interfaces:
    JepComponent, ParserVisitor, java.io.Serializable

    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 ParserVisitor for details on the VisitorPattern.
    Author:
    R Morris Created on 19-Jun-2003
    See Also:
    Serialized Form