I'm trying to parse a grammar, but I get this error:
bison -t -vd brest.y
brest.y: warning: 52 shift/reduce conflicts [-Wconflicts-sr]
brest.y: warning: 76 reduce/reduce conflicts [-Wconflicts-rr]
brest.y:167.105-121: warning: rule useless in parser due to conflicts [- Wother]
/*nil*/ { $$=NULL;}
^^^^^^^^^^^^^^^^^
**bison: m4 subprocess failed**
The lines of grammar involved in warning are:
activity:
/*nil*/ { $$=NULL;}
| resource activity { $$=concatQuadruple(getQuadrupleResource($1),$2);}
| var_declaration activity { $$=concatQuadruple(getQuadrupleVarDeclaration($1),$2);}
| invoke activity { $$=concatQuadruple($1,$2);}
| ASSIGN assignment ASSIGN_ activity { $$=concatQuadruple($2,$4);}
| respond { $$=getQuadrupleRespond($1);}
;
I have installed the following versions of bison and m4:
bison-3.0.2-3.fc21.x86_64
m4-1.4.17-6.fc21.x86_64
Any ideas?
This question is 5 years old, but I have met this problem right now so I think my solution will be useful because its only thread in google with such question. I was running bison from windows (compiled from source using cygwin) and had the same problem:
bison error: '/usr/local/share/bison/m4sugar/m4sugar.m4': No such file or directory
bison error: m4 subprocess failed
The solution for me was to set two variables before running bison command:
set BISON_PKGDATADIR=[Home Dir]/usr/local/share/bison
set M4=m4
In my case [Home Dir] was D:/files/Cygwin. Also make sure to add Path environment variable in windows to run bison & m4: Path=[Home Dir]/bin
I found the solution: /bin/m4 was installed with yum, and for any reason I don't know it had 0 bytes of size. This could be a bug from the repository, I fixed downloading and compiling it from GNU website http://ftp.gnu.org/gnu/m4/.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With