help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Outputting to a given filename?


From: warren henning
Subject: Outputting to a given filename?
Date: Tue, 17 Jun 2003 21:20:45 +0000

I am using flex 2.54 in DOS (although I don't think that should really affect the answer to my question).

I would like to have flex output to a file; that is, by default, it outputs to stdout; I want what would normally go to stdout to go to a filename of my chosing.

I looked through the manual and it said that the variable yyout (or is it yytext? I'm not sure, I did my best to figure the answer out) can be reassigned. I figured I'd do like:

main(int argc, char* argv[])
{
        yyout = fopen("tokenized.data","w");
        yylex();
        fclose(yyout);
}

and of course main() would go in the section of the flex file for auxiliary procedures.

And tried this very code in my program, but it seemed to still not work - it still outputted to stdout and did not

Am I doing something wrong? I made a good-faith effort to figure it out on my own and I'm stumped. Any help is much appreciated.

-Warren

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail





reply via email to

[Prev in Thread] Current Thread [Next in Thread]