This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to add a language? (off-topic?)


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]