Supress macro expansion
John Love-Jensen
eljay@adobe.com
Thu Jan 3 06:39:00 GMT 2008
Hi vsdeepthi,
> I want to preprocess the file but suppress macro expansion. Is this
> possible using gcc?
Short answer: no.
Long answer: yes, you have access to the GCC source code and you could
munge that to make it do what you want.
> I have tried "gcc -fdirectives_only -E" and "gcc -fpreprocessed -E".
> Any inputs?
You'll have to write your own preprocessor.
Fortunately, there is a C/C++ preprocessor called Wave already written by
Hartmut Kaiser using Boost Spirit that you could use as a starting point and
customize from there.
http://spirit.sourceforge.net/repository/applications/wave.html
Boost Spirit is a EBNF-like representation in C++. (Technically it is an
object oriented recursive descent parser generator framework implemented
using template meta-programming techniques. The C++ alternative to using
flex/bison or lex/yacc.)
http://www.boost.org/libs/spirit/
Boost is a grab bag of incredible enhancements to the Standard C++ Library.
http://www.boost.org/
HTH,
--Eljay
More information about the Gcc-help
mailing list