13#ifndef MLISP_TRACE_LVL
14# define MLISP_TRACE_LVL 0
17#ifndef MLISP_TRACE_SIGIL
18# define MLISP_TRACE_SIGIL "TRACE"
21#ifndef MLISP_AST_IDX_CHILDREN_MAX
22# define MLISP_AST_IDX_CHILDREN_MAX 10
29#define MLISP_EXEC_FLAG_DEF_TERM 0x02
36typedef ssize_t mlisp_lambda_t;
38typedef mlisp_lambda_t mlisp_args_t;
39typedef mlisp_lambda_t mlisp_arge_t;
40typedef mlisp_lambda_t mlisp_if_t;
41typedef mlisp_lambda_t mlisp_begin_t;
43typedef uint8_t mlisp_bool_t;
50#define MLISP_NUM_TYPE_TABLE( f ) \
51 f( 1, int16_t, integer, INT, "%d" ) \
52 f( 2, float, floating, FLOAT, "%f" ) \
53 f( 3, mlisp_bool_t, boolean, BOOLEAN, "%u" )
60#define MLISP_TYPE_TABLE( f ) \
61 MLISP_NUM_TYPE_TABLE( f ) \
62 f( 4, mdata_strpool_idx_t, strpool_idx, STR, SSIZE_T_FMT ) \
63 f( 5, mlisp_env_cb_t, cb, CB, "%p" ) \
64 f( 6, mlisp_lambda_t, lambda, LAMBDA, SSIZE_T_FMT ) \
65 f( 7, mlisp_args_t, args_start, ARGS_S, SSIZE_T_FMT ) \
66 f( 8, mlisp_arge_t, args_end, ARGS_E, SSIZE_T_FMT ) \
67 f(10, mlisp_begin_t, begin, BEGIN, SSIZE_T_FMT )
76 size_t args_c,
void* cb_data, uint8_t flags );
78#define _MLISP_TYPE_TABLE_FIELDS( idx, ctype, name, const_name, fmt ) \
88 mdata_strpool_idx_t name_strpool_idx;
100 mdata_strpool_idx_t token_idx;
102 ssize_t ast_idx_parent;
104 ssize_t ast_idx_children[MLISP_AST_IDX_CHILDREN_MAX];
113 struct MDATA_VECTOR per_node_child_idx;
129#ifdef MLISP_DEBUG_TRACE
130 size_t trace[MLISP_DEBUG_TRACE];
137 struct MDATA_STRPOOL strpool;
138 struct MDATA_VECTOR ast;
139 ssize_t ast_node_iter;
int 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:60
size_t ast_idx_children_sz
Number of children in MLISP_AST_NODE::ast_idx_children.
Definition mlisps.h:106
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:127
struct MDATA_VECTOR per_node_visit_ct
The number of times each node has been visited ever.
Definition mlisps.h:112
struct MDATA_VECTOR stack
A stack of data values resulting from evaluating statements.
Definition mlisps.h:115
struct MDATA_VECTOR env
Environment in which statements are defined.
Definition mlisps.h:122