Article View: comp.lang.pascal.misc
Article #26Re: Writing an expression evaluator
From: G. C. Straty
Date: Sat, 17 Feb 1996 00:00
Date: Sat, 17 Feb 1996 00:00
20 lines
1547 bytes
1547 bytes
Aristotle wrote: > > Does anyone have any tips on how to go about writing an expression > evaluator(one complex enough to handle Trig. functions). I am writing a > program that uses expression and I would like to have the user be able to > enter their own expressions and have my program implement them. Any help > would be appreciated. Thanks in advance! > > John M. "Aristotle" De Cristofaro Borland Pascal-3 (if you can remember that far back) included source code for what they called MicroCalc, sample code for a basic spread sheet. In that code was a reasonably good function interpreter and evaluator which I have used often with good results. It will handle fairly complicated expressions as long as parens are not to deep. In digging through my stack of old 5.25 DDs I found I still have it. If you are interested, I would be happy to make it available to you. straty@bldrdoc.gov
Technical Details
Message-ID:
<31251AAF.2D0B@harrier.bldrdoc.gov>Path:
arc1-ca.pugleaf.net!central.bldrdoc.gov!newsReferences:
<311FEBD8.7305@cnj.digex.net>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!central.bldrdoc.gov!news From: "G. C. Straty" <straty@harrier.bldrdoc.gov> Newsgroups: comp.lang.pascal.misc,comp.lang.pascal.borland,comp.programming,comp.lang.misc,comp.lang.c,comp.lang.c++ Subject: Re: Writing an expression evaluator Date: Fri, 16 Feb 1996 17:00:47 -0700 Organization: NIST Message-ID: <31251AAF.2D0B@harrier.bldrdoc.gov> References: <311FEBD8.7305@cnj.digex.net> NNTP-Posting-Host: harrier.bldrdoc.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.0b6b (Win16; I) CC: straty@bldrdoc.gov