From: Daniel Jacobowitz <drow@mvista.com>
To: James Buchanan <jamesbuch@iprimus.com.au>
Cc: gcc@gcc.gnu.org
Subject: Re: New front end, help needed
Date: Tue, 31 Dec 2002 10:15:00 -0000 [thread overview]
Message-ID: <20021231162238.GA29737@nevyn.them.org> (raw)
In-Reply-To: <5.1.0.14.0.20030101031203.009f2a00@pop.iprimus.com.au>
On Wed, Jan 01, 2003 at 03:14:47AM +1100, James Buchanan wrote:
> Hi everyone,
>
> I suppose the thing that stumps me is the trees. I have
> looked in tree.def, tree.h, coretypes.h and many other places
> without much success. Sometimes it appears to be a union
> (coretypes.h - but just a nothing typedef saying tree is a
> pointer to union treenode) but sometimes it appears to be a
> struct. I can't see what it is supposed to be. If I could make
> these trees for arithmetic expressions, assignment
> statements, functions, and so on, then I could compile a
> new language by writing a front end. But I don't even know
> where to start.
> Suppose I need a string, use an ARRAY_DECL (as in an array
> of chars or unicode wchar's) or a POINTER_DECL? I suppose
> I don't use POINTER_DECL, since there is no actual object,
> only a placeholder address for something else, so I use an
> ARRAY_DECL or something to internally represent var$ as
> a C string.
>
> Where to from here? I need to grow strings automagically
> within the compiler, and handle IF var$ = foo$ THEN... by
> calling strcmp() or something like that, within the runtime
> library. How do I implement these operators? How do I
> get the assembler that is generated to hook into the
> runtime code needed?
>
> Sorry for all this, but I am not sure who to ask or where
> to look or anything like that.
You should take a good look at "treelang", which is the sample
frontend, and also a good look at the GCC Internals manual (gccint.info
in gcc/doc/ in a built tree).
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2002-12-31 16:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-31 9:53 James Buchanan
2002-12-31 10:15 ` Daniel Jacobowitz [this message]
2002-12-31 10:32 ` James Buchanan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021231162238.GA29737@nevyn.them.org \
--to=drow@mvista.com \
--cc=gcc@gcc.gnu.org \
--cc=jamesbuch@iprimus.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).