|ARM Compiler firstname.lastname@example.org (foaud167) (2005-01-12)|
|Re: ARM Compiler email@example.com (2005-01-14)|
|Re: ARM Compiler firstname.lastname@example.org (2005-01-14)|
|Re: ARM Compiler email@example.com (foaud167) (2005-01-15)|
|Re: ARM Compiler firstname.lastname@example.org (Peter Ilberg) (2005-01-15)|
|Re: ARM Compiler Juergen.Kahrs@vr-web.de (=?ISO-8859-1?Q?J=FCrgen_Kahrs?=) (2005-01-19)|
|Re: ARM Compiler email@example.com (Ivan Boldyrev) (2005-01-22)|
|From:||firstname.lastname@example.org (Torben =?iso-8859-1?q?=C6gidius?= Mogensen)|
|Date:||14 Jan 2005 00:41:47 -0500|
|Organization:||Department of Computer Science, University of Copenhagen|
"foaud167" <email@example.com> writes:
> Lately, I have been considering writing a compiler (just for the heck
> of it). I decided that i will write it in java and produce ARM code,
> but i haven't decided on the input language yet. i am thinking about
> C. Any thoughts would be really great.
The choice of input language depends on what you want to achieve. As
I understand it, it is mostly for the learning experience. This makes
C a bad choice for several reasons:
1) It has an arcane syntax where parsing depends on knowing if a name
is a type name or a variable name and in other cases requires
2) The semantics of C is ill-defined.
So you would spend most of your time on the front-end and in trying to
figure out what the meaning of certain constructs are. See, for
example, the recent discussion about C compilers on the comp.sys.arm
So, I would suggest a well-defined language with a simple syntax. You
could choose a suitably simple subset of C or Pascal. Pascal has an
easy-to-parse syntax (it was designed for LL(1) parsing), but some of
its features (nested scopes and procedure parameters) are nontrivial
(though not terribly so) to implement correctly.
You could also pick a language from a compiler textbook, as these are
designed to be relatively simple to compile while still teaching the
most important issues. Good examples of such include the Tiger
language from Andrew Appel's "Modern Compiler Implementation in ..."
books or the Triangle language from Watt & Brown's "Programming
Language Processors in Java".
Return to the
Search the comp.compilers archives again.