e-Picture

Be Developers:
Put your banner here!



Expression Parser with Variables

(Libraries)

Version: 1.2.3
By: Dr. Ian Ollmann
E-mail: iano@cco.caltech.edu
Web page: Available
Release Date: Available Now
Info Last Modified: 3/14/99
Requires BeOS version: R3 PPC, R4 PPC
License: Freeware
Cost: 0
Source Available?: Yes

R3-PPC Download (107 kb)
R4-PPC Download (107 kb)



Description:

        This library and stand alone test app can parse numerical 
expressions or functions such as "sqrt( sin( 1.2e-3) - 2*y)", 
containing variables with arbitrary names. It is written with function 
plotters, spreadsheets and curve fitters in mind -- programs which 
need to very quickly evaluate the same function many times, changing 
the values of variables inbetween. 
 
      The following operators and functions are supported: +, -, *, 
/, %, ^ (power), &&, ||, !, &, |, !& (XOR), ~, -(unary), >, <, ==, >=, 
<=, sin(), cos(), tan(), sec(), csc(), cot(), asin(), acos(), atan(), 
asec(), acsc(), acot(), sinh(), cosh(), tanh(), sech(), csch(), 
coth(), exp(), ln(), log(), abs(), sqrt(), ceil(), floor() and rand(). 
 
   New Features as of version 1.2 include symbolic math operations via 
common C syntax, stack allocation, better expression simplification 
and support for predefined numerical constants such as "pi" and "e". 
The parser can also take derivatives -- Why laboriously calculate 
derivatives with numerical methods when you can do it symbolically and 
then evaluate the expression thousands of times for different 
variables with little additional overhead! 
 
    Version 1.2.1 adds a few bug fixes and fleshes out the symbolic math 
capabilities. Version 1.2.2 adds ceil() and floor() to the library of 
standard function types, corrected documentation, 
links to other parser libraries, direct Expression construction 
from '\0' terminated char[], and an Expression::GetVariableValue() 
method. Version 1.2.3 fixes a number of exception related memory leaks and 
adds a few small tweaks to the test app.
 
        As always, x86 users should be wary of possible endian-ness bugs. 
I lack the hardware to test the code on x86 processors.


If you have any questions about the information provided for a specific application, please e-mail the author. If you have any questions about the BeWare pages themselves, though, feel free to e-mail webmaster@be.com.

Copyright © 1999 by Be, Inc. All rights reserved. Legal information (includes icon usage info).
Comments, questions, or confessions about our site? Please write the Webmaster.