org.lsmp.djep.djep
Class DPrintVisitor
java.lang.Object
org.lsmp.djep.xjep.DoNothingVisitor
org.lsmp.djep.xjep.ErrorCatchingVisitor
org.lsmp.djep.xjep.PrintVisitor
org.lsmp.djep.djep.DPrintVisitor
- All Implemented Interfaces:
- ParserVisitor
public class DPrintVisitor
- extends PrintVisitor
An extension of PrintVisitor which will print the equations of a variable if required.
The behaviours of this class is determined by two modes
PRINT_PARTIAL_EQNS and PRINT_VARIABLE_EQNS.
When a variable or partial derivative is encountered then
its equation may be printed.
By default equations for PartialDerivatives are printed
but equations for normal derivatives are not.
TODO might want to print eqn for y=sin(x) but not x=3
- Author:
- Rich Morris
Created on 26-Feb-2004
| Methods inherited from class org.lsmp.djep.xjep.PrintVisitor |
addSpecialRule, append, formatValue, formatValue, getMaxLen, getMode, getMode, print, print, println, println, setMaxLen, setMode, setNumberFormat, toString, visit, visit |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PRINT_PARTIAL_EQNS
public static final int PRINT_PARTIAL_EQNS
- See Also:
- Constant Field Values
PRINT_VARIABLE_EQNS
public static final int PRINT_VARIABLE_EQNS
- See Also:
- Constant Field Values
DPrintVisitor
public DPrintVisitor()
visit
public Object visit(ASTVarNode node,
Object data)
throws ParseException
- Prints the variable or its equation.
Depends on the state of the flags and whether the variable has an equation.
- Specified by:
visit in interface ParserVisitor- Overrides:
visit in class PrintVisitor
- Throws:
ParseException
Copyright © 2014. All rights reserved.