Subj : Re: How-to on writing an interpreter? To : comp.programming From : Richard Heathfield Date : Tue Jul 19 2005 07:11 am osmium wrote: > "Rob Thorpe" writes: >>> The basic process is to define the language and to define the >>> intermediate structure to be interpreted. The latter will be symbol >>> tables and trees/graphs representing the code to execute. (OO >>> languages, such as C++ are EXTREMELY well suited for such applications) >> >> Actually I can't think of anything less useful for contructing trees >> than OO. It can be done very simply using procedural programming. > > For one tree, fine. But what if you want several trees in one program? It can still be done very simply using procedural programming. > Or want to write a tree once and be done with it, i.e., keep reusing the > same tree logic in several programs? Well, obviously you're going to reuse it. This is procedural programming! Everything gets reused. The trick is to code with one eye fixed on your program, and the other fixed on future programs. It can make your eyes water a little, and gives you a mild squint, but it is very possible. -- Richard Heathfield "Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk mail: rjh at above domain .