scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 17de97a568d0c405dba08f9a5356fefcf687b3ac
parent 4e4c6ff3b58ea36c945f4aeeb3357dca5ca6b080
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 23 Sep 2013 20:16:31 +0200

Add complex types

These types are thought for arithmetic with complex numbers, and
they were added in the c99 standard.

Diffstat:
Mdecl.c | 1+
Mkeyword.c | 2++
Mtokens.h | 3++-
3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/decl.c b/decl.c @@ -89,6 +89,7 @@ spec(void) tp = storage(tp, yytoken); break; case UNSIGNED: case SIGNED: + case COMPLEX: case IMAGINARY: case FLOAT: case DOUBLE: case BOOL: case VOID: case CHAR: case SHORT: case INT: case ENUM: case LONG: diff --git a/keyword.c b/keyword.c @@ -10,6 +10,7 @@ static struct keyword { } keywords [] = {"auto", AUTO, "break", BREAK, "_Bool", CHAR, + "_Complex", COMPLEX, "case", CASE, "char", CHAR, "const", CONST, @@ -25,6 +26,7 @@ static struct keyword { "goto", GOTO, "if", IF, "int", INT, + "_Imaginary", IMAGINARY, "long", LONG, "register", REGISTER, "restricted", RESTRICT, diff --git a/tokens.h b/tokens.h @@ -10,7 +10,8 @@ enum tokens { /* types */ INT = 1, CHAR, FLOAT, LONG, LLONG, SHORT, VOID, DOUBLE, - LDOUBLE, STRUCT, UNION, ENUM, UTYPE, BOOL, ARY, PTR, FTN, + LDOUBLE, STRUCT, UNION, ENUM, BOOL, ARY, PTR, FTN, + COMPLEX, IMAGINARY, /* storage specifier */ TYPEDEF, EXTERN, STATIC, AUTO, REGISTER, /* type qualifier */