-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathy.tab.c
1999 lines (1782 loc) · 56.6 KB
/
y.tab.c
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
#define YY_parse_h_included
/*#define YY_USE_CLASS
*/
/* A Bison++ parser, made from ast.y */
/* with Bison++ version bison++ Version 1.21.9-1, adapted from GNU bison by coetmeur@icdc.fr
Maintained by Magnus Ekdahl <magnus@debian.org>
*/
#line 1 "/usr/share/bison++/bison.cc"
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
As a special exception, when this file is copied by Bison++ into a
Bison++ output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison, and has been in Bison++ since 1.21.9.
*/
/* HEADER SECTION */
#if defined( _MSDOS ) || defined(MSDOS) || defined(__MSDOS__)
#define __MSDOS_AND_ALIKE
#endif
#if defined(_WINDOWS) && defined(_MSC_VER)
#define __HAVE_NO_ALLOCA
#define __MSDOS_AND_ALIKE
#endif
#ifndef alloca
#if defined( __GNUC__)
#define alloca __builtin_alloca
#elif (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
#include <alloca.h>
#elif defined (__MSDOS_AND_ALIKE)
#include <malloc.h>
#ifndef __TURBOC__
/* MS C runtime lib */
#define alloca _alloca
#endif
#elif defined(_AIX)
/* pragma must be put before any C/C++ instruction !! */
#pragma alloca
#include <malloc.h>
#elif defined(__hpux)
#ifdef __cplusplus
extern "C" {
void *alloca (unsigned int);
};
#else /* not __cplusplus */
void *alloca ();
#endif /* not __cplusplus */
#endif /* not _AIX not MSDOS, or __TURBOC__ or _AIX, not sparc. */
#endif /* alloca not defined. */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif
#ifdef __cplusplus
#ifndef YY_USE_CLASS
/*#warning "For C++ its recomended to use bison++, otherwise classes won't be generated"*/
#endif
#else
#ifndef __STDC__
#define const
#endif
#ifdef YY_USE_CLASS
#error "This is a C++ header generated by bison++, please use a C++ compiler!"
#endif
#endif
#include <stdio.h>
#define YYBISON 1
#line 88 "/usr/share/bison++/bison.cc"
#line 1 "ast.y"
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
FILE *yyin;
extern int yylineno;
struct treeNode
{
char name[20];
struct treeNode* left;
struct treeNode* right;
char str1[100];
char str2[100];
};
struct treeNode *createNode(char *, struct treeNode *, struct treeNode *, char *, char *);
struct treeNode *head;
struct treeNode *tempNode1;
struct treeNode *tempNode2;
char temptype[50];
char temp[50];
char buffer[50];
char tempFunc[50];
char tempparams[100];
char extraval[20];
char templog[20];
char temprel[20];
int closure = 0;
int tempval;
void display();
int height(struct treeNode *);
void printLevel(struct treeNode *, int);
void yyerror(const char*);
int yylex();
#line 38 "ast.y"
typedef union
{
char *str;
int num;
struct treeNode *node;
} yy_parse_stype;
#define YY_parse_STYPE yy_parse_stype
#ifndef YY_USE_CLASS
#define YYSTYPE yy_parse_stype
#endif
#line 88 "/usr/share/bison++/bison.cc"
/* %{ and %header{ and %union, during decl */
#define YY_parse_BISON 1
#ifndef YY_parse_COMPATIBILITY
#ifndef YY_USE_CLASS
#define YY_parse_COMPATIBILITY 1
#else
#define YY_parse_COMPATIBILITY 0
#endif
#endif
#if YY_parse_COMPATIBILITY != 0
/* backward compatibility */
#ifdef YYLTYPE
#ifndef YY_parse_LTYPE
#define YY_parse_LTYPE YYLTYPE
#endif
#endif
/* Testing alternative bison solution
/#ifdef YYSTYPE*/
#ifndef YY_parse_STYPE
#define YY_parse_STYPE YYSTYPE
#endif
/*#endif*/
#ifdef YYDEBUG
#ifndef YY_parse_DEBUG
#define YY_parse_DEBUG YYDEBUG
#endif
#endif
/* use goto to be compatible */
#ifndef YY_parse_USE_GOTO
#define YY_parse_USE_GOTO 1
#endif
#endif
/* use no goto to be clean in C++ */
#ifndef YY_parse_USE_GOTO
#define YY_parse_USE_GOTO 0
#endif
#ifndef YY_parse_PURE
#line 130 "/usr/share/bison++/bison.cc"
#line 130 "/usr/share/bison++/bison.cc"
/* YY_parse_PURE */
#endif
/* section apres lecture def, avant lecture grammaire S2 */
#line 134 "/usr/share/bison++/bison.cc"
#line 134 "/usr/share/bison++/bison.cc"
/* prefix */
#ifndef YY_parse_DEBUG
#line 136 "/usr/share/bison++/bison.cc"
#line 136 "/usr/share/bison++/bison.cc"
/* YY_parse_DEBUG */
#endif
#ifndef YY_parse_LSP_NEEDED
#line 141 "/usr/share/bison++/bison.cc"
#line 141 "/usr/share/bison++/bison.cc"
/* YY_parse_LSP_NEEDED*/
#endif
/* DEFAULT LTYPE*/
#ifdef YY_parse_LSP_NEEDED
#ifndef YY_parse_LTYPE
#ifndef BISON_YYLTYPE_ISDECLARED
#define BISON_YYLTYPE_ISDECLARED
typedef
struct yyltype
{
int timestamp;
int first_line;
int first_column;
int last_line;
int last_column;
char *text;
}
yyltype;
#endif
#define YY_parse_LTYPE yyltype
#endif
#endif
/* DEFAULT STYPE*/
/* We used to use `unsigned long' as YY_parse_STYPE on MSDOS,
but it seems better to be consistent.
Most programs should declare their own type anyway. */
#ifndef YY_parse_STYPE
#define YY_parse_STYPE int
#endif
/* DEFAULT MISCELANEOUS */
#ifndef YY_parse_PARSE
#define YY_parse_PARSE yyparse
#endif
#ifndef YY_parse_LEX
#define YY_parse_LEX yylex
#endif
#ifndef YY_parse_LVAL
#define YY_parse_LVAL yylval
#endif
#ifndef YY_parse_LLOC
#define YY_parse_LLOC yylloc
#endif
#ifndef YY_parse_CHAR
#define YY_parse_CHAR yychar
#endif
#ifndef YY_parse_NERRS
#define YY_parse_NERRS yynerrs
#endif
#ifndef YY_parse_DEBUG_FLAG
#define YY_parse_DEBUG_FLAG yydebug
#endif
#ifndef YY_parse_ERROR
#define YY_parse_ERROR yyerror
#endif
#ifndef YY_parse_PARSE_PARAM
#ifndef YY_USE_CLASS
#ifdef YYPARSE_PARAM
#define YY_parse_PARSE_PARAM void* YYPARSE_PARAM
#else
#ifndef __STDC__
#ifndef __cplusplus
#define YY_parse_PARSE_PARAM
#endif
#endif
#endif
#endif
#ifndef YY_parse_PARSE_PARAM
#define YY_parse_PARSE_PARAM void
#endif
#endif
#if YY_parse_COMPATIBILITY != 0
/* backward compatibility */
#ifdef YY_parse_LTYPE
#ifndef YYLTYPE
#define YYLTYPE YY_parse_LTYPE
#else
/* WARNING obsolete !!! user defined YYLTYPE not reported into generated header */
#endif
#endif
/* Removed due to bison compabilityproblems
/#ifndef YYSTYPE
/#define YYSTYPE YY_parse_STYPE
/#else*/
/* WARNING obsolete !!! user defined YYSTYPE not reported into generated header */
/*#endif*/
#ifdef YY_parse_PURE
# ifndef YYPURE
# define YYPURE YY_parse_PURE
# endif
#endif
#ifdef YY_parse_DEBUG
# ifndef YYDEBUG
# define YYDEBUG YY_parse_DEBUG
# endif
#endif
#ifndef YY_parse_ERROR_VERBOSE
#ifdef YYERROR_VERBOSE
#define YY_parse_ERROR_VERBOSE YYERROR_VERBOSE
#endif
#endif
#ifndef YY_parse_LSP_NEEDED
# ifdef YYLSP_NEEDED
# define YY_parse_LSP_NEEDED YYLSP_NEEDED
# endif
#endif
#endif
#ifndef YY_USE_CLASS
/* TOKEN C */
#line 263 "/usr/share/bison++/bison.cc"
#define INT 258
#define MAIN 259
#define OB 260
#define CB 261
#define SO 262
#define SC 263
#define CLOSURE 264
#define COLON 265
#define HASH 266
#define INCLUDE 267
#define LIBRARY 268
#define IF 269
#define ELSE 270
#define WHILE 271
#define FOR 272
#define CONT 273
#define BRK 274
#define RTRN 275
#define SEMICOLON 276
#define BINARYOR 277
#define BINARYAND 278
#define LT 279
#define GT 280
#define LTE 281
#define GTE 282
#define NE 283
#define EQ 284
#define VOID 285
#define CHAR 286
#define COMMA 287
#define EQUAL 288
#define SUBPREFIX 289
#define ADD 290
#define SUB 291
#define MUL 292
#define DIV 293
#define ADDRIGHT 294
#define SUBRIGHT 295
#define MULRIGHT 296
#define DIVRIGHT 297
#define ADDPREFIX 298
#define ID 299
#define NUM 300
#line 263 "/usr/share/bison++/bison.cc"
/* #defines tokens */
#else
/* CLASS */
#ifndef YY_parse_CLASS
#define YY_parse_CLASS parse
#endif
#ifndef YY_parse_INHERIT
#define YY_parse_INHERIT
#endif
#ifndef YY_parse_MEMBERS
#define YY_parse_MEMBERS
#endif
#ifndef YY_parse_LEX_BODY
#define YY_parse_LEX_BODY
#endif
#ifndef YY_parse_ERROR_BODY
#define YY_parse_ERROR_BODY
#endif
#ifndef YY_parse_CONSTRUCTOR_PARAM
#define YY_parse_CONSTRUCTOR_PARAM
#endif
#ifndef YY_parse_CONSTRUCTOR_CODE
#define YY_parse_CONSTRUCTOR_CODE
#endif
#ifndef YY_parse_CONSTRUCTOR_INIT
#define YY_parse_CONSTRUCTOR_INIT
#endif
/* choose between enum and const */
#ifndef YY_parse_USE_CONST_TOKEN
#define YY_parse_USE_CONST_TOKEN 0
/* yes enum is more compatible with flex, */
/* so by default we use it */
#endif
#if YY_parse_USE_CONST_TOKEN != 0
#ifndef YY_parse_ENUM_TOKEN
#define YY_parse_ENUM_TOKEN yy_parse_enum_token
#endif
#endif
class YY_parse_CLASS YY_parse_INHERIT
{
public:
#if YY_parse_USE_CONST_TOKEN != 0
/* static const int token ... */
#line 307 "/usr/share/bison++/bison.cc"
static const int INT;
static const int MAIN;
static const int OB;
static const int CB;
static const int SO;
static const int SC;
static const int CLOSURE;
static const int COLON;
static const int HASH;
static const int INCLUDE;
static const int LIBRARY;
static const int IF;
static const int ELSE;
static const int WHILE;
static const int FOR;
static const int CONT;
static const int BRK;
static const int RTRN;
static const int SEMICOLON;
static const int BINARYOR;
static const int BINARYAND;
static const int LT;
static const int GT;
static const int LTE;
static const int GTE;
static const int NE;
static const int EQ;
static const int VOID;
static const int CHAR;
static const int COMMA;
static const int EQUAL;
static const int SUBPREFIX;
static const int ADD;
static const int SUB;
static const int MUL;
static const int DIV;
static const int ADDRIGHT;
static const int SUBRIGHT;
static const int MULRIGHT;
static const int DIVRIGHT;
static const int ADDPREFIX;
static const int ID;
static const int NUM;
#line 307 "/usr/share/bison++/bison.cc"
/* decl const */
#else
enum YY_parse_ENUM_TOKEN { YY_parse_NULL_TOKEN=0
#line 310 "/usr/share/bison++/bison.cc"
,INT=258
,MAIN=259
,OB=260
,CB=261
,SO=262
,SC=263
,CLOSURE=264
,COLON=265
,HASH=266
,INCLUDE=267
,LIBRARY=268
,IF=269
,ELSE=270
,WHILE=271
,FOR=272
,CONT=273
,BRK=274
,RTRN=275
,SEMICOLON=276
,BINARYOR=277
,BINARYAND=278
,LT=279
,GT=280
,LTE=281
,GTE=282
,NE=283
,EQ=284
,VOID=285
,CHAR=286
,COMMA=287
,EQUAL=288
,SUBPREFIX=289
,ADD=290
,SUB=291
,MUL=292
,DIV=293
,ADDRIGHT=294
,SUBRIGHT=295
,MULRIGHT=296
,DIVRIGHT=297
,ADDPREFIX=298
,ID=299
,NUM=300
#line 310 "/usr/share/bison++/bison.cc"
/* enum token */
}; /* end of enum declaration */
#endif
public:
int YY_parse_PARSE (YY_parse_PARSE_PARAM);
virtual void YY_parse_ERROR(char *msg) YY_parse_ERROR_BODY;
#ifdef YY_parse_PURE
#ifdef YY_parse_LSP_NEEDED
virtual int YY_parse_LEX (YY_parse_STYPE *YY_parse_LVAL,YY_parse_LTYPE *YY_parse_LLOC) YY_parse_LEX_BODY;
#else
virtual int YY_parse_LEX (YY_parse_STYPE *YY_parse_LVAL) YY_parse_LEX_BODY;
#endif
#else
virtual int YY_parse_LEX() YY_parse_LEX_BODY;
YY_parse_STYPE YY_parse_LVAL;
#ifdef YY_parse_LSP_NEEDED
YY_parse_LTYPE YY_parse_LLOC;
#endif
int YY_parse_NERRS;
int YY_parse_CHAR;
#endif
#if YY_parse_DEBUG != 0
int YY_parse_DEBUG_FLAG; /* nonzero means print parse trace */
#endif
public:
YY_parse_CLASS(YY_parse_CONSTRUCTOR_PARAM);
public:
YY_parse_MEMBERS
};
/* other declare folow */
#if YY_parse_USE_CONST_TOKEN != 0
#line 341 "/usr/share/bison++/bison.cc"
const int YY_parse_CLASS::INT=258;
const int YY_parse_CLASS::MAIN=259;
const int YY_parse_CLASS::OB=260;
const int YY_parse_CLASS::CB=261;
const int YY_parse_CLASS::SO=262;
const int YY_parse_CLASS::SC=263;
const int YY_parse_CLASS::CLOSURE=264;
const int YY_parse_CLASS::COLON=265;
const int YY_parse_CLASS::HASH=266;
const int YY_parse_CLASS::INCLUDE=267;
const int YY_parse_CLASS::LIBRARY=268;
const int YY_parse_CLASS::IF=269;
const int YY_parse_CLASS::ELSE=270;
const int YY_parse_CLASS::WHILE=271;
const int YY_parse_CLASS::FOR=272;
const int YY_parse_CLASS::CONT=273;
const int YY_parse_CLASS::BRK=274;
const int YY_parse_CLASS::RTRN=275;
const int YY_parse_CLASS::SEMICOLON=276;
const int YY_parse_CLASS::BINARYOR=277;
const int YY_parse_CLASS::BINARYAND=278;
const int YY_parse_CLASS::LT=279;
const int YY_parse_CLASS::GT=280;
const int YY_parse_CLASS::LTE=281;
const int YY_parse_CLASS::GTE=282;
const int YY_parse_CLASS::NE=283;
const int YY_parse_CLASS::EQ=284;
const int YY_parse_CLASS::VOID=285;
const int YY_parse_CLASS::CHAR=286;
const int YY_parse_CLASS::COMMA=287;
const int YY_parse_CLASS::EQUAL=288;
const int YY_parse_CLASS::SUBPREFIX=289;
const int YY_parse_CLASS::ADD=290;
const int YY_parse_CLASS::SUB=291;
const int YY_parse_CLASS::MUL=292;
const int YY_parse_CLASS::DIV=293;
const int YY_parse_CLASS::ADDRIGHT=294;
const int YY_parse_CLASS::SUBRIGHT=295;
const int YY_parse_CLASS::MULRIGHT=296;
const int YY_parse_CLASS::DIVRIGHT=297;
const int YY_parse_CLASS::ADDPREFIX=298;
const int YY_parse_CLASS::ID=299;
const int YY_parse_CLASS::NUM=300;
#line 341 "/usr/share/bison++/bison.cc"
/* const YY_parse_CLASS::token */
#endif
/*apres const */
YY_parse_CLASS::YY_parse_CLASS(YY_parse_CONSTRUCTOR_PARAM) YY_parse_CONSTRUCTOR_INIT
{
#if YY_parse_DEBUG != 0
YY_parse_DEBUG_FLAG=0;
#endif
YY_parse_CONSTRUCTOR_CODE;
};
#endif
#line 352 "/usr/share/bison++/bison.cc"
#define YYFINAL 184
#define YYFLAG -32768
#define YYNTBASE 47
#define YYTRANSLATE(x) ((unsigned)(x) <= 300 ? yytranslate[x] : 79)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 46, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 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
};
#if YY_parse_DEBUG != 0
static const short yyprhs[] = { 0,
0, 5, 13, 15, 19, 22, 25, 28, 30, 34,
37, 43, 48, 53, 59, 62, 66, 68, 72, 76,
79, 82, 85, 88, 91, 94, 97, 98, 104, 115,
125, 132, 133, 142, 152, 157, 160, 164, 167, 175,
181, 187, 192, 198, 206, 209, 212, 216, 218, 222,
224, 226, 230, 234, 236, 238, 240, 242, 244, 246,
248, 250, 252, 254, 256, 258, 262, 264, 268, 272,
274, 278, 282, 284, 286, 288
};
static const short yyrhs[] = { 11,
12, 13, 51, 0, 3, 4, 5, 6, 50, 59,
46, 0, 44, 0, 7, 58, 8, 0, 54, 51,
0, 57, 51, 0, 52, 51, 0, 48, 0, 74,
75, 21, 0, 74, 53, 0, 49, 33, 71, 32,
53, 0, 49, 33, 71, 21, 0, 55, 5, 6,
21, 0, 55, 5, 56, 6, 21, 0, 74, 49,
0, 56, 32, 74, 0, 74, 0, 9, 10, 54,
0, 71, 21, 58, 0, 62, 58, 0, 64, 58,
0, 65, 58, 0, 66, 58, 0, 63, 58, 0,
50, 58, 0, 1, 21, 0, 0, 55, 5, 6,
50, 59, 0, 55, 5, 61, 6, 7, 58, 60,
58, 8, 59, 0, 55, 5, 6, 7, 58, 60,
58, 8, 59, 0, 55, 5, 61, 6, 50, 59,
0, 0, 9, 10, 55, 5, 6, 7, 58, 8,
0, 9, 10, 55, 5, 61, 6, 7, 58, 8,
0, 61, 32, 74, 49, 0, 74, 49, 0, 74,
75, 21, 0, 74, 64, 0, 49, 33, 49, 5,
75, 6, 21, 0, 49, 5, 75, 6, 21, 0,
49, 33, 71, 32, 64, 0, 49, 33, 71, 21,
0, 14, 5, 67, 6, 50, 0, 14, 5, 67,
6, 50, 15, 50, 0, 18, 21, 0, 19, 21,
0, 20, 71, 21, 0, 68, 0, 68, 72, 68,
0, 69, 0, 70, 0, 71, 73, 76, 0, 71,
72, 76, 0, 76, 0, 22, 0, 23, 0, 24,
0, 25, 0, 26, 0, 27, 0, 28, 0, 29,
0, 3, 0, 30, 0, 31, 0, 75, 32, 49,
0, 49, 0, 76, 35, 77, 0, 76, 36, 77,
0, 77, 0, 77, 37, 78, 0, 77, 38, 78,
0, 78, 0, 44, 0, 45, 0, 5, 76, 6,
0
};
#endif
#if (YY_parse_DEBUG != 0) || defined(YY_parse_ERROR_VERBOSE)
static const short yyrline[] = { 0,
57, 64, 66, 68, 70, 71, 72, 73, 75, 76,
78, 81, 83, 93, 103, 105, 106, 108, 110, 111,
112, 113, 114, 115, 116, 117, 118, 120, 123, 130,
137, 142, 144, 149, 156, 158, 161, 162, 164, 166,
169, 172, 174, 175, 180, 181, 182, 184, 185, 187,
188, 190, 192, 194, 196, 197, 199, 200, 201, 202,
203, 204, 206, 207, 208, 210, 211, 213, 214, 215,
217, 218, 219, 221, 222, 223
};
static const char * const yytname[] = { "$","error","$illegal.","INT","MAIN",
"OB","CB","SO","SC","CLOSURE","COLON","HASH","INCLUDE","LIBRARY","IF","ELSE",
"WHILE","FOR","CONT","BRK","RTRN","SEMICOLON","BINARYOR","BINARYAND","LT","GT",
"LTE","GTE","NE","EQ","VOID","CHAR","COMMA","EQUAL","SUBPREFIX","ADD","SUB",
"MUL","DIV","ADDRIGHT","SUBRIGHT","MULRIGHT","DIVRIGHT","ADDPREFIX","ID","NUM",
"'~'","PreProcessorDirectives","Main","Identifier","CompoundStmt","Global","GlobeDeclaration",
"GlobeAssignExpr","FunctionDefinition","FunctionName","ParamsType","ClosureFunctionDefinition",
"Stmt","Function","ClosureFunction","FunctionParams","Declaration","FunctionCall",
"AssignExpr","SelectionStmt","JumpStmt","cond","Expr","relExp","logExp","Extra",
"logOp","relOp","Type","VarList","E","T","F",""
};
#endif
static const short yyr1[] = { 0,
47, 48, 49, 50, 51, 51, 51, 51, 52, 52,
53, 53, 54, 54, 55, 56, 56, 57, 58, 58,
58, 58, 58, 58, 58, 58, 58, 59, 59, 59,
59, 59, 60, 60, 61, 61, 62, 62, 63, 63,
64, 64, 65, 65, 66, 66, 66, 67, 67, 68,
68, 69, 70, 71, 72, 72, 73, 73, 73, 73,
73, 73, 74, 74, 74, 75, 75, 76, 76, 76,
77, 77, 77, 78, 78, 78
};
static const short yyr2[] = { 0,
4, 7, 1, 3, 2, 2, 2, 1, 3, 2,
5, 4, 4, 5, 2, 3, 1, 3, 3, 2,
2, 2, 2, 2, 2, 2, 0, 5, 10, 9,
6, 0, 8, 9, 4, 2, 3, 2, 7, 5,
5, 4, 5, 7, 2, 2, 3, 1, 3, 1,
1, 3, 3, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 3, 1, 3, 3, 1,
3, 3, 1, 1, 1, 3
};
static const short yydefact[] = { 0,
0, 0, 0, 63, 0, 64, 65, 8, 1, 0,
0, 0, 0, 0, 0, 0, 7, 5, 0, 6,
3, 67, 10, 0, 0, 63, 18, 0, 0, 0,
17, 0, 9, 0, 0, 15, 13, 0, 0, 0,
74, 75, 0, 54, 70, 73, 66, 0, 32, 14,
16, 0, 12, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 74, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 76, 0, 11, 68,
69, 71, 72, 26, 0, 45, 46, 0, 0, 0,
25, 4, 20, 24, 21, 22, 23, 0, 67, 38,
0, 0, 2, 0, 48, 50, 51, 0, 47, 67,
0, 0, 0, 19, 0, 37, 0, 0, 0, 0,
55, 56, 0, 57, 58, 59, 60, 61, 62, 0,
0, 0, 0, 42, 0, 0, 32, 0, 0, 36,
43, 49, 53, 52, 40, 0, 0, 41, 0, 28,
0, 32, 0, 0, 0, 0, 0, 0, 31, 35,
44, 39, 0, 0, 0, 0, 32, 0, 0, 30,
32, 0, 0, 29, 0, 0, 0, 0, 33, 0,
34, 0, 0, 0
};
static const short yydefgoto[] = { 182,
8, 65, 66, 9, 10, 23, 11, 12, 30, 13,
67, 76, 157, 118, 68, 69, 70, 71, 72, 104,
105, 106, 107, 73, 123, 131, 74, 24, 44, 45,
46
};
static const short yypact[] = { 11,
5, 7, 71, 21, 17,-32768,-32768,-32768,-32768, 71,
71, 29, 71, 3, 70, 111,-32768,-32768, 60,-32768,
-32768, 6,-32768, -9, 97,-32768,-32768, 3, 89, 54,
-32768, 9,-32768, 3, 126,-32768,-32768, 116, 111, 9,
-32768,-32768, 107, 43, 78,-32768,-32768, 37, 111,-32768,
-32768, 13,-32768, 3, 9, 9, 9, 9, 134, 142,
144, 146, 9, 19, 38, 143, 145, 143, 143, 143,
143, 143, 150, 3, 180, 140,-32768, 158,-32768, 78,
78,-32768,-32768,-32768, 9,-32768,-32768, 171, 3, 28,
-32768,-32768,-32768,-32768,-32768,-32768,-32768, 143, 160,-32768,
122, 82,-32768, 188, 136,-32768,-32768, 153,-32768,-32768,
77, 190, 124,-32768, 9,-32768, 189, 86, 3, 126,
-32768,-32768, 9,-32768,-32768,-32768,-32768,-32768,-32768, 9,
9, 176, 3,-32768, 3, 143, 111, 191, 111,-32768,
184,-32768, 43, 43,-32768, 92, 160,-32768, 121,-32768,
143, 111, 3, 126, 179, 192, 37, 121,-32768,-32768,
-32768,-32768, 111, 193, 37, 198, 111, 196, 101,-32768,
111, 199, 94,-32768, 37, 200, 197, 37,-32768, 201,
-32768, 208, 210,-32768
};
static const short yypgoto[] = {-32768,
-32768, -13, -33, 159,-32768, 157, 202, -44,-32768,-32768,
-40, -102, 55, 45,-32768,-32768, -65,-32768,-32768,-32768,
93,-32768,-32768, -26, 104,-32768, -3, -71, -36, 128,
132
};
#define YYLAST 218
static const short yytable[] = { 14,
22, 49, 101, 52, 75, 43, 14, 14, 100, 14,
-15, 33, 28, 40, 36, 31, 2, 111, 77, 3,
47, 1, 34, -3, 15, 91, 16, 93, 94, 95,
96, 97, 40, 19, 150, 51, 88, 59, 32, 26,
78, 40, 89, 48, -27, 28, 21, 55, 56, 159,
60, -3, 41, 42, 61, 62, 63, 114, 108, 38,
99, 146, 26, 113, 170, 29, 6, 7, 174, 148,
90, 64, 42, 4, 25, 110, 112, 55, 56, 5,
64, 42, 132, 137, 26, 39, 141, 117, 113, 6,
7, 138, 75, 143, 144, 149, 108, 155, 119, 176,
6, 7, 35, 26, 152, 140, 172, 75, 34, 37,
158, 6, 7, 26, 57, 58, 164, 139, 166, 110,
161, 147, 75, 34, 168, 139, 75, 53, 92, 156,
6, 7, 48, 28, 177, 153, 50, 180, 54, 160,
6, 7, 116, 59, 134, 26, 85, 40, 28, 48,
-27, -27, 92, 34, 84, 135, 60, 121, 122, 28,
61, 62, 63, 28, 86, 119, 87, 28, 17, 18,
98, 20, 6, 7, 121, 122, 124, 125, 126, 127,
128, 129, 80, 81, 102, 103, 64, 42, 82, 83,
32, 109, 115, 120, 133, 136, 145, 151, 154, 162,
167, 163, 169, 171, 179, 175, 178, 183, 181, 184,
79, 130, 165, 173, 0, 142, 0, 27
};
static const short yycheck[] = { 3,
14, 35, 74, 40, 49, 32, 10, 11, 74, 13,
5, 21, 16, 5, 28, 19, 12, 89, 6, 13,
34, 11, 32, 5, 4, 66, 10, 68, 69, 70,
71, 72, 5, 5, 137, 39, 63, 1, 33, 3,
54, 5, 5, 7, 8, 49, 44, 35, 36, 152,
14, 33, 44, 45, 18, 19, 20, 98, 85, 6,
74, 133, 3, 90, 167, 6, 30, 31, 171, 135,
33, 44, 45, 3, 5, 89, 90, 35, 36, 9,
44, 45, 6, 117, 3, 32, 120, 6, 115, 30,
31, 6, 137, 130, 131, 136, 123, 6, 102, 6,
30, 31, 6, 3, 138, 119, 6, 152, 32, 21,
151, 30, 31, 3, 37, 38, 157, 32, 163, 133,
154, 135, 167, 32, 165, 32, 171, 21, 8, 9,
30, 31, 7, 137, 175, 139, 21, 178, 32, 153,
30, 31, 21, 1, 21, 3, 5, 5, 152, 7,
8, 9, 8, 32, 21, 32, 14, 22, 23, 163,
18, 19, 20, 167, 21, 169, 21, 171, 10, 11,
21, 13, 30, 31, 22, 23, 24, 25, 26, 27,
28, 29, 55, 56, 5, 46, 44, 45, 57, 58,
33, 21, 33, 6, 5, 7, 21, 7, 15, 21,
8, 10, 5, 8, 8, 7, 7, 0, 8, 0,
54, 108, 158, 169, -1, 123, -1, 16
};
#line 352 "/usr/share/bison++/bison.cc"
/* fattrs + tables */
/* parser code folow */
/* This is the parser code that is written into each bison parser
when the %semantic_parser declaration is not specified in the grammar.
It was written by Richard Stallman by simplifying the hairy parser
used when %semantic_parser is specified. */
/* Note: dollar marks section change
the next is replaced by the list of actions, each action
as one case of the switch. */
#if YY_parse_USE_GOTO != 0
/*
SUPRESSION OF GOTO : on some C++ compiler (sun c++)
the goto is strictly forbidden if any constructor/destructor
is used in the whole function (very stupid isn't it ?)
so goto are to be replaced with a 'while/switch/case construct'
here are the macro to keep some apparent compatibility
*/
#define YYGOTO(lb) {yy_gotostate=lb;continue;}
#define YYBEGINGOTO enum yy_labels yy_gotostate=yygotostart; \
for(;;) switch(yy_gotostate) { case yygotostart: {
#define YYLABEL(lb) } case lb: {
#define YYENDGOTO } }
#define YYBEGINDECLARELABEL enum yy_labels {yygotostart
#define YYDECLARELABEL(lb) ,lb
#define YYENDDECLARELABEL };
#else
/* macro to keep goto */
#define YYGOTO(lb) goto lb
#define YYBEGINGOTO
#define YYLABEL(lb) lb:
#define YYENDGOTO
#define YYBEGINDECLARELABEL
#define YYDECLARELABEL(lb)
#define YYENDDECLARELABEL
#endif
/* LABEL DECLARATION */
YYBEGINDECLARELABEL
YYDECLARELABEL(yynewstate)
YYDECLARELABEL(yybackup)
/* YYDECLARELABEL(yyresume) */
YYDECLARELABEL(yydefault)
YYDECLARELABEL(yyreduce)
YYDECLARELABEL(yyerrlab) /* here on detecting error */
YYDECLARELABEL(yyerrlab1) /* here on error raised explicitly by an action */
YYDECLARELABEL(yyerrdefault) /* current state does not do anything special for the error token. */
YYDECLARELABEL(yyerrpop) /* pop the current state because it cannot handle the error token */
YYDECLARELABEL(yyerrhandle)
YYENDDECLARELABEL
/* ALLOCA SIMULATION */
/* __HAVE_NO_ALLOCA */
#ifdef __HAVE_NO_ALLOCA
int __alloca_free_ptr(char *ptr,char *ref)
{if(ptr!=ref) free(ptr);
return 0;}
#define __ALLOCA_alloca(size) malloc(size)
#define __ALLOCA_free(ptr,ref) __alloca_free_ptr((char *)ptr,(char *)ref)
#ifdef YY_parse_LSP_NEEDED
#define __ALLOCA_return(num) \
do { return( __ALLOCA_free(yyss,yyssa)+\
__ALLOCA_free(yyvs,yyvsa)+\
__ALLOCA_free(yyls,yylsa)+\
(num)); } while(0)
#else
#define __ALLOCA_return(num) \
do { return( __ALLOCA_free(yyss,yyssa)+\
__ALLOCA_free(yyvs,yyvsa)+\
(num)); } while(0)
#endif
#else
#define __ALLOCA_return(num) do { return(num); } while(0)
#define __ALLOCA_alloca(size) alloca(size)
#define __ALLOCA_free(ptr,ref)
#endif
/* ENDALLOCA SIMULATION */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (YY_parse_CHAR = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT __ALLOCA_return(0)
#define YYABORT __ALLOCA_return(1)
#define YYERROR YYGOTO(yyerrlab1)
/* Like YYERROR except do call yyerror.
This remains here temporarily to ease the
transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL YYGOTO(yyerrlab)
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(token, value) \
do \
if (YY_parse_CHAR == YYEMPTY && yylen == 1) \
{ YY_parse_CHAR = (token), YY_parse_LVAL = (value); \
yychar1 = YYTRANSLATE (YY_parse_CHAR); \
YYPOPSTACK; \
YYGOTO(yybackup); \
} \
else \
{ YY_parse_ERROR ("syntax error: cannot back up"); YYERROR; } \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
#ifndef YY_parse_PURE
/* UNPURE */
#define YYLEX YY_parse_LEX()
#ifndef YY_USE_CLASS
/* If nonreentrant, and not class , generate the variables here */
int YY_parse_CHAR; /* the lookahead symbol */
YY_parse_STYPE YY_parse_LVAL; /* the semantic value of the */
/* lookahead symbol */
int YY_parse_NERRS; /* number of parse errors so far */
#ifdef YY_parse_LSP_NEEDED
YY_parse_LTYPE YY_parse_LLOC; /* location data for the lookahead */
/* symbol */
#endif
#endif
#else