C++ implementation of opaque C type VuoMathExpressionParser.
Definition at line 272 of file VuoMathExpressionParser.cc.
Public Member Functions | |
VuoMathExpressionParserInternal (const string &expression, const vector< string > &outputVariableNames_=vector< string >()) | |
Parses the mathematical expression(s) (e.g. More... | |
Static Public Member Functions | |
static double * | addVariable (const char *variable, void *userData) |
Callback needed by mu::Parser to parse each variable. More... | |
static string | getExpressionSeparator (void) |
Returns the token that separates expressions when multiple of them appear in a string (e.g. More... | |
Public Attributes | |
mu::Parser | muParser |
Does most of the actual parsing work. More... | |
size_t | variableCount |
Number of variables parsed. More... | |
double | variableValues [MAX_VARIABLE_COUNT] |
Storage for variables parsed, used to hold values for calculations. More... | |
map< string, size_t > | variableNamesAndIndices |
A mapping of variable names to indices in variableValues . More... | |
vector< string > | inputVariableNames |
The unique input variable names parsed, in alphabetical order. More... | |
vector< string > | outputVariableNames |
The output variable name for each expression parsed, in the order the expressions were given. More... | |
|
inline |
Parses the mathematical expression(s) (e.g.
"a + b" or "y = x + 1" or "sum=n1+n2,product=n1*n2").
If outputVariableNames_ is given, assigns unique output variable names for any empty elements.
mu::ParserError | expression contains a syntax error. |
Definition at line 306 of file VuoMathExpressionParser.cc.
|
inlinestatic |
Callback needed by mu::Parser to parse each variable.
Definition at line 285 of file VuoMathExpressionParser.cc.
|
inlinestatic |
Returns the token that separates expressions when multiple of them appear in a string (e.g.
",").
Definition at line 355 of file VuoMathExpressionParser.cc.
vector<string> VuoMathExpressionParserInternal::inputVariableNames |
The unique input variable names parsed, in alphabetical order.
Definition at line 279 of file VuoMathExpressionParser.cc.
mu::Parser VuoMathExpressionParserInternal::muParser |
Does most of the actual parsing work.
Definition at line 275 of file VuoMathExpressionParser.cc.
vector<string> VuoMathExpressionParserInternal::outputVariableNames |
The output variable name for each expression parsed, in the order the expressions were given.
Definition at line 280 of file VuoMathExpressionParser.cc.
size_t VuoMathExpressionParserInternal::variableCount |
Number of variables parsed.
Definition at line 276 of file VuoMathExpressionParser.cc.
map<string, size_t> VuoMathExpressionParserInternal::variableNamesAndIndices |
A mapping of variable names to indices in variableValues
.
Definition at line 278 of file VuoMathExpressionParser.cc.
double VuoMathExpressionParserInternal::variableValues[MAX_VARIABLE_COUNT] |
Storage for variables parsed, used to hold values for calculations.
Definition at line 277 of file VuoMathExpressionParser.cc.