2 ** Inserted at beginning of c files generated by bison
3 ** REMEMBER: Change bison.reset too.
42 /*@-unqualifiedtrans@*/
49 /*drl added 11/27/2001*/
51 /* < end of bison.head > */
53 /* A Bison parser, made from signature.y
56 #define YYBISON 1 /* Identify Bison output. */
58 #define yyparse lslparse
60 #define yyerror lslerror
61 #define yylval lsllval
62 #define yychar lslchar
63 #define yydebug lsldebug
64 #define yynerrs lslnerrs
65 # define LST_SIMPLEID 257
66 # define LST_LOGICALOP 258
68 # define LST_SIMPLEOP 260
69 # define LST_MAPSYM 261
70 # define LST_FIELDMAPSYM 262
71 # define LST_MARKERSYM 263
72 # define LST_ifTOKEN 264
73 # define LST_thenTOKEN 265
74 # define LST_elseTOKEN 266
75 # define LST_LBRACKET 267
76 # define LST_RBRACKET 268
77 # define LST_SELECTSYM 269
78 # define LST_SEPSYM 270
79 # define LST_OPENSYM 271
80 # define LST_CLOSESYM 272
81 # define LST_COLON 273
82 # define LST_COMMA 274
84 # define LST_COMMENTSYM 276
85 # define LST_WHITESPACE 277
86 # define LST_QUANTIFIERSYM 278
87 # define LST_EQUATIONSYM 279
88 # define LST_EQSEPSYM 280
89 # define LST_COMPOSESYM 281
92 # define LST_assertsTOKEN 284
93 # define LST_assumesTOKEN 285
94 # define LST_byTOKEN 286
95 # define LST_convertsTOKEN 287
96 # define LST_enumerationTOKEN 288
97 # define LST_equationsTOKEN 289
98 # define LST_exemptingTOKEN 290
99 # define LST_forTOKEN 291
100 # define LST_generatedTOKEN 292
101 # define LST_impliesTOKEN 293
102 # define LST_includesTOKEN 294
103 # define LST_introducesTOKEN 295
104 # define LST_ofTOKEN 296
105 # define LST_partitionedTOKEN 297
106 # define LST_traitTOKEN 298
107 # define LST_tupleTOKEN 299
108 # define LST_unionTOKEN 300
109 # define LST_BADTOKEN 301
114 # include "splintMacros.nf"
115 # include "llbasic.h"
116 # include "lslparse.h"
117 # include "signature.h"
119 static void lslerror (char *);
120 extern int lsllex ();
122 /*@dependent@*/ /*@null@*/ lslOp importedlslOp;
124 /*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
125 static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
128 # define YYPRINT(file, type, value) yyprint (file, type, value)
139 ltoken ltok; /* a leaf is also an ltoken */
141 /*@only@*/ ltokenList ltokenList;
142 /*@only@*/ opFormNode opform;
143 /*@owned@*/ sigNode signature;
144 /*@only@*/ nameNode name;
145 /*@owned@*/ lslOp operator;
146 /*@only@*/ lslOpList operators;
147 /*@-redef@*/ /*@-matchfields@*/
149 # define YYSTYPE yystype
150 # define YYSTYPE_IS_TRIVIAL 1
159 #define YYFLAG -32768
162 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
163 #define YYTRANSLATE(x) ((unsigned)(x) <= 301 ? yytranslate[x] : 62)
165 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
166 static const char yytranslate[] =
168 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
169 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
170 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
171 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
172 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
173 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
174 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
175 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
176 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
177 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
178 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
179 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
180 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
181 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
182 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
183 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
184 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
185 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
186 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
187 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
188 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
189 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
190 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
191 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
192 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
193 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
194 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
195 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
196 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
197 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
202 static const short yyprhs[] =
204 0, 0, 2, 4, 7, 11, 13, 15, 22, 24,
205 27, 30, 34, 38, 43, 48, 54, 58, 63, 68,
206 74, 77, 81, 85, 87, 89, 91, 92, 94, 96,
207 100, 102, 104, 108, 109, 111, 113, 117, 119
209 static const short yyrhs[] =
211 49, 0, 50, 0, 49, 50, 0, 51, 19, 57,
212 0, 61, 0, 52, 0, 10, 9, 11, 9, 12,
213 9, 0, 53, 0, 9, 53, 0, 53, 9, 0,
214 9, 53, 9, 0, 17, 54, 18, 0, 9, 17,
215 54, 18, 0, 17, 54, 18, 9, 0, 9, 17,
216 54, 18, 9, 0, 13, 54, 14, 0, 9, 13,
217 54, 14, 0, 13, 54, 14, 9, 0, 9, 13,
218 54, 14, 9, 0, 15, 3, 0, 9, 15, 3,
219 0, 9, 8, 3, 0, 6, 0, 4, 0, 5,
220 0, 0, 55, 0, 9, 0, 55, 56, 9, 0,
221 20, 0, 16, 0, 58, 7, 60, 0, 0, 59,
222 0, 60, 0, 59, 20, 60, 0, 3, 0, 3,
229 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
230 static const short yyrline[] =
232 0, 139, 141, 146, 150, 156, 158, 162, 164, 166,
233 168, 170, 172, 174, 176, 178, 181, 184, 187, 190,
234 193, 196, 201, 206, 208, 210, 213, 215, 218, 220,
235 223, 225, 228, 231, 233, 236, 238, 241, 247
240 #if (YYDEBUG) || defined YYERROR_VERBOSE
242 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
243 static const char *const yytname[] =
245 "$", "error", "$undefined.", "LST_SIMPLEID", "LST_LOGICALOP", "LST_EQOP",
246 "LST_SIMPLEOP", "LST_MAPSYM", "LST_FIELDMAPSYM", "LST_MARKERSYM",
247 "LST_ifTOKEN", "LST_thenTOKEN", "LST_elseTOKEN", "LST_LBRACKET",
248 "LST_RBRACKET", "LST_SELECTSYM", "LST_SEPSYM", "LST_OPENSYM",
249 "LST_CLOSESYM", "LST_COLON", "LST_COMMA", "LST_EOL", "LST_COMMENTSYM",
250 "LST_WHITESPACE", "LST_QUANTIFIERSYM", "LST_EQUATIONSYM",
251 "LST_EQSEPSYM", "LST_COMPOSESYM", "LST_LPAR", "LST_RPAR",
252 "LST_assertsTOKEN", "LST_assumesTOKEN", "LST_byTOKEN",
253 "LST_convertsTOKEN", "LST_enumerationTOKEN", "LST_equationsTOKEN",
254 "LST_exemptingTOKEN", "LST_forTOKEN", "LST_generatedTOKEN",
255 "LST_impliesTOKEN", "LST_includesTOKEN", "LST_introducesTOKEN",
256 "LST_ofTOKEN", "LST_partitionedTOKEN", "LST_traitTOKEN",
257 "LST_tupleTOKEN", "LST_unionTOKEN", "LST_BADTOKEN", "top",
258 "operatorList", "operator", "name", "opForm", "anyOp", "middle",
259 "placeList", "separator", "signature", "domain", "sortList", "sortId",
264 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
265 static const short yyr1[] =
267 0, 48, 49, 49, 50, 51, 51, 52, 52, 52,
268 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
269 52, 52, 52, 53, 53, 53, 54, 54, 55, 55,
270 56, 56, 57, 58, 58, 59, 59, 60, 61
273 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
274 static const short yyr2[] =
276 0, 1, 1, 2, 3, 1, 1, 6, 1, 2,
277 2, 3, 3, 4, 4, 5, 3, 4, 4, 5,
278 2, 3, 3, 1, 1, 1, 0, 1, 1, 3,
279 1, 1, 3, 0, 1, 1, 3, 1, 1
282 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
283 doesn't specify something else to do. Zero means the default is an
285 static const short yydefact[] =
287 0, 38, 24, 25, 23, 0, 0, 26, 0, 26,
288 1, 2, 0, 6, 8, 5, 0, 26, 0, 26,
289 9, 0, 28, 0, 27, 20, 0, 3, 33, 10,
290 22, 0, 21, 0, 11, 0, 16, 31, 30, 0,
291 12, 37, 4, 0, 34, 35, 17, 13, 0, 18,
292 29, 14, 0, 0, 19, 15, 0, 32, 36, 7,
296 static const short yydefgoto[] =
298 60, 10, 11, 12, 13, 14, 23, 24, 39, 42,
302 static const short yypact[] =
304 -3,-32768,-32768,-32768,-32768, 11, -4, 0, 8, 0,
305 -3,-32768, -1,-32768, 13,-32768, 17, 0, 22, 0,
306 18, 20,-32768, 19, -12,-32768, 14,-32768, 31,-32768,
307 -32768, 21,-32768, 23,-32768, 27, 28,-32768,-32768, 29,
308 30,-32768,-32768, 33, 24,-32768, 34, 36, 35,-32768,
309 -32768,-32768, 31, 31,-32768,-32768, 37,-32768,-32768,-32768,
313 static const short yypgoto[] =
315 -32768,-32768, 39,-32768,-32768, 45, 4,-32768,-32768,-32768,
316 -32768,-32768, -23,-32768
323 static const short yytable[] =
325 1, 2, 3, 4, 37, 21, 5, 6, 38, 22,
326 7, 25, 8, 26, 9, 2, 3, 4, 28, 16,
327 30, 31, 29, 33, 17, 32, 18, 34, 19, 57,
328 58, 35, 40, 36, 41, 46, 48, 49, 50, 51,
329 52, 47, 61, 54, 53, 55, 59, 56, 62, 27,
333 static const short yycheck[] =
335 3, 4, 5, 6, 16, 9, 9, 10, 20, 9,
336 13, 3, 15, 9, 17, 4, 5, 6, 19, 8,
337 3, 17, 9, 19, 13, 3, 15, 9, 17, 52,
338 53, 11, 18, 14, 3, 14, 9, 9, 9, 9,
339 7, 18, 0, 9, 20, 9, 9, 12, 0, 10,
344 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
346 /* Skeleton output parser for bison,
348 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
351 This program is free software; you can redistribute it and/or modify
352 it under the terms of the GNU General Public License as published by
353 the Free Software Foundation; either version 2, or (at your option)
356 This program is distributed in the hope that it will be useful,
357 but WITHOUT ANY WARRANTY; without even the implied warranty of
358 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
359 GNU General Public License for more details.
361 You should have received a copy of the GNU General Public License
362 along with this program; if not, write to the Free Software
363 Foundation, Inc., 59 Temple Place - Suite 330,
364 Boston, MA 02111-1307, USA. */
366 /* As a special exception, when this file is copied by Bison into a
367 Bison output file, you may use that output file without restriction.
368 This special exception was added by the Free Software Foundation
369 in version 1.24 of Bison. */
371 /* This is the parser code that is written into each bison parser when
372 the %semantic_parser declaration is not specified in the grammar.
373 It was written by Richard Stallman by simplifying the hairy parser
374 used when %semantic_parser is specified. */
376 /* All symbols defined below should begin with yy or YY, to avoid
377 infringing on user name space. This should be done even for local
378 variables, as they might otherwise be expanded by user macros.
379 There are some unavoidable exceptions within include files to
380 define necessary library symbols; they are noted "INFRINGES ON
381 USER NAME SPACE" below. */
383 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
385 /* The parser invokes alloca or malloc; define the necessary symbols. */
387 # if YYSTACK_USE_ALLOCA
388 # define YYSTACK_ALLOC alloca
390 # ifndef YYSTACK_USE_ALLOCA
391 # if defined (alloca) || defined (_ALLOCA_H)
392 # define YYSTACK_ALLOC alloca
395 # define YYSTACK_ALLOC __builtin_alloca
401 # ifdef YYSTACK_ALLOC
402 /* Pacify GCC's `empty if-body' warning. */
403 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
405 # if defined (__STDC__) || defined (__cplusplus)
406 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
407 # define YYSIZE_T size_t
409 # define YYSTACK_ALLOC malloc
410 # define YYSTACK_FREE free
412 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
415 #if (! defined (yyoverflow) \
416 && (! defined (__cplusplus) \
417 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
419 /* A type that is properly aligned for any stack member. */
429 /* The size of the maximum gap between one aligned stack and the next. */
430 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
432 /* The size of an array large to enough to hold all stacks, each with
435 # define YYSTACK_BYTES(N) \
436 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
437 + 2 * YYSTACK_GAP_MAX)
439 # define YYSTACK_BYTES(N) \
440 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
444 /* Copy COUNT objects from FROM to TO. The source and destination do
448 # define YYCOPY(To, From, Count) \
449 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
451 # define YYCOPY(To, From, Count) \
454 register YYSIZE_T yyi; \
455 for (yyi = 0; yyi < (Count); yyi++) \
456 (To)[yyi] = (From)[yyi]; \
462 /* Relocate STACK from its old location to the new one. The
463 local variables YYSIZE and YYSTACKSIZE give the old and new number of
464 elements in the stack, and YYPTR gives the new location of the
465 stack. Advance YYPTR to a properly aligned location for the next
467 # define YYSTACK_RELOCATE(Stack) \
470 YYSIZE_T yynewbytes; \
471 YYCOPY (&yyptr->Stack, Stack, yysize); \
472 Stack = &yyptr->Stack; \
473 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
474 yyptr += yynewbytes / sizeof (*yyptr); \
481 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
482 # define YYSIZE_T __SIZE_TYPE__
484 #if ! defined (YYSIZE_T) && defined (size_t)
485 # define YYSIZE_T size_t
487 #if ! defined (YYSIZE_T)
488 # if defined (__STDC__) || defined (__cplusplus)
489 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
490 # define YYSIZE_T size_t
493 #if ! defined (YYSIZE_T)
494 # define YYSIZE_T unsigned int
497 #define yyerrok (yyerrstatus = 0)
498 #define yyclearin (yychar = YYEMPTY)
501 #define YYACCEPT goto yyacceptlab
502 #define YYABORT goto yyabortlab
503 #define YYERROR goto yyerrlab1
504 /* Like YYERROR except do call yyerror. This remains here temporarily
505 to ease the transition to the new meaning of YYERROR, for GCC.
506 Once GCC version 2 has supplanted version 1, this can go. */
507 #define YYFAIL goto yyerrlab
508 #define YYRECOVERING() (!!yyerrstatus)
509 #define YYBACKUP(Token, Value) \
511 if (yychar == YYEMPTY && yylen == 1) \
515 yychar1 = YYTRANSLATE (yychar); \
521 yyerror ("syntax error: cannot back up"); \
527 #define YYERRCODE 256
530 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
533 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
534 first token. By default, to implement support for ranges, extend
535 its range to the last symbol. */
537 #ifndef YYLLOC_DEFAULT
538 # define YYLLOC_DEFAULT(Current, Rhs, N) \
539 Current.last_line = Rhs[N].last_line; \
540 Current.last_column = Rhs[N].last_column;
544 /* YYLEX -- calling `yylex' with the right arguments. */
549 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
551 # define YYLEX yylex (&yylval, &yylloc)
553 # else /* !YYLSP_NEEDED */
555 # define YYLEX yylex (&yylval, YYLEX_PARAM)
557 # define YYLEX yylex (&yylval)
559 # endif /* !YYLSP_NEEDED */
561 # define YYLEX yylex ()
565 /* Enable debugging if requested. */
569 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
570 # define YYFPRINTF fprintf
573 # define YYDPRINTF(Args) \
578 /* Nonzero means print parse trace. It is left uninitialized so that
579 multiple parsers can coexist. */
582 # define YYDPRINTF(Args)
583 #endif /* !YYDEBUG */
585 /* YYINITDEPTH -- initial size of the parser's stacks. */
587 # define YYINITDEPTH 200
590 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
591 if the built-in stack extension method is used).
593 Do not make this value too large; the results are undefined if
594 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
595 evaluated with infinite-precision integer arithmetic. */
602 # define YYMAXDEPTH 10000
605 #ifdef YYERROR_VERBOSE
608 # if defined (__GLIBC__) && defined (_STRING_H)
609 # define yystrlen strlen
611 /* Return the length of YYSTR. */
613 # if defined (__STDC__) || defined (__cplusplus)
614 yystrlen (const char *yystr)
620 register const char *yys = yystr;
622 while (*yys++ != '\0')
625 return yys - yystr - 1;
631 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
632 # define yystpcpy stpcpy
634 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
637 # if defined (__STDC__) || defined (__cplusplus)
638 yystpcpy (char *yydest, const char *yysrc)
640 yystpcpy (yydest, yysrc)
645 register char *yyd = yydest;
646 register const char *yys = yysrc;
648 while ((*yyd++ = *yys++) != '\0')
659 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
660 into yyparse. The argument should have type void *.
661 It should actually point to an object.
662 Grammar actions can access the variable by casting it
663 to the proper pointer type. */
666 # if defined (__STDC__) || defined (__cplusplus)
667 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
668 # define YYPARSE_PARAM_DECL
670 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
671 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
673 #else /* !YYPARSE_PARAM */
674 # define YYPARSE_PARAM_ARG
675 # define YYPARSE_PARAM_DECL
676 #endif /* !YYPARSE_PARAM */
678 /* Prevent warning if -Wstrict-prototypes. */
680 # ifdef YYPARSE_PARAM
681 int yyparse (void *);
687 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
688 variables are global, or local to YYPARSE. */
690 #define YY_DECL_NON_LSP_VARIABLES \
691 /* The lookahead symbol. */ \
694 /* The semantic value of the lookahead symbol. */ \
697 /* Number of parse errors so far. */ \
701 # define YY_DECL_VARIABLES \
702 YY_DECL_NON_LSP_VARIABLES \
704 /* Location data for the lookahead symbol. */ \
707 # define YY_DECL_VARIABLES \
708 YY_DECL_NON_LSP_VARIABLES
712 /* If nonreentrant, generate the variables here. */
719 yyparse (YYPARSE_PARAM_ARG)
722 /* If reentrant, generate the variables here. */
727 register int yystate;
730 /* Number of tokens to shift before error messages enabled. */
732 /* Lookahead token as an internal (translated) token number. */
735 /* Three stacks and their tools:
736 `yyss': related to states,
737 `yyvs': related to semantic values,
738 `yyls': related to locations.
740 Refer to the stacks thru separate pointers, to allow yyoverflow
741 to reallocate them elsewhere. */
743 /* The state stack. */
744 short yyssa[YYINITDEPTH];
746 register short *yyssp;
748 /* The semantic value stack. */
749 YYSTYPE yyvsa[YYINITDEPTH];
750 YYSTYPE *yyvs = yyvsa;
751 register YYSTYPE *yyvsp;
754 /* The location stack. */
755 YYLTYPE yylsa[YYINITDEPTH];
756 YYLTYPE *yyls = yylsa;
761 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
763 # define YYPOPSTACK (yyvsp--, yyssp--)
766 YYSIZE_T yystacksize = YYINITDEPTH;
769 /* The variables used to return semantic value and location from the
776 /* When reducing, the number of symbols on the RHS of the reduced
780 YYDPRINTF ((stderr, "Starting parse\n"));
785 yychar = YYEMPTY; /* Cause a token to be read. */
787 /* Initialize stack pointers.
788 Waste one element of value and location stack
789 so that they stay on the same level as the state stack.
790 The wasted elements are never initialized. */
799 /*------------------------------------------------------------.
800 | yynewstate -- Push a new state, which is found in yystate. |
801 `------------------------------------------------------------*/
803 /* In all cases, when you get here, the value and location stacks
804 have just been pushed. so pushing a state here evens the stacks.
811 if (yyssp >= yyss + yystacksize - 1)
813 /* Get the current used size of the three stacks, in elements. */
814 YYSIZE_T yysize = yyssp - yyss + 1;
818 /* Give user a chance to reallocate the stack. Use copies of
819 these so that the &'s don't force the real ones into
821 YYSTYPE *yyvs1 = yyvs;
824 /* Each stack pointer address is followed by the size of the
825 data in use in that stack, in bytes. */
827 YYLTYPE *yyls1 = yyls;
828 /* This used to be a conditional around just the two extra args,
829 but that might be undefined if yyoverflow is a macro. */
830 yyoverflow ("parser stack overflow",
831 &yyss1, yysize * sizeof (*yyssp),
832 &yyvs1, yysize * sizeof (*yyvsp),
833 &yyls1, yysize * sizeof (*yylsp),
837 yyoverflow ("parser stack overflow",
838 &yyss1, yysize * sizeof (*yyssp),
839 &yyvs1, yysize * sizeof (*yyvsp),
845 #else /* no yyoverflow */
846 # ifndef YYSTACK_RELOCATE
849 /* Extend the stack our own way. */
850 if (yystacksize >= YYMAXDEPTH)
853 if (yystacksize > YYMAXDEPTH)
854 yystacksize = YYMAXDEPTH;
858 union yyalloc *yyptr =
859 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
862 YYSTACK_RELOCATE (yyss);
863 YYSTACK_RELOCATE (yyvs);
865 YYSTACK_RELOCATE (yyls);
867 # undef YYSTACK_RELOCATE
869 YYSTACK_FREE (yyss1);
872 #endif /* no yyoverflow */
874 yyssp = yyss + yysize - 1;
875 yyvsp = yyvs + yysize - 1;
877 yylsp = yyls + yysize - 1;
880 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
881 (unsigned long int) yystacksize));
883 if (yyssp >= yyss + yystacksize - 1)
887 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
897 /* Do appropriate processing given the current state. */
898 /* Read a lookahead token if we need one and don't already have one. */
901 /* First try to decide what to do without reference to lookahead token. */
903 yyn = yypact[yystate];
907 /* Not known => get a lookahead token if don't already have one. */
909 /* yychar is either YYEMPTY or YYEOF
910 or a valid token in external form. */
912 if (yychar == YYEMPTY)
914 YYDPRINTF ((stderr, "Reading a token: "));
918 /* Convert token to internal form (in yychar1) for indexing tables with */
920 if (yychar <= 0) /* This means end of input. */
923 yychar = YYEOF; /* Don't call YYLEX any more */
925 YYDPRINTF ((stderr, "Now at end of input.\n"));
929 yychar1 = YYTRANSLATE (yychar);
932 /* We have to keep this `#if YYDEBUG', since we use variables
933 which are defined only if `YYDEBUG' is set. */
936 YYFPRINTF (stderr, "Next token is %d (%s",
937 yychar, yytname[yychar1]);
938 /* Give the individual parser a way to print the precise
939 meaning of a token, for further debugging info. */
941 YYPRINT (stderr, yychar, yylval);
943 YYFPRINTF (stderr, ")\n");
949 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
954 /* yyn is what to do for this token type in this state.
955 Negative => reduce, -yyn is rule number.
956 Positive => shift, yyn is new state.
957 New state is final state => don't bother to shift,
959 0, or most negative number => error. */
974 /* Shift the lookahead token. */
975 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
976 yychar, yytname[yychar1]));
978 /* Discard the token being shifted unless it is eof. */
987 /* Count tokens shifted since error; after three, turn off error
996 /*-----------------------------------------------------------.
997 | yydefault -- do the default action for the current state. |
998 `-----------------------------------------------------------*/
1000 yyn = yydefact[yystate];
1006 /*-----------------------------.
1007 | yyreduce -- Do a reduction. |
1008 `-----------------------------*/
1010 /* yyn is the number of a rule to reduce with. */
1013 /* If YYLEN is nonzero, implement the default value of the action:
1016 Otherwise, the following line sets YYVAL to the semantic value of
1017 the lookahead token. This behavior is undocumented and Bison
1018 users should not rely upon it. Assigning to YYVAL
1019 unconditionally makes the parser a bit smaller, and it avoids a
1020 GCC warning that YYVAL may be used uninitialized. */
1021 yyval = yyvsp[1-yylen];
1024 /* Similarly for the default location. Let the user run additional
1025 commands if for instance locations are ranges. */
1026 yyloc = yylsp[1-yylen];
1027 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1031 /* We have to keep this `#if YYDEBUG', since we use variables which
1032 are defined only if `YYDEBUG' is set. */
1037 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1040 /* Print the symbols being reduced, and their result. */
1041 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
1042 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1043 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1050 { lslOpList_free (yyvsp[0].operators); ;
1053 { lslOpList x = lslOpList_new ();
1054 g_importedlslOp = yyvsp[0].operator;
1055 lslOpList_add (x, yyvsp[0].operator);
1056 yyval.operators = x; ;
1059 { lslOpList_add (yyvsp[-1].operators, yyvsp[0].operator);
1060 yyval.operators = yyvsp[-1].operators; ;
1063 { yyval.operator = makelslOpNode (yyvsp[-2].name, yyvsp[0].signature); ;
1066 { yyval.name = makeNameNodeId (yyvsp[0].ltok); ;
1069 { yyval.name = makeNameNodeForm (yyvsp[0].opform); ;
1072 { yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;
1075 { yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1078 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1081 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
1084 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
1087 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1090 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1093 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1096 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM,
1097 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1100 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE,
1101 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1104 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE,
1105 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1108 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM,
1109 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1112 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM,
1113 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1116 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT,
1117 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1120 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT,
1121 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1124 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP,
1125 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1128 { yyval.ltok = yyvsp[0].ltok; ;
1131 { yyval.ltok = yyvsp[0].ltok; ;
1134 { yyval.ltok = yyvsp[0].ltok; ;
1137 { yyval.count = 0; ;
1140 { yyval.count = yyvsp[0].count; ;
1143 { yyval.count = 1; ;
1146 { yyval.count = yyvsp[-2].count + 1; ;
1149 { yyval.ltok = yyvsp[0].ltok; ;
1152 { yyval.ltok = yyvsp[0].ltok; ;
1155 { yyval.signature = makesigNode (yyvsp[-1].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
1158 { yyval.ltokenList = ltokenList_new (); ;
1161 { yyval.ltokenList = yyvsp[0].ltokenList; ;
1164 { yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
1167 { yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
1171 yyval.ltok = yyvsp[0].ltok;
1172 ltoken_setText (yyval.ltok, processTraitSortId (ltoken_getText (yyvsp[0].ltok)));
1176 { yyval.ltok = yyvsp[0].ltok; ;
1191 short *yyssp1 = yyss - 1;
1192 YYFPRINTF (stderr, "state stack now");
1193 while (yyssp1 != yyssp)
1194 YYFPRINTF (stderr, " %d", *++yyssp1);
1195 YYFPRINTF (stderr, "\n");
1204 /* Now `shift' the result of the reduction. Determine what state
1205 that goes to, based on the state we popped back to and the rule
1206 number reduced by. */
1210 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1211 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1212 yystate = yytable[yystate];
1214 yystate = yydefgoto[yyn - YYNTBASE];
1219 /*------------------------------------.
1220 | yyerrlab -- here on detecting error |
1221 `------------------------------------*/
1223 /* If not already recovering from an error, report this error. */
1228 #ifdef YYERROR_VERBOSE
1229 yyn = yypact[yystate];
1231 if (yyn > YYFLAG && yyn < YYLAST)
1233 YYSIZE_T yysize = 0;
1238 /* Start YYX at -YYN if negative to avoid negative indexes in
1240 for (yyx = yyn < 0 ? -yyn : 0;
1241 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1242 if (yycheck[yyx + yyn] == yyx)
1243 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1244 yysize += yystrlen ("parse error, unexpected ") + 1;
1245 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1246 yymsg = (char *) YYSTACK_ALLOC (yysize);
1249 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1250 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1255 for (yyx = yyn < 0 ? -yyn : 0;
1256 yyx < (int) (sizeof (yytname) / sizeof (char *));
1258 if (yycheck[yyx + yyn] == yyx)
1260 const char *yyq = ! yycount ? ", expecting " : " or ";
1261 yyp = yystpcpy (yyp, yyq);
1262 yyp = yystpcpy (yyp, yytname[yyx]);
1267 YYSTACK_FREE (yymsg);
1270 yyerror ("parse error; also virtual memory exhausted");
1273 #endif /* defined (YYERROR_VERBOSE) */
1274 yyerror ("parse error");
1279 /*--------------------------------------------------.
1280 | yyerrlab1 -- error raised explicitly by an action |
1281 `--------------------------------------------------*/
1283 if (yyerrstatus == 3)
1285 /* If just tried and failed to reuse lookahead token after an
1286 error, discard it. */
1288 /* return failure if at end of input */
1289 if (yychar == YYEOF)
1291 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1292 yychar, yytname[yychar1]));
1296 /* Else will try to reuse lookahead token after shifting the error
1299 yyerrstatus = 3; /* Each real token shifted decrements this */
1304 /*-------------------------------------------------------------------.
1305 | yyerrdefault -- current state does not do anything special for the |
1307 `-------------------------------------------------------------------*/
1310 /* This is wrong; only states that explicitly want error tokens
1311 should shift them. */
1313 /* If its default is to accept any token, ok. Otherwise pop it. */
1314 yyn = yydefact[yystate];
1320 /*---------------------------------------------------------------.
1321 | yyerrpop -- pop the current state because it cannot handle the |
1323 `---------------------------------------------------------------*/
1336 short *yyssp1 = yyss - 1;
1337 YYFPRINTF (stderr, "Error: state stack now");
1338 while (yyssp1 != yyssp)
1339 YYFPRINTF (stderr, " %d", *++yyssp1);
1340 YYFPRINTF (stderr, "\n");
1348 yyn = yypact[yystate];
1353 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1370 YYDPRINTF ((stderr, "Shifting error token, "));
1381 /*-------------------------------------.
1382 | yyacceptlab -- YYACCEPT comes here. |
1383 `-------------------------------------*/
1388 /*-----------------------------------.
1389 | yyabortlab -- YYABORT comes here. |
1390 `-----------------------------------*/
1395 /*---------------------------------------------.
1396 | yyoverflowab -- parser overflow comes here. |
1397 `---------------------------------------------*/
1399 yyerror ("parser stack overflow");
1406 YYSTACK_FREE (yyss);
1412 # include "bison.reset"
1414 extern char *yytext;
1416 void lslerror (char *s)
1419 (cstring_makeLiteral
1420 ("There has been a problem in the parser with LSL signatures. This is believed to result "
1421 "from a problem with bison v. 1.25. Please try rebuidling Splint "
1422 "using the pre-compiled grammar files by commenting out the "
1423 "BISON= line in the top-level Makefile."));
1426 static void yyprint (FILE *file, int type, YYSTYPE value)
1428 fprintf (file, " (%u:%u type: %d; text: %s) ",
1429 ltoken_getLine (value.ltok),
1430 ltoken_getCol (value.ltok),
1432 ltoken_getRawTextChars (value.ltok));
1435 extern void PrintToken (ltoken tok) {
1438 switch (ltoken_getCode (tok))
1440 case NOTTOKEN: codStr = "*** NOTTOKEN ***"; break;
1441 case LST_QUANTIFIERSYM: codStr = "QUANTIFIERSYM"; break;
1442 case LST_LOGICALOP: codStr = "LOGICALOP: "; break;
1443 case LST_SELECTSYM: codStr = "LST_SELECTSYM"; break;
1444 case LST_OPENSYM: codStr = "LST_OPENSYM"; break;
1445 case LST_SEPSYM: codStr = "SEPSYM"; break;
1446 case LST_CLOSESYM: codStr = "LST_CLOSESYM"; break;
1447 case LST_SIMPLEID: codStr = "LST_SIMPLEID"; break;
1448 case LST_MAPSYM: codStr = "MAPSYM"; break;
1449 case LST_MARKERSYM: codStr = "LST_MARKERSYM"; break;
1450 case LST_COMMENTSYM: codStr = "COMMENTSYM"; break;
1451 case LST_SIMPLEOP: codStr = "SIMPLEOP"; break;
1452 case LST_COLON: codStr = "LST_COLON"; break;
1453 case LST_COMMA: codStr = "COMMA"; break;
1454 case LST_LBRACKET: codStr = "LST_LBRACKET"; break;
1455 case LST_LPAR: codStr = "LST_LPAR"; break;
1456 case LST_RBRACKET: codStr = "LST_RBRACKET"; break;
1457 case LST_RPAR: codStr = "LST_RPAR"; break;
1458 case LST_EQOP: codStr = "LST_EQOP"; break;
1459 case LST_WHITESPACE: codStr = "WHITESPACE,"; break;
1460 case LST_EOL: codStr = "LST_EOL"; break;
1461 case LST_elseTOKEN: codStr = "elseTOKEN"; break;
1462 case LST_ifTOKEN: codStr = "ifTOKEN"; break;
1463 case LST_thenTOKEN: codStr = "thenTOKEN"; break;
1464 case LST_BADTOKEN: codStr = "*** BADTOKEN ***"; break;
1465 case LEOFTOKEN: /* can't reach LEOFTOKEN easily */
1466 codStr = "LEOFTOKEN"; break;
1468 codStr = "*** invalid token code ***";
1472 /* only used for debugging */
1473 printf ("%u:%u: Token Code (%u): %s",
1474 ltoken_getLine (tok), ltoken_getCol (tok),
1475 ltoken_getCode (tok), codStr);
1476 if (ltoken_getRawText (tok) != 0)
1478 printf (", Token String (%lu): %s\n",
1479 ltoken_getRawText (tok), ltoken_getRawTextChars (tok));
1488 ** Resets all flags in bison.head
1510 /*@=evalorderuncon@*/
1519 /*@=elseifcomplete@*/
1523 /*@=readonlytrans@*/
1526 /*@=systemunrecog@*/
1527 /*@=dependenttrans@*/
1528 /*@=unqualifiedtrans@*/
1532 /*drl added 11/27/2001*/