Hello again, Eike, On Wed, 23 Feb 2005 16:16:09 +0100, Eike Rathke <[EMAIL PROTECTED]> wrote: > Hi Kohei, > > On Tue, Feb 22, 2005 at 23:00:11 -0500, Kohei Yoshida wrote: > > > I have only read a fraction of the relevant code, but it seems to me > > that when a formula cell object references another cell that > > references another cell that references (...) another cell, instances > > of ScToken which are daisy-chained together keep track of their > > reference relationship, and another object of ScTokenArray manages > > them. > > > > Is this understanding correct, or am I totally off? > > Not sure if I understood correctly what you meant by "daisy-chained" and > "another object of ScTokenArray manages them". I'll try to put it in > a few words how things work: > > - Each ScFormulaCell has a pointer to one ScTokenArray. > - A ScTokenArray contains all ScToken types that represent the formula > and are necessary to interpret the formula, amongst them are > ScSingleRefToken and ScDoubleRefToken that are cell references. > - The cell references are relative offsets and/or absolute positions > that point into the document by sheet/column/row numbers addresses. > - Using the address a cell is retrieved at that position, which may be > another ScFormulaCell, which in turn is interpreted using the > ScTokenArray it is pointing to. > > Does this help, or am I off track now?
You're right on! This helps tremendously. :-) This mechanism is still a bit complicated, but I will try to understand it slowly but surely. Ultimately, I'd like to see how a given string of formula, say, "=B5*2+(C2/D10)" gets transformed into an array of ScToken's for later processing of that formula. My goal is to create a similar functionality in my UNO component so that I can transform an arbitrary formula string into a standard form of linear or polynomial equation. This way I can apply all kinds of mathematical algorithms to that equation to do some fun stuff. ;-) Or, could this functionality (i.e. tokenization of a formula string) be somehow exported via the API? Is that technically achievable? What would be the difficulty level? Kohei --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
