Re: [Flex-help] search and substitute constants in C
flex is a tool for generating scanners
Brought to you by:
wlestes
From: Ángel G. <an...@le...> - 2016-02-26 00:17:11
|
El mié, 24-02-2016 a las 22:37 +0100, Roberto Valverde Cameselle escribió: > Hello to all, I’m new to flex and i wanted to know how to parse a C > example file and when a #define statement is found, substitute all > the instances of that constant with its value. For example: > > <input file> > > #define TRUE 1 Do you only care about "#define" NAME VALUE, or do you want to properly parse full macros, too? Also, I wonder if directly calling the C preprocessor (cpp / cc -E) wouldn't solve your use case better than developing a new tool with flex… |