Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 1 (modified by rgrieder, 16 years ago) (diff)

TracNav(TracNav/TOC_Development)?

Expression Parser

This function can parse any string containing a mathematical expression like "2 * (34+1)/2 *sin(pi*3)/cosh(7)".
Usage: Pass a std::string to the constructor and the ExprParser will parse an expression that equals one number. That means that "3 4" will yield 3. Then you can use the following query functions:

getRemains() Returns the rest of the string that did get parsed
getResult() Query the result of the parsing
getSuccess() Tells whether any number could be retrieved at all