28 lines
511 B
C
28 lines
511 B
C
#ifndef WRAITH_STACK_H
|
|
#define WRAITH_STACK_H
|
|
|
|
#include "ast.h"
|
|
|
|
typedef struct StackFrame
|
|
{
|
|
Node **nodes;
|
|
uint32_t nodeCount;
|
|
uint32_t nodeCapacity;
|
|
} StackFrame;
|
|
|
|
typedef struct Stack
|
|
{
|
|
StackFrame *stackFrames;
|
|
uint32_t stackCapacity;
|
|
uint32_t stackIndex;
|
|
} Stack;
|
|
|
|
Stack* CreateStack();
|
|
void PushStackFrame(Stack *stack);
|
|
void PopStackFrame(Stack *stack);
|
|
|
|
void AddNode(Stack *stack, Node *statementNode);
|
|
Node** GetNodes(Stack *stack, uint32_t *pCount);
|
|
|
|
#endif /* WRAITH_STACK_H */
|