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

RE: Why is RelationalExpr left associative?

Subject: RE: Why is RelationalExpr left associative?
From: Mark Nahabedian <naha@xxxxxxxxxx>
Date: Sun, 29 Apr 2001 23:52:59 -0400 (Eastern Daylight Time)
left associative grammar
Gavin Thomas Nicol writes:
 > > So the question is: why are these kinds of expressions allowed? Are 
 > > there any useful situations in which one can benefit?
 > 
 > I agree that the grammar is quirky. I think the intent here is to
 > allow typical recursive definitions of expressions, which typically
 > allow something like
 > 
 >   3 > 2 > 1 
 > 
 > to appear.

The problem is that the semantics implied by the grammar are different
from the semantics that one might reasonably infer: that A > B > C is
asking if B is between A and C.  There are few programming languages
that provide this semantics, but there are some.

 > 
 > There are a number of things in XPath that are semantically
 > invalid, but grammatically correct. Almost all of these are
 > caused by some form of recursion, or inclusion of a construct
 > to allow it's use in different contexts through recursion.
 > 
 >   "foo"
 >   5
 >   "foo"[5]
 >   "foo"[5]
 >   "foo"["bar"[4]]
 >   5[4[3[2[1]]]]
 > 
 > are legal according to the grammar.
 > 
 > I've often thought of recasting the grammar... but it's 
 > probably too late now.
 > 
 > 
 > 
 >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
 > 
 > 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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
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.