das2C
das core C utilities (v3)
Loading...
Searching...
No Matches
Functions
Utilities

Functions

DAS_API int das_op_unary (const char *sOp)
 Convert a string into a unary operator token.
 
DAS_API int das_op_binary (const char *sOp)
 Convert a string into a binary operator token.
 
DAS_API const char * das_op_toStr (int nOp, int *pos)
 Provide a string representation of an operator token and an indication of where the operator normally appears.
 
DAS_API bool das_op_isBinary (int nOp)
 Return true if this is a binary operation, false otherwise.
 
DAS_API bool das_op_isUnary (int nOp)
 Return true if op is a unary operation, false otherwise.
 

Detailed Description

Function Documentation

◆ das_op_unary()

DAS_API int das_op_unary ( const char *  sOp)

Convert a string into a unary operator token.

Parameters
sOpa string such as "-", "sqrt", etc.
Returns
an operator token id or 0 if the string did not correspond to a known unary operator

◆ das_op_binary()

DAS_API int das_op_binary ( const char *  sOp)

Convert a string into a binary operator token.

Parameters
sOpa string such as "+", "-", "*", "/", "**", "^" etc.
Returns
an operator token id or 0 if the string did not correspond to a known unary operator

◆ das_op_toStr()

DAS_API const char * das_op_toStr ( int  nOp,
int *  pos 
)

Provide a string representation of an operator token and an indication of where the operator normally appears.

Parameters
nOpThe operator token value
posa pointer to an integer to receive one of the values D2OP_BEFORE, D2OP_BETWEEN or D2OP_AFTER. If pos is NULL the operator position is not set.
Returns
A pointer to a character representation of the operator or NULL if the token nOp is unknown.