From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30330 invoked by alias); 2 Jan 2008 13:46:27 -0000 Received: (qmail 30275 invoked by uid 22791); 2 Jan 2008 13:46:25 -0000 X-Spam-Check-By: sourceware.org Received: from exprod6og107.obsmtp.com (HELO exprod6og107.obsmtp.com) (64.18.1.208) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 02 Jan 2008 13:40:29 +0000 Reinject: from source ([192.150.20.142]) by exprod6ob107.postini.com ([64.18.5.12]) with SMTP; Wed, 02 Jan 2008 05:40:01 PST Reinject: from exprod6og103.obsmtp.com (exprod6ob103.obsmtp.com [64.18.1.184]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with SMTP id m02DErGb027162 for ; Wed, 2 Jan 2008 05:14:53 -0800 (PST) Received: from source ([192.150.11.134]) by exprod6ob103.postini.com ([64.18.5.12]) with SMTP; Wed, 02 Jan 2008 05:10:03 PST Received: from inner-relay-3.eur.adobe.com (inner-relay-3.adobe.com [192.150.20.198] (may be forged)) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id m02D7ein011511; Wed, 2 Jan 2008 05:07:41 -0800 (PST) Received: from fe2.corp.adobe.com (fe2.corp.adobe.com [10.8.192.72]) by inner-relay-3.eur.adobe.com (8.12.10/8.12.9) with ESMTP id m02DA0FV003596; Wed, 2 Jan 2008 05:10:01 -0800 (PST) Received: from namailgen.corp.adobe.com ([10.8.192.91]) by fe2.corp.adobe.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 2 Jan 2008 05:10:00 -0800 Received: from 10.32.16.88 ([10.32.16.88]) by namailgen.corp.adobe.com ([10.8.192.91]) via Exchange Front-End Server namailhost.corp.adobe.com ([10.8.192.72]) with Microsoft Exchange Server HTTP-DAV ; Wed, 2 Jan 2008 13:10:00 +0000 User-Agent: Microsoft-Entourage/11.3.6.070618 Date: Thu, 03 Jan 2008 01:22:00 -0000 Subject: Re: Supress macro expansion From: John Love-Jensen To: vsdeepthi , MSX to GCC Message-ID: In-Reply-To: <14575239.post@talk.nabble.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg00020.txt.bz2 Message-ID: <20080103012200.6QoALzHUeMZb3DRh9QGD08vbsTNuf3EwdP3hGoDeMHM@z> 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