1 /* Copyright (c) 1982 Regents of the University of California */ 2 3 static char sccsid[] = "@(#)maketypes.c 1.1 01/18/82"; 4 5 /* 6 * make symbols 7 */ 8 9 #include "defs.h" 10 #include "sym.h" 11 #include "symtab.h" 12 #include "sym/btypes.h" 13 #include "sym/classes.h" 14 #include "sym/sym.rep" 15 16 /* 17 * point the basic types in the right direction 18 */ 19 20 maketypes() 21 { 22 t_int = st_lookup(symtab, "integer")->type; 23 t_real = st_lookup(symtab, "real")->type; 24 t_char = st_lookup(symtab, "char")->type; 25 t_boolean = st_lookup(symtab, "boolean")->type; 26 if (t_int==NIL || t_real==NIL || t_char==NIL || t_boolean==NIL) { 27 panic("basic types are missing from namelist"); 28 } 29 } 30 31 /* 32 * enter a keyword in the given table 33 */ 34 35 make_keyword(table, name, tnum) 36 SYMTAB *table; 37 char *name; 38 int tnum; 39 { 40 register SYM *s; 41 42 s = st_insert(table, name); 43 s->class = BADUSE; 44 s->blkno = 0; 45 s->symvalue.token.toknum = tnum; 46 } 47