-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.out
More file actions
3382 lines (2745 loc) · 144 KB
/
parser.out
File metadata and controls
3382 lines (2745 loc) · 144 KB
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
Created by PLY version 3.11 (http://www.dabeaz.com/ply)
Unused terminals:
BOOLEAN
COMMENT
UMINUS
Grammar
Rule 0 S' -> program
Rule 1 program -> function_declarations
Rule 2 program -> global_declarations function_declarations
Rule 3 global_declarations -> global_declarations global_declaration
Rule 4 global_declarations -> global_declaration
Rule 5 global_declarations -> <empty>
Rule 6 global_declaration -> variable_decl
Rule 7 global_declaration -> function_init
Rule 8 function_init -> FUN name LPAREN parameter_list RPAREN return_type SEMICOLON
Rule 9 function_declarations -> function_declarations function_decl
Rule 10 function_declarations -> function_decl
Rule 11 function_decl -> FUN name LPAREN parameter_list RPAREN return_type body
Rule 12 return_type -> DECLARE type_or_arraytype
Rule 13 return_type -> <empty>
Rule 14 variable_decl -> modifier name DECLARE type_or_arraytype ASSIGN expression SEMICOLON
Rule 15 modifier -> VAR
Rule 16 modifier -> VAL
Rule 17 body -> LBRACE statement_list RBRACE
Rule 18 statement_list -> statement_list statement
Rule 19 statement_list -> statement
Rule 20 statement -> if
Rule 21 statement -> while
Rule 22 statement -> variable_decl
Rule 23 statement -> assignment
Rule 24 statement -> function_call_inline SEMICOLON
Rule 25 statement -> print SEMICOLON
Rule 26 statement -> <empty>
Rule 27 if -> IF expression body else
Rule 28 else -> ELSE body
Rule 29 else -> <empty>
Rule 30 while -> WHILE expression body
Rule 31 type_or_arraytype -> type
Rule 32 type_or_arraytype -> LBRACKET type RBRACKET
Rule 33 type_or_arraytype -> LBRACKET LBRACKET type RBRACKET RBRACKET
Rule 34 type -> TVOID
Rule 35 type -> TINT
Rule 36 type -> TSTRING
Rule 37 type -> TBOOLEAN
Rule 38 type -> TCHAR
Rule 39 type -> TFLOAT
Rule 40 function_call_inline -> name LPAREN argument_list RPAREN
Rule 41 print -> print_type LPAREN value RPAREN
Rule 42 print_type -> PRINT_INT
Rule 43 print_type -> PRINT_FLOAT
Rule 44 print_type -> PRINT_ARRAYINT
Rule 45 print_type -> PRINT_ARRAYINT2
Rule 46 print_type -> PRINT_STRING
Rule 47 print_type -> PRINT_CHAR
Rule 48 print_type -> PRINT_BOOLEAN
Rule 49 parameter_list -> parameter COMMA parameter_list
Rule 50 parameter_list -> parameter
Rule 51 parameter_list -> <empty>
Rule 52 argument_list -> argument COMMA argument_list
Rule 53 argument_list -> argument
Rule 54 argument_list -> <empty>
Rule 55 parameter -> modifier name DECLARE type_or_arraytype
Rule 56 argument -> expression
Rule 57 expression -> expression and_or expression_m
Rule 58 expression -> expression_m
Rule 59 expression_m -> expression_s
Rule 60 expression_m -> MINUS expression_m
Rule 61 expression_m -> expression_m sign expression_s
Rule 62 expression_s -> value
Rule 63 expression_s -> expression_s psign value
Rule 64 and_or -> AND
Rule 65 and_or -> OR
Rule 66 psign -> TIMES
Rule 67 psign -> DIVIDE
Rule 68 sign -> PLUS
Rule 69 sign -> MINUS
Rule 70 sign -> EXPONENT
Rule 71 sign -> REMAINDER
Rule 72 sign -> EQUALS
Rule 73 sign -> NOTEQUALS
Rule 74 sign -> GE
Rule 75 sign -> GT
Rule 76 sign -> LE
Rule 77 sign -> LT
Rule 78 value -> name
Rule 79 value -> boolean
Rule 80 value -> int
Rule 81 value -> float
Rule 82 value -> string
Rule 83 value -> char
Rule 84 value -> void
Rule 85 value -> function_call_inline
Rule 86 value -> array_call_inline
Rule 87 value -> NOT name
Rule 88 value -> LPAREN expression RPAREN
Rule 89 assignment -> array_call_or_name ASSIGN expression SEMICOLON
Rule 90 array_call_or_name -> name
Rule 91 array_call_or_name -> array_call_inline
Rule 92 array_call_inline -> name LBRACKET value RBRACKET
Rule 93 array_call_inline -> name LBRACKET value RBRACKET LBRACKET value RBRACKET
Rule 94 name -> NAME
Rule 95 boolean -> TRUE
Rule 96 boolean -> FALSE
Rule 97 int -> INT
Rule 98 float -> FLOAT
Rule 99 string -> STRING
Rule 100 char -> CHAR
Rule 101 void -> VOID
Terminals, with rules where they appear
AND : 64
ASSIGN : 14 89
BOOLEAN :
CHAR : 100
COMMA : 49 52
COMMENT :
DECLARE : 12 14 55
DIVIDE : 67
ELSE : 28
EQUALS : 72
EXPONENT : 70
FALSE : 96
FLOAT : 98
FUN : 8 11
GE : 74
GT : 75
IF : 27
INT : 97
LBRACE : 17
LBRACKET : 32 33 33 92 93 93
LE : 76
LPAREN : 8 11 40 41 88
LT : 77
MINUS : 60 69
NAME : 94
NOT : 87
NOTEQUALS : 73
OR : 65
PLUS : 68
PRINT_ARRAYINT : 44
PRINT_ARRAYINT2 : 45
PRINT_BOOLEAN : 48
PRINT_CHAR : 47
PRINT_FLOAT : 43
PRINT_INT : 42
PRINT_STRING : 46
RBRACE : 17
RBRACKET : 32 33 33 92 93 93
REMAINDER : 71
RPAREN : 8 11 40 41 88
SEMICOLON : 8 14 24 25 89
STRING : 99
TBOOLEAN : 37
TCHAR : 38
TFLOAT : 39
TIMES : 66
TINT : 35
TRUE : 95
TSTRING : 36
TVOID : 34
UMINUS :
VAL : 16
VAR : 15
VOID : 101
WHILE : 30
error :
Nonterminals, with rules where they appear
and_or : 57
argument : 52 53
argument_list : 40 52
array_call_inline : 86 91
array_call_or_name : 89
assignment : 23
body : 11 27 28 30
boolean : 79
char : 83
else : 27
expression : 14 27 30 56 57 88 89
expression_m : 57 58 60 61
expression_s : 59 61 63
float : 81
function_call_inline : 24 85
function_decl : 9 10
function_declarations : 1 2 9
function_init : 7
global_declaration : 3 4
global_declarations : 2 3
if : 20
int : 80
modifier : 14 55
name : 8 11 14 40 55 78 87 90 92 93
parameter : 49 50
parameter_list : 8 11 49
print : 25
print_type : 41
program : 0
psign : 63
return_type : 8 11
sign : 61
statement : 18 19
statement_list : 17 18
string : 82
type : 31 32 33
type_or_arraytype : 12 14 55
value : 41 62 63 92 93 93
variable_decl : 6 22
void : 84
while : 21
Parsing method: LALR
state 0
(0) S' -> . program
(1) program -> . function_declarations
(2) program -> . global_declarations function_declarations
(9) function_declarations -> . function_declarations function_decl
(10) function_declarations -> . function_decl
(3) global_declarations -> . global_declarations global_declaration
(4) global_declarations -> . global_declaration
(5) global_declarations -> .
(11) function_decl -> . FUN name LPAREN parameter_list RPAREN return_type body
(6) global_declaration -> . variable_decl
(7) global_declaration -> . function_init
(14) variable_decl -> . modifier name DECLARE type_or_arraytype ASSIGN expression SEMICOLON
(8) function_init -> . FUN name LPAREN parameter_list RPAREN return_type SEMICOLON
(15) modifier -> . VAR
(16) modifier -> . VAL
! shift/reduce conflict for FUN resolved as shift
! shift/reduce conflict for VAR resolved as shift
! shift/reduce conflict for VAL resolved as shift
FUN shift and go to state 6
VAR shift and go to state 10
VAL shift and go to state 11
! FUN [ reduce using rule 5 (global_declarations -> .) ]
! VAR [ reduce using rule 5 (global_declarations -> .) ]
! VAL [ reduce using rule 5 (global_declarations -> .) ]
program shift and go to state 1
function_declarations shift and go to state 2
global_declarations shift and go to state 3
function_decl shift and go to state 4
global_declaration shift and go to state 5
variable_decl shift and go to state 7
function_init shift and go to state 8
modifier shift and go to state 9
state 1
(0) S' -> program .
state 2
(1) program -> function_declarations .
(9) function_declarations -> function_declarations . function_decl
(11) function_decl -> . FUN name LPAREN parameter_list RPAREN return_type body
$end reduce using rule 1 (program -> function_declarations .)
FUN shift and go to state 13
function_decl shift and go to state 12
state 3
(2) program -> global_declarations . function_declarations
(3) global_declarations -> global_declarations . global_declaration
(9) function_declarations -> . function_declarations function_decl
(10) function_declarations -> . function_decl
(6) global_declaration -> . variable_decl
(7) global_declaration -> . function_init
(11) function_decl -> . FUN name LPAREN parameter_list RPAREN return_type body
(14) variable_decl -> . modifier name DECLARE type_or_arraytype ASSIGN expression SEMICOLON
(8) function_init -> . FUN name LPAREN parameter_list RPAREN return_type SEMICOLON
(15) modifier -> . VAR
(16) modifier -> . VAL
FUN shift and go to state 6
VAR shift and go to state 10
VAL shift and go to state 11
function_declarations shift and go to state 14
global_declaration shift and go to state 15
function_decl shift and go to state 4
variable_decl shift and go to state 7
function_init shift and go to state 8
modifier shift and go to state 9
state 4
(10) function_declarations -> function_decl .
FUN reduce using rule 10 (function_declarations -> function_decl .)
$end reduce using rule 10 (function_declarations -> function_decl .)
state 5
(4) global_declarations -> global_declaration .
FUN reduce using rule 4 (global_declarations -> global_declaration .)
VAR reduce using rule 4 (global_declarations -> global_declaration .)
VAL reduce using rule 4 (global_declarations -> global_declaration .)
state 6
(11) function_decl -> FUN . name LPAREN parameter_list RPAREN return_type body
(8) function_init -> FUN . name LPAREN parameter_list RPAREN return_type SEMICOLON
(94) name -> . NAME
NAME shift and go to state 17
name shift and go to state 16
state 7
(6) global_declaration -> variable_decl .
FUN reduce using rule 6 (global_declaration -> variable_decl .)
VAR reduce using rule 6 (global_declaration -> variable_decl .)
VAL reduce using rule 6 (global_declaration -> variable_decl .)
state 8
(7) global_declaration -> function_init .
FUN reduce using rule 7 (global_declaration -> function_init .)
VAR reduce using rule 7 (global_declaration -> function_init .)
VAL reduce using rule 7 (global_declaration -> function_init .)
state 9
(14) variable_decl -> modifier . name DECLARE type_or_arraytype ASSIGN expression SEMICOLON
(94) name -> . NAME
NAME shift and go to state 17
name shift and go to state 18
state 10
(15) modifier -> VAR .
NAME reduce using rule 15 (modifier -> VAR .)
state 11
(16) modifier -> VAL .
NAME reduce using rule 16 (modifier -> VAL .)
state 12
(9) function_declarations -> function_declarations function_decl .
FUN reduce using rule 9 (function_declarations -> function_declarations function_decl .)
$end reduce using rule 9 (function_declarations -> function_declarations function_decl .)
state 13
(11) function_decl -> FUN . name LPAREN parameter_list RPAREN return_type body
(94) name -> . NAME
NAME shift and go to state 17
name shift and go to state 19
state 14
(2) program -> global_declarations function_declarations .
(9) function_declarations -> function_declarations . function_decl
(11) function_decl -> . FUN name LPAREN parameter_list RPAREN return_type body
$end reduce using rule 2 (program -> global_declarations function_declarations .)
FUN shift and go to state 13
function_decl shift and go to state 12
state 15
(3) global_declarations -> global_declarations global_declaration .
FUN reduce using rule 3 (global_declarations -> global_declarations global_declaration .)
VAR reduce using rule 3 (global_declarations -> global_declarations global_declaration .)
VAL reduce using rule 3 (global_declarations -> global_declarations global_declaration .)
state 16
(11) function_decl -> FUN name . LPAREN parameter_list RPAREN return_type body
(8) function_init -> FUN name . LPAREN parameter_list RPAREN return_type SEMICOLON
LPAREN shift and go to state 20
state 17
(94) name -> NAME .
LPAREN reduce using rule 94 (name -> NAME .)
DECLARE reduce using rule 94 (name -> NAME .)
LBRACKET reduce using rule 94 (name -> NAME .)
TIMES reduce using rule 94 (name -> NAME .)
DIVIDE reduce using rule 94 (name -> NAME .)
PLUS reduce using rule 94 (name -> NAME .)
MINUS reduce using rule 94 (name -> NAME .)
EXPONENT reduce using rule 94 (name -> NAME .)
REMAINDER reduce using rule 94 (name -> NAME .)
EQUALS reduce using rule 94 (name -> NAME .)
NOTEQUALS reduce using rule 94 (name -> NAME .)
GE reduce using rule 94 (name -> NAME .)
GT reduce using rule 94 (name -> NAME .)
LE reduce using rule 94 (name -> NAME .)
LT reduce using rule 94 (name -> NAME .)
SEMICOLON reduce using rule 94 (name -> NAME .)
AND reduce using rule 94 (name -> NAME .)
OR reduce using rule 94 (name -> NAME .)
RPAREN reduce using rule 94 (name -> NAME .)
COMMA reduce using rule 94 (name -> NAME .)
LBRACE reduce using rule 94 (name -> NAME .)
RBRACKET reduce using rule 94 (name -> NAME .)
ASSIGN reduce using rule 94 (name -> NAME .)
state 18
(14) variable_decl -> modifier name . DECLARE type_or_arraytype ASSIGN expression SEMICOLON
DECLARE shift and go to state 21
state 19
(11) function_decl -> FUN name . LPAREN parameter_list RPAREN return_type body
LPAREN shift and go to state 22
state 20
(11) function_decl -> FUN name LPAREN . parameter_list RPAREN return_type body
(8) function_init -> FUN name LPAREN . parameter_list RPAREN return_type SEMICOLON
(49) parameter_list -> . parameter COMMA parameter_list
(50) parameter_list -> . parameter
(51) parameter_list -> .
(55) parameter -> . modifier name DECLARE type_or_arraytype
(15) modifier -> . VAR
(16) modifier -> . VAL
RPAREN reduce using rule 51 (parameter_list -> .)
VAR shift and go to state 10
VAL shift and go to state 11
parameter_list shift and go to state 23
parameter shift and go to state 24
modifier shift and go to state 25
state 21
(14) variable_decl -> modifier name DECLARE . type_or_arraytype ASSIGN expression SEMICOLON
(31) type_or_arraytype -> . type
(32) type_or_arraytype -> . LBRACKET type RBRACKET
(33) type_or_arraytype -> . LBRACKET LBRACKET type RBRACKET RBRACKET
(34) type -> . TVOID
(35) type -> . TINT
(36) type -> . TSTRING
(37) type -> . TBOOLEAN
(38) type -> . TCHAR
(39) type -> . TFLOAT
LBRACKET shift and go to state 28
TVOID shift and go to state 29
TINT shift and go to state 30
TSTRING shift and go to state 31
TBOOLEAN shift and go to state 32
TCHAR shift and go to state 33
TFLOAT shift and go to state 34
type_or_arraytype shift and go to state 26
type shift and go to state 27
state 22
(11) function_decl -> FUN name LPAREN . parameter_list RPAREN return_type body
(49) parameter_list -> . parameter COMMA parameter_list
(50) parameter_list -> . parameter
(51) parameter_list -> .
(55) parameter -> . modifier name DECLARE type_or_arraytype
(15) modifier -> . VAR
(16) modifier -> . VAL
RPAREN reduce using rule 51 (parameter_list -> .)
VAR shift and go to state 10
VAL shift and go to state 11
parameter_list shift and go to state 35
parameter shift and go to state 24
modifier shift and go to state 25
state 23
(11) function_decl -> FUN name LPAREN parameter_list . RPAREN return_type body
(8) function_init -> FUN name LPAREN parameter_list . RPAREN return_type SEMICOLON
RPAREN shift and go to state 36
state 24
(49) parameter_list -> parameter . COMMA parameter_list
(50) parameter_list -> parameter .
COMMA shift and go to state 37
RPAREN reduce using rule 50 (parameter_list -> parameter .)
state 25
(55) parameter -> modifier . name DECLARE type_or_arraytype
(94) name -> . NAME
NAME shift and go to state 17
name shift and go to state 38
state 26
(14) variable_decl -> modifier name DECLARE type_or_arraytype . ASSIGN expression SEMICOLON
ASSIGN shift and go to state 39
state 27
(31) type_or_arraytype -> type .
ASSIGN reduce using rule 31 (type_or_arraytype -> type .)
SEMICOLON reduce using rule 31 (type_or_arraytype -> type .)
LBRACE reduce using rule 31 (type_or_arraytype -> type .)
COMMA reduce using rule 31 (type_or_arraytype -> type .)
RPAREN reduce using rule 31 (type_or_arraytype -> type .)
state 28
(32) type_or_arraytype -> LBRACKET . type RBRACKET
(33) type_or_arraytype -> LBRACKET . LBRACKET type RBRACKET RBRACKET
(34) type -> . TVOID
(35) type -> . TINT
(36) type -> . TSTRING
(37) type -> . TBOOLEAN
(38) type -> . TCHAR
(39) type -> . TFLOAT
LBRACKET shift and go to state 40
TVOID shift and go to state 29
TINT shift and go to state 30
TSTRING shift and go to state 31
TBOOLEAN shift and go to state 32
TCHAR shift and go to state 33
TFLOAT shift and go to state 34
type shift and go to state 41
state 29
(34) type -> TVOID .
ASSIGN reduce using rule 34 (type -> TVOID .)
RBRACKET reduce using rule 34 (type -> TVOID .)
SEMICOLON reduce using rule 34 (type -> TVOID .)
LBRACE reduce using rule 34 (type -> TVOID .)
COMMA reduce using rule 34 (type -> TVOID .)
RPAREN reduce using rule 34 (type -> TVOID .)
state 30
(35) type -> TINT .
ASSIGN reduce using rule 35 (type -> TINT .)
RBRACKET reduce using rule 35 (type -> TINT .)
SEMICOLON reduce using rule 35 (type -> TINT .)
LBRACE reduce using rule 35 (type -> TINT .)
COMMA reduce using rule 35 (type -> TINT .)
RPAREN reduce using rule 35 (type -> TINT .)
state 31
(36) type -> TSTRING .
ASSIGN reduce using rule 36 (type -> TSTRING .)
RBRACKET reduce using rule 36 (type -> TSTRING .)
SEMICOLON reduce using rule 36 (type -> TSTRING .)
LBRACE reduce using rule 36 (type -> TSTRING .)
COMMA reduce using rule 36 (type -> TSTRING .)
RPAREN reduce using rule 36 (type -> TSTRING .)
state 32
(37) type -> TBOOLEAN .
ASSIGN reduce using rule 37 (type -> TBOOLEAN .)
RBRACKET reduce using rule 37 (type -> TBOOLEAN .)
SEMICOLON reduce using rule 37 (type -> TBOOLEAN .)
LBRACE reduce using rule 37 (type -> TBOOLEAN .)
COMMA reduce using rule 37 (type -> TBOOLEAN .)
RPAREN reduce using rule 37 (type -> TBOOLEAN .)
state 33
(38) type -> TCHAR .
ASSIGN reduce using rule 38 (type -> TCHAR .)
RBRACKET reduce using rule 38 (type -> TCHAR .)
SEMICOLON reduce using rule 38 (type -> TCHAR .)
LBRACE reduce using rule 38 (type -> TCHAR .)
COMMA reduce using rule 38 (type -> TCHAR .)
RPAREN reduce using rule 38 (type -> TCHAR .)
state 34
(39) type -> TFLOAT .
ASSIGN reduce using rule 39 (type -> TFLOAT .)
RBRACKET reduce using rule 39 (type -> TFLOAT .)
SEMICOLON reduce using rule 39 (type -> TFLOAT .)
LBRACE reduce using rule 39 (type -> TFLOAT .)
COMMA reduce using rule 39 (type -> TFLOAT .)
RPAREN reduce using rule 39 (type -> TFLOAT .)
state 35
(11) function_decl -> FUN name LPAREN parameter_list . RPAREN return_type body
RPAREN shift and go to state 42
state 36
(11) function_decl -> FUN name LPAREN parameter_list RPAREN . return_type body
(8) function_init -> FUN name LPAREN parameter_list RPAREN . return_type SEMICOLON
(12) return_type -> . DECLARE type_or_arraytype
(13) return_type -> .
DECLARE shift and go to state 44
SEMICOLON reduce using rule 13 (return_type -> .)
LBRACE reduce using rule 13 (return_type -> .)
return_type shift and go to state 43
state 37
(49) parameter_list -> parameter COMMA . parameter_list
(49) parameter_list -> . parameter COMMA parameter_list
(50) parameter_list -> . parameter
(51) parameter_list -> .
(55) parameter -> . modifier name DECLARE type_or_arraytype
(15) modifier -> . VAR
(16) modifier -> . VAL
RPAREN reduce using rule 51 (parameter_list -> .)
VAR shift and go to state 10
VAL shift and go to state 11
parameter shift and go to state 24
parameter_list shift and go to state 45
modifier shift and go to state 25
state 38
(55) parameter -> modifier name . DECLARE type_or_arraytype
DECLARE shift and go to state 46
state 39
(14) variable_decl -> modifier name DECLARE type_or_arraytype ASSIGN . expression SEMICOLON
(57) expression -> . expression and_or expression_m
(58) expression -> . expression_m
(59) expression_m -> . expression_s
(60) expression_m -> . MINUS expression_m
(61) expression_m -> . expression_m sign expression_s
(62) expression_s -> . value
(63) expression_s -> . expression_s psign value
(78) value -> . name
(79) value -> . boolean
(80) value -> . int
(81) value -> . float
(82) value -> . string
(83) value -> . char
(84) value -> . void
(85) value -> . function_call_inline
(86) value -> . array_call_inline
(87) value -> . NOT name
(88) value -> . LPAREN expression RPAREN
(94) name -> . NAME
(95) boolean -> . TRUE
(96) boolean -> . FALSE
(97) int -> . INT
(98) float -> . FLOAT
(99) string -> . STRING
(100) char -> . CHAR
(101) void -> . VOID
(40) function_call_inline -> . name LPAREN argument_list RPAREN
(92) array_call_inline -> . name LBRACKET value RBRACKET
(93) array_call_inline -> . name LBRACKET value RBRACKET LBRACKET value RBRACKET
MINUS shift and go to state 51
NOT shift and go to state 61
LPAREN shift and go to state 62
NAME shift and go to state 17
TRUE shift and go to state 63
FALSE shift and go to state 64
INT shift and go to state 65
FLOAT shift and go to state 66
STRING shift and go to state 67
CHAR shift and go to state 68
VOID shift and go to state 69
name shift and go to state 47
expression shift and go to state 48
expression_m shift and go to state 49
expression_s shift and go to state 50
value shift and go to state 52
boolean shift and go to state 53
int shift and go to state 54
float shift and go to state 55
string shift and go to state 56
char shift and go to state 57
void shift and go to state 58
function_call_inline shift and go to state 59
array_call_inline shift and go to state 60
state 40
(33) type_or_arraytype -> LBRACKET LBRACKET . type RBRACKET RBRACKET
(34) type -> . TVOID
(35) type -> . TINT
(36) type -> . TSTRING
(37) type -> . TBOOLEAN
(38) type -> . TCHAR
(39) type -> . TFLOAT
TVOID shift and go to state 29
TINT shift and go to state 30
TSTRING shift and go to state 31
TBOOLEAN shift and go to state 32
TCHAR shift and go to state 33
TFLOAT shift and go to state 34
type shift and go to state 70
state 41
(32) type_or_arraytype -> LBRACKET type . RBRACKET
RBRACKET shift and go to state 71
state 42
(11) function_decl -> FUN name LPAREN parameter_list RPAREN . return_type body
(12) return_type -> . DECLARE type_or_arraytype
(13) return_type -> .
DECLARE shift and go to state 44
LBRACE reduce using rule 13 (return_type -> .)
return_type shift and go to state 72
state 43
(11) function_decl -> FUN name LPAREN parameter_list RPAREN return_type . body
(8) function_init -> FUN name LPAREN parameter_list RPAREN return_type . SEMICOLON
(17) body -> . LBRACE statement_list RBRACE
SEMICOLON shift and go to state 74
LBRACE shift and go to state 75
body shift and go to state 73
state 44
(12) return_type -> DECLARE . type_or_arraytype
(31) type_or_arraytype -> . type
(32) type_or_arraytype -> . LBRACKET type RBRACKET
(33) type_or_arraytype -> . LBRACKET LBRACKET type RBRACKET RBRACKET
(34) type -> . TVOID
(35) type -> . TINT
(36) type -> . TSTRING
(37) type -> . TBOOLEAN
(38) type -> . TCHAR
(39) type -> . TFLOAT
LBRACKET shift and go to state 28
TVOID shift and go to state 29
TINT shift and go to state 30
TSTRING shift and go to state 31
TBOOLEAN shift and go to state 32
TCHAR shift and go to state 33
TFLOAT shift and go to state 34
type_or_arraytype shift and go to state 76
type shift and go to state 27
state 45
(49) parameter_list -> parameter COMMA parameter_list .
RPAREN reduce using rule 49 (parameter_list -> parameter COMMA parameter_list .)
state 46
(55) parameter -> modifier name DECLARE . type_or_arraytype
(31) type_or_arraytype -> . type
(32) type_or_arraytype -> . LBRACKET type RBRACKET
(33) type_or_arraytype -> . LBRACKET LBRACKET type RBRACKET RBRACKET
(34) type -> . TVOID
(35) type -> . TINT
(36) type -> . TSTRING
(37) type -> . TBOOLEAN
(38) type -> . TCHAR
(39) type -> . TFLOAT
LBRACKET shift and go to state 28
TVOID shift and go to state 29
TINT shift and go to state 30
TSTRING shift and go to state 31
TBOOLEAN shift and go to state 32
TCHAR shift and go to state 33
TFLOAT shift and go to state 34
type_or_arraytype shift and go to state 77
type shift and go to state 27
state 47
(78) value -> name .
(40) function_call_inline -> name . LPAREN argument_list RPAREN
(92) array_call_inline -> name . LBRACKET value RBRACKET
(93) array_call_inline -> name . LBRACKET value RBRACKET LBRACKET value RBRACKET
TIMES reduce using rule 78 (value -> name .)
DIVIDE reduce using rule 78 (value -> name .)
PLUS reduce using rule 78 (value -> name .)
MINUS reduce using rule 78 (value -> name .)
EXPONENT reduce using rule 78 (value -> name .)
REMAINDER reduce using rule 78 (value -> name .)
EQUALS reduce using rule 78 (value -> name .)
NOTEQUALS reduce using rule 78 (value -> name .)
GE reduce using rule 78 (value -> name .)
GT reduce using rule 78 (value -> name .)
LE reduce using rule 78 (value -> name .)
LT reduce using rule 78 (value -> name .)
SEMICOLON reduce using rule 78 (value -> name .)
AND reduce using rule 78 (value -> name .)
OR reduce using rule 78 (value -> name .)
RPAREN reduce using rule 78 (value -> name .)
COMMA reduce using rule 78 (value -> name .)
LBRACE reduce using rule 78 (value -> name .)
RBRACKET reduce using rule 78 (value -> name .)
LPAREN shift and go to state 78
LBRACKET shift and go to state 79
state 48
(14) variable_decl -> modifier name DECLARE type_or_arraytype ASSIGN expression . SEMICOLON
(57) expression -> expression . and_or expression_m
(64) and_or -> . AND
(65) and_or -> . OR
SEMICOLON shift and go to state 80
AND shift and go to state 82
OR shift and go to state 83
and_or shift and go to state 81
state 49
(58) expression -> expression_m .
(61) expression_m -> expression_m . sign expression_s
(68) sign -> . PLUS
(69) sign -> . MINUS
(70) sign -> . EXPONENT
(71) sign -> . REMAINDER
(72) sign -> . EQUALS
(73) sign -> . NOTEQUALS
(74) sign -> . GE
(75) sign -> . GT
(76) sign -> . LE
(77) sign -> . LT
SEMICOLON reduce using rule 58 (expression -> expression_m .)
AND reduce using rule 58 (expression -> expression_m .)
OR reduce using rule 58 (expression -> expression_m .)
RPAREN reduce using rule 58 (expression -> expression_m .)
COMMA reduce using rule 58 (expression -> expression_m .)
LBRACE reduce using rule 58 (expression -> expression_m .)
PLUS shift and go to state 85
MINUS shift and go to state 86
EXPONENT shift and go to state 87
REMAINDER shift and go to state 88
EQUALS shift and go to state 89
NOTEQUALS shift and go to state 90
GE shift and go to state 91
GT shift and go to state 92
LE shift and go to state 93
LT shift and go to state 94
sign shift and go to state 84
state 50
(59) expression_m -> expression_s .
(63) expression_s -> expression_s . psign value
(66) psign -> . TIMES
(67) psign -> . DIVIDE
PLUS reduce using rule 59 (expression_m -> expression_s .)
MINUS reduce using rule 59 (expression_m -> expression_s .)
EXPONENT reduce using rule 59 (expression_m -> expression_s .)
REMAINDER reduce using rule 59 (expression_m -> expression_s .)
EQUALS reduce using rule 59 (expression_m -> expression_s .)
NOTEQUALS reduce using rule 59 (expression_m -> expression_s .)
GE reduce using rule 59 (expression_m -> expression_s .)
GT reduce using rule 59 (expression_m -> expression_s .)
LE reduce using rule 59 (expression_m -> expression_s .)
LT reduce using rule 59 (expression_m -> expression_s .)
SEMICOLON reduce using rule 59 (expression_m -> expression_s .)
AND reduce using rule 59 (expression_m -> expression_s .)
OR reduce using rule 59 (expression_m -> expression_s .)
RPAREN reduce using rule 59 (expression_m -> expression_s .)
COMMA reduce using rule 59 (expression_m -> expression_s .)
LBRACE reduce using rule 59 (expression_m -> expression_s .)
TIMES shift and go to state 96
DIVIDE shift and go to state 97
psign shift and go to state 95
state 51
(60) expression_m -> MINUS . expression_m
(59) expression_m -> . expression_s
(60) expression_m -> . MINUS expression_m
(61) expression_m -> . expression_m sign expression_s
(62) expression_s -> . value
(63) expression_s -> . expression_s psign value
(78) value -> . name
(79) value -> . boolean
(80) value -> . int
(81) value -> . float
(82) value -> . string
(83) value -> . char
(84) value -> . void
(85) value -> . function_call_inline
(86) value -> . array_call_inline
(87) value -> . NOT name
(88) value -> . LPAREN expression RPAREN
(94) name -> . NAME
(95) boolean -> . TRUE
(96) boolean -> . FALSE
(97) int -> . INT
(98) float -> . FLOAT
(99) string -> . STRING
(100) char -> . CHAR
(101) void -> . VOID
(40) function_call_inline -> . name LPAREN argument_list RPAREN
(92) array_call_inline -> . name LBRACKET value RBRACKET
(93) array_call_inline -> . name LBRACKET value RBRACKET LBRACKET value RBRACKET
MINUS shift and go to state 51
NOT shift and go to state 61
LPAREN shift and go to state 62
NAME shift and go to state 17
TRUE shift and go to state 63