MyLang
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
mylang_syntax.hpp
Go to the documentation of this file.
1 // generated by MyParser C++ Code Generator
2 
3 #ifndef MYLANG_SYNTAX_HPP
4 #define MYLANG_SYNTAX_HPP
5 
6 #include "parser/myparser.hpp"
7 
8 namespace myparser {
9 
10 template<>
11 class RuleDef<MP_STR("root", 4)>:
12 public RuleList<MP_STR("root", 4),
13  RuleLine<
14  RuleItemSpace<>,
15  RuleItemRef<MP_STR("main structure", 14)>,
16  RuleItemSpace<>,
17  RuleItemKeyword<MP_STR(";", 1)>,
18  RuleItemSpace<>
19  >,
20  RuleLine<
21  RuleItemSpace<>,
22  RuleItemRef<MP_STR("main structure", 14)>,
23  RuleItemSpace<>
24  >,
25  RuleLine<
26  RuleItemError<MP_STR("Syntax error", 12)>
27  >
28 > {};
29 
30 template<>
31 class RuleDef<MP_STR("main structure", 14)>:
32 public RuleList<MP_STR("main structure", 14),
33  RuleLine<
34  RuleItemRef<MP_STR("program", 7)>
35  >,
36  RuleLine<
37  RuleItemRef<MP_STR("function", 8)>
38  >,
39  RuleLine<
40  RuleItemRef<MP_STR("class", 5)>
41  >
42 > {};
43 
44 template<>
45 class RuleDef<MP_STR("program", 7)>:
46 public RuleList<MP_STR("program", 7),
47  RuleLine<
48  RuleItemKeyword<MP_STR("program", 7)>,
49  RuleItemSpace<>,
50  RuleItemRef<MP_STR("function proto", 14)>,
51  RuleItemSpace<>,
52  RuleItemRef<MP_STR("main body", 9)>
53  >
54 > {};
55 
56 template<>
57 class RuleDef<MP_STR("function", 8)>:
58 public RuleList<MP_STR("function", 8),
59  RuleLine<
60  RuleItemKeyword<MP_STR("function", 8)>,
61  RuleItemSpace<>,
62  RuleItemRef<MP_STR("function proto", 14)>,
63  RuleItemSpace<>,
64  RuleItemRef<MP_STR("main body", 9)>
65  >
66 > {};
67 
68 template<>
69 class RuleDef<MP_STR("class", 5)>:
70 public RuleList<MP_STR("class", 5),
71  RuleLine<
72  RuleItemKeyword<MP_STR("class", 5)>,
73  RuleItemSpace<>,
74  RuleItemRef<MP_STR("main body", 9)>
75  >
76 > {};
77 
78 template<>
79 class RuleDef<MP_STR("main body", 9)>:
80 public RuleList<MP_STR("main body", 9),
81  RuleLine<
82  RuleItemRef<MP_STR("specific list", 13)>,
83  RuleItemSpace<>,
84  RuleItemRef<MP_STR("interface block", 15)>,
85  RuleItemSpace<>,
86  RuleItemRef<MP_STR("is block", 8)>,
87  RuleItemSpace<>,
88  RuleItemRef<MP_STR("code block", 10)>,
89  RuleItemSpace<>,
90  RuleItemRef<MP_STR("main end", 8)>
91  >
92 > {};
93 
94 template<>
95 class RuleDef<MP_STR("interface block", 15)>:
96 public RuleList<MP_STR("interface block", 15),
97  RuleLine<
98  RuleItemRef<MP_STR("definition", 10)>,
99  RuleItemSpace<>,
100  RuleItemRef<MP_STR("interface block", 15)>
101  >,
102  RuleLine<
103 
104  >
105 > {};
106 
107 template<>
108 class RuleDef<MP_STR("is block", 8)>:
109 public RuleList<MP_STR("is block", 8),
110  RuleLine<
111  RuleItemKeyword<MP_STR("is", 2)>,
112  RuleItemSpace<>,
113  RuleItemRef<MP_STR("interface block", 15)>
114  >,
115  RuleLine<
116 
117  >
118 > {};
119 
120 template<>
121 class RuleDef<MP_STR("code block", 10)>:
122 public RuleList<MP_STR("code block", 10),
123  RuleLine<
124  RuleItemKeyword<MP_STR("begin", 5)>,
125  RuleItemSpace<>,
126  RuleItemRef<MP_STR("statement list", 14)>
127  >,
128  RuleLine<
129 
130  >
131 > {};
132 
133 template<>
134 class RuleDef<MP_STR("main end", 8)>:
135 public RuleList<MP_STR("main end", 8),
136  RuleLine<
137  RuleItemKeyword<MP_STR("end", 3)>,
138  RuleItemSpace<>,
139  RuleItemKeyword<MP_STR("program", 7)>,
140  RuleItemSpace<>,
141  RuleItemRef<MP_STR("id", 2)>
142  >,
143  RuleLine<
144  RuleItemKeyword<MP_STR("end", 3)>,
145  RuleItemSpace<>,
146  RuleItemKeyword<MP_STR("function", 8)>,
147  RuleItemSpace<>,
148  RuleItemRef<MP_STR("id", 2)>
149  >,
150  RuleLine<
151  RuleItemKeyword<MP_STR("end", 3)>,
152  RuleItemSpace<>,
153  RuleItemKeyword<MP_STR("class", 5)>
154  >,
155  RuleLine<
156  RuleItemKeyword<MP_STR("end", 3)>
157  >
158 > {};
159 
160 template<>
161 class RuleDef<MP_STR("function proto", 14)>:
162 public RuleList<MP_STR("function proto", 14),
163  RuleLine<
164  RuleItemRef<MP_STR("id", 2)>,
165  RuleItemSpace<>,
166  RuleItemKeyword<MP_STR("(", 1)>,
167  RuleItemSpace<>,
168  RuleItemRef<MP_STR("argument list", 13)>,
169  RuleItemSpace<>,
170  RuleItemKeyword<MP_STR(")", 1)>
171  >
172 > {};
173 
174 template<>
175 class RuleDef<MP_STR("argument list", 13)>:
176 public RuleList<MP_STR("argument list", 13),
177  RuleLine<
178  RuleItemRef<MP_STR("argument option", 15)>,
179  RuleItemSpace<>,
180  RuleItemRef<MP_STR("id", 2)>,
181  RuleItemSpace<>,
182  RuleItemKeyword<MP_STR(",", 1)>,
183  RuleItemSpace<>,
184  RuleItemRef<MP_STR("argument list", 13)>
185  >,
186  RuleLine<
187  RuleItemRef<MP_STR("argument option", 15)>,
188  RuleItemSpace<>,
189  RuleItemRef<MP_STR("id", 2)>
190  >,
191  RuleLine<
192 
193  >
194 > {};
195 
196 template<>
197 class RuleDef<MP_STR("argument option", 15)>:
198 public RuleList<MP_STR("argument option", 15),
199  RuleLine<
200  RuleItemKeyword<MP_STR("in", 2)>
201  >,
202  RuleLine<
203  RuleItemKeyword<MP_STR("out", 3)>
204  >,
205  RuleLine<
206  RuleItemKeyword<MP_STR("fast", 4)>,
207  RuleItemSpace<>,
208  RuleItemRef<MP_STR("id", 2)>
209  >,
210  RuleLine<
211 
212  >
213 > {};
214 
215 template<>
216 class RuleDef<MP_STR("specific list", 13)>:
217 public RuleList<MP_STR("specific list", 13),
218  RuleLine<
219  RuleItemRef<MP_STR("specific", 8)>,
220  RuleItemSpace<>,
221  RuleItemKeyword<MP_STR(",", 1)>,
222  RuleItemSpace<>,
223  RuleItemRef<MP_STR("specific list", 13)>
224  >,
225  RuleLine<
226  RuleItemRef<MP_STR("specific", 8)>
227  >,
228  RuleLine<
229 
230  >
231 > {};
232 
233 template<>
234 class RuleDef<MP_STR("specific", 8)>:
235 public RuleList<MP_STR("specific", 8),
236  RuleLine<
237  RuleItemKeyword<MP_STR("extends", 7)>,
238  RuleItemSpace<>,
239  RuleItemRef<MP_STR("type", 4)>
240  >,
241  RuleLine<
242  RuleItemKeyword<MP_STR("encloses", 8)>,
243  RuleItemSpace<>,
244  RuleItemRef<MP_STR("expression", 10)>
245  >
246 > {};
247 
248 template<>
249 class RuleDef<MP_STR("definition", 10)>:
250 public RuleList<MP_STR("definition", 10),
251  RuleLine<
252  RuleItemRef<MP_STR("var definition", 14)>,
253  RuleItemSpace<>,
254  RuleItemKeyword<MP_STR(";", 1)>
255  >,
256  RuleLine<
257  RuleItemRef<MP_STR("const definition", 16)>,
258  RuleItemSpace<>,
259  RuleItemKeyword<MP_STR(";", 1)>
260  >,
261  RuleLine<
262  RuleItemRef<MP_STR("static definition", 17)>,
263  RuleItemSpace<>,
264  RuleItemKeyword<MP_STR(";", 1)>
265  >,
266  RuleLine<
267  RuleItemRef<MP_STR("type definition", 15)>,
268  RuleItemSpace<>,
269  RuleItemKeyword<MP_STR(";", 1)>
270  >,
271  RuleLine<
272  RuleItemRef<MP_STR("program", 7)>,
273  RuleItemSpace<>,
274  RuleItemKeyword<MP_STR(";", 1)>
275  >,
276  RuleLine<
277  RuleItemRef<MP_STR("function", 8)>,
278  RuleItemSpace<>,
279  RuleItemKeyword<MP_STR(";", 1)>
280  >,
281  RuleLine<
282  RuleItemRef<MP_STR("return definition", 17)>,
283  RuleItemSpace<>,
284  RuleItemKeyword<MP_STR(";", 1)>
285  >,
286  RuleLine<
287  RuleItemKeyword<MP_STR(";", 1)>
288  >
289 > {};
290 
291 template<>
292 class RuleDef<MP_STR("type definition", 15)>:
293 public RuleList<MP_STR("type definition", 15),
294  RuleLine<
295  RuleItemKeyword<MP_STR("type", 4)>,
296  RuleItemSpace<>,
297  RuleItemRef<MP_STR("id", 2)>,
298  RuleItemSpace<>,
299  RuleItemKeyword<MP_STR("is", 2)>,
300  RuleItemSpace<>,
301  RuleItemRef<MP_STR("type", 4)>
302  >
303 > {};
304 
305 template<>
306 class RuleDef<MP_STR("var definition", 14)>:
307 public RuleList<MP_STR("var definition", 14),
308  RuleLine<
309  RuleItemKeyword<MP_STR("var", 3)>,
310  RuleItemSpace<>,
311  RuleItemRef<MP_STR("id", 2)>,
312  RuleItemSpace<>,
313  RuleItemKeyword<MP_STR("is", 2)>,
314  RuleItemSpace<>,
315  RuleItemRef<MP_STR("type", 4)>
316  >
317 > {};
318 
319 template<>
320 class RuleDef<MP_STR("const definition", 16)>:
321 public RuleList<MP_STR("const definition", 16),
322  RuleLine<
323  RuleItemKeyword<MP_STR("const", 5)>,
324  RuleItemSpace<>,
325  RuleItemRef<MP_STR("id", 2)>,
326  RuleItemSpace<>,
327  RuleItemKeyword<MP_STR("is", 2)>,
328  RuleItemSpace<>,
329  RuleItemRef<MP_STR("type", 4)>
330  >
331 > {};
332 
333 template<>
334 class RuleDef<MP_STR("static definition", 17)>:
335 public RuleList<MP_STR("static definition", 17),
336  RuleLine<
337  RuleItemKeyword<MP_STR("static", 6)>,
338  RuleItemSpace<>,
339  RuleItemRef<MP_STR("id", 2)>,
340  RuleItemSpace<>,
341  RuleItemKeyword<MP_STR("is", 2)>,
342  RuleItemSpace<>,
343  RuleItemRef<MP_STR("type", 4)>
344  >
345 > {};
346 
347 template<>
348 class RuleDef<MP_STR("return definition", 17)>:
349 public RuleList<MP_STR("return definition", 17),
350  RuleLine<
351  RuleItemKeyword<MP_STR("return", 6)>,
352  RuleItemSpace<>,
353  RuleItemRef<MP_STR("id", 2)>,
354  RuleItemSpace<>,
355  RuleItemKeyword<MP_STR("is", 2)>,
356  RuleItemSpace<>,
357  RuleItemRef<MP_STR("type", 4)>
358  >,
359  RuleLine<
360  RuleItemKeyword<MP_STR("return", 6)>,
361  RuleItemSpace<>,
362  RuleItemRef<MP_STR("type", 4)>
363  >
364 > {};
365 
366 template<>
367 class RuleDef<MP_STR("statement list", 14)>:
368 public RuleList<MP_STR("statement list", 14),
369  RuleLine<
370  RuleItemRef<MP_STR("statement", 9)>,
371  RuleItemSpace<>,
372  RuleItemRef<MP_STR("statement list", 14)>
373  >,
374  RuleLine<
375 
376  >
377 > {};
378 
379 template<>
380 class RuleDef<MP_STR("statement", 9)>:
381 public RuleList<MP_STR("statement", 9),
382  RuleLine<
383  RuleItemRef<MP_STR("expression", 10)>,
384  RuleItemSpace<>,
385  RuleItemKeyword<MP_STR(";", 1)>
386  >,
387  RuleLine<
388  RuleItemRef<MP_STR("assignment", 10)>,
389  RuleItemSpace<>,
390  RuleItemKeyword<MP_STR(";", 1)>
391  >,
392  RuleLine<
393  RuleItemRef<MP_STR("return", 6)>,
394  RuleItemSpace<>,
395  RuleItemKeyword<MP_STR(";", 1)>
396  >,
397  RuleLine<
398  RuleItemRef<MP_STR("structure", 9)>
399  >,
400  RuleLine<
401  RuleItemRef<MP_STR("repeat", 6)>,
402  RuleItemSpace<>,
403  RuleItemKeyword<MP_STR(";", 1)>
404  >,
405  RuleLine<
406  RuleItemKeyword<MP_STR(";", 1)>
407  >
408 > {};
409 
410 template<>
411 class RuleDef<MP_STR("assignment", 10)>:
412 public RuleList<MP_STR("assignment", 10),
413  RuleLine<
414  RuleItemRef<MP_STR("expression", 10)>,
415  RuleItemSpace<>,
416  RuleItemRef<MP_STR("assign sign", 11)>,
417  RuleItemSpace<>,
418  RuleItemRef<MP_STR("expression", 10)>
419  >
420 > {};
421 
422 template<>
423 class RuleDef<MP_STR("assign sign", 11)>:
424 public RuleRegex<MP_STR("assign sign", 11),
425  MP_STR("\\:=|\\+=|-=|\\*=|\\/=", 18)
426 > {};
427 
428 template<>
429 class RuleDef<MP_STR("return", 6)>:
430 public RuleList<MP_STR("return", 6),
431  RuleLine<
432  RuleItemKeyword<MP_STR("return", 6)>,
433  RuleItemSpace<>,
434  RuleItemRef<MP_STR("expression", 10)>
435  >,
436  RuleLine<
437  RuleItemKeyword<MP_STR("return", 6)>
438  >
439 > {};
440 
441 template<>
442 class RuleDef<MP_STR("structure", 9)>:
443 public RuleList<MP_STR("structure", 9),
444  RuleLine<
445  RuleItemKeyword<MP_STR("if", 2)>,
446  RuleItemSpace<>,
447  RuleItemRef<MP_STR("expression", 10)>,
448  RuleItemSpace<>,
449  RuleItemKeyword<MP_STR("then", 4)>,
450  RuleItemSpace<>,
451  RuleItemRef<MP_STR("statement list", 14)>,
452  RuleItemSpace<>,
453  RuleItemRef<MP_STR("condition chain", 15)>,
454  RuleItemSpace<>,
455  RuleItemRef<MP_STR("structure end", 13)>
456  >,
457  RuleLine<
458  RuleItemKeyword<MP_STR("for", 3)>,
459  RuleItemSpace<>,
460  RuleItemRef<MP_STR("id", 2)>,
461  RuleItemSpace<>,
462  RuleItemKeyword<MP_STR("in", 2)>,
463  RuleItemSpace<>,
464  RuleItemRef<MP_STR("for range", 9)>,
465  RuleItemSpace<>,
466  RuleItemKeyword<MP_STR("do", 2)>,
467  RuleItemSpace<>,
468  RuleItemRef<MP_STR("statement list", 14)>,
469  RuleItemSpace<>,
470  RuleItemRef<MP_STR("structure end", 13)>
471  >,
472  RuleLine<
473  RuleItemKeyword<MP_STR("foreach", 7)>,
474  RuleItemSpace<>,
475  RuleItemRef<MP_STR("id", 2)>,
476  RuleItemSpace<>,
477  RuleItemKeyword<MP_STR("in", 2)>,
478  RuleItemSpace<>,
479  RuleItemRef<MP_STR("expression", 10)>,
480  RuleItemSpace<>,
481  RuleItemKeyword<MP_STR("do", 2)>,
482  RuleItemSpace<>,
483  RuleItemRef<MP_STR("statement list", 14)>,
484  RuleItemSpace<>,
485  RuleItemRef<MP_STR("structure end", 13)>
486  >,
487  RuleLine<
488  RuleItemKeyword<MP_STR("while", 5)>,
489  RuleItemSpace<>,
490  RuleItemRef<MP_STR("expression", 10)>,
491  RuleItemSpace<>,
492  RuleItemKeyword<MP_STR("do", 2)>,
493  RuleItemSpace<>,
494  RuleItemRef<MP_STR("statement list", 14)>,
495  RuleItemSpace<>,
496  RuleItemRef<MP_STR("structure end", 13)>
497  >
498 > {};
499 
500 template<>
501 class RuleDef<MP_STR("condition chain", 15)>:
502 public RuleList<MP_STR("condition chain", 15),
503  RuleLine<
504  RuleItemKeyword<MP_STR("elif", 4)>,
505  RuleItemSpace<>,
506  RuleItemRef<MP_STR("expression", 10)>,
507  RuleItemSpace<>,
508  RuleItemKeyword<MP_STR("then", 4)>,
509  RuleItemSpace<>,
510  RuleItemRef<MP_STR("statement list", 14)>,
511  RuleItemSpace<>,
512  RuleItemRef<MP_STR("condition chain", 15)>
513  >,
514  RuleLine<
515  RuleItemKeyword<MP_STR("else", 4)>,
516  RuleItemSpace<>,
517  RuleItemRef<MP_STR("statement list", 14)>
518  >,
519  RuleLine<
520 
521  >
522 > {};
523 
524 template<>
525 class RuleDef<MP_STR("for range", 9)>:
526 public RuleList<MP_STR("for range", 9),
527  RuleLine<
528  RuleItemRef<MP_STR("expression", 10)>,
529  RuleItemSpace<>,
530  RuleItemKeyword<MP_STR("to", 2)>,
531  RuleItemSpace<>,
532  RuleItemRef<MP_STR("expression", 10)>
533  >,
534  RuleLine<
535  RuleItemRef<MP_STR("expression", 10)>,
536  RuleItemSpace<>,
537  RuleItemKeyword<MP_STR("downto", 6)>,
538  RuleItemSpace<>,
539  RuleItemRef<MP_STR("expression", 10)>
540  >
541 > {};
542 
543 template<>
544 class RuleDef<MP_STR("structure end", 13)>:
545 public RuleList<MP_STR("structure end", 13),
546  RuleLine<
547  RuleItemKeyword<MP_STR("end", 3)>,
548  RuleItemSpace<>,
549  RuleItemKeyword<MP_STR("if", 2)>
550  >,
551  RuleLine<
552  RuleItemKeyword<MP_STR("end", 3)>,
553  RuleItemSpace<>,
554  RuleItemKeyword<MP_STR("for", 3)>
555  >,
556  RuleLine<
557  RuleItemKeyword<MP_STR("end", 3)>,
558  RuleItemSpace<>,
559  RuleItemKeyword<MP_STR("foreach", 7)>
560  >,
561  RuleLine<
562  RuleItemKeyword<MP_STR("end", 3)>,
563  RuleItemSpace<>,
564  RuleItemKeyword<MP_STR("while", 5)>
565  >
566 > {};
567 
568 template<>
569 class RuleDef<MP_STR("repeat", 6)>:
570 public RuleList<MP_STR("repeat", 6),
571  RuleLine<
572  RuleItemKeyword<MP_STR("repeat", 6)>,
573  RuleItemSpace<>,
574  RuleItemRef<MP_STR("statement list", 14)>,
575  RuleItemSpace<>,
576  RuleItemKeyword<MP_STR("until", 5)>,
577  RuleItemSpace<>,
578  RuleItemRef<MP_STR("expression", 10)>
579  >
580 > {};
581 
582 template<>
583 class RuleDef<MP_STR("expression list", 15)>:
584 public RuleList<MP_STR("expression list", 15),
585  RuleLine<
586  RuleItemRef<MP_STR("expression", 10)>,
587  RuleItemSpace<>,
588  RuleItemKeyword<MP_STR(",", 1)>,
589  RuleItemSpace<>,
590  RuleItemRef<MP_STR("expression list", 15)>
591  >,
592  RuleLine<
593  RuleItemRef<MP_STR("expression", 10)>
594  >,
595  RuleLine<
596 
597  >
598 > {};
599 
600 template<>
601 class RuleDef<MP_STR("expression", 10)>:
602 public RuleList<MP_STR("expression", 10),
603  RuleLine<
604  RuleItemRef<MP_STR("relative expression", 19)>
605  >
606 > {};
607 
608 template<>
609 class RuleDef<MP_STR("relative expression", 19)>:
610 public RuleList<MP_STR("relative expression", 19),
611  RuleLine<
612  RuleItemRef<MP_STR("additive expression", 19)>,
613  RuleItemSpace<>,
614  RuleItemRef<MP_STR("relative operation", 18)>
615  >
616 > {};
617 
618 template<>
619 class RuleDef<MP_STR("relative operation", 18)>:
620 public RuleList<MP_STR("relative operation", 18),
621  RuleLine<
622  RuleItemRef<MP_STR("relation", 8)>,
623  RuleItemSpace<>,
624  RuleItemRef<MP_STR("relative expression", 19)>
625  >,
626  RuleLine<
627 
628  >
629 > {};
630 
631 template<>
632 class RuleDef<MP_STR("additive expression", 19)>:
633 public RuleList<MP_STR("additive expression", 19),
634  RuleLine<
635  RuleItemRef<MP_STR("multiplicative expression", 25)>,
636  RuleItemSpace<>,
637  RuleItemRef<MP_STR("additive operation", 18)>
638  >
639 > {};
640 
641 template<>
642 class RuleDef<MP_STR("additive operation", 18)>:
643 public RuleList<MP_STR("additive operation", 18),
644  RuleLine<
645  RuleItemRef<MP_STR("addition", 8)>,
646  RuleItemSpace<>,
647  RuleItemRef<MP_STR("additive expression", 19)>
648  >,
649  RuleLine<
650 
651  >
652 > {};
653 
654 template<>
655 class RuleDef<MP_STR("multiplicative expression", 25)>:
656 public RuleList<MP_STR("multiplicative expression", 25),
657  RuleLine<
658  RuleItemRef<MP_STR("unary expression", 16)>,
659  RuleItemSpace<>,
660  RuleItemRef<MP_STR("multiplicative operation", 24)>
661  >
662 > {};
663 
664 template<>
665 class RuleDef<MP_STR("multiplicative operation", 24)>:
666 public RuleList<MP_STR("multiplicative operation", 24),
667  RuleLine<
668  RuleItemRef<MP_STR("multiplication", 14)>,
669  RuleItemSpace<>,
670  RuleItemRef<MP_STR("multiplicative expression", 25)>
671  >,
672  RuleLine<
673 
674  >
675 > {};
676 
677 template<>
678 class RuleDef<MP_STR("unary expression", 16)>:
679 public RuleList<MP_STR("unary expression", 16),
680  RuleLine<
681  RuleItemRef<MP_STR("unary operator", 14)>,
682  RuleItemSpace<>,
683  RuleItemRef<MP_STR("unary expression", 16)>
684  >,
685  RuleLine<
686  RuleItemRef<MP_STR("literal", 7)>,
687  RuleItemSpace<>,
688  RuleItemRef<MP_STR("access operation", 16)>
689  >,
690  RuleLine<
691  RuleItemRef<MP_STR("id", 2)>,
692  RuleItemSpace<>,
693  RuleItemRef<MP_STR("access operation", 16)>
694  >,
695  RuleLine<
696  RuleItemKeyword<MP_STR("(", 1)>,
697  RuleItemSpace<>,
698  RuleItemRef<MP_STR("expression", 10)>,
699  RuleItemSpace<>,
700  RuleItemKeyword<MP_STR(")", 1)>
701  >
702 > {};
703 
704 template<>
705 class RuleDef<MP_STR("access operation", 16)>:
706 public RuleList<MP_STR("access operation", 16),
707  RuleLine<
708  RuleItemRef<MP_STR("argument apply", 14)>,
709  RuleItemSpace<>,
710  RuleItemRef<MP_STR("access operation", 16)>
711  >,
712  RuleLine<
713  RuleItemKeyword<MP_STR(".", 1)>,
714  RuleItemSpace<>,
715  RuleItemRef<MP_STR("id", 2)>,
716  RuleItemSpace<>,
717  RuleItemRef<MP_STR("access operation", 16)>
718  >,
719  RuleLine<
720 
721  >
722 > {};
723 
724 template<>
725 class RuleDef<MP_STR("argument apply", 14)>:
726 public RuleList<MP_STR("argument apply", 14),
727  RuleLine<
728  RuleItemRef<MP_STR("literal", 7)>
729  >,
730  RuleLine<
731  RuleItemRef<MP_STR("id", 2)>
732  >,
733  RuleLine<
734  RuleItemKeyword<MP_STR("(", 1)>,
735  RuleItemSpace<>,
736  RuleItemRef<MP_STR("expression list", 15)>,
737  RuleItemSpace<>,
738  RuleItemKeyword<MP_STR(")", 1)>
739  >
740 > {};
741 
742 template<>
743 class RuleDef<MP_STR("type", 4)>:
744 public RuleList<MP_STR("type", 4),
745  RuleLine<
746  RuleItemRef<MP_STR("native type", 11)>
747  >,
748  RuleLine<
749  RuleItemRef<MP_STR("wrap type", 9)>
750  >,
751  RuleLine<
752  RuleItemRef<MP_STR("program type", 12)>
753  >,
754  RuleLine<
755  RuleItemRef<MP_STR("function type", 13)>
756  >,
757  RuleLine<
758  RuleItemRef<MP_STR("type inference", 14)>
759  >,
760  RuleLine<
761  RuleItemRef<MP_STR("class", 5)>
762  >,
763  RuleLine<
764  RuleItemRef<MP_STR("id", 2)>
765  >
766 > {};
767 
768 template<>
769 class RuleDef<MP_STR("native type", 11)>:
770 public RuleList<MP_STR("native type", 11),
771  RuleLine<
772  RuleItemKeyword<MP_STR("void", 4)>
773  >,
774  RuleLine<
775  RuleItemKeyword<MP_STR("boolean", 7)>
776  >,
777  RuleLine<
778  RuleItemKeyword<MP_STR("byte", 4)>
779  >,
780  RuleLine<
781  RuleItemKeyword<MP_STR("integer", 7)>
782  >,
783  RuleLine<
784  RuleItemKeyword<MP_STR("real", 4)>
785  >,
786  RuleLine<
787  RuleItemKeyword<MP_STR("bitset", 6)>
788  >
789 > {};
790 
791 template<>
792 class RuleDef<MP_STR("wrap type", 9)>:
793 public RuleList<MP_STR("wrap type", 9),
794  RuleLine<
795  RuleItemRef<MP_STR("array", 5)>
796  >,
797  RuleLine<
798  RuleItemRef<MP_STR("pointer", 7)>
799  >,
800  RuleLine<
801  RuleItemRef<MP_STR("reference", 9)>
802  >
803 > {};
804 
805 template<>
806 class RuleDef<MP_STR("array", 5)>:
807 public RuleList<MP_STR("array", 5),
808  RuleLine<
809  RuleItemKeyword<MP_STR("array", 5)>,
810  RuleItemSpace<>,
811  RuleItemKeyword<MP_STR("of", 2)>,
812  RuleItemSpace<>,
813  RuleItemRef<MP_STR("integer", 7)>,
814  RuleItemSpace<>,
815  RuleItemRef<MP_STR("type", 4)>
816  >
817 > {};
818 
819 template<>
820 class RuleDef<MP_STR("pointer", 7)>:
821 public RuleList<MP_STR("pointer", 7),
822  RuleLine<
823  RuleItemKeyword<MP_STR("pointer", 7)>,
824  RuleItemSpace<>,
825  RuleItemKeyword<MP_STR("of", 2)>,
826  RuleItemSpace<>,
827  RuleItemRef<MP_STR("type", 4)>
828  >
829 > {};
830 
831 template<>
832 class RuleDef<MP_STR("reference", 9)>:
833 public RuleList<MP_STR("reference", 9),
834  RuleLine<
835  RuleItemKeyword<MP_STR("reference", 9)>,
836  RuleItemSpace<>,
837  RuleItemKeyword<MP_STR("of", 2)>,
838  RuleItemSpace<>,
839  RuleItemRef<MP_STR("type", 4)>
840  >
841 > {};
842 
843 template<>
844 class RuleDef<MP_STR("program type", 12)>:
845 public RuleList<MP_STR("program type", 12),
846  RuleLine<
847  RuleItemKeyword<MP_STR("program", 7)>,
848  RuleItemSpace<>,
849  RuleItemRef<MP_STR("id", 2)>
850  >
851 > {};
852 
853 template<>
854 class RuleDef<MP_STR("function type", 13)>:
855 public RuleList<MP_STR("function type", 13),
856  RuleLine<
857  RuleItemKeyword<MP_STR("function", 8)>,
858  RuleItemSpace<>,
859  RuleItemRef<MP_STR("id", 2)>
860  >
861 > {};
862 
863 template<>
864 class RuleDef<MP_STR("type inference", 14)>:
865 public RuleList<MP_STR("type inference", 14),
866  RuleLine<
867  RuleItemKeyword<MP_STR("type", 4)>,
868  RuleItemSpace<>,
869  RuleItemKeyword<MP_STR("of", 2)>,
870  RuleItemSpace<>,
871  RuleItemRef<MP_STR("expression", 10)>
872  >
873 > {};
874 
875 template<>
876 class RuleDef<MP_STR("relation", 8)>:
877 public RuleList<MP_STR("relation", 8),
878  RuleLine<
879  RuleItemRef<MP_STR("comparison", 10)>
880  >,
881  RuleLine<
882  RuleItemKeyword<MP_STR("in", 2)>
883  >
884 > {};
885 
886 template<>
887 class RuleDef<MP_STR("addition", 8)>:
888 public RuleList<MP_STR("addition", 8),
889  RuleLine<
890  RuleItemRef<MP_STR("addsub", 6)>
891  >,
892  RuleLine<
893  RuleItemKeyword<MP_STR("or", 2)>
894  >,
895  RuleLine<
896  RuleItemKeyword<MP_STR("xor", 3)>
897  >
898 > {};
899 
900 template<>
901 class RuleDef<MP_STR("multiplication", 14)>:
902 public RuleList<MP_STR("multiplication", 14),
903  RuleLine<
904  RuleItemRef<MP_STR("muldiv", 6)>
905  >,
906  RuleLine<
907  RuleItemKeyword<MP_STR("div", 3)>
908  >,
909  RuleLine<
910  RuleItemKeyword<MP_STR("mod", 3)>
911  >,
912  RuleLine<
913  RuleItemKeyword<MP_STR("and", 3)>
914  >,
915  RuleLine<
916  RuleItemKeyword<MP_STR("shl", 3)>
917  >,
918  RuleLine<
919  RuleItemKeyword<MP_STR("shr", 3)>
920  >,
921  RuleLine<
922  RuleItemKeyword<MP_STR("rol", 3)>
923  >,
924  RuleLine<
925  RuleItemKeyword<MP_STR("ror", 3)>
926  >
927 > {};
928 
929 template<>
930 class RuleDef<MP_STR("unary operator", 14)>:
931 public RuleList<MP_STR("unary operator", 14),
932  RuleLine<
933  RuleItemRef<MP_STR("addsub", 6)>
934  >,
935  RuleLine<
936  RuleItemKeyword<MP_STR("not", 3)>
937  >
938 > {};
939 
940 template<>
941 class RuleDef<MP_STR("comparison", 10)>:
942 public RuleRegex<MP_STR("comparison", 10),
943  MP_STR("==|<=|=<|>=|=>|!=|<|>", 21)
944 > {};
945 
946 template<>
947 class RuleDef<MP_STR("addsub", 6)>:
948 public RuleRegex<MP_STR("addsub", 6),
949  MP_STR("\\+|-", 4)
950 > {};
951 
952 template<>
953 class RuleDef<MP_STR("muldiv", 6)>:
954 public RuleRegex<MP_STR("muldiv", 6),
955  MP_STR("\\*|\\/", 5)
956 > {};
957 
958 template<>
959 class RuleDef<MP_STR("literal", 7)>:
960 public RuleList<MP_STR("literal", 7),
961  RuleLine<
962  RuleItemRef<MP_STR("boolean", 7)>
963  >,
964  RuleLine<
965  RuleItemRef<MP_STR("byte", 4)>
966  >,
967  RuleLine<
968  RuleItemRef<MP_STR("integer", 7)>
969  >,
970  RuleLine<
971  RuleItemRef<MP_STR("real", 4)>
972  >,
973  RuleLine<
974  RuleItemRef<MP_STR("string", 6)>
975  >,
976  RuleLine<
977  RuleItemRef<MP_STR("instant array", 13)>
978  >
979 > {};
980 
981 template<>
982 class RuleDef<MP_STR("boolean", 7)>:
983 public RuleList<MP_STR("boolean", 7),
984  RuleLine<
985  RuleItemKeyword<MP_STR("yes", 3)>
986  >,
987  RuleLine<
988  RuleItemKeyword<MP_STR("no", 2)>
989  >
990 > {};
991 
992 template<>
993 class RuleDef<MP_STR("byte", 4)>:
994 public RuleRegex<MP_STR("byte", 4),
995  MP_STR("\'([^\\\\]|\\\\.)\'", 13)
996 > {};
997 
998 template<>
999 class RuleDef<MP_STR("integer", 7)>:
1000 public RuleRegex<MP_STR("integer", 7),
1001  MP_STR("[0-9]+", 6)
1002 > {};
1003 
1004 template<>
1005 class RuleDef<MP_STR("real", 4)>:
1006 public RuleRegex<MP_STR("real", 4),
1007  MP_STR("[0-9]*\\.[0-9]+([Ee][\\+-]?[0-9]+)?", 33)
1008 > {};
1009 
1010 template<>
1011 class RuleDef<MP_STR("string", 6)>:
1012 public RuleRegex<MP_STR("string", 6),
1013  MP_STR("\"([^\\\\]|\\\\.)*\"", 14)
1014 > {};
1015 
1016 template<>
1017 class RuleDef<MP_STR("instant array", 13)>:
1018 public RuleList<MP_STR("instant array", 13),
1019  RuleLine<
1020  RuleItemKeyword<MP_STR("[", 1)>,
1021  RuleItemSpace<>,
1022  RuleItemRef<MP_STR("expression list", 15)>,
1023  RuleItemSpace<>,
1024  RuleItemKeyword<MP_STR("]", 1)>
1025  >
1026 > {};
1027 
1028 template<>
1029 class RuleDef<MP_STR("space", 5)>:
1030 public RuleList<MP_STR("space", 5),
1031  RuleLine<
1032  RuleItemRef<MP_STR("ignored", 7)>
1033  >
1034 > {};
1035 
1036 template<>
1037 class RuleDef<MP_STR("keyword", 7)>:
1038 public RuleList<MP_STR("keyword", 7),
1039  RuleLine<
1040  RuleItemRef<MP_STR("reserved id", 11)>
1041  >,
1042  RuleLine<
1043  RuleItemRef<MP_STR("sign", 4)>
1044  >
1045 > {};
1046 
1047 template<>
1048 class RuleDef<MP_STR("id", 2)>:
1049 public RuleRegex<MP_STR("id", 2),
1050  MP_STR("[A-Za-z_][A-Za-z0-9_]*", 22)
1051 > {};
1052 
1053 template<>
1054 class RuleDef<MP_STR("reserved id", 11)>:
1055 public RuleRegex<MP_STR("reserved id", 11),
1056  MP_STR("[A-Za-z_][A-Za-z0-9_]*", 22)
1057 > {};
1058 
1059 template<>
1060 class RuleDef<MP_STR("sign", 4)>:
1061 public RuleRegex<MP_STR("sign", 4),
1062  MP_STR("[\\(\\)\\[\\],.;]", 13)
1063 > {};
1064 
1065 template<>
1066 class RuleDef<MP_STR("ignored", 7)>:
1067 public RuleRegex<MP_STR("ignored", 7),
1068  MP_STR("(\\/\\/.*|[ \\t\\r\\n])*", 19)
1069 > {};
1070 
1071 
1072 }
1073 
1074 #endif
Definition: myparser_rule.hpp:60
Definition: myparser_rule.hpp:118
#define MP_STR(str, len)
Definition: myparser_str.hpp:9
int main()
Definition: ml.cpp:73
Definition: myparser_rule.hpp:47