Redirect stdin ?



Hi,

I have a c application (Lex&Yacc based) that parses from stdin. I want
to rewrite the code
a bit to allow reading the source from a char array instead from stdin
without touching the
lex and yacc generated source code.

How could I do that ?

What is about the problem when the buffer is too big to feed the
source to the parser at once ?

Any ideas ?

Thanks, Lothar
.



Relevant Pages

  • Re: COBOL for utility program under Linux.
    ... CGI generally is reading from or writing to STDIN and STDOUT. ... Woo, the seven years since I last did anything in COBOL has apparently taken ...
    (comp.lang.cobol)
  • Re: question about /proc/<PID>/mem in 2.4 (fwd)
    ... > things doesn't prevent the program from reading it's own address space. ... > and this program reading stdin. ... http://www.openwall.com - bringing security into open computing environments ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: how to speed up smalltalk file I/O
    ... Looks like the problem is that you're reading from stdin, ... Integers (after the number it "eats" the non-numeric character and then ... thing displayNl. ... s:= FileStream stdin. ...
    (comp.lang.smalltalk)
  • Re: parameters or stdin
    ... > the file to process is either provided from a pipe/stream or argv. ... > hangs on the reading from stdin and I never get to test for EOF. ... FILE * inp; ...
    (comp.lang.c)
  • Re: Parsing form POST without CGI.pm on Win32
    ... Using your code (or any other code I got from books, ... deal with the STDIN all produce the same. ... Your code died "Reading of posted data failed." ... use strict; ...
    (comp.lang.perl.misc)