Mind just a little: Re: Never mind: Re: yacker SPARQL updated to parse comments

* Eric Prud'hommeaux <eric@w3.org> [2007-02-18 07:45+0100]
> * Eric Prud'hommeaux <eric@w3.org> [2007-02-18 07:24+0100]
> > This change has dropped out of the yacker SPARQL grammar. Any reason I
> > shouldn't put it back?
> 
> Hmm, they're currently in the lexical production that produces no
> token
>   @pass: [ \t\r\n]+ | '#' [^\r\n]*
> which is arguably better as they don't belong in the parse tree.
> 
> The comment test below parses perfectly in the current grammar.

That was testing the wrong version. *Now* it parses perfectly.

The issue comes from how to model

  [82]   NIL  	  ::=    	'(' WS* ')'
  [83]   WS 	  ::=   	#x20 | #x9 | #xD | #xA
  [84]   ANON 	  ::=   	'[' WS* ']'
and
  Comments in SPARQL queries take the form of '#', outside an IRI or
  string, and continue to the end of line (marked by characters 0x0D
  or 0x0A) or end of file if there is no end of line after the comment
  marker. Comments are treated as white space.

I took that to mean that WS *really* included "'#' [^\r\n]*" so I
ammended WS:

  [86]   WS 	  ::=   	#x20 | #x9 | #xD | #xA | '#' [^\r\n]*

Trying to think up a better way to express this in rq25...
Perhaps an extra production?

> > * Eric Prud'hommeaux <eric@w3.org> [2007-01-20 08:59-0500]
> > > I updated the yacker grammar to accept comments.
> > > See <http://w3.org/brief/MjA=> for a validation of
> > > 
> > > [[
> > > # starting comment
> > > #no-spacecomment
> > > SELECT # mid comment
> > >        *
> > >  WHERE { ?s ?p [ # bnode comment
> > >                  ] }
> > > # end comment
> > > ]]
> > > 
> > > 
> > > Changes:
> > > + [83a]  	COMMENT   ::=           '#' [^\r\n]*
> > > + [83b]  	IGNORED   ::=           WS+ | COMMENT
> > > - [84]   	ANON 	  ::=   	'[' WS* ']'
> > > + [84]   	ANON 	  ::=   	'[' IGNORED* ']'
> > > + @pass: 	IGNORED
> > > -- 
> > > -eric
> > > 
> > > office: +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
> > > cell:   +1.857.222.5741
> > > 
> > > (eric@w3.org)
> > > Feel free to forward this message to any list for any purpose other than
> > > email address distribution.
> > 
> > 
> > 
> > -- 
> > -eric
> > 
> > office: +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
> > cell:   +1.857.222.5741
> > 
> > (eric@w3.org)
> > Feel free to forward this message to any list for any purpose other than
> > email address distribution.
> 
> 
> 
> -- 
> -eric
> 
> office: +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
> cell:   +1.857.222.5741
> 
> (eric@w3.org)
> Feel free to forward this message to any list for any purpose other than
> email address distribution.



-- 
-eric

office: +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
cell:   +1.857.222.5741

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Sunday, 18 February 2007 07:51:05 UTC