bug-bison
[Top][All Lists]
Advanced

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

Why is this a Reduce/Shift Conflict?


From: Matthew Tedder
Subject: Why is this a Reduce/Shift Conflict?
Date: Sun, 17 Feb 2002 03:06:11 -0500

The bexpr AND bexpr line is giving Reduce/Shift conflicts.  Why?  The AND 
terminal token is only used there and it works if I change the AND token to 
'+', for example.  All the other lines work appropriately.  This doesn't seem 
right to me..  The whole project is attached.  Execute the "comp" script to 
compile..


bexpr:    BOOLIT   { $$ = $1; }
        | nexpr EQ nexpr        { if($1 == $3) { $$ = 1; } else { $$ = 0; } }
        | nexpr NE nexpr        { if($1 != $3) { $$ = 1; } else { $$ = 0; } }
        | nexpr GT nexpr        { if($1 >  $3) { $$ = 1; } else { $$ = 0; } }
        | nexpr GE nexpr        { if($1 >= $3) { $$ = 1; } else { $$ = 0; } }
        | nexpr LT nexpr         { if($1 <  $3) { $$ = 1; } else { $$ = 0; } }
        | nexpr LE nexpr         { if($1 <= $3) { $$ = 1; } else { $$ = 0; } }
        | bexpr AND bexpr      { if($1 && $3) { $$ = 1; } else { $$ = 0; } }
;

Attachment: y.tab.h
Description: Text Data

Attachment: mbasic.tab.c
Description: Text Data

Attachment: mbasic.y
Description: Text Data

Attachment: lex.yy.c
Description: Text Data

Attachment: mbasic.h
Description: Text Data

Attachment: sample.bas
Description: Text document

Attachment: mbasic.l
Description: Text Data

Attachment: mbasic.c
Description: Text document

Attachment: comp
Description: application/shellscript


reply via email to

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