Re: Techniques for writing an interpreter

adrian@dcs.rhbnc.ac.uk (A Johnstone)
12 Mar 1998 23:14:08 -0500

          From comp.compilers

Related articles
Techniques for writing an interpreter simon@magnorth.nildram.co.uk (Simon Chapman) (1998-03-06)
Re: Techniques for writing an interpreter Nick.Roberts@dial.pipex.com (Nick Roberts) (1998-03-08)
Re: Techniques for writing an interpreter adrian@dcs.rhbnc.ac.uk (1998-03-12)
Re: Techniques for writing an interpreter ct7@mitre.org (W. Craig Trader) (1998-03-15)
Re: Techniques for writing an interpreter fjh@cs.mu.OZ.AU (1998-03-15)
Re: Techniques for writing an interpreter psu@jprc.com (Peter Su) (1998-03-18)
Re: Techniques for writing an interpreter hgg9140@heckle.ca.boeing.com (1998-03-18)
Re: Techniques for writing an interpreter henry@zoo.toronto.edu (Henry Spencer) (1998-03-18)
Re: Techniques for writing an interpreter dhansen@btree.com (1998-03-18)
[23 later articles]
| List of all articles for this month |

From: adrian@dcs.rhbnc.ac.uk (A Johnstone)
Newsgroups: comp.compilers
Date: 12 Mar 1998 23:14:08 -0500
Organization: Royal Holloway, University of London
References: 98-03-032
Keywords: interpreter, design

Simon Chapman (simon@magnorth.nildram.co.uk) wrote:


: All I really want to do is create an interpreter for my simple
: scripting language. Does anyone have any suggestions as to where I
: should start? Any pointers would be greatly appreciated.


Has anyone else noticed that everytime somebody asks a question like
this they get a load of responses saying - don't write another
language, use TCL (or something else). It comes to something when the
comp.compilers community is telling people not to write language
translators... ;-)


Something you might find useful is the latest version of our parser
generator RDP which comes with a couple of thick tutorial manuals. One
of them develops a sequence of single-pass interpreters (like the ones
you have made, I guess) and then goes on to develop a simulator and an
assembler for an extremely simple virtual machine along with two
compilers for that language: one a single pass compiler directly
outputing pseudo-machine code and a second one that builds an AST and
then walks it to spit out the assembler. Within this document you will
brush up against most of the stuff that you need to build
interpreters, assemblers, simulators and simple compilers.


The RDP 1.5 distribution makes all of these tools as part of the
installation and you get full source. RDP runs anywhere that you have
an ANSI C compiler and has been tested under a fleet of different
Unixes, MS-DOS and Windows. There are (apparently) Mac, Amiga and even
Archimedes users out there. Many RDP users have written to me saying
that they find it easy to use, so you might even be able to get
something up and running quickly. In any case, you might learn some
new stuff about byte codes and so on.


Look at


                  http://www.dcs.rhbnc.ac.uk/research/languages/rdp.shtml


which has pointers to the ftp site
(ftp://ftp.dcs.rhbnc.ac.uk/pub/rdp/) and Postscript copies of the
manuals. The case study manual is still missing a couple of chapters
but it should be completed this week, subject to our departmental
refereeing process. The FTP site contains both DOS (windows) and Unix
distributions.


                                                        Adrian
--
Dr Adrian Johnstone, Senior Lecturer in Computing, Computer Science Dep,
Royal Holloway, University of London, Egham, Surrey, TW20 0EX, England.
Email a.johnstone@rhbnc.ac.uk Tel:+44(0)1784 443425 Fax:+44(0)1784 439786
--


Post a followup to this message

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