tags:

views:

201

answers:

2

I am trying to step into my yyparse function, which is defined in Bison generated code, but I get a message from GDB saying

Reading file "foo.tab.c"...No such file or directory.

The file generated by Bison is called foo.cc. Why is it looking for foo.tab.c, instead?

+1  A: 

The .cc file is really an input to the Bison program. The foo.tab.c is THE output -- a C file generated by Bison. It contains lookup tables to speed up parsing and some default definitions for most everything you'd need. This file is compiled and contributes to object code. You might find the documentation helpful.

dirkgently
+1  A: 

Input files for Bison should follow the yacc convention and be named foo.y. When processed the output file should be foo.tab.c. For C++ this is foo.yxx to foo.tab.cxx.

Are you using the -o or --output-file argument for Bison. This might be the problem, instead use the conventions mentioned.