Skip to content
Snippets Groups Projects
Commit c90b7563 authored by ben.franksen's avatar ben.franksen
Browse files

simplified snl parser definition by removing the non-terminal "number"

parent 1d41e6c3
No related branches found
No related tags found
No related merge requests found
......@@ -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); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment