Page 1 of 1

Parser

Posted: Fri Aug 07, 2009 11:12 am
by ConvertFromOldNGs
by JADE News Administrator >> Thu, 29 Oct 1998 1:11:20 GMT

I'm writing an application in which I want to store a formula (as a string), and calculate the result when required. Has anyone out there worked on writing a parser to do this kind of thing please ?

--
Darrell Duniam
dduniam@cardinal.co.nz

Re: Parser

Posted: Fri Aug 07, 2009 11:12 am
by ConvertFromOldNGs
by JADE News Administrator >> Thu, 29 Oct 1998 1:11:45 GMT

In case anyone's interested, I've now written a parser to calculate equations, which also handles precedence parentheses. I'm still working on an interpreter for mathematical functions (and rapidly ageing in the process).
--
Darrell Duniam
dduniam@cardinal.co.nz

Re: Parser

Posted: Fri Aug 07, 2009 11:12 am
by ConvertFromOldNGs
by JADE News Administrator >> Thu, 29 Oct 1998 1:12:17 GMT
In case anyone's interested, I've now written a parser to calculate equations, which also handles precedence parentheses. I'm still working on an interpreter for mathematical functions (and rapidly ageing in the process).
--


Darrell,

It seems a pity that you had to do this given that JADE laready has a perfectly good compiler and interpreter. As you know the JADE development environment (a runtime application which is written in JADE) can compile and execute JADE methods on the fly. It wouldn't be such a large step to make this capability available to users. If you can express the formulas in JADE syntax then using the JADE compiler/interpreter would be an ideal approach.
Anyway, perhaps rolling your own will provide a useful learning experience :)


What was that stuff about code reuse again?