help-bison
[Top][All Lists]
Advanced

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

Re: Parsing from continuous stream


From: Daniel Kraft
Subject: Re: Parsing from continuous stream
Date: Sun, 20 Jan 2008 09:48:11 +0000
User-agent: Thunderbird 2.0.0.0 (X11/20070425)

I'm trying to use GNU bison to parse from a "continuous" stream, that is, I do want to implement a program similar to a shell: parse one "command" at a time, process it, and continue until end-of-stream is encountered.

However, I do want my parser to return the parsed tree to the calling program to process it on each step, so ideally I'd like bison to return from yyparse() when a complete instance of the start symbol is read, but it seems it does not do this (waits for special 0-token, as far as I found out)--to counter-act, I currently do something like this:

start_symbol:
  real_start_symbol
  {
    storeValueForProcession($1);
    YYACCEPT;
  }
;

Aha, Yes!

Use the push parser that I have just implemented in Bison. You will be
the first beta tester. The documentation should be in CVS and you need a
CVS version of bison.

Thanks for the hint, it looks neat as far as I have seen yet! But I'm not yet sure how this will help me exactly; will yypush_parse return without this YYPUSHMORE whenever it encounters the start symbol (or any symbol?), so I can process it in my code and continue calling yypush_parse afterwards, with the state including all look-ahead conserved?

BTW, how does one bootstrap the autotools stuff for bison? Trying myself with aclocal; automake -a; autoheader; autoconf (like this) gives me errors in the resulting configure related to gl_* symbols; I suspect that autoconf is missing some m4-files or the like?

Cheers,
Daniel


--
Got two Dear-Daniel-Instant Messages
by MSN, associate ICQ with stress--so
please use good, old E-MAIL!




reply via email to

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