Implement OperandStack for Runtime
This commit is contained in:
parent
986c04053e
commit
920251e99f
3 changed files with 52 additions and 1 deletions
17
runtime/OperandStack.h
Normal file
17
runtime/OperandStack.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef OPERAND_STACK
|
||||
#define OPERAND_STACK
|
||||
|
||||
#define TYPE_STACK_SIZE 32
|
||||
|
||||
typedef struct OperandStack {
|
||||
int top;
|
||||
int operands[TYPE_STACK_SIZE];
|
||||
} OperandStack;
|
||||
|
||||
int OStackSize(OperandStack* stack);
|
||||
|
||||
int OStackPush(OperandStack* stack, int operand);
|
||||
|
||||
int OStackPop(OperandStack* stack, int* result);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue