From c90b7563afe71562d2ed7932c55de2e4abc644e9 Mon Sep 17 00:00:00 2001 From: "ben.franksen" <ben.franksen@online.de> Date: Mon, 17 May 2010 01:50:43 +0000 Subject: [PATCH] simplified snl parser definition by removing the non-terminal "number" --- src/snc/snl.lem | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/snc/snl.lem b/src/snc/snl.lem index 790a816d..a44590ab 100644 --- a/src/snc/snl.lem +++ b/src/snc/snl.lem @@ -166,10 +166,6 @@ decl(p) ::= type(t) ASTERISK NAME(v) SEMICOLON. decl(p) ::= type(t) ASTERISK NAME(v) subscript(s) SEMICOLON. { p = decl(t, VC_ARRAYP, v, s.str, 0, 0); } -%type number {Token} -number(p) ::= INTCON(x). { p = x; } -number(p) ::= FPCON(x). { p = x; } - %type type {int} type(p) ::= CHAR. { p = V_CHAR; } type(p) ::= SHORT. { p = V_SHORT; } @@ -292,7 +288,8 @@ for_statement(p) ::= // Expressions // Atomic -expr(p) ::= number(x). { p = expr(E_CONST, x); } +expr(p) ::= INTCON(x). { p = expr(E_CONST, x); } +expr(p) ::= FPCON(x). { p = expr(E_CONST, x); } expr(p) ::= string(x). { p = x; } expr(p) ::= NAME(v). { p = expr(E_VAR, v); } -- GitLab