Feed char array into stdin
- by Brian Lindsey
I am writing a parser for a mini scripting language. Some of my grammar rules require jumping to a different location in the file to obtain information. There doesn't seem to be a straightforward way to accomplish this. So, I was thinking about loading my data files into a char array array and parsing line by line. This will allow me to jump all over the array with ease.
My question is, is it possible to feed char arrays (i.e. char *) into stdin, so I can easily invoke the yyparse() function as needed.