This is likely to be a problem with exactly which commands you use to invoke Yacc, Lex and GCC, and not with the input files that you included here.
Yacc (which probably really is a program called Bison even if you use the command yacc) generates two files: A parser (y.tab.c) and another file (y.tab.h) with definitions that the scanner needs. The problem here is that GCC cannot find that file, y.tab.h.
Check these things:
That the file actually is generated. You may have to give the flag -d to Bison/Yacc.
That the file is called y.tab.h. The name can be different depending on program versions, and if you start Bison with the command bison or with the command yacc.
That the file is in a directory where GCC can find it.