maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
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)
 Wrapper for mlisp_stack_pop() with no flags.
 
#define mlisp_stack_push(exec, i, ctype)
 Push a value onto MLISP_EXEC_STATE::stack.
 

Functions

MERROR_RETVAL mlisp_stack_dump (struct MLISP_PARSER *parser, struct MLISP_EXEC_STATE *exec)
 Dump the stack from the given parser/exec combination.
 
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.
 
MERROR_RETVAL mlisp_stack_peek (struct MLISP_EXEC_STATE *exec, struct MLISP_STACK_NODE *o)
 

Detailed Description

Macro Definition Documentation

◆ mlisp_stack_pop

#define mlisp_stack_pop ( exec,
o )
Value:
mlisp_stack_pop_ex( exec, o, 0 )
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.

Wrapper for mlisp_stack_pop() with no flags.

◆ mlisp_stack_push

#define mlisp_stack_push ( exec,
i,
ctype )
Value:
(_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!