2 Sep
2006
2 Sep
'06
03:39
On Saturday 02 September 2006 05:23, stephan beal wrote:
main( int argc, char ** argv ) { ++argv, --argc; /* skip over program name */ if ( argc > 0 ) yyin = fopen( argv[0], "r" ); else yyin = stdin;
yylex(); }
Correction: you'll need to copy this code INTO your lex.yy.c file because it uses the yyin symbol defined in the lex-generated code. First, copy that code to main.c, then: cat main.c >> lex.yy.c then compile it: cc -o foo lex.yy.c -- ----- stephan@s11n.net http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts