   Routing to stdin
  Hey,I'm using Lex and Yacc to parse a grammar for some procedural content generation stuff I'm doing.  As far as I can tell, the lexical analyzer invoked by yyparse grabs its input from stdin and there's no way to override that.I want to grab my input from a file.  I know I can pipe it in using <, but I can't do that during runtime, which prevents me from loading a different file later in execution.Is there a way to point stdin at a file in C++?  Or alternatively, does anyone know how to get Lex/Yacc to read from a file instead of stdin by default?  Google hasn't given anything, but admittedly I may nont know the right words to search for.Cheers,--Brian   
  Bison is the GNU equivalent of YACC.  Try looking at the Bison manual to see how to do this.  I know you can have YACC eat input from a file and I've done it in the distant past.BTW, if you need a parser, you might consider the Spirit library in boost.  Its great for writing little recursive descent parsers and due to its dynamic nature, it can do things that lex/yacc can't do.   ;  You're right, there was an error in my terminology.  Technically I've been using Bison and Flex.I figured it out.  Turns out there's a 'FILE* yyin' that I can set to my own file, and the next time I call yyparse the input is grabbed from that file.Thanks for the suggestion.  I'll definitely look into it, but seeing as how my grammar is already written and tested, I may be hard-pressed to switch. :-)Cheers,--Brian;  Yeah, if you've already got your grammar implemented in flex/bison, then there's no need to switch.I've been looking at Spirit lately and I really like it for small grammars.  Hell, someone has even written a grammar that parses C source files in Spirit, so you know its up to tasks that are beyond the simple ones.   