From: Clifford Heath Date: 2005-04-29T19:29:30+09:00 Subject: Re: Announcing Reg 0.4.0 Good achievement! vikkous wrote: > Lexers, parsers, and pattern matching languages get too short a shrift > in my opinion. You're right. As I said in a recent discussion, I think it's because the people of a sufficient theoretical bent to create the tools don't seem to be able to make them usable:-). Talking about substitutions, made me wonder whether you were familiar with Txl (Tree Transformation Language). When you come to doing substitutions, read up on BURGs (Bottom Up Rewriting Grammars) if you aren't already familiar with them. They're how optimising compilers choose an optimal sequence of code to emit. They basically match leaf portions of an expression tree, and for each match, accumulate the cost of the instructions that need to be emitted to allow that sub-tree to be simplified. Within reason, all possible paths are explored that allow the tree to be rewritten to the empty tree, by emitting the optimal instruction sequence. It'd be excellent if reg could deal with the kind of ambiguity this entails, choosing a minimum-cost resolution. Clifford Heath.