-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyatgParser.h
1040 lines (917 loc) · 36.2 KB
/
yatgParser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/** \file
* This C header file was generated by $ANTLR version 3.2 Sep 23, 2009 12:02:23
*
* - From the grammar source file : C:\\Zlang\\src\\Zzparser\\Grammar\\yatg.g
* - On : 2010-07-07 17:24:01
* - for the parser : yatgParserParser *
* Editing it, at least manually, is not wise.
*
* C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws.
*
*
* The parser yatgParser has the callable functions (rules) shown below,
* which will invoke the code for the associated rule in the source grammar
* assuming that the input stream is pointing to a token/text stream that could begin
* this rule.
*
* For instance if you call the first (topmost) rule in a parser grammar, you will
* get the results of a full parse, but calling a rule half way through the grammar will
* allow you to pass part of a full token stream to the parser, such as for syntax checking
* in editors and so on.
*
* The parser entry points are called indirectly (by function pointer to function) via
* a parser context typedef pyatgParser, which is returned from a call to yatgParserNew().
*
* The methods in pyatgParser are as follows:
*
* - yatgParser_program_return pyatgParser->program(pyatgParser)
* - yatgParser_expr_return pyatgParser->expr(pyatgParser)
* - yatgParser_variable_decls_return pyatgParser->variable_decls(pyatgParser)
* - yatgParser_type_decl_return pyatgParser->type_decl(pyatgParser)
* - yatgParser_decl_return pyatgParser->decl(pyatgParser)
* - yatgParser_if_expr_return pyatgParser->if_expr(pyatgParser)
* - yatgParser_while_loop_return pyatgParser->while_loop(pyatgParser)
* - yatgParser_do_loop_return pyatgParser->do_loop(pyatgParser)
* - yatgParser_for_loop_return pyatgParser->for_loop(pyatgParser)
* - yatgParser_source_return pyatgParser->source(pyatgParser)
* - yatgParser_loop_exit_return pyatgParser->loop_exit(pyatgParser)
* - yatgParser_loop_continue_return pyatgParser->loop_continue(pyatgParser)
* - yatgParser_case_expr_return pyatgParser->case_expr(pyatgParser)
* - yatgParser_case_item_return pyatgParser->case_item(pyatgParser)
* - yatgParser_struct_def_return pyatgParser->struct_def(pyatgParser)
* - yatgParser_member_return pyatgParser->member(pyatgParser)
* - yatgParser_try_expr_return pyatgParser->try_expr(pyatgParser)
* - yatgParser_function_def_return pyatgParser->function_def(pyatgParser)
* - yatgParser_fun_return pyatgParser->fun(pyatgParser)
* - yatgParser_function_return_return pyatgParser->function_return(pyatgParser)
* - yatgParser_context_expr_return pyatgParser->context_expr(pyatgParser)
* - yatgParser_context_return pyatgParser->context(pyatgParser)
* - yatgParser_set_context_return pyatgParser->set_context(pyatgParser)
* - yatgParser_math_expression_return pyatgParser->math_expression(pyatgParser)
* - yatgParser_additive_expression_return pyatgParser->additive_expression(pyatgParser)
* - yatgParser_multiplicative_expression_return pyatgParser->multiplicative_expression(pyatgParser)
* - yatgParser_argT_return pyatgParser->argT(pyatgParser)
* - yatgParser_argument_decl_list_return pyatgParser->argument_decl_list(pyatgParser)
* - yatgParser_argument_expression_list_return pyatgParser->argument_expression_list(pyatgParser)
* - yatgParser_unary_expression_return pyatgParser->unary_expression(pyatgParser)
* - yatgParser_operand_return pyatgParser->operand(pyatgParser)
* - yatgParser_operand_op_return pyatgParser->operand_op(pyatgParser)
* - yatgParser_constant_return pyatgParser->constant(pyatgParser)
* - yatgParser_number_return pyatgParser->number(pyatgParser)
* - yatgParser_constant_expression_return pyatgParser->constant_expression(pyatgParser)
* - yatgParser_assignment_expression_return pyatgParser->assignment_expression(pyatgParser)
* - yatgParser_lvalue_return pyatgParser->lvalue(pyatgParser)
* - yatgParser_assignment_operator_return pyatgParser->assignment_operator(pyatgParser)
* - yatgParser_logical_expression_return pyatgParser->logical_expression(pyatgParser)
* - yatgParser_logical_or_expression_return pyatgParser->logical_or_expression(pyatgParser)
* - yatgParser_logical_and_expression_return pyatgParser->logical_and_expression(pyatgParser)
* - yatgParser_equality_expression_return pyatgParser->equality_expression(pyatgParser)
* - yatgParser_relational_expression_return pyatgParser->relational_expression(pyatgParser)
* - yatgParser_expr_seq_return pyatgParser->expr_seq(pyatgParser)
* - yatgParser_expr_g_return pyatgParser->expr_g(pyatgParser)
* - yatgParser_box2_return pyatgParser->box2(pyatgParser)
* - yatgParser_point3_return pyatgParser->point3(pyatgParser)
* - yatgParser_point2_return pyatgParser->point2(pyatgParser)
* - yatgParser_array_return pyatgParser->array(pyatgParser)
* - yatgParser_matrix_return pyatgParser->matrix(pyatgParser)
* - yatgParser_bitarray_return pyatgParser->bitarray(pyatgParser)
* - yatgParser_arrrange_return pyatgParser->arrrange(pyatgParser)
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* The return type for any particular rule is of course determined by the source
* grammar file.
*/
// [The "BSD licence"]
// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC
// http://www.temporal-wave.com
// http://www.linkedin.com/in/jimidle
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// 3. The name of the author may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef _yatgParser_H
#define _yatgParser_H
/* =============================================================================
* Standard antlr3 C runtime definitions
*/
#include <antlr3.h>
/* End of standard antlr 3 runtime definitions
* =============================================================================
*/
#ifdef __cplusplus
extern "C" {
#endif
// Forward declare the context typedef so that we can use it before it is
// properly defined. Delegators and delegates (from import statements) are
// interdependent and their context structures contain pointers to each other
// C only allows such things to be declared if you pre-declare the typedef.
//
typedef struct yatgParser_Ctx_struct yatgParser, * pyatgParser;
#ifdef ANTLR3_WINDOWS
// Disable: Unreferenced parameter, - Rules with parameters that are not used
// constant conditional, - ANTLR realizes that a prediction is always true (synpred usually)
// initialized but unused variable - tree rewrite variables declared but not needed
// Unreferenced local variable - lexer rule declares but does not always use _type
// potentially unitialized variable used - retval always returned from a rule
// unreferenced local function has been removed - susually getTokenNames or freeScope, they can go without warnigns
//
// These are only really displayed at warning level /W4 but that is the code ideal I am aiming at
// and the codegen must generate some of these warnings by necessity, apart from 4100, which is
// usually generated when a parser rule is given a parameter that it does not use. Mostly though
// this is a matter of orthogonality hence I disable that one.
//
#pragma warning( disable : 4100 )
#pragma warning( disable : 4101 )
#pragma warning( disable : 4127 )
#pragma warning( disable : 4189 )
#pragma warning( disable : 4505 )
#pragma warning( disable : 4701 )
#endif
/* ========================
* BACKTRACKING IS ENABLED
* ========================
*/
typedef struct yatgParser_program_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_program_return;
typedef struct yatgParser_expr_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_expr_return;
typedef struct yatgParser_variable_decls_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_variable_decls_return;
typedef struct yatgParser_type_decl_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_type_decl_return;
typedef struct yatgParser_decl_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_decl_return;
typedef struct yatgParser_if_expr_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_if_expr_return;
typedef struct yatgParser_while_loop_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_while_loop_return;
typedef struct yatgParser_do_loop_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_do_loop_return;
typedef struct yatgParser_for_loop_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_for_loop_return;
typedef struct yatgParser_source_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_source_return;
typedef struct yatgParser_loop_exit_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_loop_exit_return;
typedef struct yatgParser_loop_continue_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_loop_continue_return;
typedef struct yatgParser_case_expr_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_case_expr_return;
typedef struct yatgParser_case_item_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_case_item_return;
typedef struct yatgParser_struct_def_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_struct_def_return;
typedef struct yatgParser_member_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_member_return;
typedef struct yatgParser_try_expr_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_try_expr_return;
typedef struct yatgParser_function_def_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_function_def_return;
typedef struct yatgParser_fun_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_fun_return;
typedef struct yatgParser_function_return_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_function_return_return;
typedef struct yatgParser_context_expr_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_context_expr_return;
typedef struct yatgParser_context_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_context_return;
typedef struct yatgParser_set_context_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_set_context_return;
typedef struct yatgParser_math_expression_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_math_expression_return;
typedef struct yatgParser_additive_expression_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_additive_expression_return;
typedef struct yatgParser_multiplicative_expression_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_multiplicative_expression_return;
typedef struct yatgParser_argT_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_argT_return;
typedef struct yatgParser_argument_decl_list_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_argument_decl_list_return;
typedef struct yatgParser_argument_expression_list_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_argument_expression_list_return;
typedef struct yatgParser_unary_expression_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_unary_expression_return;
typedef struct yatgParser_operand_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_operand_return;
typedef struct yatgParser_operand_op_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_operand_op_return;
typedef struct yatgParser_constant_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_constant_return;
typedef struct yatgParser_number_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_number_return;
typedef struct yatgParser_constant_expression_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_constant_expression_return;
typedef struct yatgParser_assignment_expression_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_assignment_expression_return;
typedef struct yatgParser_lvalue_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_lvalue_return;
typedef struct yatgParser_assignment_operator_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_assignment_operator_return;
typedef struct yatgParser_logical_expression_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_logical_expression_return;
typedef struct yatgParser_logical_or_expression_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_logical_or_expression_return;
typedef struct yatgParser_logical_and_expression_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_logical_and_expression_return;
typedef struct yatgParser_equality_expression_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_equality_expression_return;
typedef struct yatgParser_relational_expression_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_relational_expression_return;
typedef struct yatgParser_expr_seq_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_expr_seq_return;
typedef struct yatgParser_expr_g_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_expr_g_return;
typedef struct yatgParser_box2_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_box2_return;
typedef struct yatgParser_point3_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_point3_return;
typedef struct yatgParser_point2_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_point2_return;
typedef struct yatgParser_array_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_array_return;
typedef struct yatgParser_matrix_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_matrix_return;
typedef struct yatgParser_bitarray_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_bitarray_return;
typedef struct yatgParser_arrrange_return_struct
{
/** Generic return elements for ANTLR3 rules that are not in tree parsers or returning trees
*/
pANTLR3_COMMON_TOKEN start;
pANTLR3_COMMON_TOKEN stop;
pANTLR3_BASE_TREE tree;
}
yatgParser_arrrange_return;
/** Context tracking structure for yatgParser
*/
struct yatgParser_Ctx_struct
{
/** Built in ANTLR3 context tracker contains all the generic elements
* required for context tracking.
*/
pANTLR3_PARSER pParser;
yatgParser_program_return (*program) (struct yatgParser_Ctx_struct * ctx);
yatgParser_expr_return (*expr) (struct yatgParser_Ctx_struct * ctx);
yatgParser_variable_decls_return (*variable_decls) (struct yatgParser_Ctx_struct * ctx);
yatgParser_type_decl_return (*type_decl) (struct yatgParser_Ctx_struct * ctx);
yatgParser_decl_return (*decl) (struct yatgParser_Ctx_struct * ctx);
yatgParser_if_expr_return (*if_expr) (struct yatgParser_Ctx_struct * ctx);
yatgParser_while_loop_return (*while_loop) (struct yatgParser_Ctx_struct * ctx);
yatgParser_do_loop_return (*do_loop) (struct yatgParser_Ctx_struct * ctx);
yatgParser_for_loop_return (*for_loop) (struct yatgParser_Ctx_struct * ctx);
yatgParser_source_return (*source) (struct yatgParser_Ctx_struct * ctx);
yatgParser_loop_exit_return (*loop_exit) (struct yatgParser_Ctx_struct * ctx);
yatgParser_loop_continue_return (*loop_continue) (struct yatgParser_Ctx_struct * ctx);
yatgParser_case_expr_return (*case_expr) (struct yatgParser_Ctx_struct * ctx);
yatgParser_case_item_return (*case_item) (struct yatgParser_Ctx_struct * ctx);
yatgParser_struct_def_return (*struct_def) (struct yatgParser_Ctx_struct * ctx);
yatgParser_member_return (*member) (struct yatgParser_Ctx_struct * ctx);
yatgParser_try_expr_return (*try_expr) (struct yatgParser_Ctx_struct * ctx);
yatgParser_function_def_return (*function_def) (struct yatgParser_Ctx_struct * ctx);
yatgParser_fun_return (*fun) (struct yatgParser_Ctx_struct * ctx);
yatgParser_function_return_return (*function_return) (struct yatgParser_Ctx_struct * ctx);
yatgParser_context_expr_return (*context_expr) (struct yatgParser_Ctx_struct * ctx);
yatgParser_context_return (*context) (struct yatgParser_Ctx_struct * ctx);
yatgParser_set_context_return (*set_context) (struct yatgParser_Ctx_struct * ctx);
yatgParser_math_expression_return (*math_expression) (struct yatgParser_Ctx_struct * ctx);
yatgParser_additive_expression_return (*additive_expression) (struct yatgParser_Ctx_struct * ctx);
yatgParser_multiplicative_expression_return (*multiplicative_expression) (struct yatgParser_Ctx_struct * ctx);
yatgParser_argT_return (*argT) (struct yatgParser_Ctx_struct * ctx);
yatgParser_argument_decl_list_return (*argument_decl_list) (struct yatgParser_Ctx_struct * ctx);
yatgParser_argument_expression_list_return (*argument_expression_list) (struct yatgParser_Ctx_struct * ctx);
yatgParser_unary_expression_return (*unary_expression) (struct yatgParser_Ctx_struct * ctx);
yatgParser_operand_return (*operand) (struct yatgParser_Ctx_struct * ctx);
yatgParser_operand_op_return (*operand_op) (struct yatgParser_Ctx_struct * ctx);
yatgParser_constant_return (*constant) (struct yatgParser_Ctx_struct * ctx);
yatgParser_number_return (*number) (struct yatgParser_Ctx_struct * ctx);
yatgParser_constant_expression_return (*constant_expression) (struct yatgParser_Ctx_struct * ctx);
yatgParser_assignment_expression_return (*assignment_expression) (struct yatgParser_Ctx_struct * ctx);
yatgParser_lvalue_return (*lvalue) (struct yatgParser_Ctx_struct * ctx);
yatgParser_assignment_operator_return (*assignment_operator) (struct yatgParser_Ctx_struct * ctx);
yatgParser_logical_expression_return (*logical_expression) (struct yatgParser_Ctx_struct * ctx);
yatgParser_logical_or_expression_return (*logical_or_expression) (struct yatgParser_Ctx_struct * ctx);
yatgParser_logical_and_expression_return (*logical_and_expression) (struct yatgParser_Ctx_struct * ctx);
yatgParser_equality_expression_return (*equality_expression) (struct yatgParser_Ctx_struct * ctx);
yatgParser_relational_expression_return (*relational_expression) (struct yatgParser_Ctx_struct * ctx);
yatgParser_expr_seq_return (*expr_seq) (struct yatgParser_Ctx_struct * ctx);
yatgParser_expr_g_return (*expr_g) (struct yatgParser_Ctx_struct * ctx);
yatgParser_box2_return (*box2) (struct yatgParser_Ctx_struct * ctx);
yatgParser_point3_return (*point3) (struct yatgParser_Ctx_struct * ctx);
yatgParser_point2_return (*point2) (struct yatgParser_Ctx_struct * ctx);
yatgParser_array_return (*array) (struct yatgParser_Ctx_struct * ctx);
yatgParser_matrix_return (*matrix) (struct yatgParser_Ctx_struct * ctx);
yatgParser_bitarray_return (*bitarray) (struct yatgParser_Ctx_struct * ctx);
yatgParser_arrrange_return (*arrrange) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred2_yatg) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred16_yatg) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred20_yatg) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred26_yatg) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred53_yatg) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred60_yatg) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred69_yatg) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred72_yatg) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred73_yatg) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred74_yatg) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred86_yatg) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred101_yatg) (struct yatgParser_Ctx_struct * ctx);
ANTLR3_BOOLEAN (*synpred106_yatg) (struct yatgParser_Ctx_struct * ctx);
// Delegated rules
const char * (*getGrammarFileName)();
void (*free) (struct yatgParser_Ctx_struct * ctx);
/* @headerFile.members() */
pANTLR3_BASE_TREE_ADAPTOR adaptor;
pANTLR3_VECTOR_FACTORY vectors;
/* End @headerFile.members() */
};
// Function protoypes for the constructor functions that external translation units
// such as delegators and delegates may wish to call.
//
ANTLR3_API pyatgParser yatgParserNew (pANTLR3_COMMON_TOKEN_STREAM instream);
ANTLR3_API pyatgParser yatgParserNewSSD (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state);
/** Symbolic definitions of all the tokens that the parser will work with.
* \{
*
* Antlr will define EOF, but we can't use that as it it is too common in
* in C header files and that would be confusing. There is no way to filter this out at the moment
* so we just undef it here for now. That isn't the value we get back from C recognizers
* anyway. We are looking for ANTLR3_TOKEN_EOF.
*/
#ifdef EOF
#undef EOF
#endif
#ifdef Tokens
#undef Tokens
#endif
#define PIVOT 60
#define SS_PLUS_EQUAL 148
#define ROW 80
#define SS_D_DOT 160
#define SS_CCBRACKET 159
#define LETTER 164
#define EWHILE_EXP 15
#define SS_FSLASH 128
#define EIF_ELSE 11
#define CASE 39
#define KW_DEFAULT 105
#define ESEQ 7
#define P_P2 30
#define P_P3 31
#define UNDO 69
#define KW_WHERE 96
#define STRING_LITERIAL 134
#define KW_FN 111
#define EOF -1
#define SS_PERCENT 129
#define KW_GLOBAL 83
#define EOL 167
#define KW_UNDEFINED 141
#define EIF_COND 9
#define KW_LEVEL 115
#define EWHILE_CON 14
#define KW_PARENT 119
#define LP_EXIT 36
#define SS_D_BAR 150
#define LP_EXIT_WITH 37
#define EDO 17
#define RETURN 49
#define KW_THEN 87
#define SS_LT_EQUAL 156
#define COORDSYS 58
#define BODY 52
#define KW_COORDSYS 117
#define SS_STAR 127
#define COMMENT 168
#define ARR_BIT 33
#define SS_GT 155
#define KW_EXIT 97
#define SS_COLON 104
#define ABOUT 61
#define KW_FUNCTION 110
#define ESRC_WHERE 28
#define MATRIX 79
#define EDO_CON 18
#define SS_COMMA 81
#define LINE_COMMENT 169
#define SS_DOT 130
#define ECATCH_EXP 48
#define KW_CATCH 108
#define NUMBER 78
#define P_BOX2 29
#define SS_D_EQUAL 152
#define LOCAL 62
#define KW_DO 88
#define SS_MINUS_EQUAL 149
#define SS_STAR_EQUAL 145
#define EWHILE 13
#define KW_ANIMATE 113
#define KW_ABOUT 120
#define EFOR 21
#define FUN_DEF 50
#define PRIM_EXP 77
#define SS_D_AMP 151
#define SS_CBRACKET 132
#define WS 166
#define SS_GT_EQUAL 157
#define SS_MINUS 126
#define LEVEL 65
#define SS_DQUOTE 162
#define KW_TO 94
#define EFOR_END 24
#define KW_BY 95
#define ETRY 46
#define ESRC_START 25
#define FUN 53
#define KW_LOCAL 82
#define EscapeSequence 161
#define SS_EQUAL 85
#define KW_ELSE 89
#define SS_EXC_EQUAL 153
#define MEMBER 45
#define MAPPED 54
#define ID_MORE 75
#define ARR_IND 35
#define SS_OPAREN 102
#define EDO_END 20
#define KW_UNSUPPLIED 142
#define KW_SELECTION 122
#define SS_CPAREN 103
#define KW_TRUE 136
#define HexDigit 165
#define KW_PIVOT 121
#define KW_WITH 98
#define CONTEXT 57
#define SELECTION 59
#define REF_OP 170
#define VDECL 4
#define AT 71
#define ECASE_END 43
#define TIME 67
#define KW_MAPPED 109
#define VDEF 5
#define PARENT 64
#define SS_PLUS 125
#define KW_TIME 116
#define EFOR_SRC 22
#define KW_STRUCT 106
#define EWHILE_END 16
#define VVAL 6
#define KW_WHILE 90
#define KW_FOR 91
#define IDENTIFIER 84
#define DIGIT1 144
#define CASE_Exp 40
#define LP_CONT 38
#define OPERAND 72
#define KW_SET 124
#define KW_RETURN 112
#define EFOR_EXP 23
#define KW_IN 92
#define HEX_LITERAL 133
#define ESRC_BY 27
#define DIGIT 143
#define KW_TRY 107
#define ARR_A 32
#define DOT 73
#define KW_UNDO 123
#define KW_IF 86
#define ARR_BIT_RANGE 34
#define WITH 68
#define CASE_Item 41
#define EIF_END 12
#define ETRY_EXP 47
#define SS_OCBRACKET 158
#define WORLD 63
#define KW_FALSE 137
#define KW_OFF 139
#define DEFAULT 42
#define KW_CONTINUE 99
#define FUN_NAME 51
#define STRUCT 44
#define ARG_EXPR_L 74
#define SET 76
#define SS_LT 154
#define EDO_EXP 19