restart bison parser

Jens Kallup <>
Fri, 02 Mar 2012 21:17:32 +0100

          From comp.compilers

Related articles
restart bison parser (Jens Kallup) (2012-03-02)
| List of all articles for this month |

From: Jens Kallup <>
Newsgroups: comp.compilers
Date: Fri, 02 Mar 2012 21:17:32 +0100
Organization: Compilers Central
Keywords: yacc, question, comment
Posted-Date: 02 Mar 2012 16:16:41 EST


I have develop a small software program, that use a bison/yacc/flex
grammar to do some task's.
When I start the program from the console, and no error's are available
in the script, the execution is fine.

But when the parser finds an error, the program stops (gui) and returns
to the next point of program (e.g. display a message).
Then, if the parser is restart (in the running gui), I get error's that
can't be recover.

I search google, but found not realy helpfull information's.
So, I try some woodoo coding in the flex .l file.
Each rule becomes a '"token" {BEGIN(INITIAL); return _TOKEN_;}'
It seems not working fine.

Thats the problem:
"How to scan a script in a gui program more than one times?".
"So, the scanner/parser is part of the one program."

I'm happy For any help.

[The usual problem is that there is still buffered text in the scanner.
A call to yyrestart(), perhaps with a subsequent call to point the input
where you want it, and BEGIN INITIAL usually do the trick. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.