tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Can be extended for C++?


From: Ivo
Subject: Re: [Tinycc-devel] Can be extended for C++?
Date: Mon, 15 Oct 2007 11:59:00 +0200
User-agent: KMail/1.9.3

On Monday 15 October 2007 11:31, Sanghyeon Seo wrote:
> 2007/10/15, ShangHongzhang 62185 <address@hidden>:
> > Is it possible to extend the TCC for supporting C++ syntax parsing?
> > I think it must be very hard to do so, isn't it?
>
> I think it would be impossibly hard to do so.

Yes. The code generator is intertwined with the parser. Also, I seem to 
remember reading somewhere that a single pass C++ compiler is impossible 
due to the nature of the language. tcc is a single pass compiler.

Perhaps you could put a C++-to-C compiler in front of tcc. Such code can 
still be found on the net. IIRC the very first C++ implementation was done 
like that (cfront plus a normal C-compiler). Later on, certain 
C++ "features" were nearly impossible to translate and they moved on to a 
dedicated C++ compiler. Perhaps "they" have overcome these problems because 
LLVM is able to generate C from C++.

--Ivo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]