use separate slot implementation for each module
[lqt.git] / cpptoxml / parser / tokens.cpp
blob7dd1d2d30a460e55076c8740cd332abe1c94c6d5
1 /****************************************************************************
2 **
3 ** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
4 ** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
5 **
6 ** This file is part of the Qt Script Generator project on Trolltech Labs.
7 **
8 ** This file may be used under the terms of the GNU General Public
9 ** License version 2.0 as published by the Free Software Foundation
10 ** and appearing in the file LICENSE.GPL included in the packaging of
11 ** this file. Please review the following information to ensure GNU
12 ** General Public Licensing requirements will be met:
13 ** http://www.trolltech.com/products/qt/opensource.html
15 ** If you are unsure which license is appropriate for your use, please
16 ** review the following information:
17 ** http://www.trolltech.com/products/qt/licensing.html or contact the
18 ** sales department at sales@trolltech.com.
20 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
21 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23 ****************************************************************************/
26 #include <QtCore/qglobal.h>
28 #include "tokens.h"
30 static char const * const _S_token_names[] = {
31 "K_DCOP",
32 "Q_OBJECT",
33 "Q_PROPERTY",
34 "__attribute__",
35 "__typeof",
36 "and",
37 "and_eq",
38 "arrow",
39 "asm",
40 "assign",
41 "auto",
42 "bitand",
43 "bitor",
44 "bool",
45 "break",
46 "case",
47 "catch",
48 "char",
49 "char_literal",
50 "class",
51 "comment",
52 "compl",
53 "concat",
54 "const",
55 "const_cast",
56 "continue",
57 "decr",
58 "default",
59 "delete",
60 "do",
61 "double",
62 "dynamic_cast",
63 "ellipsis",
64 "else",
65 "emit",
66 "enum",
67 "eq",
68 "explicit",
69 "export",
70 "extern",
71 "false",
72 "float",
73 "for",
74 "friend",
75 "geq",
76 "goto",
77 "identifier",
78 "if",
79 "incr",
80 "inline",
81 "int",
82 "k_dcop",
83 "k_dcop_signals",
84 "leq",
85 "long",
86 "mutable",
87 "namespace",
88 "new",
89 "not",
90 "not_eq",
91 "number_literal",
92 "operator",
93 "or",
94 "or_eq",
95 "preproc",
96 "private",
97 "protected",
98 "ptrmem",
99 "public",
100 "register",
101 "reinterpret_cast",
102 "return",
103 "scope",
104 "shift",
105 "short",
106 "signals",
107 "signed",
108 "sizeof",
109 "slots",
110 "static",
111 "static_cast",
112 "string_literal",
113 "struct",
114 "switch",
115 "template",
116 "this",
117 "throw",
118 "true",
119 "try",
120 "typedef",
121 "typeid",
122 "typename",
123 "union",
124 "unsigned",
125 "using",
126 "virtual",
127 "void",
128 "volatile",
129 "wchar_t",
130 "while",
131 "whitespaces",
132 "xor",
133 "xor_eq",
134 "Q_ENUMS"
137 static char _S_printable[][2] = {
138 { char(32), '\0' },
139 { char(33), '\0' },
140 { char(34), '\0' },
141 { char(35), '\0' },
142 { char(36), '\0' },
143 { char(37), '\0' },
144 { char(38), '\0' },
145 { char(39), '\0' },
146 { char(40), '\0' },
147 { char(41), '\0' },
148 { char(42), '\0' },
149 { char(43), '\0' },
150 { char(44), '\0' },
151 { char(45), '\0' },
152 { char(46), '\0' },
153 { char(47), '\0' },
154 { char(48), '\0' },
155 { char(49), '\0' },
156 { char(50), '\0' },
157 { char(51), '\0' },
158 { char(52), '\0' },
159 { char(53), '\0' },
160 { char(54), '\0' },
161 { char(55), '\0' },
162 { char(56), '\0' },
163 { char(57), '\0' },
164 { char(58), '\0' },
165 { char(59), '\0' },
166 { char(60), '\0' },
167 { char(61), '\0' },
168 { char(62), '\0' },
169 { char(63), '\0' },
170 { char(64), '\0' },
171 { char(65), '\0' },
172 { char(66), '\0' },
173 { char(67), '\0' },
174 { char(68), '\0' },
175 { char(69), '\0' },
176 { char(70), '\0' },
177 { char(71), '\0' },
178 { char(72), '\0' },
179 { char(73), '\0' },
180 { char(74), '\0' },
181 { char(75), '\0' },
182 { char(76), '\0' },
183 { char(77), '\0' },
184 { char(78), '\0' },
185 { char(79), '\0' },
186 { char(80), '\0' },
187 { char(81), '\0' },
188 { char(82), '\0' },
189 { char(83), '\0' },
190 { char(84), '\0' },
191 { char(85), '\0' },
192 { char(86), '\0' },
193 { char(87), '\0' },
194 { char(88), '\0' },
195 { char(89), '\0' },
196 { char(90), '\0' },
197 { char(91), '\0' },
198 { char(92), '\0' },
199 { char(93), '\0' },
200 { char(94), '\0' },
201 { char(95), '\0' },
202 { char(96), '\0' },
203 { char(97), '\0' },
204 { char(98), '\0' },
205 { char(99), '\0' },
206 { char(100), '\0' },
207 { char(101), '\0' },
208 { char(102), '\0' },
209 { char(103), '\0' },
210 { char(104), '\0' },
211 { char(105), '\0' },
212 { char(106), '\0' },
213 { char(107), '\0' },
214 { char(108), '\0' },
215 { char(109), '\0' },
216 { char(110), '\0' },
217 { char(111), '\0' },
218 { char(112), '\0' },
219 { char(113), '\0' },
220 { char(114), '\0' },
221 { char(115), '\0' },
222 { char(116), '\0' },
223 { char(117), '\0' },
224 { char(118), '\0' },
225 { char(119), '\0' },
226 { char(120), '\0' },
227 { char(121), '\0' },
228 { char(122), '\0' },
229 { char(123), '\0' },
230 { char(124), '\0' },
231 { char(125), '\0' },
232 { char(126), '\0' },
233 { char(127), '\0' },
236 char const *token_name(int token)
238 if (token == 0)
240 return "eof";
242 else if (token >= 32 && token <= 127)
244 return _S_printable[token - 32];
246 else if (token >= 1000)
248 return _S_token_names[token - 1000];
251 Q_ASSERT(0);
252 return 0;
255 // kate: space-indent on; indent-width 2; replace-tabs on;