Mathematic Expression Parser
These are C codes for parsing any expression. For more
detail, please look at the comment in the codes. The
first version, express1.c, contains only a few functionality.
The second version includes many mathematical functions.
Since there is a request for PASCAL, the PASCAL versions for
express1 has been added.
- Name: Mathematic Expression Parser
- Last Updated: 10 April 1995
- Platform: Standard ANSI C or PASCAL
- Source Code:
- For More Information: Contact
Kittiphan Techakittiroj
- Remark:
- Adding variable support can be done by
doing the same way as I did for the "PI" value
in "express2.c". You should have an array to
keep the value of your variables.
- Update:
- 11 May 1998, Post the PASCAL version of "express2.c".
"express2.p" is modified by
Dmitry Dyachenko
- 14 Feb 1998, Add the ability in "express2.c" to accept
commas in numbers, e.g. "1,000"
- 27 May 1997, Fix the bug when the expression is "2-2-2"
- 17 May 1997, Get rid of the extra condtions in the example
(function main)
- 30 January 1997, Fix the bug in the unary '+' reported
by robin@cybercomm.nl