Probably what I'd do, if there doesn't need to be much in the way of a main() function, is to add a main() to the yacc/bison input file, and open the file from there. The
Lex and YACC HOWTO shows an example of writing your own main() function.
For reading files, C has
fopen; you can then get input with
fscanf or fgets. C++ has
ifstream, which lets you use the >> stream input operator.
There's probably also a way to add the file-opening part to the (f)lex token-expansion definitions. I've used this before to create objects, assign pointers and stuff; you could probably expand this to include opening a file.