|
maug
Quick and dirty C mini-augmentation library.
|
Current execution state to associate with a MLISP_PARSER. More...
#include <mlisps.h>

Data Fields | |
| uint16_t | uid |
| uint8_t | flags |
| Flags which dictate the behavior of this object. | |
| struct MDATA_VECTOR | per_node_visit_ct |
| The number of times each node has been visited ever. | |
| struct MDATA_VECTOR | per_node_child_idx |
| The hild index that will be visited on next visit of each node. | |
| struct MDATA_VECTOR | stack |
| A stack of data values resulting from evaluating statements. | |
| struct MDATA_TABLE | env [MLISP_EXEC_ENV_FRAME_CT_MAX] |
| Environment in which statements are defined if ::MLISP_. | |
| int8_t | env_select |
| The current topmost frame of MLISP_EXEC_STATE::env. Please see that for more information. | |
| int8_t | no_serial |
| Dummy field; do not serialize fields after this! | |
| struct MDATA_VECTOR | lambda_trace |
| Path through any lambdas the execution has entered during this heartbeat cycle. Used to detect tail calls. | |
| union MAUG_MHANDLEPTR | cb_attachment |
| Handle/pointer for use by addtional native callbacks. This is not used within mlisp or its builtin callbacks and can be manipulated freely by the embedding implementation. | |
| struct MDATA_TABLE * | global_env |
Related Symbols | |
(Note that these are not member symbols.) | |
| #define | MLISP_EXEC_FLAG_TRANSIENT_MASK 0x0f |
| Mask for MLISP_EXEC_STATE::flags to block off flags that persist between steps. | |
| #define | MLISP_EXEC_FLAG_DEF_TERM 0x20 |
| Flag for MLISP_EXEC_STATE::flags indicating next token is a term to be defined. | |
Current execution state to associate with a MLISP_PARSER.
| struct MDATA_TABLE MLISP_EXEC_STATE::env[MLISP_EXEC_ENV_FRAME_CT_MAX] |
Environment in which statements are defined if ::MLISP_.
This is an array indexed by MLISP_EXEC_STATE::env_select, below. The members of this array are referred to as frames, elsewhere. Diving into a lambda during execution will increment MLISP_EXEC_STATE::env_select and initialize a new table here (unless it's the same lambda doing a tail call, which will free the current env frame first). Leaving that lambda will free the current env frame and decrement MLISP_EXEC_STATE::env_select.
mlisp_env_get() will search the highest-indexed (most recent) frame before searching lower frames. mlisp_env_set() will store in the highest-indexed (currently selected) frame.
| struct MDATA_VECTOR MLISP_EXEC_STATE::per_node_child_idx |
The hild index that will be visited on next visit of each node.
This is tracked per MLISP_AST_NODE, so each node has its own "program counter." This facilitates things like tail call optimization.