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

FW: Suspicious notation in SPARQL lexical rule for STRING_LITERAL_LONG1 [OK?]

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Thu, 5 Jan 2006 16:26:30 -0000
Message-ID: <DF5E364A470421429AE6DC96979A4F6F63C319@sdcexc04.emea.cpqcorp.net>
To: <public-rdf-dawg@w3.org>

Some more tests added to the syntax collection.

	Andy

-------- Original Message --------
> From: Seaborne, Andy <>
> Date: 05 January 2006 15:29
> 
>  > Hello,
>  >
>  > Let's try to use the SPARQL grammar rule
>  >
>  > [80]	STRING_LITERAL_LONG1 ::=
>  >       "'''" ( [^'\] | ECHAR | ("'" [^']) | ("''" [^']) )* "'''"
>  >
>  > to parse a string '''some-plain-text''\\more-plain-text'''
>  >
>  > It seemes to me that it is parsed as
>  >    -- starting "'''";
>  >    -- "some-plain-text", in a char-by-char loop,
>  >    -- "''\", matching ("''" [^']),
>  >    -- "\m", oops, this does not match ECHAR.
>  >    -- ore-plain-text''' is parsed by error recovery code.
>  >
>  > I believe that the proper formal notation is
>  >
>  > [80]	STRING_LITERAL_LONG1 ::=
>  >       "'''" ( ("'" ("'"?))? ([^'\] | ECHAR) )* "'''"
>  >
>  > Unfortunately, this is less readable.
>  >
>  >
>  >
>  > Best Regards,
>  > Ivan Mikhailov
>  > OpenLink Software.
> 
> Ivan,
> 
> Thanks for the comment - I've fixed the grammar
> 
> [80] STRING_LITERAL_LONG1 ::=
>      	"'''" ( ( "'" | "''" )? ( [^'\] | ECHAR ) )* "'''"
> 
> [81] STRING_LITERAL_LONG2 ::=
>    	'"""' ( ( '"' | '""' )? ( [^"\] | ECHAR ) )* '"""'
> 
> I have also added tests for these cases:
> 
> http://www.w3.org/2001/sw/DataAccess/tests/#syntax-lit-NN-rq
> 
>
http://www.w3.org/2001/sw/DataAccess/tests/data/SyntaxFull/syntax-lit-NN
.rq
> 
> for NN = 15 to 20
> 
> 
> 
> Please let us know whether this reply addresses your comment.
> 
> If you could additionally send a message with [closed] in the
> subject line, it would save us a little bit of bookkeeping.
> 
> 	Thanks again,
> 	Andy
Received on Thursday, 5 January 2006 16:57:25 GMT

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