help-bison
[Top][All Lists]
Advanced

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

Re: set flex start conditions from bison?


From: Akim Demaille
Subject: Re: set flex start conditions from bison?
Date: Wed, 26 Aug 2009 11:10:49 +0200


Le 25 août 09 à 13:53, Rui Maciel a écrit :

Akim Demaille wrote:
AFAIK, Flex does not generate a header file with its definitions such
as start conditions, so you probably need to write a small wrapper
around flex that extracts it from the generated scanner *.c file.
Then, from the grammar file, just include that extracted file from
like any other.

Flex does generate a header file, which also holds the definitions for the start
conditions. You can try it out by running the following:

flex --header-file=lex.yy.h test.l


If you defined starting conditions on your test.l file then the lex.yy.h will hold the definitions. Unfortunately they are enclosed in a #define statement.

Can you show the content of this file? Can you also show where you include it in your Bison file? Maybe you include the flex header from the bison and vice versa, which probably does not work as expected. Usually you include the Bison header from the Flex scanner (to get the token definitions and so forth). I have no experience with the converse.



reply via email to

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