QtiPlot  0.9.8.2
Public Slots | Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes
muParserScript Class Reference

TODO. More...

#include <muParserScript.h>

Inheritance diagram for muParserScript:
Script

List of all members.

Public Slots

int codeLines ()
bool compile (bool asFunction=true)
 Compile the Code. Return true if the implementation doesn't support compilation.
double * defineVariable (const char *name, double val=0.0)
QVariant eval ()
 Evaluate the Code, returning QVariant() on an error / exception.
double evalSingleLine ()
QString evalSingleLineToString (const QLocale &locale, char f, int prec)
bool exec ()
 Execute the Code, returning false on an error / exception.
bool setDouble (double val, const char *name)
bool setInt (int val, const char *name)
bool setQObject (QObject *val, const char *name)

Public Member Functions

 muParserScript (ScriptingEnv *env, const QString &code, QObject *context=0, const QString &name="<input>")

Static Public Attributes

static muParserScriptcurrent = NULL

Private Member Functions

double * addVariable (const char *name)
double * addVariableR (const char *name)
double avg (const QString &arg, int start=0, int end=-1)
double cell (int row, int col)
double col (const QString &arg)
double max (const QString &arg, int start=0, int end=-1)
double min (const QString &arg, int start=0, int end=-1)
double sum (const QString &arg, int start=0, int end=-1)
double tableCell (int col, int row)
double tablecol (const QString &arg)

Static Private Member Functions

static QString compileColArg (const QString &in)
static double * mu_addVariable (const char *name, void *)
static double * mu_addVariableR (const char *name)
static double * mu_addVariableR (const char *name, void *)
static double mu_avg (const char *arg, double start=1, double end=-1)
static double mu_cell (double row, double col)
static double mu_col (const char *arg)
static double mu_max (const char *arg, double start=1, double end=-1)
static double mu_min (const char *arg, double start=1, double end=-1)
static double mu_sum (const char *arg, double start=1, double end=-1)
static double mu_tableCell (double col, double row)
static double mu_tablecol (const char *arg)

Private Attributes

QStringList muCode
MyParser parser
MyParser rparser
Q3AsciiDict< double > rvariables
Q3AsciiDict< double > variables

Detailed Description

TODO.


Constructor & Destructor Documentation

muParserScript::muParserScript ( ScriptingEnv env,
const QString &  code,
QObject *  context = 0,
const QString &  name = "<input>" 
)

Member Function Documentation

double * muParserScript::addVariable ( const char *  name) [private]

References rparser, and variables.

Referenced by mu_addVariable().

double * muParserScript::addVariableR ( const char *  name) [private]

References rvariables.

Referenced by mu_addVariableR().

double muParserScript::avg ( const QString &  arg,
int  start = 0,
int  end = -1 
) [private]
double muParserScript::cell ( int  row,
int  col 
) [private]
int muParserScript::codeLines ( ) [inline, slot]
double muParserScript::col ( const QString &  arg) [private]
bool muParserScript::compile ( bool  for_eval = true) [virtual, slot]

Compile the Code. Return true if the implementation doesn't support compilation.

Reimplemented from Script.

References Script::Code, compileColArg(), Script::compiled, current, Script::emit_error(), Script::isCompiled, muCode, and parser.

Referenced by Matrix::canCalculate(), eval(), exec(), Table::extractData(), MatrixData::MatrixData(), MatrixModel::muParserCalculate(), and Table::muParserCalculate().

QString muParserScript::compileColArg ( const QString &  in) [static, private]

Referenced by compile().

double * muParserScript::defineVariable ( const char *  name,
double  val = 0.0 
) [slot]
QVariant muParserScript::eval ( ) [virtual, slot]
double muParserScript::evalSingleLine ( ) [slot]
QString muParserScript::evalSingleLineToString ( const QLocale &  locale,
char  f,
int  prec 
) [slot]

References parser.

Referenced by Table::muParserCalculate().

bool muParserScript::exec ( ) [virtual, slot]

Execute the Code, returning false on an error / exception.

Reimplemented from Script.

References compile(), Script::compiled, current, Script::emit_error(), Script::isCompiled, muCode, and parser.

double muParserScript::max ( const QString &  arg,
int  start = 0,
int  end = -1 
) [private]
double muParserScript::min ( const QString &  arg,
int  start = 0,
int  end = -1 
) [private]
static double* muParserScript::mu_addVariable ( const char *  name,
void *   
) [inline, static, private]

References addVariable(), and current.

Referenced by muParserScript().

static double* muParserScript::mu_addVariableR ( const char *  name) [inline, static, private]

References addVariableR(), and current.

Referenced by muParserScript().

static double* muParserScript::mu_addVariableR ( const char *  name,
void *   
) [inline, static, private]

References addVariableR(), and current.

static double muParserScript::mu_avg ( const char *  arg,
double  start = 1,
double  end = -1 
) [inline, static, private]

References avg(), and current.

Referenced by muParserScript().

static double muParserScript::mu_cell ( double  row,
double  col 
) [inline, static, private]

References cell(), and current.

Referenced by muParserScript().

static double muParserScript::mu_col ( const char *  arg) [inline, static, private]

References col(), and current.

Referenced by muParserScript().

static double muParserScript::mu_max ( const char *  arg,
double  start = 1,
double  end = -1 
) [inline, static, private]

References current, and max().

Referenced by muParserScript().

static double muParserScript::mu_min ( const char *  arg,
double  start = 1,
double  end = -1 
) [inline, static, private]

References current, and min().

Referenced by muParserScript().

static double muParserScript::mu_sum ( const char *  arg,
double  start = 1,
double  end = -1 
) [inline, static, private]

References current, and sum().

Referenced by muParserScript().

static double muParserScript::mu_tableCell ( double  col,
double  row 
) [inline, static, private]

References current, and tableCell().

Referenced by muParserScript().

static double muParserScript::mu_tablecol ( const char *  arg) [inline, static, private]

References current, and tablecol().

Referenced by muParserScript().

bool muParserScript::setDouble ( double  val,
const char *  name 
) [virtual, slot]

Reimplemented from Script.

References Script::emit_error(), Script::name(), parser, rparser, and variables.

Referenced by setInt().

bool muParserScript::setInt ( int  val,
const char *  name 
) [virtual, slot]

Reimplemented from Script.

References setDouble().

bool muParserScript::setQObject ( QObject *  val,
const char *  name 
) [slot]
double muParserScript::sum ( const QString &  arg,
int  start = 0,
int  end = -1 
) [private]
double muParserScript::tableCell ( int  col,
int  row 
) [private]
double muParserScript::tablecol ( const QString &  arg) [private]

Member Data Documentation

QStringList muParserScript::muCode [private]

Referenced by codeLines(), compile(), eval(), and exec().

Q3AsciiDict<double> muParserScript::rvariables [private]
Q3AsciiDict<double> muParserScript::variables [private]

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