W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > December 2005

Suspicious notation in SPARQL lexical rule for STRING_LITERAL_LONG1

From: imikhailov <imikhailov@openlinksw.com>
Date: Wed, 28 Dec 2005 23:50:11 +0600
To: <public-rdf-dawg-comments@w3.org>
Message-ID: <E1ErfQZ-0004vD-Up@maggie.w3.org>

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.
Received on Friday, 30 December 2005 08:14:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:49 GMT