From 0eb49b51619fd832302f26e83550a00153d27f58 Mon Sep 17 00:00:00 2001 From: overflowerror Date: Thu, 20 May 2021 20:01:31 +0200 Subject: [PATCH] grammar is now complete --- src/common.c | 3 +++ src/parser.y | 36 ++++++++++++++++++++++++++++++++++-- src/tree.c | 26 ++++++++++++++++++++++++++ src/tree.h | 15 +++++++++++++++ 4 files changed, 78 insertions(+), 2 deletions(-) diff --git a/src/common.c b/src/common.c index 562efc9..6ef5acb 100644 --- a/src/common.c +++ b/src/common.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "common.h" @@ -21,4 +22,6 @@ void _panic(const char* function, const char* format, ...) { } fprintf(stderr, "\n"); + + exit(4); } diff --git a/src/parser.y b/src/parser.y index 56fff85..cd286b8 100644 --- a/src/parser.y +++ b/src/parser.y @@ -15,10 +15,14 @@ extern void yyerror(char*); %union { struct tree tree; struct params params; + struct template template; char* text; } +%type