scc

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

commit d31abf3c36b0f84085c78a35791d8a25cb941da3
parent c076bf291eff4fa3fa0702cb971a493fc1dc1680
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 10 Jun 2012 19:12:51 +0200

Unified keywords and symbols

This helps in simplify the code, using the same code for both, keywords and
symbols. After this patch the lexical is simpler, because doesn't care about
the keywords.

Diffstat:
Msymbol.h | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/symbol.h b/symbol.h @@ -8,12 +8,14 @@ struct type; struct symbol { struct type *type; union { - struct { /* used in usual symbols */ + struct { char *str; - unsigned char level; + union { + unsigned char level;/* used in usual symbols */ + unsigned char tok; /* used in keywords */ + }; }; - unsigned char tok; /* used in keywords */ - short val; + short val; /* used in integer constant */ }; struct symbol *next; struct symbol *h_next, *h_prev;