From 163664d2065cc2e8c61a25db1537934315b286cb Mon Sep 17 00:00:00 2001 From: Lorenzo Torres Date: Tue, 16 Jun 2026 14:05:40 +0200 Subject: rename project to xcc --- xcc.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 xcc.c (limited to 'xcc.c') diff --git a/xcc.c b/xcc.c new file mode 100644 index 0000000..6518b4a --- /dev/null +++ b/xcc.c @@ -0,0 +1,26 @@ +#include +#include +#include "lexer.h" +#include "parser.h" + +int main(void) +{ + FILE *fp = fopen("examples/hello_world.ll", "r"); + fseek(fp, 0, SEEK_END); + size_t length = ftell(fp); + fseek(fp, 0, SEEK_SET); + + char *src = malloc(length + 1); + fread(src, 1, length, fp); + src[length] = '\0'; + token *head = lexer_parse(src); + + if (!head) { + printf("Parsing error!\n"); + exit(1); + } + + ir_parse(head); + + return 0; +} -- cgit v1.2.3