This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to add a language? (off-topic?)
- To: "His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon\(d\)ated" <xenophon at irtnog dot org>
- Subject: Re: How to add a language? (off-topic?)
- From: Peter Gerwinski <peter at gerwinski dot de>
- Date: Sat, 26 Dec 1998 11:27:26 +0100
- Cc: egcs at egcs dot cygnus dot com
- References: <w4opv9ao9vz.fsf@nemesis.irtnog.org>
His Holiness the Reverend Doktor Xenophon Fenderson, the Carbon(d)ated wrote:
> [...] Where in the
> code should I start looking to figure out how GCC, G++, GNU FORTRAN,
> etc. all work together, and how to get access to (and use) the code
> generation routines? Is there any documentation (aside from gcc.texi
> and the source code) that I should be reading?
You need to learn about "tree nodes". You can read
- section "Tree nodes" of the documentation of the GNU Pascal
Compiler (GPC) which is intended to cover exactly this topic
(see ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/beta/),
- the GCC source files `tree.def', `tree.h', and `tree.c';
after that you can start reading the GCC (or GPC;-) source,
starting with the parser `*parse.y', then continuing with the
routines directly called by the parser.
Code generation is then done within `rest_of_*_compilation()'.
These are the routines where the front-end stops and the
back-end starts.
(Of course you can also ignore all this and find your own
approach.;-)
HTH,
Peter
--
Peter Gerwinski, Essen, Germany, http://home.pages.de/~Peter.Gerwinski/
Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - gpc-980830
PGP key on request - 6C 94 45 BE 28 A4 96 - 0E CC E9 12 47 25 82 75
Fight the SPAM and UBE! - http://spam.abuse.net/ - http://maps.vix.com/