A generic package that allows to manipulate very, very simple symbolic expressions
SymExpr is a generic Ada package that allows the manipulation of "symbolic expressions." The expressions can be obtained by parsing a string or by using the provided constructors, together with the provided operators.
This package was born one day that I wanted to allow the users of a program of mine to specify date constraints like "This activity will start two months before the end of this other one." After writing the code for handling such requirements, I noticed that with a little effort I could have it made a stand-alone package, so I did and SymExpr was born.
Expressions in have the usual form with the four operations (+, -, * and /), the two unary operators (+ and -), function calls, variables and parenthesis. The type of the values that enter in the expression is specified as parameter to the generic package, so you can have expressions of floats, of integers, but also of dates (my case), complexes, and so on... You can create expressions by parsing strings as X := Parse("
X := Variable("x");
Y := X*X - 2*X + 1;
Project information
- Maintainer:
- Riccardo Bernardini
- Driver:
- Riccardo Bernardini
- Licence:
- GNU LGPL v3
View full history Series and milestones
trunk series is the current focus of development.