muparser - Fast Math Parser Library
Version 2.2.3
beltoforion.de
beltoforion.de
google code project page
muparser
at google code
Advertisement
Open source initiative logo

Valid XHTML 1.0 Transitional

CSS ist valide!
Advertisement

Parser initialization / deinitialization

[DLL interface]

Create a new instance handle. You can create as many different instance handles as you like. Each will internally reference a different parser object. When using the DLL it is necessary to manually release any parser handle created by mupInit() by calling mupRelease(hParser).
muParserHandle_t hParser;
hParser = mupInit(); // Create a new handle

// use the parser...

mupRelease(hParser); // Release an existing parser handle
Internally a handle is nothing more than a pointer to a parser object casted to a void pointer.

[Parser class interface]

Code for creating a new parser object. (In case of dynamic allocation use new and delete for initialization and deinitialization.)
mu::Parser parser;

Setting the expression

[DLL interface]

Setting the expression when using the DLL requires a valid parser handle and a pointer to const char pointing to the expression.
mupSetExpr(hParser, szLine);
See also: example2/example2.c.

[Parser class interface]

Setting the expression using the parser class requires a std::string containing the expression as the only parameter.
parser.SetExpr(line);
See also: example1/example1.cpp; src/muParserTest.cpp.
Advertisement

© 2005-2014 Ingo Berg Impressum Datenschutzerklärung ^ TOP