-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
42 lines (29 loc) · 746 Bytes
/
main.c
File metadata and controls
42 lines (29 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <stdlib.h>
#include <stdio.h>
#include <parser_helper.h>
#include "interpreter.h"
extern int yyparse();
extern ast_stmt_t* prog;
extern FILE* yyin;
extern int yydebug;
struct ast_identifier {
};
extern void execute_rust();
extern struct ast_identifier create_identifier(const char*);
extern void print_identifier(struct ast_identifier);
int main(int argc, char** argv) {
if(argc != 2) {
printf("Expected filename, none found.\n");
return 1;
}
execute_rust();
print_identifier(create_identifier("Test"));
yydebug = 0;
yyin = fopen(argv[1], "r");
yyparse();
scope_t* global = malloc(sizeof(scope_t));
global->parent = NULL;
global->vars = NULL;
interpretloop(prog, global);
return 0;
}