[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Again wit da AND and Repetitions

  • From: Lars Marius Garshol <larsga@i...>
  • To: XML Dev <xml-dev@i...>
  • Date: 15 May 1999 23:56:55 +0200

Re: Again wit da AND and Repetitions

* John Cowan
| IIRC the canonical way of doing (A & B & C) is to transform it into
| (A | B | C)* and then do a post-check that each of A, B, C appears
| exactly once.  ...

* Robert C. Lyons
| It seems that this approach would require the parser to perform look ahead 
| for the following content model:
| ( (A & B & C), C, C, C )

Nrgh. And I just posted a full page to say the same. Oh well.
| This content model would be transformed into: ( (A | B | C)*, C, C, C )
| The transformed content model is non-deterministic. [...]
| The original content model is deterministic; [...]

Hmmm. As far as I can see this hints that if some other transformation
were used this problem might be avoided. For example,
( ((A|B|C) , (A|B|C) , (A|B|C)), C, C, C ) does not have this problem.

However, it does have the disagreeable property that it grows the
content model by n squared, which will probably get intolerable
somewhere around 200-300. Also, it gets you into trouble anyway if the
original content model is ambiguous:

((A | B | C)*, (A & B & C), C, C, C)

If you read one A you have no idea whether you're in the & group or
not, regardless of how you transform it. 

Handling this latest content model seems like a real challenge to
me. I think any viable approach will need to know when it reaches

((A | B | C)*, (A & B & C), C, C, C)
               ^         ^
               1         2

the states corresponding to 1 and 2 above, which as far as I can see
effectively means resolving any ambiguities, which again seems to mean
that lookaheads are required. (Or, alternatively, that you need to
outlaw ambiguity in the original content model.) Please, someone,
prove me wrong.

--Lars M.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.