Re: Left-recursive LALR(1) grammar for turtle (ACTION-217)

The issue raised is wanting to add to the useablity of grammar for LALR 
parser generators.  Object lists do not have this problem because comma 
is a separator, and you can't have a trailing ",".

As this useability rewrite is at odds with a grammar for top down (RC or 
LL) usage, we can't have both.

Suggestion:

Publish the grammar as it is in the LC version (which is the same as 
SPARQL 1.0) and also add a note for this rule that explains a way an 
LALR generator might be applied, quoting the rule below, aligned in 
names to the published grammar.

On 08/12/12 15:53, Sandro Hawke wrote:
> polist
>      : predicate olist
>      | polist SEMI
>      | polist SEMI predicate olist
>      ;

We should note this a an expected shift/reduce conflict.  See section 
5.2 [1] of the bison manual for how that's hanlded in this rather common 
case.  By default it does one token lookahead (AKA it behaves like an LL 
parser!).

	Andy

[1] http://www.gnu.org/software/bison/manual/bison.html#Shift_002fReduce

Received on Monday, 10 December 2012 10:52:06 UTC