[antlr-interest] Re: antlr-interest Digest, Vol 11, Issue 41

Desai Nishitkumar Ashokkumar nadesai at cse.iitb.ac.in
Sun Oct 23 10:32:01 PDT 2005


Hello sir,
            After running preprocessor manually, preprocessod code is
different (not in semantic but syntatic) from original code. And if I
convert this preprocessod code to c++ code (without classes, only
compatible to g++) such that it is compile by g++ compiler then this
translated code is also without any macros (preprocessor statement) but
that I dont want. I only want to do is making C code compile by g++
compiler. And this I want to do automatically and dont want to change
unnecessary codes.

If I manually first do preprocessing then I think it ll not fulfilled my
goal.
Actually I want to make linux kernel compilable by g++. If I manually
apply preprocessor on that and then translate it to c++ then translated
code ll be very big. bcz kernel has lots of macros used.

Give me some suggetion to solve this problem.

Thank you again.


On Sun, 23 Oct 2005 antlr-interest-request at antlr.org wrote:

> Send antlr-interest mailing list submissions to
> 	antlr-interest at antlr.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://www.antlr.org/mailman/listinfo/antlr-interest
> or, via email, send a message with subject or body 'help' to
> 	antlr-interest-request at antlr.org
>
> You can reach the person managing the list at
> 	antlr-interest-owner at antlr.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of antlr-interest digest..."
>
>
> Today's Topics:
>
>   1. Re: ANTLR modification (Martin Probst)
>   2. Problem with carriage returns in c# stringtemplate (Tech)
>   3. query (Desai Nishitkumar Ashokkumar)
>   4. RE: Problem with carriage returns in c#	stringtemplate (Luis Leal)
>   5. Re: ANTLR modification (Jim Crafton)
>   6. RE: RE: Strange bug in ANTLR under .Net (Micheal J)
>   7. RE: ANTLR modification (Micheal J)
>   8. C# AST problem. (Phil Ritchie)
>   9. RE: C# AST problem. (Micheal J)
>  10. Re: query (Terence Parr)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 23 Oct 2005 13:39:38 +0200
> From: Martin Probst <mail at martin-probst.com>
> Subject: Re: [antlr-interest] ANTLR modification
> To: antlr-interest at antlr.org
> Message-ID: <1130067578.9732.2.camel at localhost.localdomain>
> Content-Type: text/plain
>
>
>> The general way to get anything included is to talk with the 'supreme
>>  dictator' of antlr Terence Parr ;-)
>
> 'Supreme benevolent dictator' please ;-)
>
>>
>> Though i doubt this would be included. I know a lot of people who have
>> had a need for this, including myself but we have had to to with
>> implementing this ourselves.
>
> I think this is quite a trivial change (nothing against your work Jim,
> it's just not very complicated) and most people writing parsers probably
> don't need it in the first place.
>
> Is it really necessary to manipulate the base classes? Can't you reach
> the same thing by subclassing?
>
> Martin
>
>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 23 Oct 2005 14:08:37 +0100
> From: Tech <tech at swingkid.fsnet.co.uk>
> Subject: [antlr-interest] Problem with carriage returns in c#
> 	stringtemplate
> To: antlr-interest at antlr.org
> Message-ID: <435B8B55.8000205 at swingkid.fsnet.co.uk>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> I have managed to fix this by using a subtemplate instead of a string or
> anonymous subtemplate, ie:
>
>    newline() ::= "$\r$$\n$"
>
>    program(statements) ::= <<
>    class Wrapper$\r$
>    {
>        $statements; separator={$newline()$}$
>    }
>     >>
>
> works, but
>
>    program(statements) ::= <<
>    class Wrapper$\r$
>    {
>        $statements; separator={$\r$$\n$}$
>    }
>     >>
>
> does not. Also,
>
>    program(statements) ::= <<
>    class Wrapper$\r$
>    {
>        $statements; separator={
>        }$
>    }
>     >>
>
> works as well.
>
> At least its working, but if anyone could explain what the problem is,
> it is always nice to know these things! :-)
>
> Thanks,
>
> Mark
>
>
>
>
>
>
>
>
>
>

-- 
Nishit Desai
M.Tech II year 
Computer Science & Engg.
IIT Bombay


More information about the antlr-interest mailing list