Article View: comp.lang.pascal.misc
Article #52Re: Writing an expression evaluator
From: Tom Wheeley
Date: Fri, 16 Feb 1996 22:07
Date: Fri, 16 Feb 1996 22:07
26 lines
1595 bytes
1595 bytes
In article <4g19rq$288@inferno.mpx.com.au>
mjsmith@mpx.com.au "Malcolm Smith" writes:
>
> I have an expression evaluator written in C based on Polish notation.
>
> It was primarily designed for normal mathemtical functions such as
> add, subtract, multiply and divide. It does, however, manager
> brackets - using recursion.
>
That's cheating isn't it ? r.p.n is a doddle to code :)
If you are doing this in Pascal (First in your newsgroups line) then check
out SWAG, which has several infix parsers (how you write math. expressions
in your code).
SWAG is big though, but it is a superlative programming resource. It is
accessible from the clpb mini-FAQ (sorry, con't remember the swag url)
that FAQ is also on the Web at:
http://www.geocities.com/TimesSquare/2678/clpbfaq.html
--
* TQ 1.0 * The 'Just So Quotes'.
"Waiter, there's no fly in my soup!"
-- Kermit the frog
Technical Details
Message-ID:
<824508425snz@tsys.demon.co.uk>Path:
arc1-ca.pugleaf.net!mail2news.demon.co.uk!tsys.demon.co.ukReferences:
<311FEBD8.7305@cnj.digex.net> <4g19rq$288@inferno.mpx.com.au>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!tsys.demon.co.uk From: Tom Wheeley <tomw@tsys.demon.co.uk> 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 96 22:07:05 GMT Organization: City Zen FM Message-ID: <824508425snz@tsys.demon.co.uk> References: <311FEBD8.7305@cnj.digex.net> <4g19rq$288@inferno.mpx.com.au> Reply-To: tomw@tsys.demon.co.uk X-NNTP-Posting-Host: tsys.demon.co.uk X-Newsreader: Demon Internet Simple News v1.30 X-Sig-By: Tomsystems Quote v1.2. (c)1996 Tom Wheeley, tomw@tsys.demon.co.uk X-Mail2News-Path: tsys.demon.co.uk