4a54598f9ec96688dcf4911da9e345a4d8ce7707
[nit.git] / lib / json / json_lexer.nit
1 # Lexer generated by nitcc for the grammar json
2 module json_lexer is no_warning "missing-doc"
3 import nitcc_runtime
4 import json_parser
5 class Lexer_json
6 super Lexer
7 redef fun start_state do return dfastate_0
8 end
9 private fun dfastate_0: DFAState0 do return once new DFAState0
10 private fun dfastate_1: DFAState1 do return once new DFAState1
11 private fun dfastate_2: DFAState2 do return once new DFAState2
12 private fun dfastate_3: DFAState3 do return once new DFAState3
13 private fun dfastate_4: DFAState4 do return once new DFAState4
14 private fun dfastate_5: DFAState5 do return once new DFAState5
15 private fun dfastate_6: DFAState6 do return once new DFAState6
16 private fun dfastate_7: DFAState7 do return once new DFAState7
17 private fun dfastate_8: DFAState8 do return once new DFAState8
18 private fun dfastate_9: DFAState9 do return once new DFAState9
19 private fun dfastate_10: DFAState10 do return once new DFAState10
20 private fun dfastate_11: DFAState11 do return once new DFAState11
21 private fun dfastate_12: DFAState12 do return once new DFAState12
22 private fun dfastate_13: DFAState13 do return once new DFAState13
23 private fun dfastate_14: DFAState14 do return once new DFAState14
24 private fun dfastate_15: DFAState15 do return once new DFAState15
25 private fun dfastate_16: DFAState16 do return once new DFAState16
26 private fun dfastate_17: DFAState17 do return once new DFAState17
27 private fun dfastate_18: DFAState18 do return once new DFAState18
28 private fun dfastate_19: DFAState19 do return once new DFAState19
29 private fun dfastate_20: DFAState20 do return once new DFAState20
30 private fun dfastate_21: DFAState21 do return once new DFAState21
31 private fun dfastate_22: DFAState22 do return once new DFAState22
32 private fun dfastate_23: DFAState23 do return once new DFAState23
33 private fun dfastate_24: DFAState24 do return once new DFAState24
34 private fun dfastate_25: DFAState25 do return once new DFAState25
35 private fun dfastate_26: DFAState26 do return once new DFAState26
36 private fun dfastate_27: DFAState27 do return once new DFAState27
37 private fun dfastate_28: DFAState28 do return once new DFAState28
38 private fun dfastate_29: DFAState29 do return once new DFAState29
39 private fun dfastate_30: DFAState30 do return once new DFAState30
40 private fun dfastate_31: DFAState31 do return once new DFAState31
41 private fun dfastate_32: DFAState32 do return once new DFAState32
42 private fun dfastate_33: DFAState33 do return once new DFAState33
43 private fun dfastate_34: DFAState34 do return once new DFAState34
44 class MyNToken
45 super NToken
46 end
47 private class DFAState0
48 super DFAState
49 redef fun trans(char) do
50 var c = char.code_point
51 if c <= 8 then return null
52 if c <= 10 then return dfastate_1
53 if c <= 31 then return null
54 if c <= 32 then return dfastate_1
55 if c <= 33 then return null
56 if c <= 34 then return dfastate_2
57 if c <= 43 then return null
58 if c <= 44 then return dfastate_3
59 if c <= 45 then return dfastate_4
60 if c <= 47 then return null
61 if c <= 57 then return dfastate_5
62 if c <= 58 then return dfastate_6
63 if c <= 90 then return null
64 if c <= 91 then return dfastate_7
65 if c <= 92 then return null
66 if c <= 93 then return dfastate_8
67 if c <= 101 then return null
68 if c <= 102 then return dfastate_9
69 if c <= 109 then return null
70 if c <= 110 then return dfastate_10
71 if c <= 115 then return null
72 if c <= 116 then return dfastate_11
73 if c <= 122 then return null
74 if c <= 123 then return dfastate_12
75 if c <= 124 then return null
76 if c <= 125 then return dfastate_13
77 return null
78 end
79 end
80 private class DFAState1
81 super DFAState
82 redef fun is_accept do return true
83 redef fun is_ignored do return true
84 redef fun make_token(position, source) do
85 return null
86 end
87 redef fun trans(char) do
88 var c = char.code_point
89 if c <= 8 then return null
90 if c <= 10 then return dfastate_1
91 if c <= 31 then return null
92 if c <= 32 then return dfastate_1
93 return null
94 end
95 end
96 private class DFAState2
97 super DFAState
98 redef fun trans(char) do
99 var c = char.code_point
100 if c <= 33 then return dfastate_2
101 if c <= 34 then return dfastate_29
102 if c <= 91 then return dfastate_2
103 if c <= 92 then return dfastate_30
104 return dfastate_2
105 end
106 end
107 private class DFAState3
108 super DFAState
109 redef fun is_accept do return true
110 redef fun make_token(position, source) do
111 var t = new N_39d_44d_39d
112 t.text = ","
113 t.position = position
114 return t
115 end
116 end
117 private class DFAState4
118 super DFAState
119 redef fun trans(char) do
120 var c = char.code_point
121 if c <= 47 then return null
122 if c <= 57 then return dfastate_5
123 return null
124 end
125 end
126 private class DFAState5
127 super DFAState
128 redef fun is_accept do return true
129 redef fun make_token(position, source) do
130 var t = new Nnumber
131 t.text = position.extract(source)
132 t.position = position
133 return t
134 end
135 redef fun trans(char) do
136 var c = char.code_point
137 if c <= 45 then return null
138 if c <= 46 then return dfastate_24
139 if c <= 47 then return null
140 if c <= 57 then return dfastate_5
141 if c <= 68 then return null
142 if c <= 69 then return dfastate_25
143 if c <= 100 then return null
144 if c <= 101 then return dfastate_25
145 return null
146 end
147 end
148 private class DFAState6
149 super DFAState
150 redef fun is_accept do return true
151 redef fun make_token(position, source) do
152 var t = new N_39d_58d_39d
153 t.text = ":"
154 t.position = position
155 return t
156 end
157 end
158 private class DFAState7
159 super DFAState
160 redef fun is_accept do return true
161 redef fun make_token(position, source) do
162 var t = new N_39d_91d_39d
163 t.text = "["
164 t.position = position
165 return t
166 end
167 end
168 private class DFAState8
169 super DFAState
170 redef fun is_accept do return true
171 redef fun make_token(position, source) do
172 var t = new N_39d_93d_39d
173 t.text = "]"
174 t.position = position
175 return t
176 end
177 end
178 private class DFAState9
179 super DFAState
180 redef fun trans(char) do
181 var c = char.code_point
182 if c <= 96 then return null
183 if c <= 97 then return dfastate_20
184 return null
185 end
186 end
187 private class DFAState10
188 super DFAState
189 redef fun trans(char) do
190 var c = char.code_point
191 if c <= 116 then return null
192 if c <= 117 then return dfastate_17
193 return null
194 end
195 end
196 private class DFAState11
197 super DFAState
198 redef fun trans(char) do
199 var c = char.code_point
200 if c <= 113 then return null
201 if c <= 114 then return dfastate_14
202 return null
203 end
204 end
205 private class DFAState12
206 super DFAState
207 redef fun is_accept do return true
208 redef fun make_token(position, source) do
209 var t = new N_39d_123d_39d
210 t.text = "\{"
211 t.position = position
212 return t
213 end
214 end
215 private class DFAState13
216 super DFAState
217 redef fun is_accept do return true
218 redef fun make_token(position, source) do
219 var t = new N_39d_125d_39d
220 t.text = "\}"
221 t.position = position
222 return t
223 end
224 end
225 private class DFAState14
226 super DFAState
227 redef fun trans(char) do
228 var c = char.code_point
229 if c <= 116 then return null
230 if c <= 117 then return dfastate_15
231 return null
232 end
233 end
234 private class DFAState15
235 super DFAState
236 redef fun trans(char) do
237 var c = char.code_point
238 if c <= 100 then return null
239 if c <= 101 then return dfastate_16
240 return null
241 end
242 end
243 private class DFAState16
244 super DFAState
245 redef fun is_accept do return true
246 redef fun make_token(position, source) do
247 var t = new N_39dtrue_39d
248 t.text = "true"
249 t.position = position
250 return t
251 end
252 end
253 private class DFAState17
254 super DFAState
255 redef fun trans(char) do
256 var c = char.code_point
257 if c <= 107 then return null
258 if c <= 108 then return dfastate_18
259 return null
260 end
261 end
262 private class DFAState18
263 super DFAState
264 redef fun trans(char) do
265 var c = char.code_point
266 if c <= 107 then return null
267 if c <= 108 then return dfastate_19
268 return null
269 end
270 end
271 private class DFAState19
272 super DFAState
273 redef fun is_accept do return true
274 redef fun make_token(position, source) do
275 var t = new N_39dnull_39d
276 t.text = "null"
277 t.position = position
278 return t
279 end
280 end
281 private class DFAState20
282 super DFAState
283 redef fun trans(char) do
284 var c = char.code_point
285 if c <= 107 then return null
286 if c <= 108 then return dfastate_21
287 return null
288 end
289 end
290 private class DFAState21
291 super DFAState
292 redef fun trans(char) do
293 var c = char.code_point
294 if c <= 114 then return null
295 if c <= 115 then return dfastate_22
296 return null
297 end
298 end
299 private class DFAState22
300 super DFAState
301 redef fun trans(char) do
302 var c = char.code_point
303 if c <= 100 then return null
304 if c <= 101 then return dfastate_23
305 return null
306 end
307 end
308 private class DFAState23
309 super DFAState
310 redef fun is_accept do return true
311 redef fun make_token(position, source) do
312 var t = new N_39dfalse_39d
313 t.text = "false"
314 t.position = position
315 return t
316 end
317 end
318 private class DFAState24
319 super DFAState
320 redef fun trans(char) do
321 var c = char.code_point
322 if c <= 47 then return null
323 if c <= 57 then return dfastate_28
324 return null
325 end
326 end
327 private class DFAState25
328 super DFAState
329 redef fun trans(char) do
330 var c = char.code_point
331 if c <= 42 then return null
332 if c <= 43 then return dfastate_26
333 if c <= 44 then return null
334 if c <= 45 then return dfastate_26
335 if c <= 47 then return null
336 if c <= 57 then return dfastate_27
337 return null
338 end
339 end
340 private class DFAState26
341 super DFAState
342 redef fun trans(char) do
343 var c = char.code_point
344 if c <= 47 then return null
345 if c <= 57 then return dfastate_27
346 return null
347 end
348 end
349 private class DFAState27
350 super DFAState
351 redef fun is_accept do return true
352 redef fun make_token(position, source) do
353 var t = new Nnumber
354 t.text = position.extract(source)
355 t.position = position
356 return t
357 end
358 redef fun trans(char) do
359 var c = char.code_point
360 if c <= 47 then return null
361 if c <= 57 then return dfastate_27
362 return null
363 end
364 end
365 private class DFAState28
366 super DFAState
367 redef fun is_accept do return true
368 redef fun make_token(position, source) do
369 var t = new Nnumber
370 t.text = position.extract(source)
371 t.position = position
372 return t
373 end
374 redef fun trans(char) do
375 var c = char.code_point
376 if c <= 47 then return null
377 if c <= 57 then return dfastate_28
378 if c <= 68 then return null
379 if c <= 69 then return dfastate_25
380 if c <= 100 then return null
381 if c <= 101 then return dfastate_25
382 return null
383 end
384 end
385 private class DFAState29
386 super DFAState
387 redef fun is_accept do return true
388 redef fun make_token(position, source) do
389 var t = new Nstring
390 t.text = position.extract(source)
391 t.position = position
392 return t
393 end
394 end
395 private class DFAState30
396 super DFAState
397 redef fun trans(char) do
398 var c = char.code_point
399 if c <= 33 then return null
400 if c <= 34 then return dfastate_2
401 if c <= 46 then return null
402 if c <= 47 then return dfastate_2
403 if c <= 91 then return null
404 if c <= 92 then return dfastate_2
405 if c <= 97 then return null
406 if c <= 98 then return dfastate_2
407 if c <= 101 then return null
408 if c <= 102 then return dfastate_2
409 if c <= 109 then return null
410 if c <= 110 then return dfastate_2
411 if c <= 113 then return null
412 if c <= 114 then return dfastate_2
413 if c <= 115 then return null
414 if c <= 116 then return dfastate_2
415 if c <= 117 then return dfastate_31
416 return null
417 end
418 end
419 private class DFAState31
420 super DFAState
421 redef fun trans(char) do
422 var c = char.code_point
423 if c <= 47 then return null
424 if c <= 57 then return dfastate_32
425 if c <= 64 then return null
426 if c <= 90 then return dfastate_32
427 if c <= 96 then return null
428 if c <= 122 then return dfastate_32
429 return null
430 end
431 end
432 private class DFAState32
433 super DFAState
434 redef fun trans(char) do
435 var c = char.code_point
436 if c <= 47 then return null
437 if c <= 57 then return dfastate_33
438 if c <= 64 then return null
439 if c <= 90 then return dfastate_33
440 if c <= 96 then return null
441 if c <= 122 then return dfastate_33
442 return null
443 end
444 end
445 private class DFAState33
446 super DFAState
447 redef fun trans(char) do
448 var c = char.code_point
449 if c <= 47 then return null
450 if c <= 57 then return dfastate_34
451 if c <= 64 then return null
452 if c <= 90 then return dfastate_34
453 if c <= 96 then return null
454 if c <= 122 then return dfastate_34
455 return null
456 end
457 end
458 private class DFAState34
459 super DFAState
460 redef fun trans(char) do
461 var c = char.code_point
462 if c <= 47 then return null
463 if c <= 57 then return dfastate_2
464 if c <= 64 then return null
465 if c <= 90 then return dfastate_2
466 if c <= 96 then return null
467 if c <= 122 then return dfastate_2
468 return null
469 end
470 end