Question on parsing a text file

Hi,
I have a question please.

I'm parsing a text file, and I'd like to detect when a certain Compilation Condition - i.e. #ifdef - begins.

The challenge is, that the condition can take any of the following patterns:

#ifdef (FLAG)

#if defined (FLAG)

#if (defined (FLAG))

(And perhaps I missed more)

I'd of course need to treat them all the same, as they are indeed the same.

How would you know to treat them all the same?

Thank you.
Hi,
I'd love hearing your ideas! :)
There are many ways to kill a chicken. You have your own ways too. Try it your way and if you are stuck, lend some help from many brilliant minds in this forum.
Topic archived. No new replies allowed.