[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [office-formula] Syntax loose ends: inline error names,
Andreas J Guelzow says:
> (For obvious reasons) I like the Gnumeric version:
> Sheet1.print_area refers to the named expression in sheet scope of
> Sheet1 if there is such an expression defined otherwise it refers to the
> expression in workbook scope.
> .print_area simply replaces Sheet1 with the local sheet.
I like the idea, worry about ambiguity. What is this?:
'file:///local'.print_area
Is it an external reference to a file named local, or the sheet named "file:///local"?
SheetNames can have arbitrary chars in them, and thus
sometimes get surrounded with '...'. IRIs also get surrounded by '...'.
If we simply said "either an IRI or a SheetName" can prefix a namespace
identifier, we'd create a nasty ambiguity.
And if you allow named expressions to be used as functions and attached
to sheets - a future plausible extension that has been discussed - it gets worse.
What is sheet1.myfunc("hello") -- is that a call to the function on sheet1,
or to the function named "sheet1.myfunc" (like Error.type)?
Here's what we have now:
NamedExpression ::= Source? Identifier
Source ::= "'" IRI "'" "#"
FunctionName ::= Identifier
Identifier ::= LetterXML (LetterXML | DigitXML |
'_' | '.' | CombiningCharXML)*
SheetName ::= /* empty */ | '$' ? ( [^\. #$']+ | "'" ([^'] | "''")+ "'" ) | Error
Getting exactly the right solution is non-trivial, esp. if we
want to have syntax available for nested tables.
Syntactically, we could simply say that if an IRI begin with '#',
it's local, and followed by the SheetName in IRI format.
That would be an easy change, but is it too ugly to use?
It's also odd; if I have nested tables,
I would expect an IRI reference to start from the top (root) of the document,
yet I'd want a sheetname to start from the bottom (current location)
and work up to find a matching sheetname. Might get different answers!
Perhaps we need to introduce SheetName-specific references with another
character, so disambiguation is trivial.
Suggestions on the new BNF?
--- David A. Wheeler
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]