maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
MLISP_EXEC_STATE Struct Reference

Current execution state to associate with a MLISP_PARSER. More...

#include <mlisps.h>

Collaboration diagram for MLISP_EXEC_STATE:

Data Fields

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_VECTOR env
 Environment in which statements are defined if ::MLISP_.
 
struct MDATA_VECTOR lambda_trace
 Path through any lambdas the execution has entered during this heartbeat cycle. Used to detect tail calls.
 
void * cb_attachment
 

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.
 
#define MLISP_EXEC_FLAG_SHARED_ENV   0x40
 Flag for MLISP_EXEC_STATE::flags indicating defines and calls should reference MLISP_PARSER::env instead of MLISP_EXEC_STATE::env.
 

Detailed Description

Current execution state to associate with a MLISP_PARSER.

Note
In general, this library uses nested locks because MLISP_STACK_NODE and MLISP_ENV_NODE do not have MDATA_VECTOR structs attached, so there's no danger of a MDATA_VECTOR being reallocated out from beneath another.

Field Documentation

◆ env

struct MDATA_VECTOR MLISP_EXEC_STATE::env

Environment in which statements are defined if ::MLISP_.

This is segmented with ::MLISP_TYPE_ARGS_S and :: MLISP_TYPE_ARGS_E, to denote env definitions that are actually args for the current lambda.

◆ per_node_child_idx

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.


The documentation for this struct was generated from the following file: