help-bison
[Top][All Lists]
Advanced

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

Re: reading a file multiple times with bison


From: Akim Demaille
Subject: Re: reading a file multiple times with bison
Date: 02 Sep 2002 12:17:22 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

| I've got a Qt GUI which uses a bison parser
| in the background. On startup, it reads
| a specific file. It does this by doing something
| like this:
| 
| fp = fopen(MY_FILE);
| yyin = fp;
| yyparse();
| fclose(fp);
| 
| This seems to work rather well. I can tell it
| to load a new file and it will do so just fine.
| However, if I load a file with an error in
| it, I'll get the parse error message, but from
| then on, no files that I import will work. I
| always get the same error message! If I stop
| and restart my program, it works just fine. Is
| there a buffer or some sort of persistent status
| that is not going away?
| 
| Please let me know what I need to do so I can
| go back to correctly parsing those files even
| after a file with an error has been parsed.

Add #define YYDEBUG 1 and set yydebug to 1.  Then, check what sees
your parser.  My bet is that it is your scanner that is not properly
reset.  Please, keep this list informed.




reply via email to

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