This is my code in file skener.y
%{
#include <stdio.h>
%}
%token T_Int
%%
exp: T_Int { $$ = $1; }
| exp exp '+' { $$ = $1 + $2; }
| exp exp '-' { $$ = $1 - $2; }
| exp exp '*' { $$ = $1 * $2; }
| exp exp '/' { $$ = $1 / $2; }
;
%%
When I compile it with comand "bison -d skener.y" I get error "m4: No such file or directory.". Of course I am located in working folder when typing command in prompt. I dont know what is it about?
There seems to be some error in the bison.exe file. I replaced it with the one found inside this zip file. http://marin.jb.free.fr/bison/bison-2.4.1-modified.zip
Source:http://marin.jb.free.fr/bison/
There should be no space in the name of any folder in the path. In my case I kept it in C:/Program Files/GnuWin32/bin and it caused the error. Then I moved the folder from Program Files and placed as C:/GnuWin32/bin and it starts working well.
I got this same error when I installed the GnuWin32 version of bison via their Setup.exe on my Windows 7 PC. The solution was to add the ...\GnuWin32\bin
dir to my PATH. (Interestingly, this is first tool of many that had a problem when not in my PATH)
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