Clean up semantic rules.

This commit is contained in:
Stefano Sanfilippo 2014-11-23 19:20:10 +01:00
parent 573a94def6
commit c7fec8c9e0

View File

@ -36,7 +36,6 @@ extern void emit(const char *, ...);
%start program %start program
%type<strval> expression;
%type<intval> NUMBER; %type<intval> NUMBER;
%type<floatval> FLOAT; %type<floatval> FLOAT;
%type<strval> ID; %type<strval> ID;
@ -121,14 +120,10 @@ fun_call:
FUNCALL ID args | FUNCALL ID FUNCALL ID args | FUNCALL ID
; ;
abort_stmt: abort_stmt:
ABORT { ABORT
emit("exit(1);\n");
}
; ;
assert_stmt: assert_stmt:
ASSERT_BEGIN expression ASSERT_END { ASSERT_BEGIN expression ASSERT_END
emit("assert(", $2, ");\n");
}
; ;
expression: expression:
numeric | numeric |