help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to change default outcome of shift/reduce conflict?


From: Hans Aberg
Subject: Re: How to change default outcome of shift/reduce conflict?
Date: Fri, 18 Jan 2002 19:23:30 +0100

At 16:40 +0100 2002/01/18, Akim Demaille wrote:
>Me> All LR(n) grammars, n > 1, can be rewritten as LR(1) (to a
>Me> grammar producing the same language) and even to LR(0) if each
>Me> sentence is followed by an end marker,
...
>This is over simplification: your words are right, there is an LR(1)
>for that _language_, but usually it is good for recognition, not for
>parsing.  In other words, it is often very hard to recover the natural
>parse tree for an LR(k) grammar which has been massaged down to LR(1).

And there is the problem of semantics: A "language" in the formal
mathematical sense does not include the semantics, so I figure one does not
know if the grammar transformation can be provided with good actions
expressing the semantics. -- Or perhaps this is what you meant?

But in the current case, I suspect they are not entirely into copying a
language, but also designing a new one. So then it might help that a lot
more can be captured by LR(1) than what one first might believe. To this
one should add lexer & standard context sensitivity tweaks, which opens up
even further doors.

  Hans Aberg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]