public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: John Love-Jensen <eljay@adobe.com>
To: vsdeepthi <shobhadeepthi@gmail.com>, MSX to GCC <gcc-help@gcc.gnu.org>
Subject: Re: Supress macro expansion
Date: Wed, 02 Jan 2008 15:51:00 -0000	[thread overview]
Message-ID: <C3A0E947.29B09%eljay@adobe.com> (raw)
Message-ID: <20080102155100.I5DwPD5zfu1Og2jgbJzunC2t9Ow8L9pXAcbDB2eUkno@z> (raw)
In-Reply-To: <14575239.post@talk.nabble.com>

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


  reply	other threads:[~2008-01-02 13:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-02  9:09 vsdeepthi
2008-01-02 13:16 ` John Love-Jensen [this message]
2008-01-02 15:37   ` John Love-Jensen
2008-01-02 15:51   ` John Love-Jensen
2008-01-02 17:00   ` John Love-Jensen
2008-01-02 21:36   ` John Love-Jensen
2008-01-03  1:22   ` John Love-Jensen
2008-01-03  3:01   ` John Love-Jensen
2008-01-03  3:28   ` John Love-Jensen
2008-01-03  6:39   ` John Love-Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C3A0E947.29B09%eljay@adobe.com \
    --to=eljay@adobe.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=shobhadeepthi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).