Hi Eike,
And that is where I get stuck.
I can imagine..
I wasn't surprised either ;-)
The first argument is on the stack, i.e. GetStackType() returns a type
and ScInterpreter::sp is 1.
When I jump to the next argument to be evaluated, with aCode.Jump(
pJump[ nIdx ], pJump[ pJump[ 0 ] ] ), ScInterpreter::sp is 0 afterwards.
Apart from that, aCode.Jump( pJump[ nIdx ], pJump[ pJump[ 0 ] ] ) looks
wrong to me, pJump[0] returns an offset into the RPN array, which can't be
used as an index for another pJump.
I changed the code in my mail, the actual line reads
aCode.Jump( pJump[ nIdx ], pJump[ nJumpCount ] );
and nJumpCount has the value of pJump[ 0 ].
See also the description of formula::FormulaTokenIterator::Jump() in
include/formula/tokenarray.hxx
For understanding it helps to step into such Jump() and see what it does
to the counters and on the subsequent iteration of the while loop in
ScInterpreter::Interpret() step into its condition where aCode.Next() is
executed and analyze what happens to the token array and counters.
Will do.
How do I get the argument I jumped to (that part works) on the stack to
be evaluated?
I'm not sure at the moment.
[...]
Basically both approaches would work, the latter might be even "easier"
(I know it's not easy at all) to code with what is already implemented.
I will start digging and experimenting, which may take some time.
Winfried
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.