parser echoing test in main repl
This commit is contained in:
parent
8533d7b87f
commit
25d84c1e8a
8
Makefile
8
Makefile
|
@ -1,10 +1,14 @@
|
||||||
all: build run
|
all: build run
|
||||||
|
|
||||||
build:
|
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:
|
clean:
|
||||||
rm bin/picrin
|
rm -f src/y.tab.c src/y.tab.h src/lex.yy.c
|
||||||
|
rm -f bin/picrin
|
||||||
|
|
||||||
run:
|
run:
|
||||||
bin/picrin
|
bin/picrin
|
||||||
|
|
|
@ -32,6 +32,7 @@ main()
|
||||||
pic_state *pic;
|
pic_state *pic;
|
||||||
char line[LINE_MAX_LENGTH], last_char;
|
char line[LINE_MAX_LENGTH], last_char;
|
||||||
int char_index;
|
int char_index;
|
||||||
|
pic_value v;
|
||||||
|
|
||||||
pic = pic_open();
|
pic = pic_open();
|
||||||
|
|
||||||
|
@ -51,8 +52,9 @@ main()
|
||||||
line[char_index] = '\0';
|
line[char_index] = '\0';
|
||||||
|
|
||||||
/* echo */
|
/* echo */
|
||||||
printf("%s", line);
|
v = pic_parse(pic, line);
|
||||||
|
|
||||||
|
pic_debug(pic, v);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue