-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathashp4c.cpp
More file actions
30 lines (23 loc) · 752 Bytes
/
ashp4c.cpp
File metadata and controls
30 lines (23 loc) · 752 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
#include <stdio.h>
#include <stdlib.h>
#include "command_line.h"
#include "frontend/frontend.h"
#include "midend/midend.h"
int main(int arg_count, char* args[])
{
Arena storage = {}, scratch = {};
Memory::reserve(600 * KILOBYTE);
CommandLineArg* cmdline_arg = CommandLineArg::parse_cmdline(&storage, arg_count, args);
CommandLineArg* filename = cmdline_arg->find_unnamed_arg();
if (!filename) {
printf("<filename> is required.\n");
exit(1);
}
SourceText source_text = {};
source_text.read_source(&storage, &scratch, filename->value);
Frontend frontend = {};
frontend.do_analysis(&storage, &scratch, &source_text);
Midend midend = {};
midend.do_analysis(&storage, &scratch, &source_text, &frontend);
return 0;
}