1 | /**************************************************************************** |
2 | ** |
3 | ** Copyright (C) 2016 The Qt Company Ltd. |
4 | ** Contact: https://www.qt.io/licensing/ |
5 | ** |
6 | ** This file is part of the test suite of the Qt Toolkit. |
7 | ** |
8 | ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ |
9 | ** Commercial License Usage |
10 | ** Licensees holding valid commercial Qt licenses may use this file in |
11 | ** accordance with the commercial license agreement provided with the |
12 | ** Software or, alternatively, in accordance with the terms contained in |
13 | ** a written agreement between you and The Qt Company. For licensing terms |
14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
15 | ** information use the contact form at https://www.qt.io/contact-us. |
16 | ** |
17 | ** GNU General Public License Usage |
18 | ** Alternatively, this file may be used under the terms of the GNU |
19 | ** General Public License version 3 as published by the Free Software |
20 | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT |
21 | ** included in the packaging of this file. Please review the following |
22 | ** information to ensure the GNU General Public License requirements will |
23 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. |
24 | ** |
25 | ** $QT_END_LICENSE$ |
26 | ** |
27 | ****************************************************************************/ |
28 | /* NOTE: This file is AUTO GENERATED by qtokenautomaton2cpp.xsl. */ |
29 | |
30 | #include "noNamespace.h" |
31 | |
32 | QT_BEGIN_NAMESPACE |
33 | |
34 | NoNamespace::Token NoNamespace::classifier3(const QChar *data) |
35 | |
36 | { |
37 | if (data[0].unicode() == 100) |
38 | |
39 | |
40 | { |
41 | |
42 | static const unsigned short string[] = |
43 | { |
44 | 101, 102 |
45 | }; |
46 | if(memcmp(s1: &data[1], s2: &string, n: sizeof(QChar) * 2) == 0) |
47 | |
48 | |
49 | return _111; |
50 | |
51 | } |
52 | |
53 | else if (data[0].unicode() == 97) |
54 | |
55 | |
56 | { |
57 | |
58 | static const unsigned short string[] = |
59 | { |
60 | 98, 99 |
61 | }; |
62 | if(memcmp(s1: &data[1], s2: &string, n: sizeof(QChar) * 2) == 0) |
63 | |
64 | |
65 | return _; |
66 | |
67 | } |
68 | |
69 | else if (data[0].unicode() == 103) |
70 | |
71 | |
72 | { |
73 | |
74 | static const unsigned short string[] = |
75 | { |
76 | 104, 105 |
77 | }; |
78 | if(memcmp(s1: &data[1], s2: &string, n: sizeof(QChar) * 2) == 0) |
79 | |
80 | |
81 | return wobbly; |
82 | |
83 | } |
84 | |
85 | |
86 | |
87 | return NoKeyword; |
88 | } |
89 | NoNamespace::Token NoNamespace::classifier4(const QChar *data) |
90 | |
91 | { |
92 | if (data[0].unicode() == 70) |
93 | |
94 | |
95 | { |
96 | if (data[1].unicode() == 70) |
97 | |
98 | |
99 | { |
100 | if (data[2].unicode() == 70) |
101 | |
102 | |
103 | { |
104 | if (data[3].unicode() == 70) |
105 | |
106 | |
107 | { |
108 | |
109 | |
110 | return FFFF; |
111 | |
112 | } |
113 | |
114 | else if (data[3].unicode() == 71) |
115 | |
116 | |
117 | { |
118 | |
119 | |
120 | return FFFG; |
121 | |
122 | } |
123 | |
124 | |
125 | } |
126 | |
127 | else if (data[2].unicode() == 71) |
128 | |
129 | |
130 | { |
131 | if (data[3].unicode() == 70) |
132 | |
133 | |
134 | { |
135 | |
136 | |
137 | return FFGF; |
138 | |
139 | } |
140 | |
141 | else if (data[3].unicode() == 71) |
142 | |
143 | |
144 | { |
145 | |
146 | |
147 | return FFGG; |
148 | |
149 | } |
150 | |
151 | |
152 | } |
153 | |
154 | else if (data[2].unicode() == 76) |
155 | |
156 | |
157 | { |
158 | |
159 | if (data[3].unicode() == 77) |
160 | |
161 | |
162 | return FFLM; |
163 | |
164 | } |
165 | |
166 | |
167 | } |
168 | |
169 | |
170 | } |
171 | |
172 | |
173 | |
174 | return NoKeyword; |
175 | } |
176 | NoNamespace::Token NoNamespace::classifier14(const QChar *data) |
177 | |
178 | { |
179 | if (data[0].unicode() == 119) |
180 | |
181 | |
182 | { |
183 | |
184 | static const unsigned short string[] = |
185 | { |
186 | 101, 45, 104, 97, 118, 101, 45, 100, 97, 115, 104, 101, 115 |
187 | }; |
188 | if(memcmp(s1: &data[1], s2: &string, n: sizeof(QChar) * 13) == 0) |
189 | |
190 | |
191 | return WeHaveDashes; |
192 | |
193 | } |
194 | |
195 | else if (data[0].unicode() == 99) |
196 | |
197 | |
198 | { |
199 | |
200 | static const unsigned short string[] = |
201 | { |
202 | 111, 108, 111, 110, 58, 105, 110, 58, 110, 97, 109, 101, 58 |
203 | }; |
204 | if(memcmp(s1: &data[1], s2: &string, n: sizeof(QChar) * 13) == 0) |
205 | |
206 | |
207 | return ColonInName; |
208 | |
209 | } |
210 | |
211 | |
212 | |
213 | return NoKeyword; |
214 | } |
215 | NoNamespace::Token NoNamespace::classifier15(const QChar *data) |
216 | |
217 | { |
218 | |
219 | static const unsigned short string[] = |
220 | { |
221 | 119, 101, 45, 104, 97, 118, 101, 45, 100, 97, 115, 104, 101, 115, 45 |
222 | }; |
223 | if(memcmp(s1: &data[0], s2: &string, n: sizeof(QChar) * 15) == 0) |
224 | |
225 | |
226 | return WeHaveDashes2; |
227 | |
228 | |
229 | return NoKeyword; |
230 | } |
231 | NoNamespace::Token NoNamespace::classifier44(const QChar *data) |
232 | |
233 | { |
234 | |
235 | static const unsigned short string[] = |
236 | { |
237 | 97, 82, 101, 97, 108, 108, 121, 76, 111, 110, 103, 84, 111, 107, 101, 110, 73, 70, 114, 101, 97, 107, 105, 110, 77, 101, 97, 110, 73, 116, 85, 75, 110, 111, 119, 85, 75, 110, 111, 119, 75, 110, 111, 119 |
238 | }; |
239 | if(memcmp(s1: &data[0], s2: &string, n: sizeof(QChar) * 44) == 0) |
240 | |
241 | |
242 | return AReallyLongTokenIFreakinMeanItUKnowUKnowKnow; |
243 | |
244 | |
245 | return NoKeyword; |
246 | } |
247 | NoNamespace::Token NoNamespace::toToken(const QChar *data, int length) |
248 | { |
249 | switch(length) |
250 | { |
251 | |
252 | case 3: |
253 | return classifier3(data); |
254 | |
255 | |
256 | case 4: |
257 | return classifier4(data); |
258 | |
259 | |
260 | case 14: |
261 | return classifier14(data); |
262 | |
263 | |
264 | case 15: |
265 | return classifier15(data); |
266 | |
267 | |
268 | case 44: |
269 | return classifier44(data); |
270 | |
271 | |
272 | default: |
273 | return NoKeyword; |
274 | } |
275 | } |
276 | |
277 | |
278 | QString NoNamespace::toString(Token token) |
279 | { |
280 | const unsigned short *data = 0; |
281 | int length = 0; |
282 | |
283 | switch(token) |
284 | { |
285 | |
286 | case AReallyLongTokenIFreakinMeanItUKnowUKnowKnow: |
287 | { |
288 | static const unsigned short staticallyStoredAReallyLongTokenIFreakinMeanItUKnowUKnowKnow[] = |
289 | { |
290 | 97, 82, 101, 97, 108, 108, 121, 76, 111, 110, 103, 84, 111, 107, 101, 110, 73, 70, 114, 101, 97, 107, 105, 110, 77, 101, 97, 110, 73, 116, 85, 75, 110, 111, 119, 85, 75, 110, 111, 119, 75, 110, 111, 119, 0 |
291 | }; |
292 | data = staticallyStoredAReallyLongTokenIFreakinMeanItUKnowUKnowKnow; |
293 | length = 44; |
294 | break; |
295 | } |
296 | |
297 | case ColonInName: |
298 | { |
299 | static const unsigned short staticallyStoredColonInName[] = |
300 | { |
301 | 99, 111, 108, 111, 110, 58, 105, 110, 58, 110, 97, 109, 101, 58, 0 |
302 | }; |
303 | data = staticallyStoredColonInName; |
304 | length = 14; |
305 | break; |
306 | } |
307 | |
308 | case FFFF: |
309 | { |
310 | static const unsigned short staticallyStoredFFFF[] = |
311 | { |
312 | 70, 70, 70, 70, 0 |
313 | }; |
314 | data = staticallyStoredFFFF; |
315 | length = 4; |
316 | break; |
317 | } |
318 | |
319 | case FFFG: |
320 | { |
321 | static const unsigned short staticallyStoredFFFG[] = |
322 | { |
323 | 70, 70, 70, 71, 0 |
324 | }; |
325 | data = staticallyStoredFFFG; |
326 | length = 4; |
327 | break; |
328 | } |
329 | |
330 | case FFGF: |
331 | { |
332 | static const unsigned short staticallyStoredFFGF[] = |
333 | { |
334 | 70, 70, 71, 70, 0 |
335 | }; |
336 | data = staticallyStoredFFGF; |
337 | length = 4; |
338 | break; |
339 | } |
340 | |
341 | case FFGG: |
342 | { |
343 | static const unsigned short staticallyStoredFFGG[] = |
344 | { |
345 | 70, 70, 71, 71, 0 |
346 | }; |
347 | data = staticallyStoredFFGG; |
348 | length = 4; |
349 | break; |
350 | } |
351 | |
352 | case FFLM: |
353 | { |
354 | static const unsigned short staticallyStoredFFLM[] = |
355 | { |
356 | 70, 70, 76, 77, 0 |
357 | }; |
358 | data = staticallyStoredFFLM; |
359 | length = 4; |
360 | break; |
361 | } |
362 | |
363 | case WeHaveDashes: |
364 | { |
365 | static const unsigned short staticallyStoredWeHaveDashes[] = |
366 | { |
367 | 119, 101, 45, 104, 97, 118, 101, 45, 100, 97, 115, 104, 101, 115, 0 |
368 | }; |
369 | data = staticallyStoredWeHaveDashes; |
370 | length = 14; |
371 | break; |
372 | } |
373 | |
374 | case WeHaveDashes2: |
375 | { |
376 | static const unsigned short staticallyStoredWeHaveDashes2[] = |
377 | { |
378 | 119, 101, 45, 104, 97, 118, 101, 45, 100, 97, 115, 104, 101, 115, 45, 0 |
379 | }; |
380 | data = staticallyStoredWeHaveDashes2; |
381 | length = 15; |
382 | break; |
383 | } |
384 | |
385 | case _: |
386 | { |
387 | static const unsigned short staticallyStored_[] = |
388 | { |
389 | 97, 98, 99, 0 |
390 | }; |
391 | data = staticallyStored_; |
392 | length = 3; |
393 | break; |
394 | } |
395 | |
396 | case _111: |
397 | { |
398 | static const unsigned short staticallyStored_111[] = |
399 | { |
400 | 100, 101, 102, 0 |
401 | }; |
402 | data = staticallyStored_111; |
403 | length = 3; |
404 | break; |
405 | } |
406 | |
407 | case wobbly: |
408 | { |
409 | static const unsigned short staticallyStoredwobbly[] = |
410 | { |
411 | 103, 104, 105, 0 |
412 | }; |
413 | data = staticallyStoredwobbly; |
414 | length = 3; |
415 | break; |
416 | } |
417 | |
418 | default: |
419 | /* It's either the default token, or an undefined enum |
420 | * value. We silence a compiler warning, and return the |
421 | * empty string. */ |
422 | ; |
423 | } |
424 | |
425 | union |
426 | { |
427 | const unsigned short *data; |
428 | const QChar *asQChar; |
429 | } converter; |
430 | converter.data = data; |
431 | |
432 | return QString::fromRawData(converter.asQChar, size: length); |
433 | } |
434 | |
435 | QT_END_NAMESPACE |
436 | |
437 | |