|how to write a compiler email@example.com (2003-07-02)|
|Re: how to write a compiler firstname.lastname@example.org (Jaishankar R) (2003-07-04)|
|Re: how to write a compiler email@example.com (2003-07-04)|
|Re: how to write a compiler firstname.lastname@example.org (2003-07-13)|
|Re: how to write a compiler email@example.com (Michael Meissner) (2003-07-15)|
|Re: how to write a compiler firstname.lastname@example.org (2003-07-17)|
|Re: how to write a compiler email@example.com (Alex McGuire) (2003-07-25)|
|Re: how to write a compiler firstname.lastname@example.org (2003-07-31)|
|Re: how to write a compiler email@example.com (2003-07-31)|
|Re: how to write a compiler firstname.lastname@example.org (Erik Trulsson) (2003-08-04)|
|Re: how to write a compiler email@example.com (Ivan Boldyrev) (2003-08-10)|
|[3 later articles]|
|From:||Michael Meissner <firstname.lastname@example.org>|
|Date:||15 Jul 2003 14:58:21 -0400|
|Posted-Date:||15 Jul 2003 14:58:21 EDT|
email@example.com (Paolo Bonzini) writes:
> > i'm taking up a 6 month term project in my bachelor's degree
> > course.can someone tell me the roadmap for writing a complier.and also
> > suggest the language(maybe c,java etc..or develop a custom
> > lang??)....plus is it a good idea to try for translators(c to
> > java,MSIL to java bytecode etc...)in the same semester??
> > samy
> C is not that hard, but refrain from using Bison/YACC to generate the
> grammar: it might look harder but it pays off most of the times.
> Bison is ok only for home-made little languages, but otherwise you
> often end up with a messy grammar.
Well typedef names will always be the bane of lexers/parsers, since you need to
have scope dependent feedback between the grammar and determining whether
something is a typedef or a normal identifier.
> It can be interesting to develop a small C compiler like tcc to plug
> in some optimizations. Following Appel's "Modern Compiler
> Implementation in *you-named-it*" books can provide a good place
> If you want to do a good compiler with register allocation and the
> like, 6 months can be a start. Then if you have time you can go on
> with the more complex chapters, which deal with improved data-flow
> analysis algorithms, CSE, SSA, or loop optimization for example.
Having a regular machine, with plenty of registers to generate code for would
be a help on such a short term project. The x86 architecture is not what I
would call regular, nor particularly blessed with many registers :-)
Return to the
Search the comp.compilers archives again.