Antiprism 0.23
Public Member Functions

mu::ParserCallback Class Reference

Encapsulation of prototypes for a numerical parser function. More...

#include <muParserCallback.h>

List of all members.

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.
ParserCallbackClone () 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.

Detailed Description

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.

Author:
(C) 2004-2011 Ingo Berg

Constructor & Destructor Documentation

mu::ParserCallback::ParserCallback ( fun_type0  a_pFun,
bool  a_bAllowOpti 
)

Constructor for constructing funcstion callbacks taking two arguments.

Exceptions:
nothrow
mu::ParserCallback::ParserCallback ( fun_type2  a_pFun,
bool  a_bAllowOpti,
int  a_iPrec,
EOprtAssociativity  a_eOprtAsct 
)

Constructor for constructing binary operator callbacks.

Parameters:
a_pFunPointer to a static function taking two arguments
a_bAllowOptiA flag indicating this funcation can be optimized
a_iPrecThe operator precedence
a_eOprtAsctThe operators associativity
Exceptions:
nothrow
mu::ParserCallback::ParserCallback ( )

Default constructor.

Exceptions:
nothrow
mu::ParserCallback::ParserCallback ( const ParserCallback ref)

Copy constructor.

Exceptions:
nothrow

Member Function Documentation

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.

Exceptions:
nothrow
Returns:
#pFun
EOprtAssociativity mu::ParserCallback::GetAssociativity ( ) const

Return the operators associativity.

Exceptions:
nothrownOnly valid if the callback token is a binary operator token.
int mu::ParserCallback::GetPri ( ) const

Return the operator precedence.

Exceptions:
nothrownOnly 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.

Exceptions:
nothrow

The documentation for this class was generated from the following files: