public class Define extends PostfixMathCommand implements CommandVisitorI
XJep > Define("half",1,"x/2") XJep > half(5)
Currently the Define function is handled in the preprocessing step
Node n = xj.parse("Define(\"sumToX\",1,\"x*(x+1)/2\")"); Node preproc = xj.preprocess(n);and preproc will be null if a Define statement is encountered. This is probably a bug. TODO improve syntax. So can have Define("half(x)",x/2) TODO work out how to simplify and evaluate Define statements which don't really have a value. TODO fix parser so can do half(x) = x/2
Modifier and Type | Method and Description |
---|---|
Node |
process(Node node,
Node[] children,
XJep xjep)
Performs the specified action on an expression tree.
|
checkNumberOfParameters, getNumberOfParameters, run, setCurNumberOfParameters
public Define(XJep xj)
public Node process(Node node, Node[] children, XJep xjep) throws ParseException
CommandVisitorI
process
in interface CommandVisitorI
node
- top node of the treechildren
- the children of the node after they have been preprocessed.xjep
- a reference to the current XJep interface.ParseException
Jas4pp 1.5 © Java Analysis Studio for Particle Physics