2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 /* $Id: tokenname.c,v 1.10 1994/06/27 08:03:00 ceriel Exp $ */
6 /* TOKEN NAME DEFINITIONS */
11 #include "tokenname.h"
14 /* To centralize the declaration of %tokens, their presence in this
15 file is taken as their declaration. The Makefile will produce
16 a grammar file (tokenfile.g) from this file.
17 Moreover, rather than looking up a symbol in all these lists
18 to find its printable name, a fast version of symbol2str() is
19 generated from these tables.
20 Consequenty some of these tables are not referenced explicitly
21 in the C text any more. To save space and to avoid lint confusion,
22 these have been made pseudo-invisible by #ifdefs.
26 struct tokenname tkspec[] = { /* the names of the special tokens */
27 {IDENTIFIER, "identifier"},
28 {TYPE_IDENTIFIER, "type_identifier"},
31 {FILESPECIFIER, "filespecifier"},
33 {FLOATING, "floating"},
39 struct tokenname tkcomp[] = { /* names of the composite tokens */
66 struct tokenname tkidf[] = { /* names of the identifier tokens */
71 {CONTINUE, "continue"},
81 {REGISTER, "register"},
91 {UNSIGNED, "unsigned"},
92 {VOLATILE, "volatile"},
104 struct tokenname tkfunny[] = { /* internal keywords */
105 {LNGDBL, "long double"},
106 {ULONG, "unsigned long"},
109 {FUNCTION, "function"},
110 {POINTER, "pointer"},
116 {ERRONEOUS, "erroneous"},
118 {PARCOMMA, "parcomma"},
119 {INITCOMMA, "initcomma"},
122 {ADDRESSOF,"unary &"},
123 {POSTINCR, "postfix ++"},
124 {POSTDECR, "postfix --"},
126 {INT2INT, "int2int"},
127 {INT2FLOAT, "int2float"},
128 {FLOAT2INT, "float2int"},
129 {FLOAT2FLOAT, "float2float"},
135 register struct tokenname resv[];
137 /* The names of the tokens described in resv are entered
140 while (resv->tn_symbol) {
141 struct idf *idf = str2idf(resv->tn_name, 0);
143 if (idf->id_reserved)
144 fatal("maximum identifier length insufficient");
145 idf->id_reserved = resv->tn_symbol;