help-bison
[Top][All Lists]
Advanced

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

Token push-back?


From: Evan Lavelle
Subject: Token push-back?
Date: Wed, 25 Apr 2007 16:39:43 +0100
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)

I'm just about to write a yylex wrapper to let me push back a token so that Bison can re-read it. Before I do this, can anyone tell me if there's a better way to handle this?

My problem is that I need to write a partial parser, which ignores large chunks of a language. The chunks are delimited by known tokens, so I need to do something like

ignore_block
   : STARTBLOCK {
     // check yylex input for ENDBLOCK, push it back
     } ENDBLOCK ;

ie. something like a flex exclusive start state, but initiated from Bison.

Thanks -

Evan




reply via email to

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