jackc/parser/parser.c

24 lines
424 B
C
Raw Permalink Normal View History

2021-01-04 15:00:48 -05:00
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include "parser.h"
#include "parser-structure.h"
PARSER* mkparser(TOKEN* t, char* file) {
PARSER* parser = (PARSER*)malloc(sizeof(PARSER));
parser->tokens = t;
parser->current = t;
parser->file = file;
return parser;
}
CLASS* parse(PARSER* p) {
return parseclass(p);
}
void freeparser(PARSER* p) {
freetokens(p->tokens);
free(p);
}