Subj : Re: How-to on writing an interpreter? To : comp.programming From : Phlip Date : Tue Jul 19 2005 06:01 am osmium wrote: > For one tree, fine. But what if you want several trees in one program? Or > want to write a tree once and be done with it, i.e., keep reusing the same > tree logic in several programs? Ahem. The Interpreter Pattern leverages a Composite of nodes, each containing a polymorphic Interpret() method. Something calls each Interpret(), depth-first, and each specialization of Interpret() does its own unique thing. So OO is good for one tree. -- Phlip http://www.c2.com/cgi/wiki?ZeekLand .