Shapes
GIS made easy, a lightweight header-only planar geometry library for Modern C++
wkt_lexer.hpp
1 /* Generated by re2c 1.1.1 on Sat Jun 22 16:03:54 2019 */
2 #pragma once
3 
4 #include <ciso646>
5 #include <iostream>
6 #include <simo/io/wkt_token.hpp>
7 
8 namespace simo
9 {
10 namespace shapes
11 {
12 
19 class wkt_lexer
20 {
21  public:
22 
29  wkt_lexer(const std::string& source)
30  : content(source)
31  {
32  start = cursor = source.c_str();
33  limit = start + source.size();
34  }
35 
42  int scan()
43  {
44 
46  const char* marker = nullptr;
47 
48  start = cursor;
49 
50 
51 {
52  char yych;
53  unsigned int yyaccept = 0;
54  static const unsigned char yybm[] = {
55  0, 0, 0, 0, 0, 0, 0, 0,
56  0, 128, 128, 0, 0, 128, 0, 0,
57  0, 0, 0, 0, 0, 0, 0, 0,
58  0, 0, 0, 0, 0, 0, 0, 0,
59  128, 0, 0, 0, 0, 0, 0, 0,
60  0, 0, 0, 0, 0, 0, 0, 0,
61  64, 64, 64, 64, 64, 64, 64, 64,
62  64, 64, 0, 0, 0, 0, 0, 0,
63  0, 0, 0, 0, 0, 0, 0, 0,
64  0, 0, 0, 0, 0, 0, 0, 0,
65  0, 0, 0, 0, 0, 0, 0, 0,
66  0, 0, 0, 0, 0, 0, 0, 0,
67  0, 0, 0, 0, 0, 0, 0, 0,
68  0, 0, 0, 0, 0, 0, 0, 0,
69  0, 0, 0, 0, 0, 0, 0, 0,
70  0, 0, 0, 0, 0, 0, 0, 0,
71  0, 0, 0, 0, 0, 0, 0, 0,
72  0, 0, 0, 0, 0, 0, 0, 0,
73  0, 0, 0, 0, 0, 0, 0, 0,
74  0, 0, 0, 0, 0, 0, 0, 0,
75  0, 0, 0, 0, 0, 0, 0, 0,
76  0, 0, 0, 0, 0, 0, 0, 0,
77  0, 0, 0, 0, 0, 0, 0, 0,
78  0, 0, 0, 0, 0, 0, 0, 0,
79  0, 0, 0, 0, 0, 0, 0, 0,
80  0, 0, 0, 0, 0, 0, 0, 0,
81  0, 0, 0, 0, 0, 0, 0, 0,
82  0, 0, 0, 0, 0, 0, 0, 0,
83  0, 0, 0, 0, 0, 0, 0, 0,
84  0, 0, 0, 0, 0, 0, 0, 0,
85  0, 0, 0, 0, 0, 0, 0, 0,
86  0, 0, 0, 0, 0, 0, 0, 0,
87  };
88  yych = *cursor;
89  if (yych <= 'D') {
90  if (yych <= '\'') {
91  if (yych <= '\f') {
92  if (yych <= 0x00) goto shapes_wkt_lexer_2;
93  if (yych <= 0x08) goto shapes_wkt_lexer_4;
94  if (yych <= '\n') goto shapes_wkt_lexer_6;
95  goto shapes_wkt_lexer_4;
96  } else {
97  if (yych <= '\r') goto shapes_wkt_lexer_6;
98  if (yych == ' ') goto shapes_wkt_lexer_6;
99  goto shapes_wkt_lexer_4;
100  }
101  } else {
102  if (yych <= ',') {
103  if (yych <= '(') goto shapes_wkt_lexer_8;
104  if (yych <= ')') goto shapes_wkt_lexer_10;
105  if (yych <= '+') goto shapes_wkt_lexer_4;
106  goto shapes_wkt_lexer_12;
107  } else {
108  if (yych <= '/') {
109  if (yych <= '-') goto shapes_wkt_lexer_14;
110  goto shapes_wkt_lexer_4;
111  } else {
112  if (yych <= '0') goto shapes_wkt_lexer_15;
113  if (yych <= '9') goto shapes_wkt_lexer_17;
114  goto shapes_wkt_lexer_4;
115  }
116  }
117  }
118  } else {
119  if (yych <= 'd') {
120  if (yych <= 'K') {
121  if (yych <= 'E') goto shapes_wkt_lexer_19;
122  if (yych == 'G') goto shapes_wkt_lexer_20;
123  goto shapes_wkt_lexer_4;
124  } else {
125  if (yych <= 'M') {
126  if (yych <= 'L') goto shapes_wkt_lexer_21;
127  goto shapes_wkt_lexer_22;
128  } else {
129  if (yych == 'P') goto shapes_wkt_lexer_23;
130  goto shapes_wkt_lexer_4;
131  }
132  }
133  } else {
134  if (yych <= 'k') {
135  if (yych <= 'e') goto shapes_wkt_lexer_19;
136  if (yych == 'g') goto shapes_wkt_lexer_20;
137  goto shapes_wkt_lexer_4;
138  } else {
139  if (yych <= 'm') {
140  if (yych <= 'l') goto shapes_wkt_lexer_21;
141  goto shapes_wkt_lexer_22;
142  } else {
143  if (yych == 'p') goto shapes_wkt_lexer_23;
144  goto shapes_wkt_lexer_4;
145  }
146  }
147  }
148  }
149 shapes_wkt_lexer_2:
150  ++cursor;
151  { return WKT_END_OF_INPUT; }
152 shapes_wkt_lexer_4:
153  ++cursor;
154 shapes_wkt_lexer_5:
155  { return WKT_PARSE_ERROR; }
156 shapes_wkt_lexer_6:
157  ++cursor;
158  { return scan(); }
159 shapes_wkt_lexer_8:
160  ++cursor;
161  { return WKT_LPAREN; }
162 shapes_wkt_lexer_10:
163  ++cursor;
164  { return WKT_RPAREN; }
165 shapes_wkt_lexer_12:
166  ++cursor;
167  { return WKT_COMMA; }
168 shapes_wkt_lexer_14:
169  yych = *++cursor;
170  if (yych <= '/') goto shapes_wkt_lexer_5;
171  if (yych <= '0') goto shapes_wkt_lexer_15;
172  if (yych <= '9') goto shapes_wkt_lexer_17;
173  goto shapes_wkt_lexer_5;
174 shapes_wkt_lexer_15:
175  yyaccept = 0;
176  yych = *(marker = ++cursor);
177  if (yych <= 'D') {
178  if (yych == '.') goto shapes_wkt_lexer_24;
179  } else {
180  if (yych <= 'E') goto shapes_wkt_lexer_26;
181  if (yych == 'e') goto shapes_wkt_lexer_26;
182  }
183 shapes_wkt_lexer_16:
184  { return WKT_NUM; }
185 shapes_wkt_lexer_17:
186  yyaccept = 0;
187  yych = *(marker = ++cursor);
188  if (yybm[0+yych] & 64) {
189  goto shapes_wkt_lexer_17;
190  }
191  if (yych <= 'D') {
192  if (yych == '.') goto shapes_wkt_lexer_24;
193  goto shapes_wkt_lexer_16;
194  } else {
195  if (yych <= 'E') goto shapes_wkt_lexer_26;
196  if (yych == 'e') goto shapes_wkt_lexer_26;
197  goto shapes_wkt_lexer_16;
198  }
199 shapes_wkt_lexer_19:
200  yyaccept = 1;
201  yych = *(marker = ++cursor);
202  if (yych == 'M') goto shapes_wkt_lexer_27;
203  if (yych == 'm') goto shapes_wkt_lexer_27;
204  goto shapes_wkt_lexer_5;
205 shapes_wkt_lexer_20:
206  yyaccept = 1;
207  yych = *(marker = ++cursor);
208  if (yych == 'E') goto shapes_wkt_lexer_28;
209  if (yych == 'e') goto shapes_wkt_lexer_28;
210  goto shapes_wkt_lexer_5;
211 shapes_wkt_lexer_21:
212  yyaccept = 1;
213  yych = *(marker = ++cursor);
214  if (yych == 'I') goto shapes_wkt_lexer_29;
215  if (yych == 'i') goto shapes_wkt_lexer_29;
216  goto shapes_wkt_lexer_5;
217 shapes_wkt_lexer_22:
218  yyaccept = 1;
219  yych = *(marker = ++cursor);
220  if (yych == 'U') goto shapes_wkt_lexer_30;
221  if (yych == 'u') goto shapes_wkt_lexer_30;
222  goto shapes_wkt_lexer_5;
223 shapes_wkt_lexer_23:
224  yyaccept = 1;
225  yych = *(marker = ++cursor);
226  if (yych == 'O') goto shapes_wkt_lexer_31;
227  if (yych == 'o') goto shapes_wkt_lexer_31;
228  goto shapes_wkt_lexer_5;
229 shapes_wkt_lexer_24:
230  yych = *++cursor;
231  if (yych <= '/') goto shapes_wkt_lexer_25;
232  if (yych <= '9') goto shapes_wkt_lexer_32;
233 shapes_wkt_lexer_25:
234  cursor = marker;
235  if (yyaccept <= 4) {
236  if (yyaccept <= 2) {
237  if (yyaccept <= 1) {
238  if (yyaccept == 0) {
239  goto shapes_wkt_lexer_16;
240  } else {
241  goto shapes_wkt_lexer_5;
242  }
243  } else {
244  goto shapes_wkt_lexer_55;
245  }
246  } else {
247  if (yyaccept == 3) {
248  goto shapes_wkt_lexer_75;
249  } else {
250  goto shapes_wkt_lexer_96;
251  }
252  }
253  } else {
254  if (yyaccept <= 6) {
255  if (yyaccept == 5) {
256  goto shapes_wkt_lexer_99;
257  } else {
258  goto shapes_wkt_lexer_123;
259  }
260  } else {
261  if (yyaccept == 7) {
262  goto shapes_wkt_lexer_138;
263  } else {
264  goto shapes_wkt_lexer_150;
265  }
266  }
267  }
268 shapes_wkt_lexer_26:
269  yych = *++cursor;
270  if (yych <= ',') {
271  if (yych == '+') goto shapes_wkt_lexer_34;
272  goto shapes_wkt_lexer_25;
273  } else {
274  if (yych <= '-') goto shapes_wkt_lexer_34;
275  if (yych <= '/') goto shapes_wkt_lexer_25;
276  if (yych <= '9') goto shapes_wkt_lexer_35;
277  goto shapes_wkt_lexer_25;
278  }
279 shapes_wkt_lexer_27:
280  yych = *++cursor;
281  if (yych == 'P') goto shapes_wkt_lexer_37;
282  if (yych == 'p') goto shapes_wkt_lexer_37;
283  goto shapes_wkt_lexer_25;
284 shapes_wkt_lexer_28:
285  yych = *++cursor;
286  if (yych == 'O') goto shapes_wkt_lexer_38;
287  if (yych == 'o') goto shapes_wkt_lexer_38;
288  goto shapes_wkt_lexer_25;
289 shapes_wkt_lexer_29:
290  yych = *++cursor;
291  if (yych == 'N') goto shapes_wkt_lexer_39;
292  if (yych == 'n') goto shapes_wkt_lexer_39;
293  goto shapes_wkt_lexer_25;
294 shapes_wkt_lexer_30:
295  yych = *++cursor;
296  if (yych == 'L') goto shapes_wkt_lexer_40;
297  if (yych == 'l') goto shapes_wkt_lexer_40;
298  goto shapes_wkt_lexer_25;
299 shapes_wkt_lexer_31:
300  yych = *++cursor;
301  if (yych <= 'L') {
302  if (yych == 'I') goto shapes_wkt_lexer_41;
303  if (yych <= 'K') goto shapes_wkt_lexer_25;
304  goto shapes_wkt_lexer_42;
305  } else {
306  if (yych <= 'i') {
307  if (yych <= 'h') goto shapes_wkt_lexer_25;
308  goto shapes_wkt_lexer_41;
309  } else {
310  if (yych == 'l') goto shapes_wkt_lexer_42;
311  goto shapes_wkt_lexer_25;
312  }
313  }
314 shapes_wkt_lexer_32:
315  yyaccept = 0;
316  yych = *(marker = ++cursor);
317  if (yych <= 'D') {
318  if (yych <= '/') goto shapes_wkt_lexer_16;
319  if (yych <= '9') goto shapes_wkt_lexer_32;
320  goto shapes_wkt_lexer_16;
321  } else {
322  if (yych <= 'E') goto shapes_wkt_lexer_26;
323  if (yych == 'e') goto shapes_wkt_lexer_26;
324  goto shapes_wkt_lexer_16;
325  }
326 shapes_wkt_lexer_34:
327  yych = *++cursor;
328  if (yych <= '/') goto shapes_wkt_lexer_25;
329  if (yych >= ':') goto shapes_wkt_lexer_25;
330 shapes_wkt_lexer_35:
331  yych = *++cursor;
332  if (yych <= '/') goto shapes_wkt_lexer_16;
333  if (yych <= '9') goto shapes_wkt_lexer_35;
334  goto shapes_wkt_lexer_16;
335 shapes_wkt_lexer_37:
336  yych = *++cursor;
337  if (yych == 'T') goto shapes_wkt_lexer_43;
338  if (yych == 't') goto shapes_wkt_lexer_43;
339  goto shapes_wkt_lexer_25;
340 shapes_wkt_lexer_38:
341  yych = *++cursor;
342  if (yych == 'M') goto shapes_wkt_lexer_44;
343  if (yych == 'm') goto shapes_wkt_lexer_44;
344  goto shapes_wkt_lexer_25;
345 shapes_wkt_lexer_39:
346  yych = *++cursor;
347  if (yych == 'E') goto shapes_wkt_lexer_45;
348  if (yych == 'e') goto shapes_wkt_lexer_45;
349  goto shapes_wkt_lexer_25;
350 shapes_wkt_lexer_40:
351  yych = *++cursor;
352  if (yych == 'T') goto shapes_wkt_lexer_46;
353  if (yych == 't') goto shapes_wkt_lexer_46;
354  goto shapes_wkt_lexer_25;
355 shapes_wkt_lexer_41:
356  yych = *++cursor;
357  if (yych == 'N') goto shapes_wkt_lexer_47;
358  if (yych == 'n') goto shapes_wkt_lexer_47;
359  goto shapes_wkt_lexer_25;
360 shapes_wkt_lexer_42:
361  yych = *++cursor;
362  if (yych == 'Y') goto shapes_wkt_lexer_48;
363  if (yych == 'y') goto shapes_wkt_lexer_48;
364  goto shapes_wkt_lexer_25;
365 shapes_wkt_lexer_43:
366  yych = *++cursor;
367  if (yych == 'Y') goto shapes_wkt_lexer_49;
368  if (yych == 'y') goto shapes_wkt_lexer_49;
369  goto shapes_wkt_lexer_25;
370 shapes_wkt_lexer_44:
371  yych = *++cursor;
372  if (yych == 'E') goto shapes_wkt_lexer_51;
373  if (yych == 'e') goto shapes_wkt_lexer_51;
374  goto shapes_wkt_lexer_25;
375 shapes_wkt_lexer_45:
376  yych = *++cursor;
377  if (yych == 'S') goto shapes_wkt_lexer_52;
378  if (yych == 's') goto shapes_wkt_lexer_52;
379  goto shapes_wkt_lexer_25;
380 shapes_wkt_lexer_46:
381  yych = *++cursor;
382  if (yych == 'I') goto shapes_wkt_lexer_53;
383  if (yych == 'i') goto shapes_wkt_lexer_53;
384  goto shapes_wkt_lexer_25;
385 shapes_wkt_lexer_47:
386  yych = *++cursor;
387  if (yych == 'T') goto shapes_wkt_lexer_54;
388  if (yych == 't') goto shapes_wkt_lexer_54;
389  goto shapes_wkt_lexer_25;
390 shapes_wkt_lexer_48:
391  yych = *++cursor;
392  if (yych == 'G') goto shapes_wkt_lexer_56;
393  if (yych == 'g') goto shapes_wkt_lexer_56;
394  goto shapes_wkt_lexer_25;
395 shapes_wkt_lexer_49:
396  ++cursor;
397  { return WKT_EMPTY_SET; }
398 shapes_wkt_lexer_51:
399  yych = *++cursor;
400  if (yych == 'T') goto shapes_wkt_lexer_57;
401  if (yych == 't') goto shapes_wkt_lexer_57;
402  goto shapes_wkt_lexer_25;
403 shapes_wkt_lexer_52:
404  yych = *++cursor;
405  if (yych == 'T') goto shapes_wkt_lexer_58;
406  if (yych == 't') goto shapes_wkt_lexer_58;
407  goto shapes_wkt_lexer_25;
408 shapes_wkt_lexer_53:
409  yych = *++cursor;
410  if (yych <= 'P') {
411  if (yych == 'L') goto shapes_wkt_lexer_59;
412  if (yych <= 'O') goto shapes_wkt_lexer_25;
413  goto shapes_wkt_lexer_60;
414  } else {
415  if (yych <= 'l') {
416  if (yych <= 'k') goto shapes_wkt_lexer_25;
417  goto shapes_wkt_lexer_59;
418  } else {
419  if (yych == 'p') goto shapes_wkt_lexer_60;
420  goto shapes_wkt_lexer_25;
421  }
422  }
423 shapes_wkt_lexer_54:
424  yyaccept = 2;
425  yych = *(marker = ++cursor);
426  if (yybm[0+yych] & 128) {
427  goto shapes_wkt_lexer_61;
428  }
429  if (yych <= 'Z') {
430  if (yych == 'M') goto shapes_wkt_lexer_63;
431  if (yych >= 'Z') goto shapes_wkt_lexer_65;
432  } else {
433  if (yych <= 'm') {
434  if (yych >= 'm') goto shapes_wkt_lexer_63;
435  } else {
436  if (yych == 'z') goto shapes_wkt_lexer_65;
437  }
438  }
439 shapes_wkt_lexer_55:
440  { return WKT_POINT_TAGGED_TEXT; }
441 shapes_wkt_lexer_56:
442  yych = *++cursor;
443  if (yych == 'O') goto shapes_wkt_lexer_67;
444  if (yych == 'o') goto shapes_wkt_lexer_67;
445  goto shapes_wkt_lexer_25;
446 shapes_wkt_lexer_57:
447  yych = *++cursor;
448  if (yych == 'R') goto shapes_wkt_lexer_68;
449  if (yych == 'r') goto shapes_wkt_lexer_68;
450  goto shapes_wkt_lexer_25;
451 shapes_wkt_lexer_58:
452  yych = *++cursor;
453  if (yych == 'R') goto shapes_wkt_lexer_69;
454  if (yych == 'r') goto shapes_wkt_lexer_69;
455  goto shapes_wkt_lexer_25;
456 shapes_wkt_lexer_59:
457  yych = *++cursor;
458  if (yych == 'I') goto shapes_wkt_lexer_70;
459  if (yych == 'i') goto shapes_wkt_lexer_70;
460  goto shapes_wkt_lexer_25;
461 shapes_wkt_lexer_60:
462  yych = *++cursor;
463  if (yych == 'O') goto shapes_wkt_lexer_71;
464  if (yych == 'o') goto shapes_wkt_lexer_71;
465  goto shapes_wkt_lexer_25;
466 shapes_wkt_lexer_61:
467  yych = *++cursor;
468  if (yybm[0+yych] & 128) {
469  goto shapes_wkt_lexer_61;
470  }
471  if (yych <= 'Z') {
472  if (yych == 'M') goto shapes_wkt_lexer_63;
473  if (yych <= 'Y') goto shapes_wkt_lexer_25;
474  goto shapes_wkt_lexer_65;
475  } else {
476  if (yych <= 'm') {
477  if (yych <= 'l') goto shapes_wkt_lexer_25;
478  } else {
479  if (yych == 'z') goto shapes_wkt_lexer_65;
480  goto shapes_wkt_lexer_25;
481  }
482  }
483 shapes_wkt_lexer_63:
484  ++cursor;
485  { return WKT_POINT_M_TAGGED_TEXT; }
486 shapes_wkt_lexer_65:
487  yych = *++cursor;
488  if (yych == 'M') goto shapes_wkt_lexer_72;
489  if (yych == 'm') goto shapes_wkt_lexer_72;
490  { return WKT_POINT_Z_TAGGED_TEXT; }
491 shapes_wkt_lexer_67:
492  yych = *++cursor;
493  if (yych == 'N') goto shapes_wkt_lexer_74;
494  if (yych == 'n') goto shapes_wkt_lexer_74;
495  goto shapes_wkt_lexer_25;
496 shapes_wkt_lexer_68:
497  yych = *++cursor;
498  if (yych == 'Y') goto shapes_wkt_lexer_76;
499  if (yych == 'y') goto shapes_wkt_lexer_76;
500  goto shapes_wkt_lexer_25;
501 shapes_wkt_lexer_69:
502  yych = *++cursor;
503  if (yych == 'I') goto shapes_wkt_lexer_77;
504  if (yych == 'i') goto shapes_wkt_lexer_77;
505  goto shapes_wkt_lexer_25;
506 shapes_wkt_lexer_70:
507  yych = *++cursor;
508  if (yych == 'N') goto shapes_wkt_lexer_78;
509  if (yych == 'n') goto shapes_wkt_lexer_78;
510  goto shapes_wkt_lexer_25;
511 shapes_wkt_lexer_71:
512  yych = *++cursor;
513  if (yych <= 'L') {
514  if (yych == 'I') goto shapes_wkt_lexer_79;
515  if (yych <= 'K') goto shapes_wkt_lexer_25;
516  goto shapes_wkt_lexer_80;
517  } else {
518  if (yych <= 'i') {
519  if (yych <= 'h') goto shapes_wkt_lexer_25;
520  goto shapes_wkt_lexer_79;
521  } else {
522  if (yych == 'l') goto shapes_wkt_lexer_80;
523  goto shapes_wkt_lexer_25;
524  }
525  }
526 shapes_wkt_lexer_72:
527  ++cursor;
528  { return WKT_POINT_ZM_TAGGED_TEXT; }
529 shapes_wkt_lexer_74:
530  yyaccept = 3;
531  yych = *(marker = ++cursor);
532  if (yych <= 'L') {
533  if (yych <= '\f') {
534  if (yych <= 0x08) goto shapes_wkt_lexer_75;
535  if (yych <= '\n') goto shapes_wkt_lexer_81;
536  } else {
537  if (yych <= '\r') goto shapes_wkt_lexer_81;
538  if (yych == ' ') goto shapes_wkt_lexer_81;
539  }
540  } else {
541  if (yych <= 'l') {
542  if (yych <= 'M') goto shapes_wkt_lexer_83;
543  if (yych == 'Z') goto shapes_wkt_lexer_85;
544  } else {
545  if (yych <= 'm') goto shapes_wkt_lexer_83;
546  if (yych == 'z') goto shapes_wkt_lexer_85;
547  }
548  }
549 shapes_wkt_lexer_75:
550  { return WKT_POLYGON_TAGGED_TEXT; }
551 shapes_wkt_lexer_76:
552  yych = *++cursor;
553  if (yych == 'C') goto shapes_wkt_lexer_87;
554  if (yych == 'c') goto shapes_wkt_lexer_87;
555  goto shapes_wkt_lexer_25;
556 shapes_wkt_lexer_77:
557  yych = *++cursor;
558  if (yych == 'N') goto shapes_wkt_lexer_88;
559  if (yych == 'n') goto shapes_wkt_lexer_88;
560  goto shapes_wkt_lexer_25;
561 shapes_wkt_lexer_78:
562  yych = *++cursor;
563  if (yych == 'E') goto shapes_wkt_lexer_89;
564  if (yych == 'e') goto shapes_wkt_lexer_89;
565  goto shapes_wkt_lexer_25;
566 shapes_wkt_lexer_79:
567  yych = *++cursor;
568  if (yych == 'N') goto shapes_wkt_lexer_90;
569  if (yych == 'n') goto shapes_wkt_lexer_90;
570  goto shapes_wkt_lexer_25;
571 shapes_wkt_lexer_80:
572  yych = *++cursor;
573  if (yych == 'Y') goto shapes_wkt_lexer_91;
574  if (yych == 'y') goto shapes_wkt_lexer_91;
575  goto shapes_wkt_lexer_25;
576 shapes_wkt_lexer_81:
577  yych = *++cursor;
578  if (yych <= 'L') {
579  if (yych <= '\f') {
580  if (yych <= 0x08) goto shapes_wkt_lexer_25;
581  if (yych <= '\n') goto shapes_wkt_lexer_81;
582  goto shapes_wkt_lexer_25;
583  } else {
584  if (yych <= '\r') goto shapes_wkt_lexer_81;
585  if (yych == ' ') goto shapes_wkt_lexer_81;
586  goto shapes_wkt_lexer_25;
587  }
588  } else {
589  if (yych <= 'l') {
590  if (yych <= 'M') goto shapes_wkt_lexer_83;
591  if (yych == 'Z') goto shapes_wkt_lexer_85;
592  goto shapes_wkt_lexer_25;
593  } else {
594  if (yych <= 'm') goto shapes_wkt_lexer_83;
595  if (yych == 'z') goto shapes_wkt_lexer_85;
596  goto shapes_wkt_lexer_25;
597  }
598  }
599 shapes_wkt_lexer_83:
600  ++cursor;
601  { return WKT_POLYGON_M_TAGGED_TEXT; }
602 shapes_wkt_lexer_85:
603  yych = *++cursor;
604  if (yych == 'M') goto shapes_wkt_lexer_92;
605  if (yych == 'm') goto shapes_wkt_lexer_92;
606  { return WKT_POLYGON_Z_TAGGED_TEXT; }
607 shapes_wkt_lexer_87:
608  yych = *++cursor;
609  if (yych == 'O') goto shapes_wkt_lexer_94;
610  if (yych == 'o') goto shapes_wkt_lexer_94;
611  goto shapes_wkt_lexer_25;
612 shapes_wkt_lexer_88:
613  yych = *++cursor;
614  if (yych == 'G') goto shapes_wkt_lexer_95;
615  if (yych == 'g') goto shapes_wkt_lexer_95;
616  goto shapes_wkt_lexer_25;
617 shapes_wkt_lexer_89:
618  yych = *++cursor;
619  if (yych == 'S') goto shapes_wkt_lexer_97;
620  if (yych == 's') goto shapes_wkt_lexer_97;
621  goto shapes_wkt_lexer_25;
622 shapes_wkt_lexer_90:
623  yych = *++cursor;
624  if (yych == 'T') goto shapes_wkt_lexer_98;
625  if (yych == 't') goto shapes_wkt_lexer_98;
626  goto shapes_wkt_lexer_25;
627 shapes_wkt_lexer_91:
628  yych = *++cursor;
629  if (yych == 'G') goto shapes_wkt_lexer_100;
630  if (yych == 'g') goto shapes_wkt_lexer_100;
631  goto shapes_wkt_lexer_25;
632 shapes_wkt_lexer_92:
633  ++cursor;
634  { return WKT_POLYGON_ZM_TAGGED_TEXT; }
635 shapes_wkt_lexer_94:
636  yych = *++cursor;
637  if (yych == 'L') goto shapes_wkt_lexer_101;
638  if (yych == 'l') goto shapes_wkt_lexer_101;
639  goto shapes_wkt_lexer_25;
640 shapes_wkt_lexer_95:
641  yyaccept = 4;
642  yych = *(marker = ++cursor);
643  if (yych <= 'L') {
644  if (yych <= '\f') {
645  if (yych <= 0x08) goto shapes_wkt_lexer_96;
646  if (yych <= '\n') goto shapes_wkt_lexer_102;
647  } else {
648  if (yych <= '\r') goto shapes_wkt_lexer_102;
649  if (yych == ' ') goto shapes_wkt_lexer_102;
650  }
651  } else {
652  if (yych <= 'l') {
653  if (yych <= 'M') goto shapes_wkt_lexer_104;
654  if (yych == 'Z') goto shapes_wkt_lexer_106;
655  } else {
656  if (yych <= 'm') goto shapes_wkt_lexer_104;
657  if (yych == 'z') goto shapes_wkt_lexer_106;
658  }
659  }
660 shapes_wkt_lexer_96:
661  { return WKT_LINESTRING_TAGGED_TEXT; }
662 shapes_wkt_lexer_97:
663  yych = *++cursor;
664  if (yych == 'T') goto shapes_wkt_lexer_108;
665  if (yych == 't') goto shapes_wkt_lexer_108;
666  goto shapes_wkt_lexer_25;
667 shapes_wkt_lexer_98:
668  yyaccept = 5;
669  yych = *(marker = ++cursor);
670  if (yych <= 'L') {
671  if (yych <= '\f') {
672  if (yych <= 0x08) goto shapes_wkt_lexer_99;
673  if (yych <= '\n') goto shapes_wkt_lexer_109;
674  } else {
675  if (yych <= '\r') goto shapes_wkt_lexer_109;
676  if (yych == ' ') goto shapes_wkt_lexer_109;
677  }
678  } else {
679  if (yych <= 'l') {
680  if (yych <= 'M') goto shapes_wkt_lexer_111;
681  if (yych == 'Z') goto shapes_wkt_lexer_113;
682  } else {
683  if (yych <= 'm') goto shapes_wkt_lexer_111;
684  if (yych == 'z') goto shapes_wkt_lexer_113;
685  }
686  }
687 shapes_wkt_lexer_99:
688  { return WKT_MULTIPOINT_TAGGED_TEXT; }
689 shapes_wkt_lexer_100:
690  yych = *++cursor;
691  if (yych == 'O') goto shapes_wkt_lexer_115;
692  if (yych == 'o') goto shapes_wkt_lexer_115;
693  goto shapes_wkt_lexer_25;
694 shapes_wkt_lexer_101:
695  yych = *++cursor;
696  if (yych == 'L') goto shapes_wkt_lexer_116;
697  if (yych == 'l') goto shapes_wkt_lexer_116;
698  goto shapes_wkt_lexer_25;
699 shapes_wkt_lexer_102:
700  yych = *++cursor;
701  if (yych <= 'L') {
702  if (yych <= '\f') {
703  if (yych <= 0x08) goto shapes_wkt_lexer_25;
704  if (yych <= '\n') goto shapes_wkt_lexer_102;
705  goto shapes_wkt_lexer_25;
706  } else {
707  if (yych <= '\r') goto shapes_wkt_lexer_102;
708  if (yych == ' ') goto shapes_wkt_lexer_102;
709  goto shapes_wkt_lexer_25;
710  }
711  } else {
712  if (yych <= 'l') {
713  if (yych <= 'M') goto shapes_wkt_lexer_104;
714  if (yych == 'Z') goto shapes_wkt_lexer_106;
715  goto shapes_wkt_lexer_25;
716  } else {
717  if (yych <= 'm') goto shapes_wkt_lexer_104;
718  if (yych == 'z') goto shapes_wkt_lexer_106;
719  goto shapes_wkt_lexer_25;
720  }
721  }
722 shapes_wkt_lexer_104:
723  ++cursor;
724  { return WKT_LINESTRING_M_TAGGED_TEXT; }
725 shapes_wkt_lexer_106:
726  yych = *++cursor;
727  if (yych == 'M') goto shapes_wkt_lexer_117;
728  if (yych == 'm') goto shapes_wkt_lexer_117;
729  { return WKT_LINESTRING_Z_TAGGED_TEXT; }
730 shapes_wkt_lexer_108:
731  yych = *++cursor;
732  if (yych == 'R') goto shapes_wkt_lexer_119;
733  if (yych == 'r') goto shapes_wkt_lexer_119;
734  goto shapes_wkt_lexer_25;
735 shapes_wkt_lexer_109:
736  yych = *++cursor;
737  if (yych <= 'L') {
738  if (yych <= '\f') {
739  if (yych <= 0x08) goto shapes_wkt_lexer_25;
740  if (yych <= '\n') goto shapes_wkt_lexer_109;
741  goto shapes_wkt_lexer_25;
742  } else {
743  if (yych <= '\r') goto shapes_wkt_lexer_109;
744  if (yych == ' ') goto shapes_wkt_lexer_109;
745  goto shapes_wkt_lexer_25;
746  }
747  } else {
748  if (yych <= 'l') {
749  if (yych <= 'M') goto shapes_wkt_lexer_111;
750  if (yych == 'Z') goto shapes_wkt_lexer_113;
751  goto shapes_wkt_lexer_25;
752  } else {
753  if (yych <= 'm') goto shapes_wkt_lexer_111;
754  if (yych == 'z') goto shapes_wkt_lexer_113;
755  goto shapes_wkt_lexer_25;
756  }
757  }
758 shapes_wkt_lexer_111:
759  ++cursor;
760  { return WKT_MULTIPOINT_M_TAGGED_TEXT; }
761 shapes_wkt_lexer_113:
762  yych = *++cursor;
763  if (yych == 'M') goto shapes_wkt_lexer_120;
764  if (yych == 'm') goto shapes_wkt_lexer_120;
765  { return WKT_MULTIPOINT_Z_TAGGED_TEXT; }
766 shapes_wkt_lexer_115:
767  yych = *++cursor;
768  if (yych == 'N') goto shapes_wkt_lexer_122;
769  if (yych == 'n') goto shapes_wkt_lexer_122;
770  goto shapes_wkt_lexer_25;
771 shapes_wkt_lexer_116:
772  yych = *++cursor;
773  if (yych == 'E') goto shapes_wkt_lexer_124;
774  if (yych == 'e') goto shapes_wkt_lexer_124;
775  goto shapes_wkt_lexer_25;
776 shapes_wkt_lexer_117:
777  ++cursor;
778  { return WKT_LINESTRING_ZM_TAGGED_TEXT; }
779 shapes_wkt_lexer_119:
780  yych = *++cursor;
781  if (yych == 'I') goto shapes_wkt_lexer_125;
782  if (yych == 'i') goto shapes_wkt_lexer_125;
783  goto shapes_wkt_lexer_25;
784 shapes_wkt_lexer_120:
785  ++cursor;
786  { return WKT_MULTIPOINT_ZM_TAGGED_TEXT; }
787 shapes_wkt_lexer_122:
788  yyaccept = 6;
789  yych = *(marker = ++cursor);
790  if (yych <= 'L') {
791  if (yych <= '\f') {
792  if (yych <= 0x08) goto shapes_wkt_lexer_123;
793  if (yych <= '\n') goto shapes_wkt_lexer_126;
794  } else {
795  if (yych <= '\r') goto shapes_wkt_lexer_126;
796  if (yych == ' ') goto shapes_wkt_lexer_126;
797  }
798  } else {
799  if (yych <= 'l') {
800  if (yych <= 'M') goto shapes_wkt_lexer_128;
801  if (yych == 'Z') goto shapes_wkt_lexer_130;
802  } else {
803  if (yych <= 'm') goto shapes_wkt_lexer_128;
804  if (yych == 'z') goto shapes_wkt_lexer_130;
805  }
806  }
807 shapes_wkt_lexer_123:
808  { return WKT_MULTIPOLYGON_TAGGED_TEXT; }
809 shapes_wkt_lexer_124:
810  yych = *++cursor;
811  if (yych == 'C') goto shapes_wkt_lexer_132;
812  if (yych == 'c') goto shapes_wkt_lexer_132;
813  goto shapes_wkt_lexer_25;
814 shapes_wkt_lexer_125:
815  yych = *++cursor;
816  if (yych == 'N') goto shapes_wkt_lexer_133;
817  if (yych == 'n') goto shapes_wkt_lexer_133;
818  goto shapes_wkt_lexer_25;
819 shapes_wkt_lexer_126:
820  yych = *++cursor;
821  if (yych <= 'L') {
822  if (yych <= '\f') {
823  if (yych <= 0x08) goto shapes_wkt_lexer_25;
824  if (yych <= '\n') goto shapes_wkt_lexer_126;
825  goto shapes_wkt_lexer_25;
826  } else {
827  if (yych <= '\r') goto shapes_wkt_lexer_126;
828  if (yych == ' ') goto shapes_wkt_lexer_126;
829  goto shapes_wkt_lexer_25;
830  }
831  } else {
832  if (yych <= 'l') {
833  if (yych <= 'M') goto shapes_wkt_lexer_128;
834  if (yych == 'Z') goto shapes_wkt_lexer_130;
835  goto shapes_wkt_lexer_25;
836  } else {
837  if (yych <= 'm') goto shapes_wkt_lexer_128;
838  if (yych == 'z') goto shapes_wkt_lexer_130;
839  goto shapes_wkt_lexer_25;
840  }
841  }
842 shapes_wkt_lexer_128:
843  ++cursor;
844  { return WKT_MULTIPOLYGON_M_TAGGED_TEXT; }
845 shapes_wkt_lexer_130:
846  yych = *++cursor;
847  if (yych == 'M') goto shapes_wkt_lexer_134;
848  if (yych == 'm') goto shapes_wkt_lexer_134;
849  { return WKT_MULTIPOLYGON_Z_TAGGED_TEXT; }
850 shapes_wkt_lexer_132:
851  yych = *++cursor;
852  if (yych == 'T') goto shapes_wkt_lexer_136;
853  if (yych == 't') goto shapes_wkt_lexer_136;
854  goto shapes_wkt_lexer_25;
855 shapes_wkt_lexer_133:
856  yych = *++cursor;
857  if (yych == 'G') goto shapes_wkt_lexer_137;
858  if (yych == 'g') goto shapes_wkt_lexer_137;
859  goto shapes_wkt_lexer_25;
860 shapes_wkt_lexer_134:
861  ++cursor;
862  { return WKT_MULTIPOLYGON_ZM_TAGGED_TEXT; }
863 shapes_wkt_lexer_136:
864  yych = *++cursor;
865  if (yych == 'I') goto shapes_wkt_lexer_139;
866  if (yych == 'i') goto shapes_wkt_lexer_139;
867  goto shapes_wkt_lexer_25;
868 shapes_wkt_lexer_137:
869  yyaccept = 7;
870  yych = *(marker = ++cursor);
871  if (yych <= 'L') {
872  if (yych <= '\f') {
873  if (yych <= 0x08) goto shapes_wkt_lexer_138;
874  if (yych <= '\n') goto shapes_wkt_lexer_140;
875  } else {
876  if (yych <= '\r') goto shapes_wkt_lexer_140;
877  if (yych == ' ') goto shapes_wkt_lexer_140;
878  }
879  } else {
880  if (yych <= 'l') {
881  if (yych <= 'M') goto shapes_wkt_lexer_142;
882  if (yych == 'Z') goto shapes_wkt_lexer_144;
883  } else {
884  if (yych <= 'm') goto shapes_wkt_lexer_142;
885  if (yych == 'z') goto shapes_wkt_lexer_144;
886  }
887  }
888 shapes_wkt_lexer_138:
889  { return WKT_MULTILINESTRING_TAGGED_TEXT; }
890 shapes_wkt_lexer_139:
891  yych = *++cursor;
892  if (yych == 'O') goto shapes_wkt_lexer_146;
893  if (yych == 'o') goto shapes_wkt_lexer_146;
894  goto shapes_wkt_lexer_25;
895 shapes_wkt_lexer_140:
896  yych = *++cursor;
897  if (yych <= 'L') {
898  if (yych <= '\f') {
899  if (yych <= 0x08) goto shapes_wkt_lexer_25;
900  if (yych <= '\n') goto shapes_wkt_lexer_140;
901  goto shapes_wkt_lexer_25;
902  } else {
903  if (yych <= '\r') goto shapes_wkt_lexer_140;
904  if (yych == ' ') goto shapes_wkt_lexer_140;
905  goto shapes_wkt_lexer_25;
906  }
907  } else {
908  if (yych <= 'l') {
909  if (yych <= 'M') goto shapes_wkt_lexer_142;
910  if (yych == 'Z') goto shapes_wkt_lexer_144;
911  goto shapes_wkt_lexer_25;
912  } else {
913  if (yych <= 'm') goto shapes_wkt_lexer_142;
914  if (yych == 'z') goto shapes_wkt_lexer_144;
915  goto shapes_wkt_lexer_25;
916  }
917  }
918 shapes_wkt_lexer_142:
919  ++cursor;
920  { return WKT_MULTILINESTRING_M_TAGGED_TEXT; }
921 shapes_wkt_lexer_144:
922  yych = *++cursor;
923  if (yych == 'M') goto shapes_wkt_lexer_147;
924  if (yych == 'm') goto shapes_wkt_lexer_147;
925  { return WKT_MULTILINESTRING_Z_TAGGED_TEXT; }
926 shapes_wkt_lexer_146:
927  yych = *++cursor;
928  if (yych == 'N') goto shapes_wkt_lexer_149;
929  if (yych == 'n') goto shapes_wkt_lexer_149;
930  goto shapes_wkt_lexer_25;
931 shapes_wkt_lexer_147:
932  ++cursor;
933  { return WKT_MULTILINESTRING_ZM_TAGGED_TEXT; }
934 shapes_wkt_lexer_149:
935  yyaccept = 8;
936  yych = *(marker = ++cursor);
937  if (yych <= 'L') {
938  if (yych <= '\f') {
939  if (yych <= 0x08) goto shapes_wkt_lexer_150;
940  if (yych <= '\n') goto shapes_wkt_lexer_151;
941  } else {
942  if (yych <= '\r') goto shapes_wkt_lexer_151;
943  if (yych == ' ') goto shapes_wkt_lexer_151;
944  }
945  } else {
946  if (yych <= 'l') {
947  if (yych <= 'M') goto shapes_wkt_lexer_153;
948  if (yych == 'Z') goto shapes_wkt_lexer_155;
949  } else {
950  if (yych <= 'm') goto shapes_wkt_lexer_153;
951  if (yych == 'z') goto shapes_wkt_lexer_155;
952  }
953  }
954 shapes_wkt_lexer_150:
955  { return WKT_GEOMETRYCOLLECTION_TAGGED_TEXT; }
956 shapes_wkt_lexer_151:
957  yych = *++cursor;
958  if (yych <= 'L') {
959  if (yych <= '\f') {
960  if (yych <= 0x08) goto shapes_wkt_lexer_25;
961  if (yych <= '\n') goto shapes_wkt_lexer_151;
962  goto shapes_wkt_lexer_25;
963  } else {
964  if (yych <= '\r') goto shapes_wkt_lexer_151;
965  if (yych == ' ') goto shapes_wkt_lexer_151;
966  goto shapes_wkt_lexer_25;
967  }
968  } else {
969  if (yych <= 'l') {
970  if (yych <= 'M') goto shapes_wkt_lexer_153;
971  if (yych == 'Z') goto shapes_wkt_lexer_155;
972  goto shapes_wkt_lexer_25;
973  } else {
974  if (yych <= 'm') goto shapes_wkt_lexer_153;
975  if (yych == 'z') goto shapes_wkt_lexer_155;
976  goto shapes_wkt_lexer_25;
977  }
978  }
979 shapes_wkt_lexer_153:
980  ++cursor;
981  { return WKT_GEOMETRYCOLLECTION_M_TAGGED_TEXT; }
982 shapes_wkt_lexer_155:
983  yych = *++cursor;
984  if (yych == 'M') goto shapes_wkt_lexer_157;
985  if (yych == 'm') goto shapes_wkt_lexer_157;
986  { return WKT_GEOMETRYCOLLECTION_Z_TAGGED_TEXT; }
987 shapes_wkt_lexer_157:
988  ++cursor;
989  { return WKT_GEOMETRYCOLLECTION_ZM_TAGGED_TEXT; }
990 }
991 
992  }
993 
1000  std::string get_token() const
1001  {
1002  return std::string(reinterpret_cast<const char*>(start), static_cast<size_t>(cursor - start));
1003  }
1004 
1011  size_t get_position()
1012  {
1013  return static_cast<size_t>(start - content.c_str());
1014  }
1015 
1016  private:
1018  std::string content;
1019 
1021  const char* start = nullptr;
1022 
1024  const char* cursor = nullptr;
1025 
1027  const char* limit = nullptr;
1028 };
1029 
1030 } // namespace shapes
1031 } // namespace simo
int scan()
scan the next token
Definition: wkt_lexer.hpp:42
wkt_lexer(const std::string &source)
creates a wkt lexer from the given source
Definition: wkt_lexer.hpp:29
std::string get_token() const
returns the current token string
Definition: wkt_lexer.hpp:1000
size_t get_position()
returns the current reading position
Definition: wkt_lexer.hpp:1011