Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!snorkelwacker!mit-eddie!rutgers!psuvax1!psuvm!cmh117 From: CMH117@psuvm.psu.edu (Charles Hannum) Newsgroups: comp.lang.c Subject: Re: Wanted: Expression Evaluator Message-ID: <90052.234131CMH117@psuvm.psu.edu> Date: 22 Feb 90 04:41:31 GMT References: <4365@jarthur.Claremont.EDU> <1990Feb19.012607.22402@ux1.cso.uiuc.edu> Organization: Penn State University Lines: 26 >In article <4365@jarthur.Claremont.EDU> ssdken@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 ... Virtually, - Charles Martin Hannum II "Klein bottle for sale ... inquire within." (That's Charles to you!) "To life immortal!" cmh117@psuvm.{bitnet,psu.edu} "No noozzzz izzz netzzzsnoozzzzz..." c9h@psuecl.{bitnet,psu.edu} "Mem'ry, all alone in the moonlight ..."