aboutsummaryrefslogtreecommitdiff
path: root/tools/mhmake/src/bison.cc
blob: 37596b5618b947cba294175b5ea898e91a991154 (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
/*  This file is part of mhmake.
 *
 *  Copyright (C) 2001-2009 Marc Haesen
 *
 *  Mhmake 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 3 of the License, or
 *  (at your option) any later version.
 *
 *  Mhmake 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 Mhmake.  If not, see <http://www.gnu.org/licenses/>.
*/

/* $Rev$ */

/* -*-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.  */

/* 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)
#include <malloc.h>
#pragma alloca

#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
#define YY_USE_CLASS
#endif
#else
#ifndef __STDC__
#define const
#endif
#endif
#include <stdio.h>
#define YYBISON 1
$/* %{ and %header{ and %union, during decl */
#define YY_@_BISON 1
#ifndef YY_@_COMPATIBILITY
#ifndef YY_USE_CLASS
#define  YY_@_COMPATIBILITY 1
#else
#define  YY_@_COMPATIBILITY 0
#endif
#endif

#if YY_@_COMPATIBILITY != 0
/* backward compatibility */
#ifdef YYLTYPE
#ifndef YY_@_LTYPE
#define YY_@_LTYPE YYLTYPE
#endif
#endif
#ifdef YYSTYPE
#ifndef YY_@_STYPE
#define YY_@_STYPE YYSTYPE
#endif
#endif
#ifdef YYDEBUG
#ifndef YY_@_DEBUG
#define  YY_@_DEBUG YYDEBUG
#endif
#endif
#ifdef YY_@_STYPE
#ifndef yystype
#define yystype YY_@_STYPE
#endif
#endif
/* use goto to be compatible */
#ifndef YY_@_USE_GOTO
#define YY_@_USE_GOTO 1
#endif
#endif

/* use no goto to be clean in C++ */
#ifndef YY_@_USE_GOTO
#define YY_@_USE_GOTO 0
#endif

#ifndef YY_@_PURE
$/*  YY_@_PURE */
#endif

/* section apres lecture def, avant lecture grammaire S2 */
$/* prefix */
#ifndef YY_@_DEBUG
$/* YY_@_DEBUG */
#endif


#ifndef YY_@_LSP_NEEDED
$ /* YY_@_LSP_NEEDED*/
#endif



/* DEFAULT LTYPE*/
#ifdef YY_@_LSP_NEEDED
#ifndef YY_@_LTYPE
typedef struct yyltype
{
  int timestamp;
  int first_line;
  int first_column;
  int last_line;
  int last_column;
  char *text;
}
yyltype;

#define YY_@_LTYPE yyltype
#endif
#endif
/* DEFAULT STYPE*/
      /* We used to use `unsigned long' as YY_@_STYPE on MSDOS,
   but it seems better to be consistent.
   Most programs should declare their own type anyway.  */

#ifndef YY_@_STYPE
#define YY_@_STYPE int
#endif
/* DEFAULT MISCELANEOUS */
#ifndef YY_@_PARSE
#define YY_@_PARSE yyparse
#endif
#ifndef YY_@_LEX
#define YY_@_LEX yylex
#endif
#ifndef YY_@_LVAL
#define YY_@_LVAL yylval
#endif
#ifndef YY_@_LLOC
#define YY_@_LLOC yylloc
#endif
#ifndef YY_@_CHAR
#define YY_@_CHAR yychar
#endif
#ifndef YY_@_NERRS
#define YY_@_NERRS yynerrs
#endif
#ifndef YY_@_DEBUG_FLAG
#define YY_@_DEBUG_FLAG yydebug
#endif
#ifndef YY_@_ERROR
#define YY_@_ERROR yyerror
#endif
#ifndef YY_@_PARSE_PARAM
#ifndef __STDC__
#ifndef __cplusplus
#ifndef YY_USE_CLASS
#define YY_@_PARSE_PARAM
#ifndef YY_@_PARSE_PARAM_DEF
#define YY_@_PARSE_PARAM_DEF
#endif
#endif
#endif
#endif
#ifndef YY_@_PARSE_PARAM
#define YY_@_PARSE_PARAM void
#endif
#endif
#if YY_@_COMPATIBILITY != 0
/* backward compatibility */
#ifdef YY_@_LTYPE
#ifndef YYLTYPE
#define YYLTYPE YY_@_LTYPE
#else
/* WARNING obsolete !!! user defined YYLTYPE not reported into generated header */
#endif
#endif
#ifndef YYSTYPE
#define YYSTYPE YY_@_STYPE
#else
/* WARNING obsolete !!! user defined YYSTYPE not reported into generated header */
#endif
#ifdef YY_@_PURE
#ifndef YYPURE
#define YYPURE YY_@_PURE
#endif
#endif
#ifdef YY_@_DEBUG
#ifndef YYDEBUG
#define YYDEBUG YY_@_DEBUG
#endif
#endif
#ifndef YY_@_ERROR_VERBOSE
#ifdef YYERROR_VERBOSE
#define YY_@_ERROR_VERBOSE YYERROR_VERBOSE
#endif
#endif
#ifndef YY_@_LSP_NEEDED
#ifdef YYLSP_NEEDED
#define YY_@_LSP_NEEDED YYLSP_NEEDED
#endif
#endif
#endif
#ifndef YY_USE_CLASS
/* TOKEN C */
$ /* #defines tokens */
#else
/* CLASS */
#ifndef YY_@_CLASS
#define YY_@_CLASS @
#endif
#ifndef YY_@_INHERIT
#define YY_@_INHERIT
#endif
#ifndef YY_@_MEMBERS
#define YY_@_MEMBERS
#endif
#ifndef YY_@_LEX_BODY
#define YY_@_LEX_BODY
#endif
#ifndef YY_@_ERROR_BODY
#define YY_@_ERROR_BODY
#endif
#ifndef YY_@_CONSTRUCTOR_PARAM
#define YY_@_CONSTRUCTOR_PARAM
#endif
#ifndef YY_@_CONSTRUCTOR_CODE
#define YY_@_CONSTRUCTOR_CODE
#endif
#ifndef YY_@_CONSTRUCTOR_INIT
#define YY_@_CONSTRUCTOR_INIT
#endif
/* choose between enum and const */
#ifndef YY_@_USE_CONST_TOKEN
#define YY_@_USE_CONST_TOKEN 0
/* yes enum is more compatible with flex,  */
/* so by default we use it */
#endif
#if YY_@_USE_CONST_TOKEN != 0
#ifndef YY_@_ENUM_TOKEN
#define YY_@_ENUM_TOKEN yy_@_enum_token
#endif
#endif

class YY_@_CLASS YY_@_INHERIT
{
public:
#if YY_@_USE_CONST_TOKEN != 0
/* static const int token ... */
$ /* decl const */
#else
enum YY_@_ENUM_TOKEN { YY_@_NULL_TOKEN=0
$ /* enum token */
     }; /* end of enum declaration */
#endif
public:
 int YY_@_PARSE (YY_@_PARSE_PARAM);
#ifdef YY_@_PURE
#else
#ifdef YY_@_LSP_NEEDED
 YY_@_LTYPE YY_@_LLOC;
#endif
 int   YY_@_NERRS;
 int    YY_@_CHAR;
#endif
#if YY_@_DEBUG != 0
 int YY_@_DEBUG_FLAG;   /*  nonzero means print parse trace     */
#endif
public:
 YY_@_CLASS(YY_@_CONSTRUCTOR_PARAM);
public:
 YY_@_MEMBERS
};
/* other declare folow */
#if YY_@_USE_CONST_TOKEN != 0
$ /* const YY_@_CLASS::token */
#endif
/*apres const  */
YY_@_CLASS::YY_@_CLASS(YY_@_CONSTRUCTOR_PARAM) YY_@_CONSTRUCTOR_INIT
{
#if YY_@_DEBUG != 0
YY_@_DEBUG_FLAG=0;
#endif
YY_@_CONSTRUCTOR_CODE;
};
#endif
$ /* 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_@_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_@_LSP_NEEDED
#define __ALLOCA_return(num) \
            return( __ALLOCA_free(yyss,yyssa)+\
        __ALLOCA_free(yyvs,yyvsa)+\
        __ALLOCA_free(yyls,yylsa)+\
       (num))
#else
#define __ALLOCA_return(num) \
            return( __ALLOCA_free(yyss,yyssa)+\
        __ALLOCA_free(yyvs,yyvsa)+\
       (num))
#endif
#else
#define __ALLOCA_return(num) return(num)
#define __ALLOCA_alloca(size) alloca(size)
#define __ALLOCA_free(ptr,ref)
#endif

/* ENDALLOCA SIMULATION */

#define yyerrok         (yyerrstatus = 0)
#define yyclearin       (YY_@_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_@_CHAR == YYEMPTY && yylen == 1)\
  {\
    YY_@_CHAR = (token), YY_@_LVAL = (value);\
    yychar1 = YYTRANSLATE (YY_@_CHAR);\
    YYPOPSTACK;\
    YYGOTO(yybackup);\
  }\
  else\
    {\
      YY_@_ERROR ("syntax error: cannot back up"); YYERROR;\
    }\
while (0)

#define YYTERROR        1
#define YYERRCODE       256

#ifndef YY_@_PURE
/* UNPURE */
#define YYLEX           YY_@_LEX()
#ifndef YY_USE_CLASS
/* If nonreentrant, and not class , generate the variables here */
int     YY_@_CHAR;                      /*  the lookahead symbol        */
        /*  lookahead symbol    */
int YY_@_NERRS;                 /*  number of parse errors so far */
#ifdef YY_@_LSP_NEEDED
YY_@_LTYPE YY_@_LLOC;   /*  location data for the lookahead     */
      /*  symbol                              */
#endif
#endif


#else
/* PURE */
#ifdef YY_@_LSP_NEEDED
#define YYLEX           YY_@_LEX(&YY_@_LVAL, &YY_@_LLOC)
#else
#define YYLEX           YY_@_LEX(&YY_@_LVAL)
#endif
#endif
#ifndef YY_USE_CLASS
#if YY_@_DEBUG != 0
int YY_@_DEBUG_FLAG;                    /*  nonzero means print parse trace     */
/* Since this is uninitialized, it does not stop multiple parsers
   from coexisting.  */
#endif
#endif



/*  YYINITDEPTH indicates the initial size of the parser's stacks       */

#ifndef YYINITDEPTH
#define YYINITDEPTH 200
#endif

/*  YYMAXDEPTH is the maximum size the stacks can grow to
    (effective only if the built-in stack extension method is used).  */

#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif


#if __GNUC__ > 1                /* GNU C and GNU C++ define this. */
#define __yy_bcopy(FROM,TO,COUNT)       __builtin_memcpy(TO,FROM,COUNT)
#else                           /* not GNU C or C++ */

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */

#ifdef __cplusplus
static void __yy_bcopy (char *from, char *to, int count)
#else
#ifdef __STDC__
static void __yy_bcopy (char *from, char *to, int count)
#else
static void __yy_bcopy (from, to, count)
     char *from;
     char *to;
     int count;
#endif
#endif
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}
#endif

int
#ifdef YY_USE_CLASS
 YY_@_CLASS::
#endif
     YY_@_PARSE(YY_@_PARSE_PARAM)
#ifndef __STDC__
#ifndef __cplusplus
#ifndef YY_USE_CLASS
/* parameter definition without protypes */
YY_@_PARSE_PARAM_DEF
#endif
#endif
#endif
{
  register int yystate;
  register int yyn;
  register short *yyssp;
  register YY_@_STYPE *yyvsp;
  int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
  int yychar1=0;          /*  lookahead token as an internal (translated) token number */

  short yyssa[YYINITDEPTH];     /*  the state stack                     */
  YY_@_STYPE yyvsa[YYINITDEPTH];        /*  the semantic value stack            */

  short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
  YY_@_STYPE *yyvs = yyvsa;     /*  to allow yyoverflow to reallocate them elsewhere */

#ifdef YY_@_LSP_NEEDED
  YY_@_LTYPE yylsa[YYINITDEPTH];        /*  the location stack                  */
  YY_@_LTYPE *yyls = yylsa;
  YY_@_LTYPE *yylsp;

#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
#else
#define YYPOPSTACK   (yyvsp--, yyssp--)
#endif

  int yystacksize = YYINITDEPTH;

#ifdef YY_@_PURE
  int YY_@_CHAR;
  YY_@_STYPE YY_@_LVAL;
  int YY_@_NERRS;
#ifdef YY_@_LSP_NEEDED
  YY_@_LTYPE YY_@_LLOC;
#endif
#endif

  YY_@_STYPE yyval;             /*  the variable used to return         */
        /*  semantic values from the action     */
        /*  routines                            */

  int yylen;
/* start loop, in which YYGOTO may be used. */
YYBEGINGOTO

#if YY_@_DEBUG != 0
  if (YY_@_DEBUG_FLAG)
    fprintf(stderr, "Starting parse\n");
#endif
  yystate = 0;
  yyerrstatus = 0;
  YY_@_NERRS = 0;
  YY_@_CHAR = YYEMPTY;          /* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */

  yyssp = yyss - 1;
  yyvsp = yyvs;
#ifdef YY_@_LSP_NEEDED
  yylsp = yyls;
#endif

/* Push a new state, which is found in  yystate  .  */
/* In all cases, when you get here, the value and location stacks
   have just been pushed. so pushing a state here evens the stacks.  */
YYLABEL(yynewstate)

  *++yyssp = yystate;

  if (yyssp >= yyss + yystacksize - 1)
  {
    /* Give user a chance to reallocate the stack */
    /* Use copies of these so that the &'s don't force the real ones into memory. */
    YY_@_STYPE *yyvs1 = yyvs;
    short *yyss1 = yyss;
#ifdef YY_@_LSP_NEEDED
    YY_@_LTYPE *yyls1 = yyls;
#endif

    /* Get the current used size of the three stacks, in elements.  */
    int size = yyssp - yyss + 1;

#ifdef yyoverflow
      /* Each stack pointer address is followed by the size of
    the data in use in that stack, in bytes.  */
#ifdef YY_@_LSP_NEEDED
      /* This used to be a conditional around just the two extra args,
    but that might be undefined if yyoverflow is a macro.  */
    yyoverflow("parser stack overflow",
      &yyss1, size * sizeof (*yyssp),
      &yyvs1, size * sizeof (*yyvsp),
      &yyls1, size * sizeof (*yylsp),
      &yystacksize);
#else
    yyoverflow("parser stack overflow",
      &yyss1, size * sizeof (*yyssp),
      &yyvs1, size * sizeof (*yyvsp),
      &yystacksize);
#endif

    yyss = yyss1; yyvs = yyvs1;
#ifdef YY_@_LSP_NEEDED
    yyls = yyls1;
#endif
#else /* no yyoverflow */
    /* Extend the stack our own way.  */
    if (yystacksize >= YYMAXDEPTH)
    {
      YY_@_ERROR("parser stack overflow");
      __ALLOCA_return(2);
    }
    yystacksize *= 2;
    if (yystacksize > YYMAXDEPTH)
      yystacksize = YYMAXDEPTH;
    yyss = (short *) __ALLOCA_alloca (yystacksize * sizeof (*yyssp));
    __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
    __ALLOCA_free(yyss1,yyssa);
    yyvs = (YY_@_STYPE *) __ALLOCA_alloca (yystacksize * sizeof (*yyvsp));
    __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
    __ALLOCA_free(yyvs1,yyvsa);
#ifdef YY_@_LSP_NEEDED
    yyls = (YY_@_LTYPE *) __ALLOCA_alloca (yystacksize * sizeof (*yylsp));
    __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
    __ALLOCA_free(yyls1,yylsa);
#endif
#endif /* no yyoverflow */

    yyssp = yyss + size - 1;
    yyvsp = yyvs + size - 1;
#ifdef YY_@_LSP_NEEDED
    yylsp = yyls + size - 1;
#endif

#if YY_@_DEBUG != 0
    if (YY_@_DEBUG_FLAG)
      fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif

     if (yyssp >= yyss + yystacksize - 1)
       YYABORT;
  }

#if YY_@_DEBUG != 0
  if (YY_@_DEBUG_FLAG)
    fprintf(stderr, "Entering state %d\n", yystate);
#endif

  YYGOTO(yybackup);
YYLABEL(yybackup)

/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
/* YYLABEL(yyresume) */

  /* First try to decide what to do without reference to lookahead token.  */

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    YYGOTO(yydefault);

  /* Not known => get a lookahead token if don't already have one.  */

  /* yychar is either YYEMPTY or YYEOF
     or a valid token in external form.  */

  if (YY_@_CHAR == YYEMPTY)
  {
#if YY_@_DEBUG != 0
    if (YY_@_DEBUG_FLAG)
      fprintf(stderr, "Reading a token: ");
#endif
    YY_@_CHAR = YYLEX;
  }

  /* Convert token to internal form (in yychar1) for indexing tables with */

  if (YY_@_CHAR <= 0)           /* This means end of input. */
  {
    yychar1 = 0;
    YY_@_CHAR = YYEOF;                /* Don't call YYLEX any more */

#if YY_@_DEBUG != 0
    if (YY_@_DEBUG_FLAG)
      fprintf(stderr, "Now at end of input.\n");
#endif
  }
  else
  {
    yychar1 = YYTRANSLATE(YY_@_CHAR);

#if YY_@_DEBUG != 0
    if (YY_@_DEBUG_FLAG)
    {
      fprintf (stderr, "Next token is %d (%s", YY_@_CHAR, yytname[yychar1]);
      /* Give the individual parser a way to print the precise meaning
         of a token, for further debugging info.  */
#ifdef YYPRINT
      YYPRINT (stderr, YY_@_CHAR, YY_@_LVAL);
#endif
      fprintf (stderr, ")\n");
    }
#endif
  }

  yyn += yychar1;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
    YYGOTO(yydefault);

  yyn = yytable[yyn];

  /* yyn is what to do for this token type in this state.
     Negative => reduce, -yyn is rule number.
     Positive => shift, yyn is new state.
       New state is final state => don't bother to shift,
       just return success.
     0, or most negative number => error.  */

  if (yyn < 0)
  {
    if (yyn == YYFLAG)
      YYGOTO(yyerrlab);
    yyn = -yyn;
    YYGOTO(yyreduce);
  }
  else if (yyn == 0)
    YYGOTO(yyerrlab);

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the lookahead token.  */

#if YY_@_DEBUG != 0
  if (YY_@_DEBUG_FLAG)
    fprintf(stderr, "Shifting token %d (%s), ", YY_@_CHAR, yytname[yychar1]);
#endif

  /* Discard the token being shifted unless it is eof.  */
  if (YY_@_CHAR != YYEOF)
    YY_@_CHAR = YYEMPTY;

  *++yyvsp = YY_@_LVAL;
#ifdef YY_@_LSP_NEEDED
  *++yylsp = YY_@_LLOC;
#endif

  /* count tokens shifted since error; after three, turn off error status.  */
  if (yyerrstatus) yyerrstatus--;

  yystate = yyn;
  YYGOTO(yynewstate);

/* Do the default action for the current state.  */
YYLABEL(yydefault)

  yyn = yydefact[yystate];
  if (yyn == 0)
    YYGOTO(yyerrlab);

/* Do a reduction.  yyn is the number of a rule to reduce with.  */
YYLABEL(yyreduce)
  yylen = yyr2[yyn];
  if (yylen > 0)
    yyval = yyvsp[1-yylen]; /* implement default value of the action */

#if YY_@_DEBUG != 0
  if (YY_@_DEBUG_FLAG)
  {
    int i;

    fprintf (stderr, "Reducing via rule %d (line %d), ",
       yyn, yyrline[yyn]);

    /* Print the symbols being reduced, and their result.  */
    for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
      fprintf (stderr, "%s ", yytname[yyrhs[i]]);
    fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  }
#endif

$   /* the action file gets copied in in place of this dollarsign  */
  yyvsp -= yylen;
  yyssp -= yylen;
#ifdef YY_@_LSP_NEEDED
  yylsp -= yylen;
#endif

#if YY_@_DEBUG != 0
  if (YY_@_DEBUG_FLAG)
  {
    short *ssp1 = yyss - 1;
    fprintf (stderr, "state stack now");
    while (ssp1 != yyssp)
      fprintf (stderr, " %d", *++ssp1);
      fprintf (stderr, "\n");
    }
#endif

    *++yyvsp = yyval;

#ifdef YY_@_LSP_NEEDED
    yylsp++;
    if (yylen == 0)
    {
      *yylsp= YY_@_LLOC;
      //yylsp->first_line = YY_@_LLOC.first_line;
      //yylsp->first_column = YY_@_LLOC.first_column;
      //yylsp->last_line = (yylsp-1)->last_line;
      //yylsp->last_column = (yylsp-1)->last_column;
      //yylsp->text = 0;
    }
    else
    {
      *yylsp = *(yylsp+yylen-1);
      //yylsp->last_line = (yylsp+yylen-1)->last_line;
      //yylsp->last_column = (yylsp+yylen-1)->last_column;
    }
#endif

  /* Now "shift" the result of the reduction.
     Determine what state that goes to,
     based on the state we popped back to
     and the rule number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTBASE];

  YYGOTO(yynewstate);

YYLABEL(yyerrlab)   /* here on detecting error */

  if (! yyerrstatus)
    /* If not already recovering from an error, report this error.  */
  {
    ++YY_@_NERRS;

#ifdef YY_@_ERROR_VERBOSE
    yyn = yypact[yystate];

    if (yyn > YYFLAG && yyn < YYLAST)
    {
      int size = 0;
      char *msg;
      int x, count;

      count = 0;
      /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
      for (x = (yyn < 0 ? -yyn : 0);
        x < (sizeof(yytname) / sizeof(char *)); x++)
      if (yycheck[x + yyn] == x)
        size += strlen(yytname[x]) + 15, count++;
      msg = (char *) malloc(size + 15);
      if (msg != 0)
      {
        strcpy(msg, "parse error");

        if (count < 5)
        {
          count = 0;
          for (x = (yyn < 0 ? -yyn : 0);
            x < (sizeof(yytname) / sizeof(char *)); x++)
          if (yycheck[x + yyn] == x)
          {
            strcat(msg, count == 0 ? ", expecting `" : " or `");
            strcat(msg, yytname[x]);
            strcat(msg, "'");
            count++;
          }
        }
        YY_@_ERROR(msg);
        free(msg);
      }
      else
        YY_@_ERROR ("parse error; also virtual memory exceeded");
    }
    else
#endif /* YY_@_ERROR_VERBOSE */
      YY_@_ERROR("parse error");
  }

  YYGOTO(yyerrlab1);
YYLABEL(yyerrlab1)   /* here on error raised explicitly by an action */

  if (yyerrstatus == 3)
  {
      /* if just tried and failed to reuse lookahead token after an error, discard it.  */

      /* return failure if at end of input */
    if (YY_@_CHAR == YYEOF)
      YYABORT;

#if YY_@_DEBUG != 0
    if (YY_@_DEBUG_FLAG)
      fprintf(stderr, "Discarding token %d (%s).\n", YY_@_CHAR, yytname[yychar1]);
#endif

    YY_@_CHAR = YYEMPTY;
  }

  /* Else will try to reuse lookahead token
     after shifting the error token.  */

  yyerrstatus = 3;              /* Each real token shifted decrements this */

  YYGOTO(yyerrhandle);

YYLABEL(yyerrdefault)  /* current state does not do anything special for the error token. */

#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */
  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  if (yyn) YYGOTO(yydefault);
#endif

YYLABEL(yyerrpop)   /* pop the current state because it cannot handle the error token */

  if (yyssp == yyss) YYABORT;
  yyvsp--;
  yystate = *--yyssp;
#ifdef YY_@_LSP_NEEDED
  yylsp--;
#endif

#if YY_@_DEBUG != 0
  if (YY_@_DEBUG_FLAG)
  {
    short *ssp1 = yyss - 1;
    fprintf (stderr, "Error: state stack now");
    while (ssp1 != yyssp)
      fprintf (stderr, " %d", *++ssp1);
    fprintf (stderr, "\n");
  }
#endif

YYLABEL(yyerrhandle)

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    YYGOTO(yyerrdefault);

  yyn += YYTERROR;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
    YYGOTO(yyerrdefault);

  yyn = yytable[yyn];
  if (yyn < 0)
  {
    if (yyn == YYFLAG)
      YYGOTO(yyerrpop);
    yyn = -yyn;
    YYGOTO(yyreduce);
  }
  else if (yyn == 0)
    YYGOTO(yyerrpop);

  if (yyn == YYFINAL)
    YYACCEPT;

#if YY_@_DEBUG != 0
  if (YY_@_DEBUG_FLAG)
    fprintf(stderr, "Shifting error token, ");
#endif

  *++yyvsp = YY_@_LVAL;
#ifdef YY_@_LSP_NEEDED
  *++yylsp = YY_@_LLOC;
#endif

  yystate = yyn;
  YYGOTO(yynewstate);
/* end loop, in which YYGOTO may be used. */
  YYENDGOTO
}

/* END */
$ /* section 3 */

/* AFTER END , NEVER READ !!! */