W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > January to March 2007

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

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Mon, 19 Feb 2007 11:06:49 +0000
Message-ID: <45D984C9.3020502@hp.com>
To: Eric Prud'hommeaux <eric@w3.org>
CC: public-rdf-dawg@w3.org

I haven't had time to make sure Yacker is up-to-date.  Last time I tried I ran 
into problems regenerating the parsers (I emailed you the details).  (Aside: 
what are the quoting rules exactly? and what is @pass exactly?  I think I may 
have got these wrong in the past.)

Comments are in NI/ANON in the version I have been using but you're right that 
comments don't belong in the syntax tree so talking about them in the grammar 
is a bit odd.

That, coupled with the fact different tools handle comments in different ways, 
means I think it clearer to keep the comments out of explicit mention.

Eric Prud'hommeaux wrote:
> * 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:

It wasn't meant that way - "as is they were whitespace" (i.e. split tokens if 
necessary).

> 
>   [86]   WS 	  ::=   	#x20 | #x9 | #xD | #xA | '#' [^\r\n]*
> 
> Trying to think up a better way to express this in rq25...
> Perhaps an extra production?

I prefer the previous alternative - not in the grammar.

I will and find time to make sure everything is up-to-date.

	Andy
Received on Monday, 19 February 2007 11:07:00 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:36 GMT