]> andersk Git - splint.git/blob - src/signature.tab.c
Initial revision
[splint.git] / src / signature.tab.c
1
2 /*  A Bison parser, made from signature.y
3  by  GNU Bison version 1.25
4   */
5
6 #define YYBISON 1  /* Identify Bison output.  */
7
8 #define yyparse lslparse
9 #define yylex lsllex
10 #define yyerror lslerror
11 #define yylval lsllval
12 #define yychar lslchar
13 #define yydebug lsldebug
14 #define yynerrs lslnerrs
15 #define LST_SIMPLEID    258
16 #define LST_LOGICALOP   259
17 #define LST_EQOP        260
18 #define LST_SIMPLEOP    261
19 #define LST_MAPSYM      262
20 #define LST_FIELDMAPSYM 263
21 #define LST_MARKERSYM   264
22 #define LST_ifTOKEN     265
23 #define LST_thenTOKEN   266
24 #define LST_elseTOKEN   267
25 #define LST_LBRACKET    268
26 #define LST_RBRACKET    269
27 #define LST_SELECTSYM   270
28 #define LST_SEPSYM      271
29 #define LST_OPENSYM     272
30 #define LST_CLOSESYM    273
31 #define LST_COLON       274
32 #define LST_COMMA       275
33 #define LST_EOL 276
34 #define LST_COMMENTSYM  277
35 #define LST_WHITESPACE  278
36 #define LST_QUANTIFIERSYM       279
37 #define LST_EQUATIONSYM 280
38 #define LST_EQSEPSYM    281
39 #define LST_COMPOSESYM  282
40 #define LST_LPAR        283
41 #define LST_RPAR        284
42 #define LST_assertsTOKEN        285
43 #define LST_assumesTOKEN        286
44 #define LST_byTOKEN     287
45 #define LST_convertsTOKEN       288
46 #define LST_enumerationTOKEN    289
47 #define LST_equationsTOKEN      290
48 #define LST_exemptingTOKEN      291
49 #define LST_forTOKEN    292
50 #define LST_generatedTOKEN      293
51 #define LST_impliesTOKEN        294
52 #define LST_includesTOKEN       295
53 #define LST_introducesTOKEN     296
54 #define LST_ofTOKEN     297
55 #define LST_partitionedTOKEN    298
56 #define LST_traitTOKEN  299
57 #define LST_tupleTOKEN  300
58 #define LST_unionTOKEN  301
59 #define LST_BADTOKEN    302
60
61 #line 36 "signature.y"
62
63
64 # include "bison.reset"
65
66 # include <stdio.h>
67 # include "lclintMacros.nf"
68 # include "llbasic.h"
69 # include "lslparse.h"
70 # include "signature.h"
71
72 void lslerror (char *);
73 /*@dependent@*/ /*@null@*/ lslOp importedlslOp;
74
75 /*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
76 static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
77 /*@=noparams@*/
78
79 # define YYPRINT(file, type, value) yyprint (file, type, value)
80
81 # define YYDEBUG 1
82
83 # include "bison.head"
84
85
86 #line 73 "signature.y"
87 typedef union {
88   ltoken ltok;  /* a leaf is also an ltoken */
89   unsigned int count;
90   /*@only@*/  ltokenList ltokenList;
91   /*@only@*/  opFormNode opform;
92   /*@owned@*/ sigNode signature;
93   /*@only@*/  nameNode name;
94   /*@owned@*/ lslOp operator;
95   /*@only@*/  lslOpList operators;
96 } YYSTYPE;
97 #ifndef YYDEBUG
98 #define YYDEBUG 1
99 #endif
100
101 #include <stdio.h>
102
103 #ifndef __cplusplus
104 #ifndef __STDC__
105 #define const
106 #endif
107 #endif
108
109
110
111 #define YYFINAL         62
112 #define YYFLAG          -32768
113 #define YYNTBASE        48
114
115 #define YYTRANSLATE(x) ((unsigned)(x) <= 302 ? yytranslate[x] : 62)
116
117 static const char yytranslate[] = {     0,
118      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
119      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
120      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
121      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
122      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
123      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
124      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
125      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
126      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
127      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
128      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
129      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
130      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
131      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
132      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
133      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
134      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
135      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
136      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
137      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
138      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
139      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
140      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
141      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
142      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
143      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
144      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
145     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
146     26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
147     36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
148     46,    47
149 };
150
151 #if YYDEBUG != 0
152 static const short yyprhs[] = {     0,
153      0,     2,     4,     7,    11,    13,    15,    22,    24,    27,
154     30,    34,    38,    43,    48,    54,    58,    63,    68,    74,
155     77,    81,    85,    87,    89,    91,    92,    94,    96,   100,
156    102,   104,   108,   109,   111,   113,   117,   119
157 };
158
159 static const short yyrhs[] = {    49,
160      0,    50,     0,    49,    50,     0,    51,    19,    57,     0,
161     61,     0,    52,     0,    10,     9,    11,     9,    12,     9,
162      0,    53,     0,     9,    53,     0,    53,     9,     0,     9,
163     53,     9,     0,    17,    54,    18,     0,     9,    17,    54,
164     18,     0,    17,    54,    18,     9,     0,     9,    17,    54,
165     18,     9,     0,    13,    54,    14,     0,     9,    13,    54,
166     14,     0,    13,    54,    14,     9,     0,     9,    13,    54,
167     14,     9,     0,    15,     3,     0,     9,    15,     3,     0,
168      9,     8,     3,     0,     6,     0,     4,     0,     5,     0,
169      0,    55,     0,     9,     0,    55,    56,     9,     0,    20,
170      0,    16,     0,    58,     7,    60,     0,     0,    59,     0,
171     60,     0,    59,    20,    60,     0,     3,     0,     3,     0
172 };
173
174 #endif
175
176 #if YYDEBUG != 0
177 static const short yyrline[] = { 0,
178    139,   141,   146,   150,   156,   158,   162,   164,   166,   168,
179    170,   172,   174,   176,   178,   181,   184,   187,   190,   193,
180    196,   201,   206,   208,   210,   213,   215,   218,   220,   223,
181    225,   228,   231,   233,   236,   238,   241,   247
182 };
183 #endif
184
185
186 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
187
188 static const char * const yytname[] = {   "$","error","$undefined.","LST_SIMPLEID",
189 "LST_LOGICALOP","LST_EQOP","LST_SIMPLEOP","LST_MAPSYM","LST_FIELDMAPSYM","LST_MARKERSYM",
190 "LST_ifTOKEN","LST_thenTOKEN","LST_elseTOKEN","LST_LBRACKET","LST_RBRACKET",
191 "LST_SELECTSYM","LST_SEPSYM","LST_OPENSYM","LST_CLOSESYM","LST_COLON","LST_COMMA",
192 "LST_EOL","LST_COMMENTSYM","LST_WHITESPACE","LST_QUANTIFIERSYM","LST_EQUATIONSYM",
193 "LST_EQSEPSYM","LST_COMPOSESYM","LST_LPAR","LST_RPAR","LST_assertsTOKEN","LST_assumesTOKEN",
194 "LST_byTOKEN","LST_convertsTOKEN","LST_enumerationTOKEN","LST_equationsTOKEN",
195 "LST_exemptingTOKEN","LST_forTOKEN","LST_generatedTOKEN","LST_impliesTOKEN",
196 "LST_includesTOKEN","LST_introducesTOKEN","LST_ofTOKEN","LST_partitionedTOKEN",
197 "LST_traitTOKEN","LST_tupleTOKEN","LST_unionTOKEN","LST_BADTOKEN","top","operatorList",
198 "operator","name","opForm","anyOp","middle","placeList","separator","signature",
199 "domain","sortList","sortId","opId", NULL
200 };
201 #endif
202
203 static const short yyr1[] = {     0,
204     48,    49,    49,    50,    51,    51,    52,    52,    52,    52,
205     52,    52,    52,    52,    52,    52,    52,    52,    52,    52,
206     52,    52,    53,    53,    53,    54,    54,    55,    55,    56,
207     56,    57,    58,    58,    59,    59,    60,    61
208 };
209
210 static const short yyr2[] = {     0,
211      1,     1,     2,     3,     1,     1,     6,     1,     2,     2,
212      3,     3,     4,     4,     5,     3,     4,     4,     5,     2,
213      3,     3,     1,     1,     1,     0,     1,     1,     3,     1,
214      1,     3,     0,     1,     1,     3,     1,     1
215 };
216
217 static const short yydefact[] = {     0,
218     38,    24,    25,    23,     0,     0,    26,     0,    26,     1,
219      2,     0,     6,     8,     5,     0,    26,     0,    26,     9,
220      0,    28,     0,    27,    20,     0,     3,    33,    10,    22,
221      0,    21,     0,    11,     0,    16,    31,    30,     0,    12,
222     37,     4,     0,    34,    35,    17,    13,     0,    18,    29,
223     14,     0,     0,    19,    15,     0,    32,    36,     7,     0,
224      0,     0
225 };
226
227 static const short yydefgoto[] = {    60,
228     10,    11,    12,    13,    14,    23,    24,    39,    42,    43,
229     44,    45,    15
230 };
231
232 static const short yypact[] = {    -3,
233 -32768,-32768,-32768,-32768,    11,    -4,     0,     8,     0,    -3,
234 -32768,    -1,-32768,    13,-32768,    17,     0,    22,     0,    18,
235     20,-32768,    19,   -12,-32768,    14,-32768,    31,-32768,-32768,
236     21,-32768,    23,-32768,    27,    28,-32768,-32768,    29,    30,
237 -32768,-32768,    33,    24,-32768,    34,    36,    35,-32768,-32768,
238 -32768,    31,    31,-32768,-32768,    37,-32768,-32768,-32768,    42,
239     48,-32768
240 };
241
242 static const short yypgoto[] = {-32768,
243 -32768,    39,-32768,-32768,    45,     4,-32768,-32768,-32768,-32768,
244 -32768,   -23,-32768
245 };
246
247
248 #define YYLAST          50
249
250
251 static const short yytable[] = {     1,
252      2,     3,     4,    37,    21,     5,     6,    38,    22,     7,
253     25,     8,    26,     9,     2,     3,     4,    28,    16,    30,
254     31,    29,    33,    17,    32,    18,    34,    19,    57,    58,
255     35,    40,    36,    41,    46,    48,    49,    50,    51,    52,
256     47,    61,    54,    53,    55,    59,    56,    62,    27,    20
257 };
258
259 static const short yycheck[] = {     3,
260      4,     5,     6,    16,     9,     9,    10,    20,     9,    13,
261      3,    15,     9,    17,     4,     5,     6,    19,     8,     3,
262     17,     9,    19,    13,     3,    15,     9,    17,    52,    53,
263     11,    18,    14,     3,    14,     9,     9,     9,     9,     7,
264     18,     0,     9,    20,     9,     9,    12,     0,    10,     5
265 };
266 #define YYPURE 1
267
268 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
269 #line 3 "/usr/lib/bison.simple"
270
271 /* Skeleton output parser for bison,
272    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
273
274    This program is free software; you can redistribute it and/or modify
275    it under the terms of the GNU General Public License as published by
276    the Free Software Foundation; either version 2, or (at your option)
277    any later version.
278
279    This program is distributed in the hope that it will be useful,
280    but WITHOUT ANY WARRANTY; without even the implied warranty of
281    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
282    GNU General Public License for more details.
283
284    You should have received a copy of the GNU General Public License
285    along with this program; if not, write to the Free Software
286    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
287
288 /* As a special exception, when this file is copied by Bison into a
289    Bison output file, you may use that output file without restriction.
290    This special exception was added by the Free Software Foundation
291    in version 1.24 of Bison.  */
292
293 #ifndef alloca
294 #ifdef __GNUC__
295 #define alloca __builtin_alloca
296 #else /* not GNU C.  */
297 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
298 #include <alloca.h>
299 #else /* not sparc */
300 #if defined (MSDOS) && !defined (__TURBOC__)
301 #include <malloc.h>
302 #else /* not MSDOS, or __TURBOC__ */
303 #if defined(_AIX)
304 #include <malloc.h>
305  #pragma alloca
306 #else /* not MSDOS, __TURBOC__, or _AIX */
307 #ifdef __hpux
308 #ifdef __cplusplus
309 extern "C" {
310 void *alloca (unsigned int);
311 };
312 #else /* not __cplusplus */
313 void *alloca ();
314 #endif /* not __cplusplus */
315 #endif /* __hpux */
316 #endif /* not _AIX */
317 #endif /* not MSDOS, or __TURBOC__ */
318 #endif /* not sparc.  */
319 #endif /* not GNU C.  */
320 #endif /* alloca not defined.  */
321
322 /* This is the parser code that is written into each bison parser
323   when the %semantic_parser declaration is not specified in the grammar.
324   It was written by Richard Stallman by simplifying the hairy parser
325   used when %semantic_parser is specified.  */
326
327 /* Note: there must be only one dollar sign in this file.
328    It is replaced by the list of actions, each action
329    as one case of the switch.  */
330
331 #define yyerrok         (yyerrstatus = 0)
332 #define yyclearin       (yychar = YYEMPTY)
333 #define YYEMPTY         -2
334 #define YYEOF           0
335 #define YYACCEPT        return(0)
336 #define YYABORT         return(1)
337 #define YYERROR         goto yyerrlab1
338 /* Like YYERROR except do call yyerror.
339    This remains here temporarily to ease the
340    transition to the new meaning of YYERROR, for GCC.
341    Once GCC version 2 has supplanted version 1, this can go.  */
342 #define YYFAIL          goto yyerrlab
343 #define YYRECOVERING()  (!!yyerrstatus)
344 #define YYBACKUP(token, value) \
345 do                                                              \
346   if (yychar == YYEMPTY && yylen == 1)                          \
347     { yychar = (token), yylval = (value);                       \
348       yychar1 = YYTRANSLATE (yychar);                           \
349       YYPOPSTACK;                                               \
350       goto yybackup;                                            \
351     }                                                           \
352   else                                                          \
353     { yyerror ("syntax error: cannot back up"); YYERROR; }      \
354 while (0)
355
356 #define YYTERROR        1
357 #define YYERRCODE       256
358
359 #ifndef YYPURE
360 #define YYLEX           yylex()
361 #endif
362
363 #ifdef YYPURE
364 #ifdef YYLSP_NEEDED
365 #ifdef YYLEX_PARAM
366 #define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)
367 #else
368 #define YYLEX           yylex(&yylval, &yylloc)
369 #endif
370 #else /* not YYLSP_NEEDED */
371 #ifdef YYLEX_PARAM
372 #define YYLEX           yylex(&yylval, YYLEX_PARAM)
373 #else
374 #define YYLEX           yylex(&yylval)
375 #endif
376 #endif /* not YYLSP_NEEDED */
377 #endif
378
379 /* If nonreentrant, generate the variables here */
380
381 #ifndef YYPURE
382
383 int     yychar;                 /*  the lookahead symbol                */
384 YYSTYPE yylval;                 /*  the semantic value of the           */
385                                 /*  lookahead symbol                    */
386
387 #ifdef YYLSP_NEEDED
388 YYLTYPE yylloc;                 /*  location data for the lookahead     */
389                                 /*  symbol                              */
390 #endif
391
392 int yynerrs;                    /*  number of parse errors so far       */
393 #endif  /* not YYPURE */
394
395 #if YYDEBUG != 0
396 int yydebug;                    /*  nonzero means print parse trace     */
397 /* Since this is uninitialized, it does not stop multiple parsers
398    from coexisting.  */
399 #endif
400
401 /*  YYINITDEPTH indicates the initial size of the parser's stacks       */
402
403 #ifndef YYINITDEPTH
404 #define YYINITDEPTH 200
405 #endif
406
407 /*  YYMAXDEPTH is the maximum size the stacks can grow to
408     (effective only if the built-in stack extension method is used).  */
409
410 #if YYMAXDEPTH == 0
411 #undef YYMAXDEPTH
412 #endif
413
414 #ifndef YYMAXDEPTH
415 #define YYMAXDEPTH 10000
416 #endif
417
418 /* Prevent warning if -Wstrict-prototypes.  */
419 #ifdef __GNUC__
420 int yyparse (void);
421 #endif
422 \f
423 #if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */
424 #define __yy_memcpy(TO,FROM,COUNT)      __builtin_memcpy(TO,FROM,COUNT)
425 #else                           /* not GNU C or C++ */
426 #ifndef __cplusplus
427
428 /* This is the most reliable way to avoid incompatibilities
429    in available built-in functions on various systems.  */
430 static void
431 __yy_memcpy (to, from, count)
432      char *to;
433      char *from;
434      int count;
435 {
436   register char *f = from;
437   register char *t = to;
438   register int i = count;
439
440   while (i-- > 0)
441     *t++ = *f++;
442 }
443
444 #else /* __cplusplus */
445
446 /* This is the most reliable way to avoid incompatibilities
447    in available built-in functions on various systems.  */
448 static void
449 __yy_memcpy (char *to, char *from, int count)
450 {
451   register char *f = from;
452   register char *t = to;
453   register int i = count;
454
455   while (i-- > 0)
456     *t++ = *f++;
457 }
458
459 #endif
460 #endif
461 \f
462 #line 196 "/usr/lib/bison.simple"
463
464 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
465    into yyparse.  The argument should have type void *.
466    It should actually point to an object.
467    Grammar actions can access the variable by casting it
468    to the proper pointer type.  */
469
470 #ifdef YYPARSE_PARAM
471 #ifdef __cplusplus
472 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
473 #define YYPARSE_PARAM_DECL
474 #else /* not __cplusplus */
475 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
476 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
477 #endif /* not __cplusplus */
478 #else /* not YYPARSE_PARAM */
479 #define YYPARSE_PARAM_ARG
480 #define YYPARSE_PARAM_DECL
481 #endif /* not YYPARSE_PARAM */
482
483 int
484 yyparse(YYPARSE_PARAM_ARG)
485      YYPARSE_PARAM_DECL
486 {
487   register int yystate;
488   register int yyn;
489   register short *yyssp;
490   register YYSTYPE *yyvsp;
491   int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
492   int yychar1 = 0;              /*  lookahead token as an internal (translated) token number */
493
494   short yyssa[YYINITDEPTH];     /*  the state stack                     */
495   YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
496
497   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
498   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
499
500 #ifdef YYLSP_NEEDED
501   YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
502   YYLTYPE *yyls = yylsa;
503   YYLTYPE *yylsp;
504
505 #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
506 #else
507 #define YYPOPSTACK   (yyvsp--, yyssp--)
508 #endif
509
510   int yystacksize = YYINITDEPTH;
511
512 #ifdef YYPURE
513   int yychar;
514   YYSTYPE yylval;
515   int yynerrs;
516 #ifdef YYLSP_NEEDED
517   YYLTYPE yylloc;
518 #endif
519 #endif
520
521   YYSTYPE yyval;                /*  the variable used to return         */
522                                 /*  semantic values from the action     */
523                                 /*  routines                            */
524
525   int yylen;
526
527 #if YYDEBUG != 0
528   if (yydebug)
529     fprintf(stderr, "Starting parse\n");
530 #endif
531
532   yystate = 0;
533   yyerrstatus = 0;
534   yynerrs = 0;
535   yychar = YYEMPTY;             /* Cause a token to be read.  */
536
537   /* Initialize stack pointers.
538      Waste one element of value and location stack
539      so that they stay on the same level as the state stack.
540      The wasted elements are never initialized.  */
541
542   yyssp = yyss - 1;
543   yyvsp = yyvs;
544 #ifdef YYLSP_NEEDED
545   yylsp = yyls;
546 #endif
547
548 /* Push a new state, which is found in  yystate  .  */
549 /* In all cases, when you get here, the value and location stacks
550    have just been pushed. so pushing a state here evens the stacks.  */
551 yynewstate:
552
553   *++yyssp = yystate;
554
555   if (yyssp >= yyss + yystacksize - 1)
556     {
557       /* Give user a chance to reallocate the stack */
558       /* Use copies of these so that the &'s don't force the real ones into memory. */
559       YYSTYPE *yyvs1 = yyvs;
560       short *yyss1 = yyss;
561 #ifdef YYLSP_NEEDED
562       YYLTYPE *yyls1 = yyls;
563 #endif
564
565       /* Get the current used size of the three stacks, in elements.  */
566       int size = yyssp - yyss + 1;
567
568 #ifdef yyoverflow
569       /* Each stack pointer address is followed by the size of
570          the data in use in that stack, in bytes.  */
571 #ifdef YYLSP_NEEDED
572       /* This used to be a conditional around just the two extra args,
573          but that might be undefined if yyoverflow is a macro.  */
574       yyoverflow("parser stack overflow",
575                  &yyss1, size * sizeof (*yyssp),
576                  &yyvs1, size * sizeof (*yyvsp),
577                  &yyls1, size * sizeof (*yylsp),
578                  &yystacksize);
579 #else
580       yyoverflow("parser stack overflow",
581                  &yyss1, size * sizeof (*yyssp),
582                  &yyvs1, size * sizeof (*yyvsp),
583                  &yystacksize);
584 #endif
585
586       yyss = yyss1; yyvs = yyvs1;
587 #ifdef YYLSP_NEEDED
588       yyls = yyls1;
589 #endif
590 #else /* no yyoverflow */
591       /* Extend the stack our own way.  */
592       if (yystacksize >= YYMAXDEPTH)
593         {
594           yyerror("parser stack overflow");
595           return 2;
596         }
597       yystacksize *= 2;
598       if (yystacksize > YYMAXDEPTH)
599         yystacksize = YYMAXDEPTH;
600       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
601       __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
602       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
603       __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
604 #ifdef YYLSP_NEEDED
605       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
606       __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
607 #endif
608 #endif /* no yyoverflow */
609
610       yyssp = yyss + size - 1;
611       yyvsp = yyvs + size - 1;
612 #ifdef YYLSP_NEEDED
613       yylsp = yyls + size - 1;
614 #endif
615
616 #if YYDEBUG != 0
617       if (yydebug)
618         fprintf(stderr, "Stack size increased to %d\n", yystacksize);
619 #endif
620
621       if (yyssp >= yyss + yystacksize - 1)
622         YYABORT;
623     }
624
625 #if YYDEBUG != 0
626   if (yydebug)
627     fprintf(stderr, "Entering state %d\n", yystate);
628 #endif
629
630   goto yybackup;
631  yybackup:
632
633 /* Do appropriate processing given the current state.  */
634 /* Read a lookahead token if we need one and don't already have one.  */
635 /* yyresume: */
636
637   /* First try to decide what to do without reference to lookahead token.  */
638
639   yyn = yypact[yystate];
640   if (yyn == YYFLAG)
641     goto yydefault;
642
643   /* Not known => get a lookahead token if don't already have one.  */
644
645   /* yychar is either YYEMPTY or YYEOF
646      or a valid token in external form.  */
647
648   if (yychar == YYEMPTY)
649     {
650 #if YYDEBUG != 0
651       if (yydebug)
652         fprintf(stderr, "Reading a token: ");
653 #endif
654       yychar = YYLEX;
655     }
656
657   /* Convert token to internal form (in yychar1) for indexing tables with */
658
659   if (yychar <= 0)              /* This means end of input. */
660     {
661       yychar1 = 0;
662       yychar = YYEOF;           /* Don't call YYLEX any more */
663
664 #if YYDEBUG != 0
665       if (yydebug)
666         fprintf(stderr, "Now at end of input.\n");
667 #endif
668     }
669   else
670     {
671       yychar1 = YYTRANSLATE(yychar);
672
673 #if YYDEBUG != 0
674       if (yydebug)
675         {
676           fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
677           /* Give the individual parser a way to print the precise meaning
678              of a token, for further debugging info.  */
679 #ifdef YYPRINT
680           YYPRINT (stderr, yychar, yylval);
681 #endif
682           fprintf (stderr, ")\n");
683         }
684 #endif
685     }
686
687   yyn += yychar1;
688   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
689     goto yydefault;
690
691   yyn = yytable[yyn];
692
693   /* yyn is what to do for this token type in this state.
694      Negative => reduce, -yyn is rule number.
695      Positive => shift, yyn is new state.
696        New state is final state => don't bother to shift,
697        just return success.
698      0, or most negative number => error.  */
699
700   if (yyn < 0)
701     {
702       if (yyn == YYFLAG)
703         goto yyerrlab;
704       yyn = -yyn;
705       goto yyreduce;
706     }
707   else if (yyn == 0)
708     goto yyerrlab;
709
710   if (yyn == YYFINAL)
711     YYACCEPT;
712
713   /* Shift the lookahead token.  */
714
715 #if YYDEBUG != 0
716   if (yydebug)
717     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
718 #endif
719
720   /* Discard the token being shifted unless it is eof.  */
721   if (yychar != YYEOF)
722     yychar = YYEMPTY;
723
724   *++yyvsp = yylval;
725 #ifdef YYLSP_NEEDED
726   *++yylsp = yylloc;
727 #endif
728
729   /* count tokens shifted since error; after three, turn off error status.  */
730   if (yyerrstatus) yyerrstatus--;
731
732   yystate = yyn;
733   goto yynewstate;
734
735 /* Do the default action for the current state.  */
736 yydefault:
737
738   yyn = yydefact[yystate];
739   if (yyn == 0)
740     goto yyerrlab;
741
742 /* Do a reduction.  yyn is the number of a rule to reduce with.  */
743 yyreduce:
744   yylen = yyr2[yyn];
745   if (yylen > 0)
746     yyval = yyvsp[1-yylen]; /* implement default value of the action */
747
748 #if YYDEBUG != 0
749   if (yydebug)
750     {
751       int i;
752
753       fprintf (stderr, "Reducing via rule %d (line %d), ",
754                yyn, yyrline[yyn]);
755
756       /* Print the symbols being reduced, and their result.  */
757       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
758         fprintf (stderr, "%s ", yytname[yyrhs[i]]);
759       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
760     }
761 #endif
762
763
764   switch (yyn) {
765
766 case 1:
767 #line 139 "signature.y"
768 { lslOpList_free (yyvsp[0].operators); ;
769     break;}
770 case 2:
771 #line 142 "signature.y"
772 { lslOpList x = lslOpList_new ();
773                 g_importedlslOp = yyvsp[0].operator;
774                 lslOpList_add (x, yyvsp[0].operator);
775                 yyval.operators = x; ;
776     break;}
777 case 3:
778 #line 147 "signature.y"
779 { lslOpList_add (yyvsp[-1].operators, yyvsp[0].operator);
780                 yyval.operators = yyvsp[-1].operators; ;
781     break;}
782 case 4:
783 #line 151 "signature.y"
784 { yyval.operator = makelslOpNode (yyvsp[-2].name, yyvsp[0].signature); ;
785     break;}
786 case 5:
787 #line 157 "signature.y"
788 { yyval.name = makeNameNodeId (yyvsp[0].ltok); ;
789     break;}
790 case 6:
791 #line 159 "signature.y"
792 { yyval.name = makeNameNodeForm (yyvsp[0].opform); ;
793     break;}
794 case 7:
795 #line 163 "signature.y"
796 { yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;
797     break;}
798 case 8:
799 #line 165 "signature.y"
800 { yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
801     break;}
802 case 9:
803 #line 167 "signature.y"
804 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
805     break;}
806 case 10:
807 #line 169 "signature.y"
808 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
809     break;}
810 case 11:
811 #line 171 "signature.y"
812 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
813     break;}
814 case 12:
815 #line 173 "signature.y"
816 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
817     break;}
818 case 13:
819 #line 175 "signature.y"
820 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
821     break;}
822 case 14:
823 #line 177 "signature.y"
824 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
825     break;}
826 case 15:
827 #line 179 "signature.y"
828 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM, 
829                               opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
830     break;}
831 case 16:
832 #line 182 "signature.y"
833 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE, 
834                               opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
835     break;}
836 case 17:
837 #line 185 "signature.y"
838 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE, 
839                               opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
840     break;}
841 case 18:
842 #line 188 "signature.y"
843 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM, 
844                             opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
845     break;}
846 case 19:
847 #line 191 "signature.y"
848 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM, 
849                             opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
850     break;}
851 case 20:
852 #line 194 "signature.y"
853 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT, 
854                             opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
855     break;}
856 case 21:
857 #line 197 "signature.y"
858 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT, 
859                             opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
860     break;}
861 case 22:
862 #line 202 "signature.y"
863 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP, 
864                             opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
865     break;}
866 case 23:
867 #line 207 "signature.y"
868 { yyval.ltok = yyvsp[0].ltok; ;
869     break;}
870 case 24:
871 #line 209 "signature.y"
872 { yyval.ltok = yyvsp[0].ltok; ;
873     break;}
874 case 25:
875 #line 211 "signature.y"
876 { yyval.ltok = yyvsp[0].ltok; ;
877     break;}
878 case 26:
879 #line 214 "signature.y"
880 { yyval.count = 0; ;
881     break;}
882 case 27:
883 #line 216 "signature.y"
884 { yyval.count = yyvsp[0].count; ;
885     break;}
886 case 28:
887 #line 219 "signature.y"
888 { yyval.count = 1; ;
889     break;}
890 case 29:
891 #line 221 "signature.y"
892 { yyval.count = yyvsp[-2].count + 1; ;
893     break;}
894 case 30:
895 #line 224 "signature.y"
896 { yyval.ltok = yyvsp[0].ltok; ;
897     break;}
898 case 31:
899 #line 226 "signature.y"
900 { yyval.ltok = yyvsp[0].ltok; ;
901     break;}
902 case 32:
903 #line 229 "signature.y"
904 { yyval.signature = makesigNode (yyvsp[-1].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
905     break;}
906 case 33:
907 #line 232 "signature.y"
908 { yyval.ltokenList = ltokenList_new (); ;
909     break;}
910 case 34:
911 #line 234 "signature.y"
912 { yyval.ltokenList = yyvsp[0].ltokenList; ;
913     break;}
914 case 35:
915 #line 237 "signature.y"
916 { yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
917     break;}
918 case 36:
919 #line 239 "signature.y"
920 { yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
921     break;}
922 case 37:
923 #line 242 "signature.y"
924
925           yyval.ltok = yyvsp[0].ltok; 
926           ltoken_setText (yyval.ltok, processTraitSortId (ltoken_getText (yyvsp[0].ltok))); 
927         ;
928     break;}
929 case 38:
930 #line 248 "signature.y"
931 { yyval.ltok = yyvsp[0].ltok; ;
932     break;}
933 }
934    /* the action file gets copied in in place of this dollarsign */
935 #line 498 "/usr/lib/bison.simple"
936 \f
937   yyvsp -= yylen;
938   yyssp -= yylen;
939 #ifdef YYLSP_NEEDED
940   yylsp -= yylen;
941 #endif
942
943 #if YYDEBUG != 0
944   if (yydebug)
945     {
946       short *ssp1 = yyss - 1;
947       fprintf (stderr, "state stack now");
948       while (ssp1 != yyssp)
949         fprintf (stderr, " %d", *++ssp1);
950       fprintf (stderr, "\n");
951     }
952 #endif
953
954   *++yyvsp = yyval;
955
956 #ifdef YYLSP_NEEDED
957   yylsp++;
958   if (yylen == 0)
959     {
960       yylsp->first_line = yylloc.first_line;
961       yylsp->first_column = yylloc.first_column;
962       yylsp->last_line = (yylsp-1)->last_line;
963       yylsp->last_column = (yylsp-1)->last_column;
964       yylsp->text = 0;
965     }
966   else
967     {
968       yylsp->last_line = (yylsp+yylen-1)->last_line;
969       yylsp->last_column = (yylsp+yylen-1)->last_column;
970     }
971 #endif
972
973   /* Now "shift" the result of the reduction.
974      Determine what state that goes to,
975      based on the state we popped back to
976      and the rule number reduced by.  */
977
978   yyn = yyr1[yyn];
979
980   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
981   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
982     yystate = yytable[yystate];
983   else
984     yystate = yydefgoto[yyn - YYNTBASE];
985
986   goto yynewstate;
987
988 yyerrlab:   /* here on detecting error */
989
990   if (! yyerrstatus)
991     /* If not already recovering from an error, report this error.  */
992     {
993       ++yynerrs;
994
995 #ifdef YYERROR_VERBOSE
996       yyn = yypact[yystate];
997
998       if (yyn > YYFLAG && yyn < YYLAST)
999         {
1000           int size = 0;
1001           char *msg;
1002           int x, count;
1003
1004           count = 0;
1005           /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
1006           for (x = (yyn < 0 ? -yyn : 0);
1007                x < (sizeof(yytname) / sizeof(char *)); x++)
1008             if (yycheck[x + yyn] == x)
1009               size += strlen(yytname[x]) + 15, count++;
1010           msg = (char *) malloc(size + 15);
1011           if (msg != 0)
1012             {
1013               strcpy(msg, "parse error");
1014
1015               if (count < 5)
1016                 {
1017                   count = 0;
1018                   for (x = (yyn < 0 ? -yyn : 0);
1019                        x < (sizeof(yytname) / sizeof(char *)); x++)
1020                     if (yycheck[x + yyn] == x)
1021                       {
1022                         strcat(msg, count == 0 ? ", expecting `" : " or `");
1023                         strcat(msg, yytname[x]);
1024                         strcat(msg, "'");
1025                         count++;
1026                       }
1027                 }
1028               yyerror(msg);
1029               free(msg);
1030             }
1031           else
1032             yyerror ("parse error; also virtual memory exceeded");
1033         }
1034       else
1035 #endif /* YYERROR_VERBOSE */
1036         yyerror("parse error");
1037     }
1038
1039   goto yyerrlab1;
1040 yyerrlab1:   /* here on error raised explicitly by an action */
1041
1042   if (yyerrstatus == 3)
1043     {
1044       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
1045
1046       /* return failure if at end of input */
1047       if (yychar == YYEOF)
1048         YYABORT;
1049
1050 #if YYDEBUG != 0
1051       if (yydebug)
1052         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1053 #endif
1054
1055       yychar = YYEMPTY;
1056     }
1057
1058   /* Else will try to reuse lookahead token
1059      after shifting the error token.  */
1060
1061   yyerrstatus = 3;              /* Each real token shifted decrements this */
1062
1063   goto yyerrhandle;
1064
1065 yyerrdefault:  /* current state does not do anything special for the error token. */
1066
1067 #if 0
1068   /* This is wrong; only states that explicitly want error tokens
1069      should shift them.  */
1070   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
1071   if (yyn) goto yydefault;
1072 #endif
1073
1074 yyerrpop:   /* pop the current state because it cannot handle the error token */
1075
1076   if (yyssp == yyss) YYABORT;
1077   yyvsp--;
1078   yystate = *--yyssp;
1079 #ifdef YYLSP_NEEDED
1080   yylsp--;
1081 #endif
1082
1083 #if YYDEBUG != 0
1084   if (yydebug)
1085     {
1086       short *ssp1 = yyss - 1;
1087       fprintf (stderr, "Error: state stack now");
1088       while (ssp1 != yyssp)
1089         fprintf (stderr, " %d", *++ssp1);
1090       fprintf (stderr, "\n");
1091     }
1092 #endif
1093
1094 yyerrhandle:
1095
1096   yyn = yypact[yystate];
1097   if (yyn == YYFLAG)
1098     goto yyerrdefault;
1099
1100   yyn += YYTERROR;
1101   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1102     goto yyerrdefault;
1103
1104   yyn = yytable[yyn];
1105   if (yyn < 0)
1106     {
1107       if (yyn == YYFLAG)
1108         goto yyerrpop;
1109       yyn = -yyn;
1110       goto yyreduce;
1111     }
1112   else if (yyn == 0)
1113     goto yyerrpop;
1114
1115   if (yyn == YYFINAL)
1116     YYACCEPT;
1117
1118 #if YYDEBUG != 0
1119   if (yydebug)
1120     fprintf(stderr, "Shifting error token, ");
1121 #endif
1122
1123   *++yyvsp = yylval;
1124 #ifdef YYLSP_NEEDED
1125   *++yylsp = yylloc;
1126 #endif
1127
1128   yystate = yyn;
1129   goto yynewstate;
1130 }
1131 #line 249 "signature.y"
1132
1133
1134 # include "bison.reset"
1135
1136 extern char *yytext;
1137
1138 void lslerror (char *s) 
1139 {
1140   lclplainerror (message ("An error has occurred in parsing LSL signature: %s", 
1141                           cstring_fromChars (s)));
1142 }
1143
1144 static void yyprint (FILE *file, int type, YYSTYPE value)
1145 {
1146   fprintf (file, " (%u:%u type: %d; text: %s) ", 
1147            ltoken_getLine (value.ltok), 
1148            ltoken_getCol (value.ltok), 
1149            type, 
1150            ltoken_getRawTextChars (value.ltok));
1151 }
1152
1153 extern void PrintToken (ltoken tok) {
1154   char *codStr;
1155   
1156   switch (ltoken_getCode (tok)) 
1157     {
1158     case NOTTOKEN:          codStr = "*** NOTTOKEN ***"; break;
1159     case LST_QUANTIFIERSYM: codStr = "QUANTIFIERSYM"; break;
1160     case LST_LOGICALOP:     codStr = "LOGICALOP: "; break; 
1161     case LST_SELECTSYM:     codStr = "LST_SELECTSYM"; break;
1162     case LST_OPENSYM:       codStr = "LST_OPENSYM"; break;
1163     case LST_SEPSYM:        codStr = "SEPSYM"; break;
1164     case LST_CLOSESYM:      codStr = "LST_CLOSESYM"; break;
1165     case LST_SIMPLEID:      codStr = "LST_SIMPLEID"; break;
1166     case LST_MAPSYM:        codStr = "MAPSYM"; break;
1167     case LST_MARKERSYM:     codStr = "LST_MARKERSYM"; break;
1168     case LST_COMMENTSYM:    codStr = "COMMENTSYM"; break;
1169     case LST_SIMPLEOP:      codStr = "SIMPLEOP"; break;
1170     case LST_COLON:         codStr = "LST_COLON"; break;
1171     case LST_COMMA:         codStr = "COMMA"; break;
1172     case LST_LBRACKET:      codStr = "LST_LBRACKET"; break;
1173     case LST_LPAR:          codStr = "LST_LPAR"; break;
1174     case LST_RBRACKET:      codStr = "LST_RBRACKET"; break;
1175     case LST_RPAR:          codStr = "LST_RPAR"; break;
1176     case LST_EQOP:          codStr = "LST_EQOP"; break;
1177     case LST_WHITESPACE:    codStr = "WHITESPACE,"; break;
1178     case LST_EOL:           codStr = "LST_EOL"; break;
1179     case LST_elseTOKEN:     codStr = "elseTOKEN"; break;
1180     case LST_ifTOKEN:       codStr = "ifTOKEN"; break;
1181     case LST_thenTOKEN:     codStr = "thenTOKEN"; break;
1182     case LST_BADTOKEN:      codStr = "*** BADTOKEN ***"; break;
1183     case LEOFTOKEN: /* can't reach LEOFTOKEN easily */
1184       codStr = "LEOFTOKEN"; break;
1185     default:
1186       codStr = "*** invalid token code ***";
1187       break;
1188     } /* end switch */
1189   
1190   /* only used for debugging */
1191   printf ("%u:%u: Token Code (%u): %s",
1192           ltoken_getLine (tok), ltoken_getCol (tok), 
1193           ltoken_getCode (tok), codStr);
1194   if (ltoken_getRawText (tok) != 0) 
1195     {
1196       printf (", Token String (%lu): %s\n", 
1197               ltoken_getRawText (tok), ltoken_getRawTextChars (tok));
1198     }
1199   else printf ("\n");
1200 }
1201
1202
1203
1204
This page took 0.132656 seconds and 5 git commands to generate.