Re: writing a compiler...

Jeff Kenton <>
5 Jun 2003 23:16:46 -0400

          From comp.compilers

Related articles
writing a compiler... (Tommy) (2003-06-03)
Re: writing a compiler... (Vasile Rotaru) (2003-06-05)
Re: writing a compiler... (2003-06-05)
Re: writing a compiler... (Jeff Kenton) (2003-06-05)
Re: writing a compiler... (Chris F Clark) (2003-06-05)
Re: writing a compiler... (2003-06-08)
Re: writing a compiler... (2003-06-20)
Re: writing a compiler... (Conor O'Neill) (2003-06-20)
Re: writing a compiler... (Lex Spoon) (2003-06-25)
| List of all articles for this month |

From: Jeff Kenton <>
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

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.



= Jeff Kenton Consulting and software development =
= =

Post a followup to this message

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