Re: Best practices for recusive type parsing

[email protected] (Collin Peters) Mon, 10 Nov 2003 10:04:30 -0800
Newsgroups perl.recdescent
Message-ID <[email protected]>
Randal L. Schwartz wrote:
>>>>>>"Collin" == Collin Peters <[email protected]> writes:
> Collin> ! winarea = (winwidth * winheight)/144
> 

> 
> This design is highly assymetrical.  You probably want something more like:
> 
> <evaluate op="/">
>   <evaluate op="*">
>     <variable name="winwidth"/>
>     <variable name="winheight"/>
>   </evaluate>
>   <number value="144"/>
> </evaluate>
> 
> Then every variable is always "variable", evry number is "number"
> every operator is always "evaluate", and it's the attributes to
> distinguish them.  That's much more XML-ish.
> 

What about the case of 'winwidth * winheight / winoper'?  That method 
wouldn't work with having more than one operator.  This is one of the 
reasons this is such a pain as there are SO many different options and 
ways it can be written.  Thanks for the advice, any other ideas are 
appreciated.

Collin