Re: predicateObjectList rule requires lookahead

On Thu, Dec 15, 2011 at 10:08 AM, Gregg Kellogg <gregg@kellogg-assoc.com>wrote:

> I believe that grammar rule [7] predicateObjectList [1] is not LL(1) and
> requires look ahead to know what branch to go into. For example:
>
> [ :a :b ; ]
>
> may  cause it to go down the ( ":" verb objectList )* branch instead of
> the ";"? branch, and result in an error.


Hmm, it also invalidates the following:

[ :a :b ;; ]

While odd-looking, this is legal according to the alternate rule given
below.


> The previous definition did work okay:
>
> [7] predicateObjectList ::= verb objectList ( ";" ( verb objectList)? )*
>
> Any reason it was changed?
>

Not sure -- in fact, every published version of Turtle that I can find
going back to the 2008 team submission [2] matches the current editor's
draft. Where did you find this definition?

This definition does match the PropertyListNotEmpty rule in SPARQL [3].
Given the goal of maximum compatibility between SPARQL and Turtle, it might
not be a bad idea to change Turtle's definition to match.

-Alex


>
> Gregg
>
> [1]
> http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#sec-grammar
>

[2]
http://www.w3.org/TeamSubmission/2008/SUBM-turtle-20080114/#predicateObjectList
[3] http://www.w3.org/TR/sparql11-query/#rPropertyListNotEmpty

Received on Thursday, 15 December 2011 16:12:48 UTC