From d9f3d6f06a53edbf185a4dcc58549cbd5a2794d9 Mon Sep 17 00:00:00 2001 From: Stefano Sanfilippo Date: Sun, 23 Nov 2014 19:24:10 +0100 Subject: [PATCH] Fix conflicts by introducing a CASE_END token. --- Monicelli.ll | 3 +++ Monicelli.y | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Monicelli.ll b/Monicelli.ll index 81c901a..91c4159 100644 --- a/Monicelli.ll +++ b/Monicelli.ll @@ -144,6 +144,9 @@ CHAR [a-zA-Z_] "avvertite don ulrico" { return ABORT; } +"..." { + return CASE_END; +} [ \t\f\v] {} diff --git a/Monicelli.y b/Monicelli.y index 97d4de3..fe304be 100644 --- a/Monicelli.y +++ b/Monicelli.y @@ -20,7 +20,7 @@ extern void emit(const char *, ...); %token PRINT INPUT %token ASSERT_BEGIN ASSERT_END %token LOOP_BEGIN LOOP_CONDITION -%token BRANCH_CONDITION BRANCH_BEGIN BRANCH_ELSE BRANCH_END +%token BRANCH_CONDITION BRANCH_BEGIN BRANCH_ELSE BRANCH_END CASE_END %token COLON COMMA LCURL RCURL %token FUNDECL PARAMS FUNCALL %token ABORT @@ -111,7 +111,7 @@ cases: case_stmt | case_stmt cases ; case_stmt: - expression COLON NEWLINE statements + expression COLON NEWLINE statements CASE_END ; fun_call: FUNCALL ID args