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 3.3 1994/06/24 12:06:34 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"},
30 {FILESPECIFIER, "filespecifier"},
32 {FLOATING, "floating"},
38 struct tokenname tkcomp[] = { /* names of the composite tokens */
54 struct tokenname tkidf[] = { /* names of the identifier tokens */
59 {CONTINUE, "continue"},
69 {REGISTER, "register"},
78 {UNSIGNED, "unsigned"},
83 struct tokenname tkother[] = { /* additional keywords from the RM */
90 struct tokenname tkfunny[] = { /* internal keywords */
98 {FUNCTION, "function"},
101 {NEWLINE, "newline"},
104 {IMPLICIT, "implicit"},
107 {ERRONEOUS, "erroneous"},
109 {PARCOMMA, "parcomma"},
110 {INITCOMMA, "initcomma"},
112 {POSTINCR, "postfix ++"},
113 {POSTDECR, "postfix --"},
125 {INT2INT, "int2int"},
126 {INT2FLOAT, "int2float"},
127 {FLOAT2INT, "float2int"},
128 {FLOAT2FLOAT, "float2float"},
134 register struct tokenname resv[];
136 /* The names of the tokens described in resv are entered
139 while (resv->tn_symbol) {
140 struct idf *idf = str2idf(resv->tn_name);
142 if (idf->id_reserved)
143 fatal("maximum identifier length insufficient");
144 idf->id_reserved = resv->tn_symbol;