diff --git a/lab-3/main_test.c b/lab-3/main_test.c index 7153e6a..6205cc0 100644 --- a/lab-3/main_test.c +++ b/lab-3/main_test.c @@ -44,7 +44,7 @@ UTEST(scanner, hello) { int index = 0; token_t t; do { - printf("index: %d token: %d text: %s\n", index, t, yytext); + // printf("index: %d token: %d text: %s\n", index, t, yytext); ASSERT_EQ(tokens[index].t, (t = yylex())); ASSERT_STREQ(tokens[index].p, yytext); ++index; diff --git a/lab-4/parser.bison b/lab-4/parser.bison index 6d1a7f6..451e66c 100644 --- a/lab-4/parser.bison +++ b/lab-4/parser.bison @@ -60,22 +60,9 @@ int yylex(); %token TOKEN_EXPONENTIAL %% -program : expr TOKEN_SEMI; -expr : expr TOKEN_PLUS term - | expr TOKEN_MINUS term - | term - ; -term : term TOKEN_MUL factor - | term TOKEN_DIV factor - | factor - ; -factor: TOKEN_MINUS factor - | TOKEN_LPAREN expr TOKEN_RPAREN - | TOKEN_INT - ; %% void yyerror(const char* msg) { fprintf(stderr, "Error | Line: %d\n%s\n",yylineno,msg);