Learning lex yacc for first time. but no code in bison is running ERROR: C:\GnuWin32\bin\bison.exe: m4: Invalid argument I reinstalled bison checked the path but still the error is not going. Something wrong with m4 file
PS C:\Users\Vishwajeet\Desktop\lab\Compiler\D2> bison -dy gm2.y conflicts: 1 shift/reduce, 1 reduce/reduce C:\GnuWin32\bin\bison.exe: m4: Invalid argument
path: C:\GnuWin32\bin path without space
%{
#include<stdio.h>
#include<stdlib.h>
int yylex();
%}
%token A B C NL
%%
stmt: S NL { printf("valid string\n");
exit(0); }
;
S: X Y | W
;
X: A X B |
;
Y: C Y |
;
W: A W C | Z
;
Z: B Z |
;
%%
int yyerror(char *msg)
{strong text
printf("invalid string\n");
exit(0);
}
calc.tab.c calc.tab.h: calc.y bison -t -v -d calc.y
produces no error for me – Doot