From: Simon Strandgaard Date: 2005-03-17T17:27:17+09:00 Subject: Re: tree transformation insight required On Wed, 9 Mar 2005 19:00:46 +0900, Luke Graham wrote: [snip] > Can anyone suggest a good way to get the c++-producing code out > of recurse and into some sort of template language, or into functions > that get passed into simplified recurse? I figured those functions > would need to return functions (usually themselves) to simulate > some state changes, ala... [snip] I have had good results with visitor design pattern and interpreter design pattern. For instance have a look at the bottom most class in this file http://rubyforge.org/cgi-bin/viewcvs.cgi/projects/regexp_engine/source/scanner_nodes.rb?rev=1.22&cvsroot=aeditor&content-type=text/vnd.viewcvs-markup -- Simon Strandgaard