Re: Need Help in Shift Reduce Errors

2005-07-22 Thread Laurence Finston
On Fri, 22 Jul 2005, Atul Kulkarni wrote:

> I am facing a problem with the Grammar i am feeding to the Bison. It
> throws 2 shift reduce conflicts. Please help with this I am not able
> to resolve them.

If shifting is the correct behavior, my advice is to not worry about it.

Laurence Finston


___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison


Re: Need Help in Shift Reduce Errors

2005-07-22 Thread Atul Kulkarni
Well I would not really worry about them but one variant of Bison Yacc
just does not generate output "c" code for this grammar. That's what
worries me.

Regards,
Atul.

On 7/22/05, Laurence Finston <[EMAIL PROTECTED]> wrote:
> On Fri, 22 Jul 2005, Atul Kulkarni wrote:
> 
> > I am facing a problem with the Grammar i am feeding to the Bison. It
> > throws 2 shift reduce conflicts. Please help with this I am not able
> > to resolve them.
> 
> If shifting is the correct behavior, my advice is to not worry about it.
> 
> Laurence Finston
>


___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison


Re: Need Help in Shift Reduce Errors

2005-07-22 Thread Laurence Finston
On Fri, 22 Jul 2005, Atul Kulkarni wrote:

> Well I would not really worry about them but one variant of Bison Yacc
> just does not generate output "c" code for this grammar. That's what
> worries me.
>

It may be that Bison fails if the number of conflicts
is different from the value specified using the '%expect'
option.  I have a vague recollection that this used to happen, but I
haven't used '%expect' for a long time.  I just checked the current
manual, and it just says that Bison issues a warning, but doesn't say
anything about failing or aborting.  If you're using '%expect', and
getting rid of it doesn't help,  I suggest having a look through the
documentation.  I didn't look very thoroughly.

Laurence


___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison


Re: Need Help in Shift Reduce Errors

2005-07-22 Thread Hans Aberg


On 22 Jul 2005, at 06:23, Atul Kulkarni wrote:


I am facing a problem with the Grammar i am feeding to the Bison. It
throws 2 shift reduce conflicts. Please help with this I am not able
to resolve them.


Shift/reduce conflicts can sometimes be resolved using token  
precedences (%left, etc.). Look into the .output file, in the states  
with the conflict, and there, at the conflicting rules. Set token  
precedences for the tokens immediately before and after the ".". If  
there are no such tokens, the best option for this method to work, is  
to rewrite the grammar, as to get them.


  Hans Aberg




___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison