Or, you could do a reopen() on the input file and stdin.
--
- Tim Jones
]> Is there a way to get lex and yacc to read from somewhere other than
]> stdin?
]
] yacc declares "FILE *yyin". A pre-processor might be set up like:
]
] extern FILE *yyin;
]
] yyin = popen( "/usr/bin/m4 infile", "r" );
] yyparse();
] pclose( yyin );
Both yacc and lex use the file pointers yyin and yyout to communicate
with the environment. I'm not exactly sure why Mr. Plona used
popen(3) to start another process when the same thing can be
accomplished by an fopen(3) call, without the extra overhead of the
second process. What benifits are gained from this, if at all?
Inquiring minds want to know!
--
___________________________________________________________________________
Erik O'Shaughnessy Mac/Unix Support Guy |Phrase of the day:
Small Systems | "Poetically Inert"
New Mexico State University |
---------------------------------------------------------------------------
--
------------------------------------------------------------
Naval Research Lab (202)404-7966
Space Science Division
------------------------------------------------------------
yacc declares "FILE *yyin". A pre-processor might be set up like:Quote:> Is there a way to get lex and yacc to read from somewhere other than
> stdin?
extern FILE *yyin;
yyin = popen( "/usr/bin/m4 infile", "r" );
yyparse();
pclose( yyin );
--
Sit denique inscriptum in fronte unius "Let it finally be written on
cuiusque quid de rebus publicis sentiat the forehead of each man what he
- Cicero thinks of open systems"
Gentlefolks:
I need to specify an ascii character in a regular expression by its byte
value, specically an EXCAPE character.
How do I do specify the byte value? by using \0x010 or ???
Thanks
Alan Walkington
Member of the Technical Staff
United Defense L.P., San Jose
2. what's two_to_onep? (SunOS 4.1.1 and gcc)
3. more scsi board install questions
7. Apache: Parse all .xhtml by own script
8. Simple lex v. yacc question
9. Lex (Flex) and Yacc (or Bison) questions.
10. LEX / YACC yywrap() question
11. Followup YACC & LEX Question