aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/cc/cc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/cc/cc.h')
-rw-r--r--sys/cmd/cc/cc.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/cmd/cc/cc.h b/sys/cmd/cc/cc.h
index 9871e99..84f173f 100644
--- a/sys/cmd/cc/cc.h
+++ b/sys/cmd/cc/cc.h
@@ -100,6 +100,7 @@ void errorat(Pos x, byte *fmt, ...);
DIRECTIVE(Ddefine,"define", ppdef) \
DIRECTIVE(Dundef,"undef", ppund) \
DIRECTIVE(Dif,"if", ppif0) \
+ DIRECTIVE(Delif,"elif", ppif1) \
DIRECTIVE(Delse, "else", ppif1) \
DIRECTIVE(Difdef,"ifdef", ppif2) \
DIRECTIVE(Difndef,"ifndef", ppif3) \
@@ -184,6 +185,8 @@ enum
Vusgn = iota(12),
Vfloat = iota(13),
Vstr = iota(14),
+
+ Vmask = Vchar - 1,
};
#undef TOK
@@ -221,6 +224,17 @@ struct Sym
};
};
+struct SymTab
+{
+ int32 n_buckets;
+ int32 size;
+ int32 n_occupied;
+ int32 upper_bound;
+ int32 *flags;
+ string *keys;
+ Sym **vals;
+};
+
Sym *lookup(SymTab *tab, string ident);
Sym *define(SymTab *tab, string ident, int kind);
@@ -228,7 +242,7 @@ struct Lexer
{
Pos pos;
Io *io;
- SymTab *sym;
+ SymTab sym;
byte *b;
byte buf[2*1024];
};