ORA-XQ-148-E: suggestion: make all whitespace explicit in the EBNF

SECTION A.2.1: white space rules

Whereas:

a) the whitespace rules for XQuery are so complex
(What is "ignorable whitespace"? How will the user learn
that he can put a comment between a $ and a QName, but not
between "for" and "$"?  What is the difference between
"whitespace: explicit" and "whitespace: significant"? 
Do the XQuery whitespace rules govern EBNF's that are quoted 
from other documents that don't have XQuery conventions?)

b) there are different whitespace rules for so many 
different cases (in direct element constructors not nested within an
enclosed expression; in other kinds of direct constructors;
in comments, pragmas, and must-understand extensions;
in keyword phrases that are necessary for disambiguation;
in all other contexts -- I think I got them all, but I am not
sure).

My suggestion is that you give up on implicit whitespace rules
in the EBNF, and go with totally explicit whitespace in every
EBNF.  You already have S to represent spaces, tabs and newlines.
To that you can add other symbols.  For example IWS might stand
for what you call "ignorable whitespace".
I think IWS ::= S | Pragma | MUExtension | ExprComment.
Now given S and IWS, you can clearly write 
ForClause ::= "for" S? "$" IWS? Varname IWS? TypeDeclaration? ...
etc., which clearly shows that a comment is not allowed between
"for" and "$".  

You can also clear up the nesting possibilities of comments,
pragmas and must-understand extensions.  E.g., is it
Pragma ::= "(::" S? "pragma" S? QName S? ...
or is it
Pragma ::= "(::" IWS? "pragma" IWS? QName IWS? ...

- Steve B.

Received on Tuesday, 17 February 2004 11:35:24 UTC