public class MAssign extends Assign implements MatrixSpecialEvaluationI, SpecialPreProcessorI
curNumberOfParameters, numberOfParameters| Constructor and Description |
|---|
MAssign() |
| Modifier and Type | Method and Description |
|---|---|
MatrixValueI |
evaluate(MatrixNodeI node,
MatrixEvaluator visitor,
MatrixJep j)
A special methods for evaluating an assignment.
|
MatrixNodeI |
preprocess(ASTFunNode node,
MatrixPreprocessor visitor,
MatrixJep mjep,
MatrixNodeFactory nf)
Subverts the preprocessing stage.
|
void |
run(Stack s)
The run method should not be called.
|
checkNumberOfParameters, checkStack, getNumberOfParameters, setCurNumberOfParameterspublic void run(Stack s) throws ParseException
evaluate(org.lsmp.djep.matrixJep.nodeTypes.MatrixNodeI, org.lsmp.djep.matrixJep.MatrixEvaluator, org.lsmp.djep.matrixJep.MatrixJep) instead.run in interface PostfixMathCommandIrun in class PostfixMathCommandParseExceptionpublic MatrixValueI evaluate(MatrixNodeI node, MatrixEvaluator visitor, MatrixJep j) throws ParseException
evaluate in interface MatrixSpecialEvaluationInode - The top node.visitor - The parser visitorj - The current MatrixJep instance.ParseExceptionpublic MatrixNodeI preprocess(ASTFunNode node, MatrixPreprocessor visitor, MatrixJep mjep, MatrixNodeFactory nf) throws ParseException
SpecialPreProcessorIMatrixNodeI children[] = visitor.visitChildrenAsArray(node,null);The final step is to construct a node of the correct type. The MatrixNodeFactory argument has a number of methods to do this. For example
return (ASTMFunNode) nf.buildOperatorNode(node.getOperator(),children,rhsDim);Note how the dimension is specified.
preprocess in interface SpecialPreProcessorInode - the top node of the tree representing the function and its arguments.visitor - A reference to the preprocessing visitor.mjep - A reference of the MatrixJep instance.nf - A reference to the node factory object.ParseException - if some error occurs.Copyright © 2018. All rights reserved.