Re: Example interpreter C

Rafael 'Dido' Sevilla <dido@imperium.ph>
16 Aug 2005 11:18:44 -0400

          From comp.compilers

Related articles
Example interpreter C henryb@ntlworld.com (Henry Butwsky) (2005-08-13)
Re: Example interpreter C lfinsto1@gwdg.de (Laurence Finston) (2005-08-16)
Re: Example interpreter C dido@imperium.ph (Rafael 'Dido' Sevilla) (2005-08-16)
Re: Example interpreter C haberg@math.su.se (2005-08-21)
Re: Example interpreter C lfinsto1@gwdg.de (Laurence Finston) (2005-08-21)
Re: Example interpreter C gneuner2@comcast.net (George Neuner) (2005-08-24)
Re: Example interpreter C Markus.Elfring@web.de (2005-08-24)
Re: Example interpreter C der_julian@web.de (Julian Stecklina) (2005-08-31)
Re: Example interpreter C j_simon@gmx.at (Joerg Simon) (2005-09-02)
[5 later articles]
| List of all articles for this month |
From: Rafael 'Dido' Sevilla <dido@imperium.ph>
Newsgroups: comp.compilers
Date: 16 Aug 2005 11:18:44 -0400
Organization: Imperium Technology Inc.
References: 05-08-055
Keywords: interpreter
Posted-Date: 16 Aug 2005 11:18:44 EDT

Henry Butwsky wrote:
> I understand that I need to write a parser that creates and AST
> (abstract symbol table) . Can any one point in the direction of an
> such an expale interpreter ?


First of all, AST == Abstract Syntax Tree.


If you want an example of the incremental development of an interpreter,
you might want to look for the Kernighan and Pike classic book: "The
Unix Programming Environment". There's a whole chapter there where they
follow the development of an interactive interpreter for a small
language called "hoc", from a simple four-function calculator, to one
with simple memory, to one that allows for variables, to one that has
control flow and looping constructs, to one that actually has
user-definable functions.


That book was new in 1984, and it's surprising to see how much of it is
still perfectly applicable to modern Unix variants today.


http://www.amazon.com/exec/obidos/tg/detail/-/013937681X/qid=1124082888/sr=8-1/ref=pd_bbs_1/002-1644588-2338425?v=glance&s=books&n=507846


--
General purpose money is what allows people to trade tracts of rain
forest for Coca-Cola.
http://stormwyrm.blogspot.com/


Post a followup to this message

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