RE: Minor grammar suggestion

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 UTC