Antiprism 0.23
|
Encapsulation of prototypes for a numerical parser function. More...
#include <muParserCallback.h>
Public Member Functions | |
ParserCallback (fun_type0 a_pFun, bool a_bAllowOpti) | |
Constructor for constructing funcstion callbacks taking two arguments. | |
ParserCallback (fun_type2 a_pFun, bool a_bAllowOpti, int a_iPrec, EOprtAssociativity a_eAssociativity) | |
Constructor for constructing binary operator callbacks. | |
ParserCallback () | |
Default constructor. | |
ParserCallback (const ParserCallback &a_Fun) | |
Copy constructor. | |
ParserCallback * | Clone () const |
Clone this instance and return a pointer to the new instance. | |
bool | IsOptimizable () const |
Return tru if the function is conservative. | |
void * | GetAddr () const |
Get the callback address for the parser function. | |
ECmdCode | GetCode () const |
Return the callback code. | |
int | GetPri () const |
Return the operator precedence. | |
EOprtAssociativity | GetAssociativity () const |
Return the operators associativity. | |
int | GetArgc () const |
Returns the number of function Arguments. |
Encapsulation of prototypes for a numerical parser function.
Encapsulates the prototyp for numerical parser functions. The class stores the number of arguments for parser functions as well as additional flags indication the function is non optimizeable. The pointer to the callback function pointer is stored as void* and needs to be casted according to the argument count. Negative argument counts indicate a parser function with a variable number of arguments.
mu::ParserCallback::ParserCallback | ( | fun_type0 | a_pFun, |
bool | a_bAllowOpti | ||
) |
Constructor for constructing funcstion callbacks taking two arguments.
nothrow |
mu::ParserCallback::ParserCallback | ( | fun_type2 | a_pFun, |
bool | a_bAllowOpti, | ||
int | a_iPrec, | ||
EOprtAssociativity | a_eOprtAsct | ||
) |
Constructor for constructing binary operator callbacks.
a_pFun | Pointer to a static function taking two arguments |
a_bAllowOpti | A flag indicating this funcation can be optimized |
a_iPrec | The operator precedence |
a_eOprtAsct | The operators associativity |
nothrow |
mu::ParserCallback::ParserCallback | ( | ) |
Default constructor.
nothrow |
mu::ParserCallback::ParserCallback | ( | const ParserCallback & | ref | ) |
Copy constructor.
nothrow |
void * mu::ParserCallback::GetAddr | ( | ) | const |
Get the callback address for the parser function.
The type of the address is void. It needs to be recasted according to the argument number to the right type.
nothrow |
EOprtAssociativity mu::ParserCallback::GetAssociativity | ( | ) | const |
Return the operators associativity.
nothrown | Only valid if the callback token is a binary operator token. |
int mu::ParserCallback::GetPri | ( | ) | const |
Return the operator precedence.
nothrown | Only valid if the callback token is an operator token (binary or infix). |
bool mu::ParserCallback::IsOptimizable | ( | ) | const |
Return tru if the function is conservative.
Conservative functions return always the same result for the same argument.
nothrow |