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

(slight correction) Re: Are we losing out because of grammars?

  • From: Rick Jelliffe <ricko@a...>
  • To: xml-dev@l...
  • Date: Fri, 02 Feb 2001 03:54:25 +0800

corrections counting test
(Sorry, the rules I sent had a lot of errors, so I am sending them again. I
apologise for not being a robot.)

Off the top of my head,  grammars like
   ( a, (a |b)*, c, (a, b)+, b )+
are pretty hard to model completely.  One can easily infer the rules

  - there can only be a, b, c
        test="count(*) = count(a)+count(b)+count(c)"
     inferred by counting elements
  - there must be at least 1 c, at least 2 b, and at least 2 a
       test="c"  test="count(b) > 1" test="count(a) >1"
      inferred by counting required elements
  - it must start with a and end with a b
       test="*[1][self::a]"  test="b[not(next-sibling::*)]"
     inferred by looking at the start start and tracing from the end state
  - c must be followed by a
       test="count(c[next-sibling::a]) = count(c)"
    inferred by making lists of allowed following elements (is this
Warshall's closure?)
  - there must be a sequence of  cab and abb
       test="c[next-sibling::a[next-sibling::b]]"
       test="c[next-sibling::b[next-sibling::b]]"
    inferred by tracing required sequences.

Cheers
Rick Jelliffe



PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.