|Compilers and using gcc as part of the compiler firstname.lastname@example.org (Nicholas King) (2001-08-15)|
|Re: Compilers and using gcc as part of the compiler email@example.com.OZ.AU (2001-08-16)|
|Re: Compilers and using gcc as part of the compiler firstname.lastname@example.org (Axel Kittenberger) (2001-08-17)|
|Re: Compilers and using gcc as part of the compiler email@example.com (Joachim Durchholz) (2001-08-18)|
|From:||firstname.lastname@example.org.OZ.AU (Fergus Henderson)|
|Date:||16 Aug 2001 23:56:39 -0400|
|Organization:||Computer Science, University of Melbourne|
|Posted-Date:||16 Aug 2001 23:56:39 EDT|
Nicholas King <email@example.com> writes:
>I am working on building a compiler for a object oriented language i have
>designed that consists of allowing methods in a object to return multiple
>types at once.
>ie return (String ,Int)
>Now i was thinking would it be possible to use the gcc backend as the code
>generation phrase? But i am unable to find anything on gcc architecture.
>Any help would be appreciated.
>Yours Sincerely Zeddie
>[I'd compile to C and then use GCC to compile the C code. -John]
The moderator's advice is good. Even if you do decide to implement
your own compiler and interface to the back-end, your compiler will be
much easier to debug if you first generate C code, and only try
interfacing directly with the GCC back-end once the C code works. But
you should also consider compiling to C++ or Java if they are a better
match for your source language.
Alternatively, rather than writing a new compiler, just modify the
compiler for an existing language to support your new extensions.
This is likely to be a lot easier than writing a compiler from
scratch. There are many freely available open-source compilers
If you do want more information on how to interface with the GCC
back-end, see the chapter "Writing a compiler front-end" in "Using,
Maintaining and Enhancing COBOL for the GNU Compiler Collection (GCC)"
<http://cobolforgcc.sourceforge.net/cobol_toc.html>; the documentation
on the tree intermediate representation
<http://gcc.gnu.org/onlinedocs/gcc.html>; and the "example" and "toy"
sample front-ends which are linked to from
Fergus Henderson <firstname.lastname@example.org> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
Return to the
Search the comp.compilers archives again.