Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #470

restart bison parser

From Jens Kallup <jkallup@web.de>
Newsgroups comp.compilers
Subject restart bison parser
Date 2012-03-02 21:17 +0100
Organization Compilers Central
Message-ID <12-03-003@comp.compilers> (permalink)

Show all headers | View raw


Hello,

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.
Thank's

Jens
[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]

Back to comp.compilers | Previous | Next | Find similar


Thread

restart bison parser Jens Kallup <jkallup@web.de> - 2012-03-02 21:17 +0100

csiph-web