diff --git a/nemu/src/monitor/sdb/addrexp.y b/nemu/src/monitor/sdb/addrexp.y index 6aadc7a..9e296ba 100644 --- a/nemu/src/monitor/sdb/addrexp.y +++ b/nemu/src/monitor/sdb/addrexp.y @@ -1,16 +1,21 @@ -%{ +%code requires { + #include #include #include - #include extern int yylex(void); - void yyerror(uint32_t *result, const char *err) { +} +%{ + #include + #include + #include + void yyerror(word_t *result, const char *err) { fprintf(stderr, "Error: %s\n", err); } %} %token NUMBER HEX_NUMBER %start input -%define api.value.type { uint32_t } +%define api.value.type { word_t } %parse-param { uint32_t *result } %left '-' '+' %left '*' '/' diff --git a/nemu/tests/Makefile b/nemu/tests/Makefile index 7709a27..6804b41 100644 --- a/nemu/tests/Makefile +++ b/nemu/tests/Makefile @@ -1,4 +1,5 @@ TEST_SRCS += tests/expr_test.c +YACC = bison $(OBJ_DIR)/%: %.c $(TEST_OBJS) app @mkdir -p $(dir $@)