Best practices for recusive type parsing

[email protected] (Collin Peters) Mon, 03 Nov 2003 12:28:28 -0800
Newsgroups perl.recdescent
Message-ID <[email protected]>
I am using P::RD for parsing a constraint language in a big ERP system. 
  We are trying to parse some of the constraints into XML.  There are 
some equations in the constraints.  Below is a simple example.

! winarea = (winwidth * winheight)/144

This simply computes an area value of something by multiplying the width 
and height and then dividing by 144.  I would like the XML to look 
something like.

<evaluate>
	<evaluate>
		<start value="winwidth"/>
		<multiply value="winheight"/>
	</evaluate>
	<divideby value="144"/>
</evaluate>


The equation can look like anything, though.  For example:
6 + (x /y) * (5 + (a * 2)/2)

I have made something a little simpler using operatives such as leftop. 
  But I'm wondering what the standard practice is for doing order of 
operations type evaluations with parentheses.  Is there an operative to 
help with this?

Collin