diff --git a/Makefile b/Makefile index 3b4ff387..2005ab97 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,14 @@ all: build run build: - gcc -o bin/picrin -I./include src/main.c src/state.c src/gc.c src/pair.c src/write.c src/symbol.c src/value.c + cd src; \ + yacc -d parse.y; \ + lex scan.l + gcc -o bin/picrin -I./include src/main.c src/state.c src/gc.c src/pair.c src/write.c src/symbol.c src/value.c src/y.tab.c src/lex.yy.c clean: - rm bin/picrin + rm -f src/y.tab.c src/y.tab.h src/lex.yy.c + rm -f bin/picrin run: bin/picrin diff --git a/src/main.c b/src/main.c index 806c720f..28f04b18 100644 --- a/src/main.c +++ b/src/main.c @@ -32,6 +32,7 @@ main() pic_state *pic; char line[LINE_MAX_LENGTH], last_char; int char_index; + pic_value v; pic = pic_open(); @@ -51,8 +52,9 @@ main() line[char_index] = '\0'; /* echo */ - printf("%s", line); + v = pic_parse(pic, line); + pic_debug(pic, v); printf("\n"); }