From f5ae2c192f81b4a4ac84cf709b04faaf4d3be283 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sun, 17 Apr 2022 16:05:44 -0400 Subject: print single input expressions --- expr.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/expr.y b/expr.y index e066643..f1648e7 100644 --- a/expr.y +++ b/expr.y @@ -19,8 +19,6 @@ static char **expr_args; #define YYSTYPE expr_yystype -//#include "y.tab.h" - static int yylex(void); static int yyerror(const char *s); static void expr_only_integers(YYSTYPE *y1, YYSTYPE *y2); @@ -43,9 +41,11 @@ static int expr_compare(YYSTYPE *y1, YYSTYPE *y2); %% expr : STRING { + printf("%s\n", $1.u.s); } | INTEGER { + printf("%d\n", $1.u.i); } | '(' expr ')' { -- cgit v1.2.1