It sounds like you're confusing the compilation and execution stages of your program.
gcc compiles the program, that's all it does. It turns human readable source code into machine readable binary code. It does not take ascii input files, output files, etc. or run the code, all it takes is the source code and turns it into a binary. The "-o" switch in gcc controls what the name of that binary file that it creates will be. In your case, it compiled your code into a binary, and named that binary "in.txt" (an odd name for an executable, but gcc doesn't judge). So your program is now called "in.txt". If you had an "in.txt" file before, it has now been replaced with your new compiled binary.
After your program has been compiled, then you need to run it. This is when you pass any input or output files that your program needs to use during execution. How you pass these files to your program depends entirely on how your program expects to receive input. You might give it the name of the file as a command line argument, or if your program reads from stdin you might cat the file and pipe it to the program, etc.
The process should look something like:
$ gcc -o thisismybinaryfile lex.yy.o y.tab.o -ll
$ ./thisismybinaryfile in.txt
$ cat in.txt | ./thisismybinaryfile
$ ./thisismybinaryfile < in.txt
Same goes for the output. You might pass the name of the file to use for output as a command line argument, or the program might dump to stdout and you need to use ">" to redirect that output to a file.
This page has some more information on using lex and yacc: