maug
Quick and dirty C mini-augmentation library.
Macros | Functions
MLISP Execution Stack
Collaboration diagram for MLISP Execution Stack:

Macros

#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...
 

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...
 

Detailed Description

Macro Definition Documentation

◆ mlisp_stack_push

#define mlisp_stack_push (   exec,
  i,
  ctype 
)     (_mlisp_stack_push_ ## ctype( exec, (ctype)i ))

Push a value onto MLISP_EXEC_STATE::stack.

Parameters
execPointer to the running MLISP_EXEC_STATE.
iValue to push.
Ctype of the value to push. Please see MLISP Types for more information.
Warning
MLISP_EXEC_STATE::stack should be unlocked prior to calling!

Function Documentation

◆ mlisp_stack_dump()

MERROR_RETVAL mlisp_stack_dump ( struct MLISP_PARSER parser,
struct MLISP_EXEC_STATE exec 
)

Dump the stack from the given parser/exec combination.

Warning
This is only available if MLISP_DUMP_ENABLED is defined at compile time!

◆ mlisp_stack_pop_ex()

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.

Warning
MLISP_EXEC_STATE::stack should be unlocked prior to calling!