|
maug
Quick and dirty C mini-augmentation library.
|
MLISP Interpreter Functions and Macros. More...
#include <mlisps.h>
Go to the source code of this file.
Macros | |
| #define | MLISP_TOKEN_SZ_MAX 4096 |
| #define | MLISP_EXEC_TRACE_LVL 0 |
| #define | MLISP_STACK_TRACE_LVL 0 |
| #define | MLISP_ENV_FLAG_BUILTIN 0x02 |
| #define | MLISP_ENV_FLAG_CMP_GT 0x10 |
| Flag for _mlisp_env_cb_cmp() specifying TRUE if A > B. | |
| #define | MLISP_ENV_FLAG_CMP_LT 0x20 |
| Flag for _mlisp_env_cb_cmp() specifying TRUE if A < B. | |
| #define | MLISP_ENV_FLAG_CMP_EQ 0x40 |
| Flag for _mlisp_env_cb_cmp() specifying TRUE if A == B. | |
| #define | MLISP_ENV_FLAG_ARI_ADD 0x10 |
| Flag for _mlisp_env_cb_arithmetic() specifying to add A + B. | |
| #define | MLISP_ENV_FLAG_ARI_MUL 0x20 |
| Flag for _mlisp_env_cb_arithmetic() specifying to multiply A * B. | |
| #define | MLISP_ENV_FLAG_ARI_DIV 0x40 |
| #define | MLISP_ENV_FLAG_ARI_MOD 0x80 |
| #define | MLISP_ENV_FLAG_ANO_OR 0x10 |
| #define | MLISP_ENV_FLAG_ANO_AND 0x20 |
| #define | MLISP_ENV_FLAG_DEFINE_GLOBAL 0x10 |
| Flag for _mlisp_env_cb_define() specifying global env. | |
| #define | MLISP_AUTOLOCK_EXEC_ENV 0x01 |
| #define | MLISP_AUTOLOCK_CHILD_IDX 0x02 |
| #define | MLISP_AUTOLOCK_VISIT_CT 0x04 |
| #define | MLISP_AUTOLOCK_PARSER_AST 0x08 |
| #define | MLISP_AUTOLOCK_GLOBAL_ENV 0x10 |
| #define | MLISP_STACK_FLAG_PEEK 0x01 |
| Flag for mlisp_stack_pop_ex() indicating the value should not be removed from the stack. | |
| #define | mlisp_stack_pop(exec, o) mlisp_stack_pop_ex( exec, o, 0 ) |
| Wrapper for mlisp_stack_pop() with no flags. | |
| #define | mlisp_stack_push(exec, i, ctype) (_mlisp_stack_push_ ## ctype( exec, (ctype)i )) |
| Push a value onto MLISP_EXEC_STATE::stack. More... | |
| #define | _MLISP_TYPE_TABLE_PUSH_PROTO(idx, ctype, name, const_name, fmt) |
| #define | mlisp_ast_has_ready_children(exec_child_idx, n) ((exec_child_idx) < (n)->ast_idx_children_sz) |
| #define | MLISP_PSTATE_TABLE_CONST(name, idx) extern MAUG_CONST uint8_t SEG_MCONST name; |
Functions | |
| MERROR_RETVAL | mlisp_stack_dump (struct MLISP_PARSER *parser, struct MLISP_EXEC_STATE *exec) |
| Dump the stack from the given parser/exec combination. More... | |
| MERROR_RETVAL | mlisp_stack_pop_ex (struct MLISP_EXEC_STATE *exec, struct MLISP_STACK_NODE *o, uint8_t flags) |
| Pop a value off of (removing from) MLISP_EXEC_STATE::stack and copy it to a provided output. More... | |
| MERROR_RETVAL | mlisp_env_dump (struct MLISP_PARSER *parser, struct MLISP_EXEC_STATE *exec, uint8_t global) |
| Dump the environment from the given parser/exec combination. More... | |
| struct MLISP_ENV_NODE * | mlisp_env_get (struct MLISP_EXEC_STATE *exec, const char *key) |
| MERROR_RETVAL | mlisp_env_unset (struct MLISP_EXEC_STATE *exec, const char *token, size_t token_sz, uint8_t global) |
| MERROR_RETVAL | mlisp_env_set (struct MLISP_EXEC_STATE *exec, const char *token, size_t token_sz, uint8_t env_type, const void *data, uint8_t global, uint8_t flags) |
| ssize_t | mlisp_count_builtins (struct MLISP_EXEC_STATE *exec) |
| MERROR_RETVAL | mlisp_check_state (struct MLISP_PARSER *parser, struct MLISP_EXEC_STATE *exec) |
| MERROR_RETVAL | mlisp_step (struct MLISP_PARSER *parser, struct MLISP_EXEC_STATE *exec) |
| Iterate the current exec_state() starting from the next MLISP_AST_NODE to be executed according to the tree of MLISP_EXEC_STATE::per_node_child_idx values. | |
| MERROR_RETVAL | mlisp_step_lambda (struct MLISP_PARSER *parser, struct MLISP_EXEC_STATE *exec, const char *lambda) |
| Iterate the current exec_state() starting from the lambda named. More... | |
| MERROR_RETVAL | mlisp_exec_add_env_builtins (struct MLISP_PARSER *parser, struct MLISP_EXEC_STATE *exec) |
| MERROR_RETVAL | mlisp_exec_init (struct MLISP_PARSER *parser, struct MLISP_EXEC_STATE *exec, uint8_t flags) |
| MERROR_RETVAL | mlisp_exec_set_global_env (struct MLISP_PARSER *parser, struct MLISP_EXEC_STATE *exec, struct MDATA_TABLE *global_env) |
| Set the given exec state to use the given vector as a global variable environment. This can be long-lived and shared with other exec states. | |
| void | mlisp_exec_free (struct MLISP_EXEC_STATE *exec) |
| MERROR_RETVAL | mlisp_deserialize_prepare_EXEC_STATE (struct MLISP_EXEC_STATE *exec, size_t i) |
MLISP Interpreter Functions and Macros.