parses a string with a mathematical expression.
More...
List of all members.
Detailed Description
parses a string with a mathematical expression.
The expression can consist of constants, variables, operators and standard mathematical functions. A constant can be any number like 3, -5, 3e-5, or pi. Everything that does not start with a digit and is not an operator is treated as a variable. An operator can be either:
+, -, *, /, ^, >, <, <=, >=, ==, !=, &&, ||, cond ? true stat : false stat, or |abs|
A mathematical function can be either:
sin(), cos(), tan(), ln(), log(), exp() or sqrt().
If the parser returns null, it couldn't parse the expression. Then, errmsg_ should contain info.
Constructor & Destructor Documentation
| MathExpressionParser::MathExpressionParser |
( |
const char * |
str = 0 |
) |
[inline] |
Member Function Documentation
| static int MathExpressionParser::constIdxOf |
( |
const char * |
|
) |
[static] |
| const char* MathExpressionParser::errMsg |
( |
|
) |
const [inline] |
| MathExpression* MathExpressionParser::parse |
( |
const char * |
|
) |
const [protected] |
| void MathExpressionParser::setInput |
( |
const char * |
s |
) |
[inline] |
| static BufferString MathExpressionParser::varNameOf |
( |
const char * |
fullvarnm, |
|
|
int * |
shift = 0 | |
|
) |
| | [static] |
Member Data Documentation