

Stack - which contains the result of evaluating the formula. String was correctly parsed, there should be just one Eval on the This continues untilĮventually there are no more RPN tokens, at which point, if the formula Stack and the next RPN token is evaluated.

The ValueEval resulting from evaluate() is pushed on the To be an instance of one of the implementations of OperationEval.evaluate(Eval) returns an Eval which is supposed Operands are always ValueEvals, and operations are always OperationEvals. Thus an operation in the formula is evaluated.Īn Eval is of subinterface ValueEval or OperationEval. The OperationEval instance's evaluate method which returns an Eval That many Evals are popped of the stack and passed in an array to

And depending on how many operands it takes, OperationPtg, an OperationEval instance is created for the specific Is pushed on the stack, unless the Ptg is an OperationPtg. Specific type of Eval wrapper is constructed to wrap the RPN token and Henceforth since that is what the FormulaParser calls the classes), a Viewer.) Depending on the type of RPN token (also called Ptgs Is best understood if you view it in a class diagram (If you don't know what RPN tokens are, now is a good time to Into Reverse Polish Notation (RPN) tokens using the FormulaParser class. Briefly, a formula string (along with the sheet and workbook thatįorm the context in which the formula is evaluated) is first parsed
