Re: preprocessing C++ with new features

Lorenzo Bettini <bettini@dsi.unifi.it>
15 Apr 2003 00:18:18 -0400

          From comp.compilers

Related articles
preprocessing C++ with new features bettini@dsi.unifi.it (Lorenzo Bettini) (2003-03-30)
Re: preprocessing C++ with new features haberg@math.su.se (2003-03-30)
Re: preprocessing C++ with new features idbaxter@semdesigns.com (Ira Baxter) (2003-03-30)
Re: preprocessing C++ with new features Nicola.Musatti@ObjectWay.it (2003-03-31)
Re: preprocessing C++ with new features bonzini@gnu.org (2003-04-13)
Re: preprocessing C++ with new features bettini@dsi.unifi.it (Lorenzo Bettini) (2003-04-15)
Re: preprocessing C++ with new features Thomas.Aigner@bfd-r.bayern.de (Thomas Aigner) (2003-05-23)
| List of all articles for this month |
From: Lorenzo Bettini <bettini@dsi.unifi.it>
Newsgroups: comp.compilers
Date: 15 Apr 2003 00:18:18 -0400
Organization: CINECA
References: 03-03-159 03-04-036
Keywords: C++
Posted-Date: 15 Apr 2003 00:18:17 EDT

Paolo Bonzini wrote:
>>I would like to add some new features to C++ and so I'd need mechanisms
>>for preprocessing C++ code in order to handle only the new features and
>>thus to generate new (translated) C++ code.
>>
>>Are there any tools for helping me do this (apart from Open C++)?
>
>
> Flex and Bison can be used; you can have the lexer output the generic
> C++ code and pass the new features to Bison. If you can be sure that
> the new keywords are not used as variable names and the like (which
> you should be unless you want to write PL/1...) it is very easy.


Hi


I've already started developing this project using flex and bison, and
reached a good stable point.


The problem was actually that I had also to recognize things such as
class and method definitions apart from new constructs.


Indeed I had some problems in reading all the rest of code as it is and
save it in a sort of abstract syntax tree...


However I look forward to taking a look at your implementation at the
link you provided.


Thanks a lot!


ciao :-)
Lorenzo


--
+-----------------------------------------------------+
| Lorenzo Bettini ICQ# lbetto, 16080134 |
| PhD in Computer Science |
| Dip. Sistemi e Informatica, Univ. di Firenze |
| Tel +39 055 4796741, Fax +39 055 4796730 |
| Florence - Italy (Linux User # 158233) |
| Home Page : http://www.lorenzobettini.it |
| http://music.dsi.unifi.it XKlaim language |
| http://www.lorenzobettini.it/purple Cover Band |
| http://www.gnu.org/software/src-highlite |
| http://www.gnu.org/software/gengetopt |
| http://www.lorenzobettini.it/software/gengen |
+-----------------------------------------------------+



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.