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

On 10/12/12 11:52, David Wood wrote:
> Hi Andy,
>
> I presume you mean a "note" in the Turtle spec and not a "WG Note".  If so, I like your suggestion.
>

Yes - small "n" :-)  Footnote.

(Except without pages, there are no foots.)

	Andy

> Regards,
> Dave
>
>
> On Dec 10, 2012, at 5:51, Andy Seaborne <andy.seaborne@epimorphics.com> wrote:
>
>> 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 12:15:43 UTC