Pristine Ack-5.5
[Ack-5.5.git] / lang / cem / cpp.ansi / tokenname.c
1 /*
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".
4  */
5 /* $Id: tokenname.c,v 1.3 1994/06/24 11:38:25 ceriel Exp $ */
6 /* TOKEN NAME DEFINITIONS */
7
8 #include        "idf.h"
9 #include        "arith.h"
10 #include        "LLlex.h"
11 #include        "Lpars.h"
12
13
14 struct tokenname        {       /*      Used for defining the name of a
15                                         token as identified by its symbol
16                                 */
17         int tn_symbol;
18         char *tn_name;
19 };
20
21
22 /*      To centralize the declaration of %tokens, their presence in this
23         file is taken as their declaration. The Makefile will produce
24         a grammar file (tokenfile.g) from this file.
25         Moreover, rather than looking up a symbol in all these lists
26         to find its printable name, a fast version of symbol2str() is
27         generated from these tables.
28         Consequenty some of these tables are not referenced explicitly
29         in the C text any more.  To save space and to avoid lint confusion,
30         these have been made pseudo-invisible by #ifdefs.
31 */
32
33 #ifdef  ____
34 struct tokenname tkspec[] =     {       /* the names of the special tokens */
35         {IDENTIFIER, "identifier"},
36         {STRING, "string"},
37         {FILESPECIFIER, "filespecifier"},
38         {INTEGER, "integer"},
39         {0, ""}
40 };
41
42 struct tokenname tkcomp[] =     {       /* names of the composite tokens */
43         {PLUSAB, "+="},
44         {MINAB, "-="},
45         {TIMESAB, "*="},
46         {DIVAB, "/="},
47         {MODAB, "%="},
48         {LEFTAB, "<<="},
49         {RIGHTAB, ">>="},
50         {ANDAB, "&="},
51         {XORAB, "^="},
52         {ORAB, "|="},
53         {NOTEQUAL, "!="},
54         {AND, "&&"},
55         {PLUSPLUS, "++"},
56         {MINMIN, "--"},
57         {ARROW, "->"},
58         {LEFT, "<<"},
59         {LESSEQ, "<="},
60         {EQUAL, "=="},
61         {GREATEREQ, ">="},
62         {RIGHT, ">>"},
63         {OR, "||"},
64         {ELLIPSIS, "..."},
65         {0, ""}
66 };
67
68 struct tokenname tkfunny[] =    {       /* internal keywords */
69         {ERRONEOUS, "erroneous"},
70         {0, ""}
71 };
72 #endif  /* ____ */