Go to the source code of this file.
|
typedef char *(* | ev_Expander )(const char *str, int thread) |
|
typedef void(* | EXPRopDependencyCallback )(EV_FUNCTION *me, EV_SYMBOL **argv, void *ref_id) |
|
typedef void(* | EXPRopChangeRefCallback )(EV_FUNCTION *me, EV_SYMBOL **argv, char *new_args[], const char *new_fullpath, const char *old_fullpath, const char *old_cwd, const char *chan_name, const char *old_chan_name) |
|
typedef void(* | EXPRfuncCallback )(EV_FUNCTION *me, EV_SYMBOL *result, EV_SYMBOL **argv, int thread, unsigned &func_flags) |
|
|
typedef struct EV_TYPEDEF | EV_TYPEDEF |
|
typedef struct EV_OPERATOR | EV_OPERATOR |
|
typedef struct EV_FUNCHELP | EV_FUNCHELP |
|
|
typedef struct EV_SYMTABLE | EV_SYMTABLE |
|
|
EXPR_API void | ev_InitFloat () |
|
EXPR_API void | ev_InitString () |
| initialize string operations More...
|
|
EXPR_API void | ev_InitVariable () |
|
EXPR_API void | ev_InitVector () |
| initialize vector operations More...
|
|
EXPR_API void | ev_InitMatrix () |
| initialize matrix operations More...
|
|
EXPR_API void | ev_InitUserFunc () |
|
EXPR_API void | ev_PrintHelp (std::ostream &os, const char *match, const char *keyword, bool full_match_only=false) |
|
EXPR_API int | ev_GetNFunctions () |
|
EXPR_API EV_FUNCTION * | ev_GetFunction (int i) |
|
EXPR_API EV_TYPEDEF * | ev_GetTypeDef (int key) |
|
EXPR_API int | ev_FindFunction (const char *name) |
|
EXPR_API void | ev_SetFunctionDependencyCallbacks (const char *func, EXPRopDependencyCallback depend_cb, EXPRopChangeRefCallback changeref_cb) |
|
EXPR_API EV_EXPRESSION * | ev_AllocExpr (EV_InlineFuncReturnType rettype) |
|
EXPR_API int | ev_ChangeExpr (EV_EXPRESSION *expr, const char *source) |
|
EXPR_API void | ev_UnresolveVars (EV_EXPRESSION *expr, int thread) |
|
EXPR_API fpreal | ev_EvaluateFloat (EV_EXPRESSION *expr, int thread) |
|
EXPR_API void | ev_EvaluateString (UT_String &result, EV_EXPRESSION *expr, int thread) |
|
EXPR_API int | ev_EvaluateVector (EV_EXPRESSION *expr, ev_Vector &result, int thread) |
|
EXPR_API int | ev_EvaluateMatrix (EV_EXPRESSION *expr, ev_Matrix &result, int thread) |
|
EXPR_API void | ev_FreeExpr (EV_EXPRESSION *expr) |
|
EXPR_API void | ev_UpdateOpDependency (EV_EXPRESSION *expr, void *ref_id, int thread) |
|
EXPR_API int | ev_ChangeOpReference (EV_EXPRESSION *expr, const char *new_fullpath, const char *old_fullpath, const char *old_cwd, const char *chan_name, const char *old_chan_name, int thread) |
|
EXPR_API EV_SYMBOL * | ev_Evaluate (EV_EXPRESSION *expr, EV_InlineFuncReturnType func_ret_type, int thread) |
|
EXPR_API void | EXPRftoa (UT_WorkBuffer &buf, fpreal v) |
|
EXPR_API void | ev_SetExpander (ev_Expander expander) |
|
|
EXPR_API void | ev_AddType (EV_TYPEDEF *type) |
|
EXPR_API void | ev_AddVariableType (EV_TYPEDEF *type, int atEnd) |
|
EXPR_API void | ev_DeleteVariableType (EV_TYPEDEF *type) |
|
EXPR_API void | ev_AddOperator (EV_OPERATOR *op, int level) |
|
EXPR_API void | ev_AddFunction (EV_FUNCTION *func) |
|
EXPR_API void | ev_DeleteFunction (EV_FUNCTION *func) |
|
EXPR_API void | ev_SetOptimization (int level) |
|
|
EXPR_API void | ev_SetFunctionInstanceAllocator (const char *function, void *(*alloc)(), void(*free)(void *)) |
| Functions for supplying state data for custom expressions. More...
|
|
EXPR_API void * | ev_GetFunctionData (int thread) |
|
|
EXPR_API bool | ev_SaveCompiledCode (EV_EXPRESSION *expr, std::ostream &os, int thread) |
|
EXPR_API bool | ev_LoadCompiledCode (EV_EXPRESSION *expr, UT_IStream &is, int thread) |
|
|
EXPR_API EV_SYMBOL * | ev_AllocSymbol (int type, int thread) |
|
EXPR_API void | ev_FreeSymbol (EV_SYMBOL *symbol, int thread) |
|
|
EXPR_API void | ev_setSafeMode (bool safe_mode) |
|
EXPR_API bool | ev_isInSafeMode () |
|
EXPR_API bool | ev_isKeyword (const char *string) |
|
#define EV_END_FN |
( |
|
answer | ) |
result->value.fval = (answer) |
Handy macros for defining expression functions. They only differ by which function parameters are supplied to avoid unused parameter warnings.
Definition at line 221 of file EXPR.h.
#define EV_END_FNS |
( |
|
answer | ) |
result->value.sval = (answer) |
Handy macros for defining expression functions. They only differ by which function parameters are supplied to avoid unused parameter warnings.
Definition at line 223 of file EXPR.h.
#define EV_EXFUNC_REF 0x40000000 |
Refers to an expression function.
Definition at line 83 of file EXPR.h.
#define EV_FLAGS_SET 0x10000000 |
User flags have been set.
Definition at line 81 of file EXPR.h.
#define EV_FOR_EXFUNC 0x80000000 |
Symbol is to be used by expr func
Definition at line 84 of file EXPR.h.
#define EV_NHELPARGS 10 /* Maximum # of args in help */ |
#define EV_OPTIMIZE0 0 /* No optimization */ |
#define EV_OPTIMIZE1 1 /* Constant folding */ |
#define EV_START_FN |
( |
|
name | ) |
|
Value:
**But if you need a result
GLuint const GLchar * name
class representing a symbol operated upon by expressions
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
Handy macros for defining expression functions. They only differ by which function parameters are supplied to avoid unused parameter warnings.
- Examples:
- expr/functions.C.
Definition at line 212 of file EXPR.h.
#define EV_START_FNNA |
( |
|
name | ) |
|
Value:
**But if you need a result
GLuint const GLchar * name
class representing a symbol operated upon by expressions
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
Handy macros for defining expression functions. They only differ by which function parameters are supplied to avoid unused parameter warnings.
Definition at line 215 of file EXPR.h.
#define EV_START_FUNC |
( |
|
name | ) |
|
Value:
**But if you need a result
GLuint const GLchar * name
class representing a symbol operated upon by expressions
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
Handy macros for defining expression functions. They only differ by which function parameters are supplied to avoid unused parameter warnings.
Definition at line 218 of file EXPR.h.
#define EV_SYMCONSTANT 0x08000000 |
Symbol has a constant value.
Definition at line 80 of file EXPR.h.
#define EV_SYMEXPAND 0x20000000 |
String should be expanded.
Definition at line 82 of file EXPR.h.
#define EV_SYMTRANSIENT 0x04000000 |
Symbol is result of operation.
These flags are common to symbols, operators and functions
NOTE: The high 8 bits of the flag are reserved for internal use User flags should start at not go higher than 0x800000
Note: when changing this definition, update EX_USERFLAGMASK
Definition at line 79 of file EXPR.h.
#define EV_TYPE_CPPSYMBOL 45 |
A symbol inside a function.
Definition at line 115 of file EXPR.h.
#define EV_TYPE_DEFINE 12 |
A node local variable.
These types are used in Houdini outside of EXPR. DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 112 of file EXPR.h.
#define EV_TYPE_GEOATTRIBUTE 13 |
An attribute reference.
Definition at line 113 of file EXPR.h.
#define EV_TYPE_GLOBAL_VAR 20 |
A global variable.
Definition at line 114 of file EXPR.h.
#define EV_TYPE_LOCAL_VAR 10 |
A node local variable.
These types are used in Houdini outside of EXPR. DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 110 of file EXPR.h.
#define EV_TYPE_UNRESOLVED_CPPSYMBOL 46 |
An unknown function symbol
Definition at line 116 of file EXPR.h.
#define EV_TYPE_UNRESOLVED_VAR 11 |
An unknown variable.
Definition at line 111 of file EXPR.h.
#define EV_TYPEEXPANDVAR 4 |
Variable of form ${foo$x}.
Definition at line 102 of file EXPR.h.
Float type of symbol.
Implicit types known by expression language
- The type identifiers must be positive unique integers
- Eventhough Variables are handled as a special case, the type identifier for each variable type must be unique
- It is suggested that applications start their typedefs identifiers 10 or greater. The identifiers do not have to be sequential.
DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 99 of file EXPR.h.
Matrix
Definition at line 104 of file EXPR.h.
String type of symbol.
Definition at line 100 of file EXPR.h.
Unix variable type.
Definition at line 101 of file EXPR.h.
Vector.
Definition at line 103 of file EXPR.h.
#define EX_USERFLAGMASK (0x03ffffff | EV_EXFUNC_REF) |
#define MAX_OPERATOR_TOKEN 32 |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 69 of file EXPR.h.
#define MAX_RECURSION 20 /* Maximum depth of recursion */ |
#define OP_AND 22 /* & */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 61 of file EXPR.h.
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 65 of file EXPR.h.
#define OP_BRACE 31 /* { end brace implied */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 67 of file EXPR.h.
#define OP_COLON 21 /* : */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 60 of file EXPR.h.
#define OP_COMMA 16 /* , almost a NOP */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 58 of file EXPR.h.
#define OP_DIVIDE 4 /* / */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 46 of file EXPR.h.
#define OP_DOT 24 /* . */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 63 of file EXPR.h.
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 50 of file EXPR.h.
#define OP_EQUATE 32 /* = */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 68 of file EXPR.h.
#define OP_GE 13 /* >= */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 55 of file EXPR.h.
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 54 of file EXPR.h.
#define OP_LE 11 /* <= */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 53 of file EXPR.h.
#define OP_LOGAND 14 /* && (logical and) */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 56 of file EXPR.h.
#define OP_LOGOR 15 /* || (logical or) */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 57 of file EXPR.h.
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 52 of file EXPR.h.
#define OP_MINUS 2 /* - */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 44 of file EXPR.h.
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 48 of file EXPR.h.
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 51 of file EXPR.h.
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 49 of file EXPR.h.
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 62 of file EXPR.h.
#define OP_PLUS 1 /* + */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 43 of file EXPR.h.
#define OP_POWER 5 /* ^ */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 47 of file EXPR.h.
#define OP_QUESTION 20 /* ? */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 59 of file EXPR.h.
#define OP_SBRACKET 30 /* [ end square bracket implied */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 66 of file EXPR.h.
#define OP_TILDE 25 /* ~ */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 64 of file EXPR.h.
#define OP_TIMES 3 /* * */ |
Valid operator tokens - used by the operator typedef below DON'T CHANGE THESE VALUES - They are saved as ints for compiled expressions.
Definition at line 45 of file EXPR.h.
typedef char*(* ev_Expander)(const char *str, int thread) |
Following are the defines/typedefs for the language handler
Definition at line 630 of file EXPR.h.
typedef void(* EXPRopChangeRefCallback)(EV_FUNCTION *me, EV_SYMBOL **argv, char *new_args[], const char *new_fullpath, const char *old_fullpath, const char *old_cwd, const char *chan_name, const char *old_chan_name) |
This callback is used to scan for op dependencies and add/remove dependencies. Unlike evaluation, this callback can have null arguments. A null argument signifies a non-constant parameter to the function.
Definition at line 139 of file EXPR.h.
This is an enumeration of the type of return values that an inline function may be expected to return. Setting this value to EV_EXPR_RETURN_NONE will disallow an expression from supporting inline functions.
Enumerator |
---|
EV_EXPR_RETURN_NONE |
|
EV_EXPR_RETURN_FLOAT |
|
EV_EXPR_RETURN_STRING |
|
EV_EXPR_RETURN_VECTOR |
|
EV_EXPR_RETURN_MATRIX |
|
Definition at line 313 of file EXPR.h.
Functions for expansion of library Add operators, type definitions and functions.
Functions for expansion of library Add operators, type definitions and functions.
Functions for expansion of library Add operators, type definitions and functions.
Functions used internally by type declarations
EXPR_API int ev_ChangeOpReference |
( |
EV_EXPRESSION * |
expr, |
|
|
const char * |
new_fullpath, |
|
|
const char * |
old_fullpath, |
|
|
const char * |
old_cwd, |
|
|
const char * |
chan_name, |
|
|
const char * |
old_chan_name, |
|
|
int |
thread |
|
) |
| |
Functions for expansion of library Add operators, type definitions and functions.
Functions for expansion of library Add operators, type definitions and functions.
Functions used internally by type declarations
From within an expression function, use this to retrieve the data created by the alloc function specified in ev_SetFunctionInstanceAllocator().
- Parameters
-
thread | Thread id supplied to the expression function callback |
initialize floating point operations Float initialization will automatically initialize vector/matrix
initialize matrix operations
initialize string operations
initialize vector operations
These functions put the expression evaluator into/out of "safe" mode. In safe mode, certain functions will not be executed.
EXPR_API bool ev_isKeyword |
( |
const char * |
string | ) |
|
These functions put the expression evaluator into/out of "safe" mode. In safe mode, certain functions will not be executed.
These functions save and load compiled expressions.
EXPR_API void ev_PrintHelp |
( |
std::ostream & |
os, |
|
|
const char * |
match, |
|
|
const char * |
keyword, |
|
|
bool |
full_match_only = false |
|
) |
| |
These functions save and load compiled expressions.
Functions for supplying state data for custom expressions.
This function specifies the constructor/destructor functions for the state data.
- Parameters
-
function | Name of the custom expression function |
alloc | This allocates and initializes the state data |
free | This deallocates the state data |
Functions for expansion of library Add operators, type definitions and functions.
These functions put the expression evaluator into/out of "safe" mode. In safe mode, certain functions will not be executed.
Nice conversion of float to string data. This will do simple checks to try to convert integer values more correctly.