13#ifndef MLISP_TRACE_LVL
14# define MLISP_TRACE_LVL 0
17#ifndef MLISP_EXEC_ENV_FRAME_CT_MAX
18# define MLISP_EXEC_ENV_FRAME_CT_MAX 10
21#ifndef MLISP_TRACE_SIGIL
22# define MLISP_TRACE_SIGIL "TRACE"
25#ifndef MLISP_AST_IDX_CHILDREN_MAX
26# define MLISP_AST_IDX_CHILDREN_MAX 10
34#define MLISP_EXEC_FLAG_TRANSIENT_MASK 0x0f
41#define MLISP_EXEC_FLAG_DEF_TERM 0x20
43#define MLISP_EXEC_FLAG_INITIALIZED 0x08
50typedef ssize_t mlisp_lambda_t;
52typedef mlisp_lambda_t mlisp_args_t;
53typedef mlisp_lambda_t mlisp_arge_t;
54typedef mlisp_lambda_t mlisp_if_t;
55typedef mlisp_lambda_t mlisp_begin_t;
57typedef uint8_t mlisp_bool_t;
64#define MLISP_NUM_TYPE_TABLE( f ) \
65 f( 1, int16_t, integer, INT, "%d" ) \
66 f( 2, float, floating, FLOAT, "%f" ) \
67 f( 3, mlisp_bool_t, boolean, BOOLEAN, "%u" )
74#define MLISP_TYPE_TABLE( f ) \
75 MLISP_NUM_TYPE_TABLE( f ) \
76 f( 4, mdata_strpool_idx_t, strpool_idx, STR, SIZE_T_FMT ) \
77 f( 5, mlisp_env_cb_t, cb, CB, "%p" ) \
78 f( 6, mlisp_lambda_t, lambda, LAMBDA, SSIZE_T_FMT ) \
79 f(10, mlisp_begin_t, begin, BEGIN, SSIZE_T_FMT )
94 size_t args_c, uint8_t* cb_data, uint8_t
flags );
96#define _MLISP_TYPE_TABLE_FIELDS( idx, ctype, name, const_name, fmt ) \
120 mdata_strpool_idx_t token_idx;
122 ssize_t ast_idx_parent;
124 ssize_t ast_idx_children[MLISP_AST_IDX_CHILDREN_MAX];
191#ifdef MLISP_DEBUG_TRACE
192 size_t trace[MLISP_DEBUG_TRACE];
uint16_t MERROR_RETVAL
Return type indicating function returns a value from this list.
Definition: merror.h:19
#define MLISP_TYPE_TABLE(f)
Table of other types.
Definition: mlisps.h:74
MERROR_RETVAL(* mlisp_env_cb_t)(struct MLISP_PARSER *parser, struct MLISP_EXEC_STATE *exec, size_t n_idx, size_t args_c, uint8_t *cb_data, uint8_t flags)
A callback to attach to an mlisp command with mlisp_env_set() with MLISP_TYPE_CB.
Definition: mlisps.h:92
A pool of immutable text strings. Deduplicates strings to save memory.
Definition: mdata.h:68
A vector of uniformly-sized objects, stored contiguously.
Definition: mdata.h:93
size_t ast_idx_children_sz
Number of children in MLISP_AST_NODE::ast_idx_children.
Definition: mlisps.h:126
Current execution state to associate with a MLISP_PARSER.
Definition: mlisps.h:136
struct MDATA_VECTOR lambda_trace
Path through any lambdas the execution has entered during this heartbeat cycle. Used to detect tail c...
Definition: mlisps.h:184
int8_t no_serial
Dummy field; do not serialize fields after this!
Definition: mlisps.h:178
struct MDATA_VECTOR per_node_child_idx
The hild index that will be visited on next visit of each node.
Definition: mlisps.h:151
struct MDATA_VECTOR per_node_visit_ct
The number of times each node has been visited ever.
Definition: mlisps.h:143
struct MDATA_VECTOR stack
A stack of data values resulting from evaluating statements.
Definition: mlisps.h:154
uint8_t flags
Flags which dictate the behavior of this object.
Definition: mlisps.h:140
union MAUG_MHANDLEPTR cb_attachment
Handle/pointer for use by addtional native callbacks. This is not used within mlisp or its builtin ca...
Definition: mlisps.h:190
struct MDATA_TABLE env[MLISP_EXEC_ENV_FRAME_CT_MAX]
Environment in which statements are defined if ::MLISP_.
Definition: mlisps.h:171
int8_t env_select
The current topmost frame of MLISP_EXEC_STATE::env. Please see that for more information.
Definition: mlisps.h:176
ssize_t ast_node_iter
Definitions to use if MLISP_EXEC_FLAG_DEF_TERM is defined on the accompanying MLISP_EXEC_STATE::flags...
Definition: mlisps.h:207