OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

office-formula message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Syntax - recent changes, please look over..

The syntax has stayed very stable; I think the primary
reason is that the current syntax handles the "normal" cases
quite nicely.  However, we need to handle ALL cases, even the
truly weird ones.  Please take a look and kibitz/improve what's there!

I've noted repeatedly that I want this DONE by May 2. So if there are
any concerns we need some time to work on them.  If you have
changes you want to make, please make/propose them by Wednesday (April 26).

I've made a few changes to the proposed syntax on the Wiki;
please take a look, and see if you agree with them.  As always,
the current draft is at:

Here are the changes, in a nutshell:
* Restored the ability to use '$' in front of the column or row,
   and added it to the sheetname too.  Somehow that got removed among
   the other changes, it was there before.  I remember that there were
   some issues with the latter; perhaps other changes have resolved that
   (I plan to implement using flex to check that).
* Bare sheetnames can't include # or $ -- you have to enclose them with '..'.
   At the very least, it's a problem if they can START with those characters,
   because then you can't tell if you have an error or non-relative sheet,
   or a funny sheetname.  I'm thinking that perhaps we should be more
   restrictive about bare sheetnames anyway, maybe just limit them to
   Identifier characters.  In fact, that may be important for lexing (I'll see
   about that soon). Thoughts, anyone?
* ":" (when outside [..]) is now a top-precedence operator,
   to handle stuff like [.A1:B3]:[.X6].  This is required when the
   cell ranges are NOT constants but instead are named expressions
   or function results (e.g., MYFUNC1():MYFUNC2()).
* Added support for Error (in expressions and in cell references).
   There's a funky interaction because '#' has TWO different meanings:
   "begin an error value" and "separate source from sheetname",
   and '#' has a critical role in the latter.  I think I've handled this
   in a way that ensures that simple lexers will still work well.
* I hooked in "AutomaticIntersection" so it could actually be used.
   It had been defined earlier by someone else, but was never used.
* I inserted an Array syntax.  Think of this more as a stub... we need one.
   Comments there, or improvements, would be ESPECIALLY appreciated.

The current syntax for AutomaticIntersection is very peculiar.
It means that this is a string:
But single quotes means it's going to be specially interpreted as
a reference to a value identifying a row or column:
  'Hamburg' !! 'Sales'
So there's a SERIOUS difference between ' and ".
Eike, can you explain this?  I'd _prefer_ having just String representation,
and then using !! as yet another operator, so it'd look like this:
  "Hamburg" !! "Sales"
Can anyone help me understand why that is a bad idea?

I plan to try to convert this into a flex/bison implementation.
I think it's important that the syntax be easy to implement without
a lot of complex state manipulations using typical tools.
Where that's not possible, it suggests a potential problem.
It also lets us test the syntax directly.  I expect to learn lots, and
probably make some changes, based on that.  I'll post as I learn.

--- David A. Wheeler

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]