W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2003

RE: Minor grammar suggestion

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Tue, 21 Jan 2003 10:18:55 +0100
Message-ID: <DFF2AC9E3583D511A21F0008C7E621060453DF90@daemsg02.software-ag.de>
To: xquery@attbi.com, public-qt-comments@w3.org

I think you are right. In fact, I hadn't spotted that NCName:* allows
whitespace - it doesn't in XPath 1.0. In my own parser I implement ":*" as a
single token, which means I apparently allow whitespace before the ":" but
not after it - an unhappy compromise!

Michael Kay

> -----Original Message-----
> From: XQuery [mailto:xquery@attbi.com] 
> Sent: 20 January 2003 21:44
> To: public-qt-comments@w3.org
> Subject: Minor grammar suggestion
> Importance: Low
> 
> 
> 
> If you disallow whitespace from appearing in the wildcard 
> pattern NCName:*, then the lexer can be implemented with 
> effectively one character of lookahead and the parser with 
> two tokens of lookahead.
> 
> Otherwise, the lexer needs two lookaheads (or an equivalent) 
> to distinguish between the three cases NCName:NCName (no WS 
> allowed), NCName:* (WS allowed) and NCName::* (WS allowed).
> 
> (The only other patterns requiring lookahead in the parser 
> are the terminator sequences -->, --}, and ]]>, but all three 
> of these consume all characters until the terminator or EOF 
> is found, so their lookahead is
> context-sensitive.)
> 
> 
> Cheers,
> 
> Michael Brundage
> xquery@attbi.com
> 
Received on Tuesday, 21 January 2003 04:19:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:23 GMT