cctools
|
Implements evaluation of JX expressions. More...
#include "jx.h"
Go to the source code of this file.
Functions | |
struct jx * | jx_eval (struct jx *j, struct jx *context) |
Evaluate an expression. More... | |
struct jx * | jx_eval_with_defines (struct jx *j, struct jx *context) |
Evaluate an expression with embedded definitions. More... | |
void | jx_eval_enable_external (int enable) |
Enable external functions. More... | |
Implements evaluation of JX expressions.
Evaluate an expression.
Traverses the expression, evaluates all operators and evalutes unbound symbols by looking for matches in the context object.
j | The expression to evaluate. |
context | An object in which values will be found. |
Evaluate an expression with embedded definitions.
Same as jx_eval, except first looks for a "defines" clause and combines that with the context. Allows an expression to have its own bound values, for convenience.
j | The expression to evaluate, which may contain a "defines" clause. |
context | An object in which values will be found. |
void jx_eval_enable_external | ( | int | enable | ) |
Enable external functions.
A small number of JX functions make use of "external" context, For safety, these functions are not enabled unless the user first calls jx_eval_enable_external(1).
enable | If non-zero, enable external functions, otherwise disable. |