From fe36a92c2d22057e8bbbf4c248706984f06415c0 Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 5 Jun 2018 02:49:50 +0200 Subject: Add void type --- src/symbol_table.c | 2 ++ src/symbol_table.h | 3 ++- src/tpc.lex | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/symbol_table.c b/src/symbol_table.c index 60f2cd6..3ac34fb 100644 --- a/src/symbol_table.c +++ b/src/symbol_table.c @@ -203,6 +203,8 @@ static char *string_of_type(int type) { return "INT"; case CHAR: return "CHAR"; + case VOID: + return "VOID"; default: return "UNEXPECTED"; } diff --git a/src/symbol_table.h b/src/symbol_table.h index 917e4f9..cd14ae2 100644 --- a/src/symbol_table.h +++ b/src/symbol_table.h @@ -16,7 +16,8 @@ typedef enum type { INT, - CHAR + CHAR, + VOID } Type; typedef struct { diff --git a/src/tpc.lex b/src/tpc.lex index bdf6bb5..7d907b4 100644 --- a/src/tpc.lex +++ b/src/tpc.lex @@ -7,6 +7,7 @@ #include "tpc.tab.h" #define INT 0 #define CHAR 1 +#define VOID 2 int lineno = 1; %} -- cgit v1.2.3