Files
cground/src/parser.h
2025-11-23 13:37:08 +11:00

28 lines
630 B
C

#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