help-bison
[Top][All Lists]
Advanced

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

Re: Read and write to files within Bison


From: Mike Aubury
Subject: Re: Read and write to files within Bison
Date: Tue, 18 Feb 2003 09:45:02 +0000

>  int main(int argc, char *argv[]) {
>   int i;
>   FILE *yyout;
>
>   for (i=0; i<26; i++)
>
>   vars[i] = 1;  //initialize all variables to true
>
>   fprintf(yyout, "0 0 moveto\n");
>
>   if (argc == 1)
>     yyparse();
>
>   if (argc == 2) {
>     yyin = fopen(argv[1], "r");
>     yyparse();
>   }
>
>   if (argc == 3) {
>
>    yyout = fopen(argv[2],"w");
>
>    yyin = fopen(argv[1], "r");
>    yyparse();
>    fclose(yyout);
>   }
>
>   return 0;
> }


Just a thought - but you are fprinting to yyout before you're opening it for a 
start....




reply via email to

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