tweaked the lexer to always have DEBUG of 0 and updated .tok file logic in runner

This commit is contained in:
Partho Bhattacharya
2025-02-13 18:51:31 -05:00
parent 3125d14942
commit f64a4633f7
16 changed files with 2783 additions and 17 deletions

43
Makefile.save Normal file
View File

@ -0,0 +1,43 @@
CC := gcc
FLEX := flex
LEX := lexicalStructure.lex
EXE := runner
CFLAGS := -std=c99 -Wall
CPPFLAGS :=
runner: flex.o runner.o
$(CC) -o runner runner.o flex.o
debug: CFLAGS += -DDEBUG=true
debug: clean runner
runner.o: runner.c runner.h flex.h
$(CC) $(CFLAGS) -o runner.o -c runner.c
flex.o: lex.yy.c typedefs.h
$(CC) $(CFLAGS) -o flex.o -c lex.yy.c
lex.yy.c: lexicalStructure.lex
$(FLEX) -o lex.yy.c $(LEX)
test:
./$(EXE) ./tests/test_comments.alpha
./$(EXE) ./tests/test_generalTokenTest.alpha
./$(EXE) ./tests/test_keywords.alpha
./$(EXE) ./tests/test_operators.alpha
./$(EXE) ./tests/test_otherpunc.alpha
./$(EXE) ./tests/test_simpleIntTest.alpha
./$(EXE) ./tests/test_simpleLiterals.alpha
./$(EXE) -tok ./tests/test_comments.alpha
./$(EXE) -tok ./tests/test_generalTokenTest.alpha
./$(EXE) -tok ./tests/test_keywords.alpha
./$(EXE) -tok ./tests/test_operators.alpha
./$(EXE) -tok ./tests/test_otherpunc.alpha
./$(EXE) -tok ./tests/test_simpleIntTest.alpha
./$(EXE) -tok ./tests/test_simpleLiterals.alpha
clean:
rm -f *.o
rm -f lex.yy.c
rm -f $(EXE)
rm -f flex.h
rm -f *.tok