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 --- .gitignore | 2 +- Makefile | 6 +++--- lc.c | 26 -------------------------- parser.c | 1 - parser.h | 1 + xcc.c | 26 ++++++++++++++++++++++++++ 6 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 lc.c create mode 100644 xcc.c diff --git a/.gitignore b/.gitignore index a2f1174..07a226b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ **/*.o -lc +xcc diff --git a/Makefile b/Makefile index e276abd..b232249 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,17 @@ include config.mk -SRC:=lc.c\ +SRC:=xcc.c\ lexer.c\ parser.c OBJ:=$(SRC:.c=.o) all: $(OBJ) - $(CC) $(OBJ) -o lc + $(CC) $(OBJ) -o xcc %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ .PHONY: clean clean: - @rm -rfv $(OBJ) lc + @rm -rfv $(OBJ) xcc diff --git a/lc.c b/lc.c deleted file mode 100644 index 6518b4a..0000000 --- a/lc.c +++ /dev/null @@ -1,26 +0,0 @@ -#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; -} diff --git a/parser.c b/parser.c index 764858d..8806aa5 100644 --- a/parser.c +++ b/parser.c @@ -1,5 +1,4 @@ #include "parser.h" -#include "lexer.h" #include #include diff --git a/parser.h b/parser.h index 4c750cf..9c5cc71 100644 --- a/parser.h +++ b/parser.h @@ -3,6 +3,7 @@ #include #include +#include "lexer.h" typedef enum { NODE_START, 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