Techniques for writing an interpreter

Simon Chapman <simon@magnorth.nildram.co.uk>
6 Mar 1998 01:57:57 -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)
[25 later articles]
| List of all articles for this month |

From: Simon Chapman <simon@magnorth.nildram.co.uk>
Newsgroups: comp.compilers
Date: 6 Mar 1998 01:57:57 -0500
Organization: Magnetic North
Keywords: interpreter, question

I wonder if someone here could give me a little guidance?


I've been using Lex & Yacc (also Flex and Bison) for some time to
write simple scripting utilities. More recently I've become interested
in extending the functionality of these utilities to include more
sophisticated contructs such as flow control, labels, nested IF-ELSE
and so on.


It seems to me that in order to write such an interpreter, I need much
more than just the ability to parse a grammar and perform simple
actions. There needs to be a step after that which builds some sort
of tree, and then walks through it, effectively "running" the
program. Thats where my knowledge on the subject runs out!


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.
--
Simon
[Yup. Either make a tree or RPN byte codes. As has often been mentioned,
writing yet another scripting interpreter is invariably a waste of time,
since there are several good freeware ones available for the taking.
-John]




--


Post a followup to this message

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