TODO. More...
#include <muParserScript.h>
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 muParserScript * | current = 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 |
TODO.
| muParserScript::muParserScript | ( | ScriptingEnv * | env, | |
| const QString & | code, | |||
| QObject * | context = 0, |
|||
| const QString & | name = "<input>" | |||
| ) |
| 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] |
References Table::avg(), col(), Table::colNames(), Script::Context, and rvariables.
Referenced by mu_avg().
| double muParserScript::cell | ( | int | row, | |
| int | col | |||
| ) | [private] |
References Matrix::cell(), Script::Context, matrix(), Matrix::numCols(), Matrix::numRows(), and Matrix::text().
Referenced by mu_cell().
| int muParserScript::codeLines | ( | ) | [inline, slot] |
References muCode.
Referenced by Matrix::canCalculate(), Table::extractData(), MatrixData::MatrixData(), Table::muParserCalculate(), MatrixModel::muParserCalculate(), and MatrixData::value().
| double muParserScript::col | ( | const QString & | arg | ) | [private] |
References Table::cell(), Table::colNames(), Script::Context, Table::numCols(), Table::numRows(), rparser, rvariables, Table::text(), and variables.
| 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(), muCode, and parser.
Referenced by Matrix::canCalculate(), eval(), exec(), Table::extractData(), MatrixData::MatrixData(), Table::muParserCalculate(), and MatrixModel::muParserCalculate().
| QString muParserScript::compileColArg | ( | const QString & | in | ) | [static, private] |
Referenced by compile().
| double * muParserScript::defineVariable | ( | const char * | name, | |
| double | val = 0.0 | |||
| ) | [slot] |
References Script::emit_error(), parser, rparser, and variables.
Referenced by Matrix::canCalculate(), Table::extractData(), MatrixData::MatrixData(), Table::muParserCalculate(), and MatrixModel::muParserCalculate().
| QVariant muParserScript::eval | ( | ) | [virtual, slot] |
Evaluate the Code, returning QVariant() on an error / exception.
Reimplemented from Script.
References compile(), Script::compiled, current, Script::emit_error(), Script::isCompiled, muCode, and parser.
Referenced by Matrix::canCalculate(), Table::extractData(), MatrixData::MatrixData(), Table::muParserCalculate(), MatrixModel::muParserCalculate(), and MatrixData::value().
| double muParserScript::evalSingleLine | ( | ) | [slot] |
References parser.
Referenced by Matrix::canCalculate(), Table::extractData(), MatrixData::MatrixData(), MatrixModel::muParserCalculate(), and MatrixData::value().
| 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] |
References col(), Table::colNames(), Script::Context, Table::max(), and rvariables.
Referenced by mu_max().
| double muParserScript::min | ( | const QString & | arg, | |
| int | start = 0, |
|||
| int | end = -1 | |||
| ) | [private] |
References col(), Table::colNames(), Script::Context, Table::min(), and rvariables.
Referenced by mu_min().
| 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, | |
| void * | ||||
| ) | [inline, static, private] |
References addVariableR(), and current.
| static double* muParserScript::mu_addVariableR | ( | const char * | name | ) | [inline, static, private] |
References addVariableR(), and current.
Referenced by muParserScript().
| 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] |
| 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] |
References col(), Table::colNames(), Script::Context, rvariables, and Table::sum().
Referenced by mu_sum().
| double muParserScript::tableCell | ( | int | col, | |
| int | row | |||
| ) | [private] |
References Table::cell(), Script::Context, Table::numCols(), Table::numRows(), and Table::text().
Referenced by mu_tableCell().
| double muParserScript::tablecol | ( | const QString & | arg | ) | [private] |
References Table::cell(), Table::colNames(), Script::Context, MdiSubWindow::folder(), MdiSubWindow::name(), Table::numCols(), Table::numRows(), Folder::rootFolder(), rparser, rvariables, Folder::table(), Table::text(), and variables.
Referenced by mu_tablecol().
muParserScript * muParserScript::current = NULL [static] |
Referenced by compile(), eval(), exec(), mu_addVariable(), mu_addVariableR(), mu_avg(), mu_cell(), mu_col(), mu_max(), mu_min(), mu_sum(), mu_tableCell(), and mu_tablecol().
QStringList muParserScript::muCode [private] |
Referenced by codeLines(), compile(), eval(), and exec().
MyParser muParserScript::parser [private] |
Referenced by compile(), defineVariable(), eval(), evalSingleLine(), evalSingleLineToString(), exec(), muParserScript(), and setDouble().
MyParser muParserScript::rparser [private] |
Referenced by addVariable(), col(), defineVariable(), muParserScript(), setDouble(), and tablecol().
Q3AsciiDict<double> muParserScript::rvariables [private] |
Referenced by addVariableR(), avg(), col(), max(), min(), muParserScript(), sum(), and tablecol().
Q3AsciiDict<double> muParserScript::variables [private] |
Referenced by addVariable(), col(), defineVariable(), muParserScript(), setDouble(), and tablecol().
1.7.1