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: Rui Maciel
Subject: Re: set flex start conditions from bison?
Date: Tue, 25 Aug 2009 12:53:26 +0100
User-agent: KMail/1.12.0 (Linux/2.6.28-15-generic; KDE/4.3.0; x86_64; ; )

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.


Rui Maciel




reply via email to

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