muParserX
2.0.0
|
Namespace for mathematical applications. More...
Classes | |
class | ParserErrorMsg |
struct | ErrorContext |
Error context class. More... | |
class | ParserError |
Error class of the parser. More... | |
class | FunCmplxReal |
Parser callback object for returning the real part of a complex number. More... | |
class | FunCmplxImag |
Parser callback object for returning the imaginary part of a complex number. More... | |
class | FunCmplxConj |
Parser callback object for returning the complex conjugate of the complex number. More... | |
class | FunCmplxArg |
Parser callback object for returning the phase angle (or angular component) of a complex number, expressed in radians. More... | |
class | FunCmplxNorm |
Parser callback object for returning the norm value of the complex number phase angle. More... | |
class | FunCmplxCos |
class | FunCmplxSin |
class | FunCmplxCosH |
class | FunCmplxSinH |
class | FunCmplxTan |
class | FunCmplxTanH |
class | FunCmplxSqrt |
class | FunCmplxExp |
class | FunCmplxLn |
class | FunCmplxLog |
class | FunCmplxLog10 |
class | FunCmplxLog2 |
class | FunCmplxAbs |
class | FunCmplxPow |
class | FunParserID |
Parser function callback for determining the size of an array. More... | |
class | FunMax |
Determine maximal value from the parameter list. More... | |
class | FunMin |
Determine minimal value from the parameter list. More... | |
class | FunSum |
Parser callback for summing up all function arguments. More... | |
class | FunSizeOf |
Parser function callback for determining the size of an array. More... | |
class | FunMatrixOnes |
Parser callback object for creating matrices consisting entirely of ones. More... | |
class | FunMatrixZeros |
Parser callback object for creating matrices consisting entirely of zeros. More... | |
class | FunMatrixEye |
Parser callback object for creating unity matrices. More... | |
class | FunMatrixSize |
Determines the dimensions of a matrix. More... | |
class | FunSin |
class | FunCos |
class | FunTan |
class | FunASin |
class | FunACos |
class | FunATan |
class | FunSinH |
class | FunCosH |
class | FunTanH |
class | FunASinH |
class | FunACosH |
class | FunATanH |
class | FunLog |
class | FunLog10 |
class | FunLog2 |
class | FunLn |
class | FunSqrt |
class | FunCbrt |
class | FunExp |
class | FunAbs |
class | FunPow |
class | FunHypot |
class | FunAtan2 |
class | FunFmod |
class | FunRemainder |
class | FunStrLen |
Callback object for determining the length of a string. More... | |
class | FunStrToUpper |
Convert a string to upper case letters. <> More... | |
class | FunStrToLower |
Convert a string to lower case letters. More... | |
class | FunStrToDbl |
Parse string to a floating point value. <> More... | |
class | TokenPtr |
class | ICallback |
Interface for callback objects. More... | |
class | TokenIfThenElse |
A class for encapsulation if-then-else tokens. More... | |
class | IOprtBin |
Interface for binary operators. More... | |
class | IOprtPostfix |
Interface for unary postfix operators. More... | |
class | IOprtInfix |
Interface for unary infix operators. More... | |
class | IPackage |
class | IPrecedence |
Interface for binary and ternary operators. More... | |
class | IToken |
Generic token interface for expression tokens. More... | |
class | GenericToken |
Default token implentation. More... | |
class | IValueReader |
Interface for custom value reader objects. More... | |
class | IValue |
Interface to be implemented by all classes representing values. More... | |
class | OprtAssign |
Assignement operator. More... | |
class | OprtAssignAdd |
Assignement operator. More... | |
class | OprtAssignSub |
Assignement operator. More... | |
class | OprtAssignMul |
Assignement operator. More... | |
class | OprtAssignDiv |
Assignement operator. More... | |
class | OprtStrAdd |
class | OprtEQ |
Callback object for testing if two values are equal. More... | |
class | OprtNEQ |
Callback object for testing if two values are not equal. More... | |
class | OprtLT |
Callback object class for the "Less than" operator. More... | |
class | OprtGT |
Callback object class for the "Greater than" operator. More... | |
class | OprtLE |
Callback object class for the "Less or equal" operator. More... | |
class | OprtGE |
Callback object class for the "Greater or or equal" operator. More... | |
class | OprtAnd |
Callback class for a logic and operator. More... | |
class | OprtOr |
Callback class for a logic or operator. More... | |
class | OprtLOr |
Callback class for a logical or operator. More... | |
class | OprtLAnd |
Callback class for a logical and operator. More... | |
class | OprtShl |
Callback class for the shift left operator. More... | |
class | OprtShr |
Callback class for the shift right operator. More... | |
class | OprtCastToFloat |
Callback for an operator allowing to cast values to floating point values. More... | |
class | OprtCastToInt |
Callback for an operator allowing to cast values to integer values. More... | |
class | OprtSignCmplx |
Callback for the negative sign operator. More... | |
class | OprtAddCmplx |
Parser callback for implementing an addition of two complex values. More... | |
class | OprtSubCmplx |
Parser callback for implementing the subtraction of two complex values. More... | |
class | OprtMulCmplx |
Callback object for implementing the multiplications of complex values. More... | |
class | OprtDivCmplx |
Callback object for implementing the division of complex values. More... | |
class | OprtPowCmplx |
Raise x to the power of y. More... | |
class | OprtIndex |
Default implementation of a multidimensional index operator. More... | |
class | OprtTranspose |
class | OprtCreateArray |
On the fly array creation using the curly bracket operator. More... | |
class | OprtColon |
class | OprtSign |
Callback for the negative sign operator for noncomplex values. More... | |
class | OprtSignPos |
Callback for the positive sign operator for noncomplex values. More... | |
class | OprtAdd |
Parser callback for implementing an addition of two noncomplex values. More... | |
class | OprtSub |
Parser callback for implementing the subtraction of two noncomplex values. More... | |
class | OprtMul |
Callback object for implementing the multiplications of noncomplex values. More... | |
class | OprtDiv |
Callback object for implementing the division of noncomplex values. More... | |
class | OprtPow |
Raise x to the power of y. More... | |
class | OprtFact |
Calculate factorial of a non-negative integer. More... | |
class | OprtPercentage |
Returns percentage of given number. More... | |
class | PackageCmplx |
Package for installing complex functions and operators. More... | |
class | PackageCommon |
Package for installing operators and functions which are always present. More... | |
class | PackageMatrix |
Package for installing complex functions and operators. More... | |
class | PackageNonCmplx |
Package for installing complex functions and operators. More... | |
class | PackageStr |
Package for installing unit postfix operators into muParserX. More... | |
class | OprtNano |
class | OprtMicro |
class | OprtMilli |
class | OprtKilo |
class | OprtMega |
class | OprtGiga |
class | PackageUnit |
Package for installing unit postfix operators into muParserX. More... | |
class | ParserX |
The parser implementation. More... | |
class | ParserXBase |
Implementation of the parser engine. More... | |
class | ParserMessageProviderBase |
Base class for Parser Message providing classes. More... | |
class | ParserMessageProviderEnglish |
English versions of parser messages. More... | |
class | ParserMessageProviderGerman |
German versions of parser messages. More... | |
class | RPN |
A class representing the reverse polnish notation of the expression. More... | |
class | TokenNewline |
A class for encapsulation a newline token. More... | |
class | Stack |
Parser stack implementation. More... | |
class | ParserTester |
Test cases for unit testing the parser framework. More... | |
class | TokenReader |
Token reader for the ParserXBase class. More... | |
class | DblValReader |
A class for reading floating point values from an expression string. More... | |
class | BoolValReader |
A class for reading boolean values from an expression string. More... | |
class | HexValReader |
A class for reading hex values from an expression string. More... | |
class | BinValReader |
A class for reading binary values from an expression string. More... | |
class | StrValReader |
A class for reading strings from an expression string. More... | |
class | Value |
Value class of muParserX. More... | |
class | ValueCache |
The ValueCache class provides a simple mechanism to recycle unused value items. More... | |
class | Variable |
The variable class represents a parser variable. More... | |
Typedefs | |
typedef TokenPtr< IToken > | ptr_tok_type |
Type of a managed pointer storing parser tokens. | |
typedef TokenPtr< ICallback > | ptr_cal_type |
Type of a managed pointer storing callback tokens. | |
typedef TokenPtr< IValue > | ptr_val_type |
Type of a managed pointer storing value tokens. | |
typedef TokenPtr< IOprtBin > | ptr_binop_type |
Type of a managed pointer storing binary operator tokens. | |
typedef std::vector< ptr_tok_type > | token_vec_type |
Type for a vector of tokens. | |
typedef std::vector< ptr_val_type > | val_vec_type |
Type for a vector of value items. | |
typedef double | float_type |
Parser datatype for floating point value. | |
typedef int | int_type |
Parser datatype for integer valuse. | |
typedef std::complex< float_type > | cmplx_type |
The basic type used for representing complex numbers. | |
typedef bool | bool_type |
Parser boolean datatype. More... | |
typedef Matrix< Value > | matrix_type |
The parsers underlying matrix type. | |
typedef std::string | string_type |
Parser datatype for strings. | |
typedef string_type::value_type | char_type |
Character type of the parser. | |
typedef std::vector< IValueReader * > | readervec_type |
Type of a vector holding pointers to value reader objects. | |
typedef std::map< string_type, ptr_tok_type > | var_maptype |
type for the parser variable storage. | |
typedef std::map< string_type, ptr_tok_type > | val_maptype |
type of a container used to store parser values. | |
typedef std::map< string_type, ptr_tok_type > | fun_maptype |
Type of a container that binds Callback object pointer to operator identifiers. | |
typedef std::map< string_type, ptr_tok_type, su::pred::SortByLength< string_type > > | oprt_bin_maptype |
Type of a container that binds Callback object pointer to operator identifiers. | |
typedef std::map< string_type, ptr_tok_type > | oprt_pfx_maptype |
Type of a map for storing postfix operators by their name. | |
typedef std::map< string_type, ptr_tok_type > | oprt_ifx_maptype |
Type of a map for storing infix operators by their name. | |
Enumerations | |
enum | ECmdCode { cmBO = 0 , cmBC = 1 , cmIO = 2 , cmIC = 3 , cmCBO = 4 , cmCBC = 5 , cmARG_SEP = 6 , cmIF = 7 , cmELSE = 8 , cmENDIF = 9 , cmJMP = 10 , cmVAL = 11 , cmFUNC = 12 , cmOPRT_BIN = 13 , cmOPRT_INFIX = 14 , cmOPRT_POSTFIX = 15 , cmEOE = 16 , cmSCRIPT_NEWLINE = 17 , cmSCRIPT_COMMENT = 18 , cmSCRIPT_WHILE = 19 , cmSCRIPT_GOTO = 20 , cmSCRIPT_LABEL = 21 , cmSCRIPT_FOR = 22 , cmSCRIPT_IF = 23 , cmSCRIPT_ELSE = 24 , cmSCRIPT_ELSEIF = 25 , cmSCRIPT_ENDIF = 26 , cmSCRIPT_FUNCTION = 27 , cmUNKNOWN = 28 , cmCOUNT } |
Bytecode values. More... | |
enum | ESynCodes { noBO = 1 << 0 , noBC = 1 << 1 , noIO = 1 << 2 , noIC = 1 << 3 , noCBO = 1 << 4 , noCBC = 1 << 5 , noVAL = 1 << 6 , noVAR = 1 << 7 , noCOMMA = 1 << 8 , noFUN = 1 << 9 , noOPT = 1 << 10 , noPFX = 1 << 11 , noIFX = 1 << 12 , noEND = 1 << 13 , noIF = 1 << 14 , noELSE = 1 << 15 , noNEWLINE = 1 << 16 , sfSTART_OF_LINE = noOPT | noBC | noPFX | noCOMMA | noIO | noIC | noIF | noELSE , sfALLOW_NONE = ~0 } |
Syntax codes. More... | |
enum | EOprtAsct |
Binary operator associativity values. | |
enum | EOprtPrecedence { } |
Parser operator precedence values. More... | |
enum | EErrorCodes { ecUNEXPECTED_OPERATOR = 0 , ecUNASSIGNABLE_TOKEN = 1 , ecUNEXPECTED_EOF = 2 , ecUNEXPECTED_COMMA = 3 , ecUNEXPECTED_VAL = 4 , ecUNEXPECTED_VAR = 5 , ecUNEXPECTED_PARENS = 6 , ecUNEXPECTED_STR = 7 , ecUNEXPECTED_CONDITIONAL = 8 , ecUNEXPECTED_NEWLINE = 9 , ecSTRING_EXPECTED = 10 , ecVAL_EXPECTED = 11 , ecMISSING_PARENS = 12 , ecMISSING_ELSE_CLAUSE = 13 , ecMISPLACED_COLON = 14 , ecUNEXPECTED_FUN = 15 , ecUNTERMINATED_STRING = 16 , ecTOO_MANY_PARAMS = 17 , ecTOO_FEW_PARAMS = 18 , ecTYPE_CONFLICT = 19 , ecTYPE_CONFLICT_FUN = 20 , ecTYPE_CONFLICT_IDX = 21 , ecINVALID_TYPE = 22 , ecINVALID_TYPECAST = 23 , ecARRAY_SIZE_MISMATCH = 24 , ecNOT_AN_ARRAY = 25 , ecUNEXPECTED_SQR_BRACKET = 26 , ecUNEXPECTED_CURLY_BRACKET = 27 , ecINVALID_NAME = 28 , ecBUILTIN_OVERLOAD = 29 , ecINVALID_FUN_PTR = 30 , ecINVALID_VAR_PTR = 31 , ecINVALID_PARAMETER = 32 , ecINVALID_NUMBER_OF_PARAMETERS = 33 , ecNAME_CONFLICT = 34 , ecOPT_PRI = 35 , ecASSIGNEMENT_TO_VALUE = 36 , ecDOMAIN_ERROR = 37 , ecDIV_BY_ZERO = 38 , ecGENERIC = 39 , ecINDEX_OUT_OF_BOUNDS = 40 , ecINDEX_DIMENSION = 41 , ecMISSING_SQR_BRACKET = 42 , ecMISSING_CURLY_BRACKET = 43 , ecEVAL = 44 , ecOVERFLOW = 45 , ecMATRIX_DIMENSION_MISMATCH = 46 , ecUNKNOWN_ESCAPE_SEQUENCE = 47 , ecVARIABLE_DEFINED = 48 , ecCONSTANT_DEFINED = 49 , ecFUNOPRT_DEFINED = 50 , ecINTERNAL_ERROR = 51 , ecCOUNT , ecUNDEFINED = -1 } |
Error codes. More... | |
Functions | |
std::ostream & | operator<< (std::ostream &a_Stream, const IToken &tok) |
Overloaded streaming operator for outputting the value type into an std::ostream. More... | |
std::ostream & | operator<< (std::ostream &a_Stream, const IValue &a_Val) |
Overloaded streaming operator for outputting the value type into an std::ostream. More... | |
std::ostream & | console () |
Encapsulate cout. More... | |
std::istream & | console_in () |
Encapsulate cin. More... | |
Variables | |
const char_type * | g_sCmdCode [] |
Strings assigned to the enum codes of ECmdCode. More... | |
Namespace for mathematical applications.
typedef bool mup::bool_type |
Parser boolean datatype.
This must be bool! The only reason for this typedef is that I need the name bool_type for a preprocessor macro definition to avoid inconsistent naming of the macro parameters.
enum mup::ECmdCode |
Bytecode values.
enum mup::EErrorCodes |
Error codes.
This is the complete list of all error codes used by muparserx
Enumerator | |
---|---|
ecUNEXPECTED_OPERATOR | Unexpected binary operator found. |
ecUNASSIGNABLE_TOKEN | Token cant be identified. |
ecUNEXPECTED_EOF | Unexpected end of expression. (Example: "2+sin(") |
ecUNEXPECTED_COMMA | An unexpected comma has been found. (Example: "1,23") |
ecUNEXPECTED_VAL | An unexpected value token has been found. |
ecUNEXPECTED_VAR | An unexpected variable token has been found. |
ecUNEXPECTED_PARENS | Unexpected Parenthesis, opening or closing. |
ecUNEXPECTED_STR | A string has been found at an inapropriate position. |
ecSTRING_EXPECTED | A string function has been called with a different type of argument. |
ecVAL_EXPECTED | A numerical function has been called with a non value type of argument. |
ecMISSING_PARENS | Missing parens. (Example: "3*sin(3") |
ecUNEXPECTED_FUN | Unexpected function found. (Example: "sin(8)cos(9)") |
ecUNTERMINATED_STRING | unterminated string constant. (Example: "3*valueof("hello)") |
ecTOO_MANY_PARAMS | Too many function parameters. |
ecTOO_FEW_PARAMS | Too few function parameters. (Example: "ite(1<2,2)") |
ecTYPE_CONFLICT | Generic type conflict. |
ecTYPE_CONFLICT_FUN | Function argument type conflict. |
ecTYPE_CONFLICT_IDX | Function argument type conflict. |
ecINVALID_TYPECAST | Invalid Value token cast. |
ecARRAY_SIZE_MISMATCH | Array size mismatch during a vector operation. |
ecNOT_AN_ARRAY | Using the index operator on a scalar variable. |
ecUNEXPECTED_SQR_BRACKET | Invalid use of the index operator. |
ecUNEXPECTED_CURLY_BRACKET | Invalid use of the index operator. |
ecINVALID_NAME | Invalid function, variable or constant name. |
ecBUILTIN_OVERLOAD | Trying to overload builtin operator. |
ecINVALID_FUN_PTR | Invalid callback function pointer. |
ecINVALID_VAR_PTR | Invalid variable pointer. |
ecINVALID_PARAMETER | Invalid function parameter. |
ecNAME_CONFLICT | Name conflict. |
ecOPT_PRI | Invalid operator priority. |
ecASSIGNEMENT_TO_VALUE | Assignment to operator (3=4 instead of a=4) |
ecDOMAIN_ERROR | Trying to use func/oprtr with out-of-domain input args. |
ecDIV_BY_ZERO | Division by zero (currently unused) |
ecGENERIC | Generic error. |
ecINDEX_OUT_OF_BOUNDS | Array index is out of bounds. |
ecMISSING_SQR_BRACKET | The index operator was not closed properly (i.e. "v[3") |
ecEVAL | Error while evaluating function / operator. |
ecOVERFLOW | Overflow (possibly) occurred. |
ecVARIABLE_DEFINED | Variable is already defined. |
ecCONSTANT_DEFINED | Constant is already defined. |
ecFUNOPRT_DEFINED | Function/operator is already defined. |
ecINTERNAL_ERROR | Internal error of any kind. |
ecCOUNT | This is no error code, It just stores just the total number of error codes. |
ecUNDEFINED | Undefined message, placeholder to detect unassigned error messages. |
enum mup::EOprtPrecedence |
Parser operator precedence values.
These are predefined values for the operator precedence.
enum mup::ESynCodes |
Syntax codes.
The syntax codes control the syntax check done during the first time parsing of the expression string. They are flags that indicate which tokens are allowed next if certain tokens are identified.
|
inline |
Encapsulate cout.
Used for supporting UNICODE more easily.
|
inline |
Encapsulate cin.
Used for supporting UNICODE more easily.
std::ostream& mup::operator<< | ( | std::ostream & | a_Stream, |
const IToken & | tok | ||
) |
Overloaded streaming operator for outputting the value type into an std::ostream.
a_Stream | The stream object |
a_Val | The value object to be streamed |
This function is only present if _UNICODE is not defined.
std::ostream& mup::operator<< | ( | std::ostream & | a_Stream, |
const IValue & | a_Val | ||
) |
Overloaded streaming operator for outputting the value type into an std::ostream.
a_Stream | The stream object |
a_Val | The value object to be streamed |
This function is only present if _UNICODE is not defined.
const char_type * mup::g_sCmdCode |
Strings assigned to the enum codes of ECmdCode.
Used for debugging purposes only.