QtiPlot  0.9.8.2
Public Slots | Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
muParserScript Class Reference

TODO. More...

#include <muParserScript.h>

Inheritance diagram for muParserScript:
Script

Public Slots

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

Public Member Functions

 muParserScript (ScriptingEnv *env, const QString &code, QObject *context=0, const QString &name="<input>")
 
- Public Member Functions inherited from Script
virtual void addCode (const QString &code)
 Append to the code that will be executed when calling exec() or eval() More...
 
const QString code () const
 Return the code that will be executed when calling exec() or eval() More...
 
QObject * context () const
 Return the context in which the code is to be executed. More...
 
bool emitErrors () const
 Return whether errors / exceptions are to be emitted or silently ignored. More...
 
const QString name () const
 Like QObject::name, but with unicode support. More...
 
 Script (ScriptingEnv *env, const QString &code, QObject *context=0, const QString &name="<input>")
 
ScriptingEnvscriptingEnv ()
 
virtual void setCode (const QString &code)
 Set the code that will be executed when calling exec() or eval() More...
 
virtual void setContext (QObject *context)
 Set the context in which the code is to be executed. More...
 
void setEmitErrors (bool yes)
 Set whether errors / exceptions are to be emitted or silently ignored. More...
 
void setName (const QString &name)
 Like QObject::setName, but with unicode support. More...
 
 ~Script ()
 

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
 

Additional Inherited Members

- Signals inherited from Script
void codeChanged ()
 This is emitted whenever the code to be executed by exec() and eval() is changed. More...
 
void error (const QString &message, const QString &scriptName, int lineNumber)
 signal an error condition / exception More...
 
void print (const QString &output)
 output generated by the code More...
 
- Protected Types inherited from Script
enum  compileStatus { notCompiled, isCompiled, compileErr }
 
- Protected Member Functions inherited from Script
void emit_error (const QString &message, int lineNumber)
 
- Protected Attributes inherited from Script
QString Code
 
enum Script::compileStatus compiled
 
QObject * Context
 
bool EmitErrors
 
ScriptingEnvEnv
 
QString Name
 

Detailed Description

TODO.

Constructor & Destructor Documentation

◆ muParserScript()

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

Member Function Documentation

◆ addVariable()

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

References rparser, and variables.

Referenced by codeLines(), and mu_addVariable().

◆ addVariableR()

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

References rvariables.

Referenced by codeLines(), and mu_addVariableR().

◆ avg()

double muParserScript::avg ( const QString &  arg,
int  start = 0,
int  end = -1 
)
private

◆ cell()

double muParserScript::cell ( int  row,
int  col 
)
private

◆ codeLines

int muParserScript::codeLines ( )
inlineslot

◆ col()

double muParserScript::col ( const QString &  arg)
private

◆ compile

bool muParserScript::compile ( bool  asFunction = true)
slot

◆ compileColArg()

QString muParserScript::compileColArg ( const QString &  in)
staticprivate

Referenced by compile(), and mu_addVariableR().

◆ defineVariable

double * muParserScript::defineVariable ( const char *  name,
double  val = 0.0 
)
slot

◆ eval

QVariant muParserScript::eval ( )
slot

◆ evalSingleLine

double muParserScript::evalSingleLine ( )
slot

◆ evalSingleLineToString

QString muParserScript::evalSingleLineToString ( const QLocale &  locale,
char  f,
int  prec 
)
slot

References parser.

Referenced by Table::muParserCalculate().

◆ exec

bool muParserScript::exec ( )
slot

◆ max()

double muParserScript::max ( const QString &  arg,
int  start = 0,
int  end = -1 
)
private

◆ min()

double muParserScript::min ( const QString &  arg,
int  start = 0,
int  end = -1 
)
private

◆ mu_addVariable()

static double* muParserScript::mu_addVariable ( const char *  name,
void *   
)
inlinestaticprivate

References addVariable(), and current.

Referenced by muParserScript().

◆ mu_addVariableR() [1/2]

static double* muParserScript::mu_addVariableR ( const char *  name)
inlinestaticprivate

References addVariableR(), and current.

Referenced by muParserScript().

◆ mu_addVariableR() [2/2]

static double* muParserScript::mu_addVariableR ( const char *  name,
void *   
)
inlinestaticprivate

◆ mu_avg()

static double muParserScript::mu_avg ( const char *  arg,
double  start = 1,
double  end = -1 
)
inlinestaticprivate

References avg(), and current.

Referenced by muParserScript().

◆ mu_cell()

static double muParserScript::mu_cell ( double  row,
double  col 
)
inlinestaticprivate

References cell(), and current.

Referenced by muParserScript().

◆ mu_col()

static double muParserScript::mu_col ( const char *  arg)
inlinestaticprivate

References col(), and current.

Referenced by muParserScript().

◆ mu_max()

static double muParserScript::mu_max ( const char *  arg,
double  start = 1,
double  end = -1 
)
inlinestaticprivate

References current, and max().

Referenced by muParserScript().

◆ mu_min()

static double muParserScript::mu_min ( const char *  arg,
double  start = 1,
double  end = -1 
)
inlinestaticprivate

References current, and min().

Referenced by muParserScript().

◆ mu_sum()

static double muParserScript::mu_sum ( const char *  arg,
double  start = 1,
double  end = -1 
)
inlinestaticprivate

References current, and sum().

Referenced by muParserScript().

◆ mu_tableCell()

static double muParserScript::mu_tableCell ( double  col,
double  row 
)
inlinestaticprivate

References current, and tableCell().

Referenced by muParserScript().

◆ mu_tablecol()

static double muParserScript::mu_tablecol ( const char *  arg)
inlinestaticprivate

References current, and tablecol().

Referenced by muParserScript().

◆ setDouble

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

◆ setInt

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

References setDouble().

◆ setQObject

bool muParserScript::setQObject ( QObject *  val,
const char *  name 
)
slot

◆ sum()

double muParserScript::sum ( const QString &  arg,
int  start = 0,
int  end = -1 
)
private

◆ tableCell()

double muParserScript::tableCell ( int  col,
int  row 
)
private

◆ tablecol()

double muParserScript::tablecol ( const QString &  arg)
private

Member Data Documentation

◆ current

muParserScript * muParserScript::current = NULL
static

◆ muCode

QStringList muParserScript::muCode
private

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

◆ parser

MyParser muParserScript::parser
private

◆ rparser

MyParser muParserScript::rparser
private

◆ rvariables

Q3AsciiDict<double> muParserScript::rvariables
private

◆ variables

Q3AsciiDict<double> muParserScript::variables
private

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