Subj : Re: How-to on writing an interpreter? To : comp.programming From : Richard Heathfield Date : Sat Jul 16 2005 05:08 am C. Rebert wrote: > I'm trying to implement an interpreter for a programming language, but > so far haven't been able to find any good materials on how to write a > simple stack-based interpreter. I would appreciate it if someone could > point me to some resources on writing such an interpreter. I'd be open > to buying such materials, as long as they aren't ludicrously expensive. > Thanks for your time. The canonical tome is colloquially known as "The Dragon Book", thanks to the cover art, but the official name is: "Compilers: Principles, Techniques, and Tools", by Aho, Sethi, and Ullman. Nowadays, the Web allows you to find negative opinions about any subject you like with a simple search, and indeed you will find people slagging off the Dragon Book if you try. Nevertheless, the fact remains that the people who actually write interpreters and compilers would rather gnaw their own leg off than let their Dragon Book out of their sight. Guidance on writing much simpler interpreters (basically calculators, or calculators-in-disguise) can be found in "The C Programming Language" (Kernighan and Ritchie) and "The Unix Programming Environment" (Kernighan and Pike). -- Richard Heathfield "Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk mail: rjh at above domain .