W3C home > Mailing lists > Public > xml-editor@w3.org > April to June 1998

XML 1.0 - query - ambiguous syntax in choice/seq ?

From: Kent M Pitman <kmp@harlequin.com>
Date: Sun, 3 May 98 19:42:07 EDT
Message-Id: <9805032342.AA01440@excel.harlequin.com>
To: xml-editor@w3.org
Cc: kmp@harlequin.com
Regarding syntax rules [48]-[50], if I'm parsing for a cp and see the text:

 (Foo)*

is the "(Foo)" a choice or a seq?  Unless there is a clarification 
somewhere, it seems to me to match both.  And I'm uncomfortable 
picking one or the other arbitrarily.

Perhaps you should define [a]:

 choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'
    seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'

OR [b}:

 choice ::= '(' S? cp ( S? '|' S? cp )* S? ')'
    seq ::= '(' S? cp ( S? ',' S? cp )+ S? ')'

In fact, I believe the draft spec [a], presumably to avoid just this
ambiguity.  Why was a change made to introduce an ambiguity?

- - - - -

By the way, I mentioned this during draft stages but it was not fixed:
I really think ('?' | '*' | '+') deserves a syntax rule
of its own for modularity since it occurs in at least two rules 
[47] and [48] and since it is a proper conceptual entity of its own.
Received on Sunday, 3 May 1998 19:38:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:29 GMT