|PCC, TCC - new front end firstname.lastname@example.org (Marco) (2009-05-22)|
|Re: PCC, TCC - new front end email@example.com (2009-05-24)|
|Re: PCC, TCC - new front end firstname.lastname@example.org (Philip Herron) (2009-06-03)|
|From:||Philip Herron <email@example.com>|
|Date:||Wed, 03 Jun 2009 11:59:58 +0100|
|Posted-Date:||03 Jun 2009 09:17:25 EDT|
> I have no desire or time to learn a complicated compiler such as gcc.
> I am thinking of starting with PCC or TCC or something like that and
> then put a new front end on it.
I am actually writing an Extremely long tutorial on how to do this!
Well its how to build your own interpreted, then it goes into how to
make your own compiler using gcc. So I'll post it here when i finish it,
making your own front-end in gcc is actually easier that you might
think, I'll put a more concise tutorial on their wiki soon.
If you want to work with a compiler collection that may be easier to
learn to build a new front-end LLVM is meant to be much easier from what
i have been reading. They use C++ so the virtual functions are much
easier to find and implement. And i think they have some good documentation.
> Would generating C code be a better approach?
The problem with doing this i find is if your developing a front-end to
a compiler-collection is that what are you actually using then of the
compiler. As in generally in compiler-collections you do your own
front-end parsing generate your own IR then push it into GIMPLE
representation internally to the compiler. If you decide to generate C
code then all you use is a popen() or execl() to exec the compiler (and
you could use any compiler then) and pass in the code from your codegen.
Return to the
Search the comp.compilers archives again.