maps.h (469B)
1 #ifndef __MAPS_H_ 2 #define __MAPS_H_ 3 #include <stdlib.h> 4 #include <stdio.h> 5 6 #include "util.h" 7 #include "lexer.h" 8 #include "parse.h" 9 10 typedef struct map { 11 char *id; 12 void *data; 13 struct map *next; 14 } map; 15 16 typedef struct fn { 17 char *name; 18 type *rtype, *args; 19 int argc; 20 } fn; 21 22 typedef struct var { 23 char *name; 24 type *type; 25 } var; 26 27 extern map *funcs; 28 extern map *vars; 29 30 map *addmap(map *m, void *data, char *id, mctx *ctx); 31 void *lookupmap(map *m, char *id); 32 #endif