libbbb  1.2.1
Groups common code used in some applications and libraries.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
bbb::RexEval Class Reference

Interpret mathematical expressions. More...

#include <rexeval.h>

Classes

struct  OpData
 structure describing an operator More...
 

Public Types

enum  Operation {
  OP_Invalid = -1, OP_Add, OP_Sub, OP_Mul,
  OP_IDiv, OP_Mod, OP_Div, OP_Pow,
  OP_Equ, OP_And, OP_Or, OP_Not,
  OP_Great, OP_Small, OP_GreatEqu, OP_SmallEqu,
  OP_OParantesis, OP_CParantesis, OP_Max
}
 lists all opperations that we know of
 
enum  Associativity { LeftAssoc, RightAssoc }
 types of associativity
 
typedef void(* kbOperand )(RexEval *ev)
 type of callback used with operands
 

Public Member Functions

 RexEval (const QString &s)
 
void setError (const QString &s)
 
bool isOperatorSymbol (QChar c) const
 
bool hasErrors (void) const
 
const QString & errorString (void) const
 
void addOperator (const QString &s)
 
void addOperand (const QString &s)
 
void compute ()
 
OperandTkoneDouble (RexEval *ev, double &d1)
 
OperandTktwoDoubles (RexEval *ev, double &d1, double &d2)
 
double resultDouble (void)
 
QString resultString (void)
 
bool resultBool (void)
 
void dumpChain (List2Dh *hdr)
 

Static Public Member Functions

static int cmpPrecedence (OperatorTk *op1, OperatorTk *op2)
 
static bool isAssociative (OperatorTk *op1, Associativity asoc)
 
static bool isOperator (BaseTk *btk)
 
static void opKbAdd (RexEval *ev)
 
static void opKbAnd (RexEval *ev)
 
static void opKbDiv (RexEval *ev)
 
static void opKbEqu (RexEval *ev)
 
static void opKbGreatEqu (RexEval *ev)
 
static void opKbGreat (RexEval *ev)
 
static void opKbIDiv (RexEval *ev)
 
static void opKbMod (RexEval *ev)
 
static void opKbMul (RexEval *ev)
 
static void opKbNot (RexEval *ev)
 
static void opKbOr (RexEval *ev)
 
static void opKbPow (RexEval *ev)
 
static void opKbSmallEqu (RexEval *ev)
 
static void opKbSmall (RexEval *ev)
 
static void opKbSub (RexEval *ev)
 

Detailed Description


The documentation for this class was generated from the following files: