OpendTect
6.6
|
Parses a string with a mathematical expression. More...
Public Member Functions | |
ExpressionParser (const char *str=0, bool inputsareseries=true) | |
const char * | errMsg () const |
bool | foundOldAbs () const |
Expression * | parse () const |
void | setInput (const char *s) |
Static Public Member Functions | |
static int | constIdxOf (const char *) |
static BufferString | varNameOf (const char *fullvarnm, int *shift=0) |
static Expression::VarType | varTypeOf (const char *) |
Protected Member Functions | |
bool | findAndOrOr (char *, int, Expression *&) const |
bool | findInequality (char *, int, Expression *&) const |
bool | findMathFunction (BufferString &, int, Expression *&) const |
bool | findOtherOper (BufferString &, int, Expression *&) const |
bool | findOuterAbs (char *, int, Expression *&) const |
bool | findOuterParens (char *, int, Expression *&) const |
bool | findPlusAndMinus (char *, int, Expression *&) const |
bool | findQMarkOper (char *, int, Expression *&) const |
bool | findStatsFunction (BufferString &, int, Expression *&) const |
bool | findVariable (char *, int, Expression *&) const |
Expression * | parse (const char *) const |
Protected Attributes | |
bool | abswarn_ |
BufferString | errmsg_ |
BufferString | inp_ |
const bool | inputsareseries_ |
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.
|
inline |
|
static |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
Expression* Math::ExpressionParser::parse | ( | ) | const |
|
protected |
|
inline |
|
static |
|
static |
|
mutableprotected |
|
mutableprotected |
|
protected |
|
protected |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2022