W3C home > Mailing lists > Public > public-rdf-wg@w3.org > December 2012

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

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Mon, 10 Dec 2012 10:51:36 +0000
Message-ID: <50C5BEB8.5070007@epimorphics.com>
To: public-rdf-wg@w3.org
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 GMT

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