Re: writing a compiler...

Jeff Kenton <JeffKenton@attbi.com>
5 Jun 2003 23:16:46 -0400

          From comp.compilers

Related articles
writing a compiler... ltk_RE_MO_VE_@libero.it (Tommy) (2003-06-03)
Re: writing a compiler... vrotaru@seznam.cz (Vasile Rotaru) (2003-06-05)
Re: writing a compiler... m.a.ellis@ucsnew1.ncl.ac.uk (2003-06-05)
Re: writing a compiler... JeffKenton@attbi.com (Jeff Kenton) (2003-06-05)
Re: writing a compiler... cfc@shell01.TheWorld.com (Chris F Clark) (2003-06-05)
Re: writing a compiler... Steve_Lipscombe@amat.com (2003-06-08)
Re: writing a compiler... vbdis@aol.com (2003-06-20)
Re: writing a compiler... Conor.ONeill.NoSpamPlease@logicacmg.com (Conor O'Neill) (2003-06-20)
Re: writing a compiler... lex@cc.gatech.edu (Lex Spoon) (2003-06-25)
| List of all articles for this month |
From: Jeff Kenton <JeffKenton@attbi.com>
Newsgroups: comp.compilers
Date: 5 Jun 2003 23:16:46 -0400
Organization: AT&T Broadband
References: 03-06-016
Keywords: practice
Posted-Date: 05 Jun 2003 23:16:46 EDT

Tommy wrote:
> I would like some advice on how to start learning and practicing the
> "art" of writing compilers. I will review/study all the academical
> material on compiler theory and so on (dragon book), but what I am
> asking you is how to start with the practice....
      ...
> Finally, I would prefer not to use flex, yacc and bison (etc..)


First, define your language. It might be something as simple as an
arithmetic expression grammar (with variables at least -- don't be too
lazy).


Then, write yourself a parser -- recursive descent is fine. Don't
worry about all the fancy parsing theory for now.


After that, compiler writing is all about data structures and
transformations. What is your parser going to produce? A parse tree
is usual. Design it. Pay attention to how it will be used. You're
likely going to walk the tree and produce some intermediate
representation. Or, perhaps you want to start by interpreting it.


Every stage will present questions, and every answer will teach you
something. Get a book that talks about the practical problems you
will face. Theory is great, but there's lots of pure engineering
involved too.


Enjoy.


--


-------------------------------------------------------------------------
= Jeff Kenton Consulting and software development =
= http://home.attbi.com/~jeffrey.kenton =
-------------------------------------------------------------------------


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.