jack-compiler/parser/parser.c

20 lines
392 B
C
Raw Normal View History

2020-12-14 14:12:20 -05:00
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include "parser.h"
2020-12-22 11:18:54 -05:00
#include "parser-structure.h"
2020-12-14 14:12:20 -05:00
2020-12-22 11:18:54 -05:00
// Statements
2020-12-14 14:12:20 -05:00
PARSER* mkparser(TOKEN* tokens, char* file) {
PARSER* parser = (PARSER*)malloc(sizeof(PARSER));
parser->tokens = tokens;
parser->current = tokens;
parser->file = file;
return parser;
}
2020-12-22 12:38:10 -05:00
void parse(PARSER* p) {
p->output = parseclasses(p);
2020-12-14 14:12:20 -05:00
}