[Top][All Lists]

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

Conditional compiling of flex file

From: Cory Benjamin
Subject: Conditional compiling of flex file
Date: Sun, 25 May 2003 14:51:17 -0700

I have a flex file which I am planning on using with two programs I am
writing.  One of the programs needs to be able to recognize all of the
tokens declared, however the other only needs to recognize a subset (about
50%) of the tokens.

Instead of creating and having to maintain a separate flex file, I would
like to be able to have flex conditionally compile the file.  Standard
#include, #ifdefs of course will not work since flex doesn't process those,
and while I could #ifdef the logic inside each token, I don't want to even
include the flex tables for tokens I won't ever need if I don't have to.

My thought is to create a mini-preprocessor of my own to process the file
before I even send it to flex, but I thought I would check to see if anyone
else has had to deal with this before, and what solution they came up with?

BTW, my "problem" applies to Bison as well.


Cory Benjamin

reply via email to

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