Initial commit

This commit is contained in:
2025-11-23 13:37:08 +11:00
commit d1711accde
10 changed files with 499 additions and 0 deletions

27
src/parser.h Normal file
View File

@@ -0,0 +1,27 @@
#ifndef PARSER_H
#define PARSER_H
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include "types.h"
#include "lexer.h"
typedef struct GroundProgram {
GroundInstruction* instructions;
size_t size;
} GroundProgram;
// Creates a new GroundProgram
GroundProgram createGroundProgram();
// Adds instruction (instruction) to GroundProgram (gp)
void addInstructionToProgram(GroundProgram* gp, GroundInstruction instruction);
// Frees all GroundInstructions in GroundProgram (gp)
void freeGroundProgram(GroundProgram* gp);
// Parses the file into a GroundProgram
GroundProgram parseFile(LexedFile file);
#endif