I have written a program which chains a call to the c preprocessor (cpp) to
a parser written in lex/yacc. My current arrangement uses a temporary file
between cpp and my lexer. I would like to use a pipe (socketpair or whatever)
I think that I need to connect the stdout of my cpp process to the stdin of
my lexer process. How do I do this. (I've read the man pages for pipe and
socket pair, but they haven't helped)
| |
fork fork
/ \ / \
| | / \
cpp | cpp-->pipe-->lexer
/ | | | |
| | | ------> end rest-of-program
tempfile ->wait
| |
\___lexer
|
rest-of-program
(I'm using acc on a sun; I'm calling cpp using execlp(...) from a process
forked from main)
| | | | | | | ------------------------------------------------------------
| | +-- | | | Due to transcription and transmission errors, the views
--- | | | expressed here may not reflect even my own opinions!