Dec 232017
This unit implements a simple arihmetic evaluation function to decode.
File TPPARSE.ZIP from The Programmer’s Corner in
Category Pascal Source Code
This unit implements a simple arihmetic evaluation function to decode.
File Name File Size Zip Size Zip Type
CRUNCHIT.EXE 10576 6283 deflated
CRUNCHIT.PAS 479 269 deflated
EVALU8.DOC 1441 777 deflated
EVALU8.PAS 8672 2814 deflated
TESTEVAL.PAS 268 195 deflated

Download File TPPARSE.ZIP Here

Contents of the EVALU8.DOC file

Public Domain 1990 David G. Edwards

If anyone improves this (and believe me, it can use improvement), I would
be grateful to have a copy. My address is:
David G. Edwards
Route 2 Box 3280
Nicholson, GA 30565
(404) 549-6912

Fido: 1:370/60.5

You should get
EVALU8.TPU for TP 5.5
TESTEVAL.PAS which should return PI
CRUNCHIT.PAS to evaluate arithmetic functions from the DOS command line

Here's the basics:

unit Evalu8;

Language : Turbo Pascal 5.5
Programmer: David G. Edwards, Athens (GA) Software, Inc.
Date : Dec. 17, 1989

Purpose : The unit contains a function to accept an input string
containing an arithmetic expression and return a real number.

Summary : Modified from the March, 1989 Computer Language article "The
nuts and bolts of compiler construction" by Jack W. Crenshaw.

Restrictions: There is very little error checking. Watch the heap if the
function aborts with a non-fatal error. A couple of the
procs use the TP 'exit' procedure to jump out of a proc.

Modifications: 07/12/90 changed declaration from
function Evaluate(RawString:string) : real; to allow for
somewhat better error detection.


function Evaluate(RawString:string; var result : real) : boolean;

see Evalu8.Pas for the rest of it.

 December 23, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>