Wanted: Expression Evaluator
Charles Hannum
CMH117 at psuvm.psu.edu
Thu Feb 22 15:41:31 AEST 1990
>In article <4365 at jarthur.Claremont.EDU> ssdken at jarthur.Claremont.EDU (Ken
>Nelson) writes:
>>Hi:
>>
>> I need the C source for an expression evaluator. Something that can
>> understand things like this:
>>
>> A/B*LOG(D)
>>
>>
>> The evaluator would get A B and D from a symbol table, evaluate the
>> expression and return the result.
>>
>> Anybody have such a beast????
I have an O(n) parser that I think will do what you want. It uses a stack-
based algorithm which I invented and later discovered that I was not the first
to do so ... <sigh>
Virtually,
- Charles Martin Hannum II "Klein bottle for sale ... inquire within."
(That's Charles to you!) "To life immortal!"
cmh117 at psuvm.{bitnet,psu.edu} "No noozzzz izzz netzzzsnoozzzzz..."
c9h at psuecl.{bitnet,psu.edu} "Mem'ry, all alone in the moonlight ..."
More information about the Comp.lang.c
mailing list