Commit | Line | Data |
---|---|---|
505bf312 KB |
1 | /*- |
2 | * Copyright (c) 1980 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * %sccs.include.redist.c% | |
f644bb55 | 6 | */ |
144a0e9a | 7 | |
f644bb55 | 8 | #ifndef lint |
505bf312 KB |
9 | static char sccsid[] = "@(#)maketypes.c 5.2 (Berkeley) %G%"; |
10 | #endif /* not lint */ | |
144a0e9a ML |
11 | |
12 | /* | |
13 | * make symbols | |
14 | */ | |
15 | ||
16 | #include "defs.h" | |
17 | #include "sym.h" | |
18 | #include "symtab.h" | |
19 | #include "sym/btypes.h" | |
20 | #include "sym/classes.h" | |
21 | #include "sym/sym.rep" | |
22 | ||
23 | /* | |
24 | * point the basic types in the right direction | |
25 | */ | |
26 | ||
27 | maketypes() | |
28 | { | |
29 | t_int = st_lookup(symtab, "integer")->type; | |
30 | t_real = st_lookup(symtab, "real")->type; | |
31 | t_char = st_lookup(symtab, "char")->type; | |
32 | t_boolean = st_lookup(symtab, "boolean")->type; | |
33 | if (t_int==NIL || t_real==NIL || t_char==NIL || t_boolean==NIL) { | |
34 | panic("basic types are missing from namelist"); | |
35 | } | |
36 | } | |
37 | ||
38 | /* | |
39 | * enter a keyword in the given table | |
40 | */ | |
41 | ||
42 | make_keyword(table, name, tnum) | |
43 | SYMTAB *table; | |
44 | char *name; | |
45 | int tnum; | |
46 | { | |
47 | register SYM *s; | |
48 | ||
49 | s = st_insert(table, name); | |
50 | s->class = BADUSE; | |
51 | s->blkno = 0; | |
52 | s->symvalue.token.toknum = tnum; | |
53 | } |