28 lines
509 B
C
28 lines
509 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;
|
|
int32_t stackCapacity;
|
|
int32_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 */
|