Re: building an interpreter for Aho, Ullman and Sethi's appendix example

wbs@wschindler.net (Bill)
2 Jan 2004 03:38:18 -0500

          From comp.compilers

Related articles
building an interpreter for Aho, Ullman and Sethi's appendix example leena_pattnaik@hotmail.com (Leena Pattnaik) (2003-12-23)
Re: building an interpreter for Aho, Ullman and Sethi's appendix e hodroj@terra.net.lb (2003-12-27)
Re: building an interpreter for Aho, Ullman and Sethi's appendix e wbs@wschindler.net (2004-01-02)
| List of all articles for this month |
From: wbs@wschindler.net (Bill)
Newsgroups: comp.compilers
Date: 2 Jan 2004 03:38:18 -0500
Organization: http://groups.google.com
References: 03-12-133
Keywords: books, tools
Posted-Date: 02 Jan 2004 03:38:18 EST

"Leena Pattnaik" <leena_pattnaik@hotmail.com> wrote
> In Aho, Sethi and Ullman's dragon book ''Compilers : Principles,
> Techniques, and Tools', there is a grammar (in Appendix A- page
> 745-747) for a Pascal subset with the purpose of allowing the reader
> to attempt to implement the basic component of an interpreter for it
> (preferably in C or C++). I've attempted the implemention and would be
> interested to see if someone has done this or if there is a sample
> implementation that i can look at.


In the same book is a discussion of tools for building compilers and
interpreters. You might want to review lex and yacc. It is pretty
straight-forward to write the exercise using these tools. I use these
tools all the time to build not only interpreters but compiler
front-ends as well.


I would strongly urge you to get to know these tools. One could argue
that you could hand code the parser etc. to gain performance, but you
may sacrifice ease of debugging and code clairity by doing so.


Numerous *nix and windows compatable versions of the tools are
available.


Post a followup to this message

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