summaryrefslogtreecommitdiff
path: root/unproto/symbol.c
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>1997-02-25 20:42:19 +0100
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:38:07 +0200
commit4c36e9a0c125ccfff37aa440dab2cf58c4152fff (patch)
treea5d9c84ba2661029ddb2223dacd50529a361c3d5 /unproto/symbol.c
parentf8de35da65c5d93bb733073cf40da154bc1c0748 (diff)
parent9696d7b0e1f3a1b0f5fd4a0428eb75afe8ad4ed6 (diff)
downloaddev86-4c36e9a0c125ccfff37aa440dab2cf58c4152fff.tar.gz
Import Dev86src-0.0.11.tar.gzv0.0.11
Diffstat (limited to 'unproto/symbol.c')
-rw-r--r--unproto/symbol.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/unproto/symbol.c b/unproto/symbol.c
index 0871f63..ce9f7d9 100644
--- a/unproto/symbol.c
+++ b/unproto/symbol.c
@@ -33,12 +33,12 @@
/* Department of Mathematics and Computer Science
/* Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
/* LAST MODIFICATION
-/* 91/11/30 21:10:33
+/* 92/02/15 18:59:56
/* VERSION/RELEASE
-/* 1.2
+/* 1.4
/*--*/
-static char symbol_sccsid[] = "@(#) symbol.c 1.2 91/11/30 21:10:33";
+static char symbol_sccsid[] = "@(#) symbol.c 1.4 92/02/15 18:59:56";
/* C library */
@@ -59,30 +59,6 @@ static struct symbol *sym_tab[SYM_TABSIZE] = {0,};
#define STREQ(x,y) (*(x) == *(y) && strcmp((x),(y)) == 0)
-/* hash - hash a string; original author: P. J. Weinberger at Bell Labs. */
-
-static unsigned hash(s, size)
-register char *s;
-unsigned size;
-{
- register unsigned long h = 0;
- register unsigned long g;
-
- /*
- * For a performance comparison with the hash function presented in K&R,
- * first edition, see the "Dragon" book by Aho, Sethi and Ullman.
- */
-
- while (*s) {
- h = (h << 4) + *s++;
- if (g = (h & 0xf0000000)) {
- h ^= (g >> 24);
- h ^= g;
- }
- }
- return (h % size);
-}
-
/* sym_enter - enter symbol into table */
void sym_enter(name, type)
@@ -94,7 +70,7 @@ int type;
if ((s = (struct symbol *) malloc(sizeof(*s))) == 0
|| (s->name = malloc(strlen(name) + 1)) == 0)
- error(1, "out of memory");
+ fatal("out of memory");
(void) strcpy(s->name, name);
s->type = type;
@@ -135,6 +111,7 @@ struct sym {
static struct sym syms[] = {
"if", TOK_CONTROL,
"else", TOK_CONTROL,
+ "for", TOK_CONTROL,
"while", TOK_CONTROL,
"do", TOK_CONTROL,
"switch", TOK_CONTROL,
@@ -146,6 +123,12 @@ static struct sym syms[] = {
"goto", TOK_CONTROL,
"struct", TOK_COMPOSITE,
"union", TOK_COMPOSITE,
+ "__DATE__", TOK_DATE,
+ "__TIME__", TOK_TIME,
+#if defined(MAP_VOID_STAR) || defined(MAP_VOID)
+ "void", TOK_VOID,
+#endif
+ "asm", TOK_OTHER,
0,
};