help-bison
[Top][All Lists]
Advanced

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

Re: Shift/reduce conflict?


From: Ramaswamy
Subject: Re: Shift/reduce conflict?
Date: Wed, 25 Jun 2003 10:31:33 +0530

Hi,
    The problem is not just with the shift reduce as u expect. When it gets
the 1st x its get into a state where it expects either on of - the 2nd x of
"xx", the 1st x of "xy" and the 1st x of "xz". So that is not a problem. But
after the 2nd x it would have a problem, it would be choosing to take either
the "xy" or the "xz" path which ever turns out to be the shift (default
behaviour at the s/r error). U can solve the problem by making "xx", "xy"
and "xy" different token at the lexer and have a nice grammar for that. Or
else u can use bison's GLR parsing scheme. Bye.

Regds
Ram

----- Original Message -----
From: <address@hidden>
To: <address@hidden>
Sent: Wednesday, June 25, 2003 9:35 AM
Subject: Shift/reduce conflict?


> Hi,
>
> For an input where "xxxyxz", "xyxz", "xxxz" and "xz" are all valid,
> I tried the following (flex not used):
>
> start: xx xy xz
> xx: |'x''x'
> xy: |'x''y'
> xz: 'x''z'
>
> Unfortunately, it doesn't seem to work. Once the first 'x' is read,
> only 'x' is expected, 'y' and 'z' becomes illegal. Any suggestions?
>
> Thank You,
> I.Q.
>
> --
> __________________________________________________________
> Sign-up for your own FREE Personalized E-mail at Mail.com
> http://www.mail.com/?sr=signup
>
> CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
> http://corp.mail.com/careers
>
>
>
> _______________________________________________
> address@hidden http://mail.gnu.org/mailman/listinfo/help-bison
>





reply via email to

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