How to eliminate a shift/ reduce issue in Bison/Flex?

43 views Asked by At

I have a school project where I have to make a minipy compiler (kind of similar to python), and I have a shift/reduce conflict in my .synt file. The problem is within this grammar:

INS:INS_AFF  
   |INS INS_AFF 
   |INS_IF
   |INS_FOR1
   |INS_FOR2
   |INS_WHILE

The problem only appeared after adding INS in the second line, but I need to add that in each line — otherwise, it won't work. So what other options do I have?

I tried every solution I ever found, but nothing worked. Either it won't work as it's supposed to, or it gives me more problems.

0

There are 0 answers