refactor: 重构前端代码并添加日志功能

- 重命名和重构了多个文件,包括 lexer、parser 和 AST 相关代码
- 添加了日志功能,使用 LOG_* 宏替代原有的 error 和 warn 函数
- 优化了错误处理和内存分配方式
- 调整了代码结构,提高了模块化和可读性
This commit is contained in:
ZZY
2025-03-19 12:22:55 +08:00
parent 172d72b0a0
commit 05c637e594
76 changed files with 1479 additions and 310 deletions

View File

@ -1,6 +1,7 @@
CC = gcc
CFLAGS = -g -Wall
CFLAGS = -g -Wall -I../../../..
SRC = ../lexer.c ../token.c
LIB = -L../../../../lib -lcore
all = test_all
@ -8,10 +9,10 @@ test_all: test
./test
run:
$(CC) $(CFLAGS) $(SRC) run.c -o run
$(CC) $(CFLAGS) $(SRC) run.c $(LIB) -o run
test:
$(CC) $(CFLAGS) $(SRC) -o test test.c
$(CC) $(CFLAGS) $(SRC) $(LIB) -o test test.c
clean:
rm -f test run