help-bison
[Top][All Lists]
Advanced

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

Re: Bison & flex on start conditions


From: Hans Aberg
Subject: Re: Bison & flex on start conditions
Date: Fri, 13 Jan 2006 18:58:21 +0100

As you point out, the Bison generated parser uses a lookahead token that may or may not be required in each specific parse, embedded into the LALR(1) algorithm used to create it, and there appears to be no easy way around that. One can think of inserting some user code at the place where the Bison parser asks for a new token, though. But I am not sure it will give the effect you are asking for.

On 13 Jan 2006, at 14:10, Steve Murphy wrote:

Hello--

Been playing with bison/flex for years; think they're great.

There are few interoperability issues between them, however.

One that would be nice to smooth out would be the start-condition
capability in flex... and how to trigger it from the bison grammar end
of things.

Bison can call a function in the flex world, that will run the
 BEGIN(XXX) and set the start condition for flex. But usually, it's
already too late... bison has it's lookahead token. Flex already
evaluated the token under the old regime, and returned a token.

Has anybody got a solution how to trigger flex start conditions from
bison, so everything works out nice?

murf

--
Steve Murphy <address@hidden>
Electronic Tools Company



_______________________________________________
address@hidden http://lists.gnu.org/mailman/listinfo/help-bison





reply via email to

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