2 ** Inserted at beginning of c files generated by bison
3 ** REMEMBER: Change bison.reset too.
42 /*@-unqualifiedtrans@*/
49 /*drl added 11/27/2001*/
52 /*drl added 12/11/2002*/
55 /* < end of bison.head > */
57 /* A Bison parser, made from signature.y
60 #define YYBISON 1 /* Identify Bison output. */
62 #define yyparse lslparse
64 #define yyerror lslerror
65 #define yylval lsllval
66 #define yychar lslchar
67 #define yydebug lsldebug
68 #define yynerrs lslnerrs
69 # define LST_SIMPLEID 257
70 # define LST_LOGICALOP 258
72 # define LST_SIMPLEOP 260
73 # define LST_MAPSYM 261
74 # define LST_FIELDMAPSYM 262
75 # define LST_MARKERSYM 263
76 # define LST_ifTOKEN 264
77 # define LST_thenTOKEN 265
78 # define LST_elseTOKEN 266
79 # define LST_LBRACKET 267
80 # define LST_RBRACKET 268
81 # define LST_SELECTSYM 269
82 # define LST_SEPSYM 270
83 # define LST_OPENSYM 271
84 # define LST_CLOSESYM 272
85 # define LST_COLON 273
86 # define LST_COMMA 274
88 # define LST_COMMENTSYM 276
89 # define LST_WHITESPACE 277
90 # define LST_QUANTIFIERSYM 278
91 # define LST_EQUATIONSYM 279
92 # define LST_EQSEPSYM 280
93 # define LST_COMPOSESYM 281
96 # define LST_assertsTOKEN 284
97 # define LST_assumesTOKEN 285
98 # define LST_byTOKEN 286
99 # define LST_convertsTOKEN 287
100 # define LST_enumerationTOKEN 288
101 # define LST_equationsTOKEN 289
102 # define LST_exemptingTOKEN 290
103 # define LST_forTOKEN 291
104 # define LST_generatedTOKEN 292
105 # define LST_impliesTOKEN 293
106 # define LST_includesTOKEN 294
107 # define LST_introducesTOKEN 295
108 # define LST_ofTOKEN 296
109 # define LST_partitionedTOKEN 297
110 # define LST_traitTOKEN 298
111 # define LST_tupleTOKEN 299
112 # define LST_unionTOKEN 300
113 # define LST_BADTOKEN 301
118 # include "splintMacros.nf"
119 # include "llbasic.h"
120 # include "lslparse.h"
121 # include "signature.h"
123 static void lslerror (char *);
124 extern int lsllex ();
126 /*@dependent@*/ /*@null@*/ lslOp importedlslOp;
128 /*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
129 static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
132 # define YYPRINT(file, type, value) yyprint (file, type, value)
143 ltoken ltok; /* a leaf is also an ltoken */
145 /*@only@*/ ltokenList ltokenList;
146 /*@only@*/ opFormNode opform;
147 /*@owned@*/ sigNode signature;
148 /*@only@*/ nameNode name;
149 /*@owned@*/ lslOp operator;
150 /*@only@*/ lslOpList operators;
151 /*@-redef@*/ /*@-matchfields@*/
153 # define YYSTYPE yystype
154 # define YYSTYPE_IS_TRIVIAL 1
163 #define YYFLAG -32768
166 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
167 #define YYTRANSLATE(x) ((unsigned)(x) <= 301 ? yytranslate[x] : 62)
169 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
170 static const char yytranslate[] =
172 0, 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, 2, 2, 2, 2,
194 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
195 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
196 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
197 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
198 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
199 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
200 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
201 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
206 static const short yyprhs[] =
208 0, 0, 2, 4, 7, 11, 13, 15, 22, 24,
209 27, 30, 34, 38, 43, 48, 54, 58, 63, 68,
210 74, 77, 81, 85, 87, 89, 91, 92, 94, 96,
211 100, 102, 104, 108, 109, 111, 113, 117, 119
213 static const short yyrhs[] =
215 49, 0, 50, 0, 49, 50, 0, 51, 19, 57,
216 0, 61, 0, 52, 0, 10, 9, 11, 9, 12,
217 9, 0, 53, 0, 9, 53, 0, 53, 9, 0,
218 9, 53, 9, 0, 17, 54, 18, 0, 9, 17,
219 54, 18, 0, 17, 54, 18, 9, 0, 9, 17,
220 54, 18, 9, 0, 13, 54, 14, 0, 9, 13,
221 54, 14, 0, 13, 54, 14, 9, 0, 9, 13,
222 54, 14, 9, 0, 15, 3, 0, 9, 15, 3,
223 0, 9, 8, 3, 0, 6, 0, 4, 0, 5,
224 0, 0, 55, 0, 9, 0, 55, 56, 9, 0,
225 20, 0, 16, 0, 58, 7, 60, 0, 0, 59,
226 0, 60, 0, 59, 20, 60, 0, 3, 0, 3,
233 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
234 static const short yyrline[] =
236 0, 139, 142, 147, 152, 159, 161, 166, 168, 170,
237 172, 174, 176, 178, 180, 182, 185, 188, 191, 194,
238 197, 200, 205, 210, 212, 214, 218, 220, 224, 226,
239 230, 232, 236, 240, 242, 246, 248, 252, 259
244 #if (YYDEBUG) || defined YYERROR_VERBOSE
246 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
247 static const char *const yytname[] =
249 "$", "error", "$undefined.", "LST_SIMPLEID", "LST_LOGICALOP", "LST_EQOP",
250 "LST_SIMPLEOP", "LST_MAPSYM", "LST_FIELDMAPSYM", "LST_MARKERSYM",
251 "LST_ifTOKEN", "LST_thenTOKEN", "LST_elseTOKEN", "LST_LBRACKET",
252 "LST_RBRACKET", "LST_SELECTSYM", "LST_SEPSYM", "LST_OPENSYM",
253 "LST_CLOSESYM", "LST_COLON", "LST_COMMA", "LST_EOL", "LST_COMMENTSYM",
254 "LST_WHITESPACE", "LST_QUANTIFIERSYM", "LST_EQUATIONSYM",
255 "LST_EQSEPSYM", "LST_COMPOSESYM", "LST_LPAR", "LST_RPAR",
256 "LST_assertsTOKEN", "LST_assumesTOKEN", "LST_byTOKEN",
257 "LST_convertsTOKEN", "LST_enumerationTOKEN", "LST_equationsTOKEN",
258 "LST_exemptingTOKEN", "LST_forTOKEN", "LST_generatedTOKEN",
259 "LST_impliesTOKEN", "LST_includesTOKEN", "LST_introducesTOKEN",
260 "LST_ofTOKEN", "LST_partitionedTOKEN", "LST_traitTOKEN",
261 "LST_tupleTOKEN", "LST_unionTOKEN", "LST_BADTOKEN", "top",
262 "operatorList", "operator", "name", "opForm", "anyOp", "middle",
263 "placeList", "separator", "signature", "domain", "sortList", "sortId",
268 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
269 static const short yyr1[] =
271 0, 48, 49, 49, 50, 51, 51, 52, 52, 52,
272 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
273 52, 52, 52, 53, 53, 53, 54, 54, 55, 55,
274 56, 56, 57, 58, 58, 59, 59, 60, 61
277 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
278 static const short yyr2[] =
280 0, 1, 1, 2, 3, 1, 1, 6, 1, 2,
281 2, 3, 3, 4, 4, 5, 3, 4, 4, 5,
282 2, 3, 3, 1, 1, 1, 0, 1, 1, 3,
283 1, 1, 3, 0, 1, 1, 3, 1, 1
286 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
287 doesn't specify something else to do. Zero means the default is an
289 static const short yydefact[] =
291 0, 38, 24, 25, 23, 0, 0, 26, 0, 26,
292 1, 2, 0, 6, 8, 5, 0, 26, 0, 26,
293 9, 0, 28, 0, 27, 20, 0, 3, 33, 10,
294 22, 0, 21, 0, 11, 0, 16, 31, 30, 0,
295 12, 37, 4, 0, 34, 35, 17, 13, 0, 18,
296 29, 14, 0, 0, 19, 15, 0, 32, 36, 7,
300 static const short yydefgoto[] =
302 60, 10, 11, 12, 13, 14, 23, 24, 39, 42,
306 static const short yypact[] =
308 -3,-32768,-32768,-32768,-32768, 11, -4, 0, 8, 0,
309 -3,-32768, -1,-32768, 13,-32768, 17, 0, 22, 0,
310 18, 20,-32768, 19, -12,-32768, 14,-32768, 31,-32768,
311 -32768, 21,-32768, 23,-32768, 27, 28,-32768,-32768, 29,
312 30,-32768,-32768, 33, 24,-32768, 34, 36, 35,-32768,
313 -32768,-32768, 31, 31,-32768,-32768, 37,-32768,-32768,-32768,
317 static const short yypgoto[] =
319 -32768,-32768, 39,-32768,-32768, 45, 4,-32768,-32768,-32768,
320 -32768,-32768, -23,-32768
327 static const short yytable[] =
329 1, 2, 3, 4, 37, 21, 5, 6, 38, 22,
330 7, 25, 8, 26, 9, 2, 3, 4, 28, 16,
331 30, 31, 29, 33, 17, 32, 18, 34, 19, 57,
332 58, 35, 40, 36, 41, 46, 48, 49, 50, 51,
333 52, 47, 61, 54, 53, 55, 59, 56, 62, 27,
337 static const short yycheck[] =
339 3, 4, 5, 6, 16, 9, 9, 10, 20, 9,
340 13, 3, 15, 9, 17, 4, 5, 6, 19, 8,
341 3, 17, 9, 19, 13, 3, 15, 9, 17, 52,
342 53, 11, 18, 14, 3, 14, 9, 9, 9, 9,
343 7, 18, 0, 9, 20, 9, 9, 12, 0, 10,
348 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
350 /* Skeleton output parser for bison,
352 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
355 This program is free software; you can redistribute it and/or modify
356 it under the terms of the GNU General Public License as published by
357 the Free Software Foundation; either version 2, or (at your option)
360 This program is distributed in the hope that it will be useful,
361 but WITHOUT ANY WARRANTY; without even the implied warranty of
362 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
363 GNU General Public License for more details.
365 You should have received a copy of the GNU General Public License
366 along with this program; if not, write to the Free Software
367 Foundation, Inc., 59 Temple Place - Suite 330,
368 Boston, MA 02111-1307, USA. */
370 /* As a special exception, when this file is copied by Bison into a
371 Bison output file, you may use that output file without restriction.
372 This special exception was added by the Free Software Foundation
373 in version 1.24 of Bison. */
375 /* This is the parser code that is written into each bison parser when
376 the %semantic_parser declaration is not specified in the grammar.
377 It was written by Richard Stallman by simplifying the hairy parser
378 used when %semantic_parser is specified. */
380 /* All symbols defined below should begin with yy or YY, to avoid
381 infringing on user name space. This should be done even for local
382 variables, as they might otherwise be expanded by user macros.
383 There are some unavoidable exceptions within include files to
384 define necessary library symbols; they are noted "INFRINGES ON
385 USER NAME SPACE" below. */
387 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
389 /* The parser invokes alloca or malloc; define the necessary symbols. */
391 # if YYSTACK_USE_ALLOCA
392 # define YYSTACK_ALLOC alloca
394 # ifndef YYSTACK_USE_ALLOCA
395 # if defined (alloca) || defined (_ALLOCA_H)
396 # define YYSTACK_ALLOC alloca
399 # define YYSTACK_ALLOC __builtin_alloca
405 # ifdef YYSTACK_ALLOC
406 /* Pacify GCC's `empty if-body' warning. */
407 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
409 # if defined (__STDC__) || defined (__cplusplus)
410 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
411 # define YYSIZE_T size_t
413 # define YYSTACK_ALLOC malloc
414 # define YYSTACK_FREE free
416 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
419 #if (! defined (yyoverflow) \
420 && (! defined (__cplusplus) \
421 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
423 /* A type that is properly aligned for any stack member. */
433 /* The size of the maximum gap between one aligned stack and the next. */
434 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
436 /* The size of an array large to enough to hold all stacks, each with
439 # define YYSTACK_BYTES(N) \
440 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
441 + 2 * YYSTACK_GAP_MAX)
443 # define YYSTACK_BYTES(N) \
444 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
448 /* Copy COUNT objects from FROM to TO. The source and destination do
452 # define YYCOPY(To, From, Count) \
453 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
455 # define YYCOPY(To, From, Count) \
458 register YYSIZE_T yyi; \
459 for (yyi = 0; yyi < (Count); yyi++) \
460 (To)[yyi] = (From)[yyi]; \
466 /* Relocate STACK from its old location to the new one. The
467 local variables YYSIZE and YYSTACKSIZE give the old and new number of
468 elements in the stack, and YYPTR gives the new location of the
469 stack. Advance YYPTR to a properly aligned location for the next
471 # define YYSTACK_RELOCATE(Stack) \
474 YYSIZE_T yynewbytes; \
475 YYCOPY (&yyptr->Stack, Stack, yysize); \
476 Stack = &yyptr->Stack; \
477 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
478 yyptr += yynewbytes / sizeof (*yyptr); \
485 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
486 # define YYSIZE_T __SIZE_TYPE__
488 #if ! defined (YYSIZE_T) && defined (size_t)
489 # define YYSIZE_T size_t
491 #if ! defined (YYSIZE_T)
492 # if defined (__STDC__) || defined (__cplusplus)
493 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
494 # define YYSIZE_T size_t
497 #if ! defined (YYSIZE_T)
498 # define YYSIZE_T unsigned int
501 #define yyerrok (yyerrstatus = 0)
502 #define yyclearin (yychar = YYEMPTY)
505 #define YYACCEPT goto yyacceptlab
506 #define YYABORT goto yyabortlab
507 #define YYERROR goto yyerrlab1
508 /* Like YYERROR except do call yyerror. This remains here temporarily
509 to ease the transition to the new meaning of YYERROR, for GCC.
510 Once GCC version 2 has supplanted version 1, this can go. */
511 #define YYFAIL goto yyerrlab
512 #define YYRECOVERING() (!!yyerrstatus)
513 #define YYBACKUP(Token, Value) \
515 if (yychar == YYEMPTY && yylen == 1) \
519 yychar1 = YYTRANSLATE (yychar); \
525 yyerror ("syntax error: cannot back up"); \
531 #define YYERRCODE 256
534 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
537 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
538 first token. By default, to implement support for ranges, extend
539 its range to the last symbol. */
541 #ifndef YYLLOC_DEFAULT
542 # define YYLLOC_DEFAULT(Current, Rhs, N) \
543 Current.last_line = Rhs[N].last_line; \
544 Current.last_column = Rhs[N].last_column;
548 /* YYLEX -- calling `yylex' with the right arguments. */
553 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
555 # define YYLEX yylex (&yylval, &yylloc)
557 # else /* !YYLSP_NEEDED */
559 # define YYLEX yylex (&yylval, YYLEX_PARAM)
561 # define YYLEX yylex (&yylval)
563 # endif /* !YYLSP_NEEDED */
565 # define YYLEX yylex ()
569 /* Enable debugging if requested. */
573 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
574 # define YYFPRINTF fprintf
577 # define YYDPRINTF(Args) \
582 /* Nonzero means print parse trace. It is left uninitialized so that
583 multiple parsers can coexist. */
586 # define YYDPRINTF(Args)
587 #endif /* !YYDEBUG */
589 /* YYINITDEPTH -- initial size of the parser's stacks. */
591 # define YYINITDEPTH 200
594 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
595 if the built-in stack extension method is used).
597 Do not make this value too large; the results are undefined if
598 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
599 evaluated with infinite-precision integer arithmetic. */
606 # define YYMAXDEPTH 10000
609 #ifdef YYERROR_VERBOSE
612 # if defined (__GLIBC__) && defined (_STRING_H)
613 # define yystrlen strlen
615 /* Return the length of YYSTR. */
617 # if defined (__STDC__) || defined (__cplusplus)
618 yystrlen (const char *yystr)
624 register const char *yys = yystr;
626 while (*yys++ != '\0')
629 return yys - yystr - 1;
635 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
636 # define yystpcpy stpcpy
638 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
641 # if defined (__STDC__) || defined (__cplusplus)
642 yystpcpy (char *yydest, const char *yysrc)
644 yystpcpy (yydest, yysrc)
649 register char *yyd = yydest;
650 register const char *yys = yysrc;
652 while ((*yyd++ = *yys++) != '\0')
663 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
664 into yyparse. The argument should have type void *.
665 It should actually point to an object.
666 Grammar actions can access the variable by casting it
667 to the proper pointer type. */
670 # if defined (__STDC__) || defined (__cplusplus)
671 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
672 # define YYPARSE_PARAM_DECL
674 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
675 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
677 #else /* !YYPARSE_PARAM */
678 # define YYPARSE_PARAM_ARG
679 # define YYPARSE_PARAM_DECL
680 #endif /* !YYPARSE_PARAM */
682 /* Prevent warning if -Wstrict-prototypes. */
684 # ifdef YYPARSE_PARAM
685 int yyparse (void *);
691 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
692 variables are global, or local to YYPARSE. */
694 #define YY_DECL_NON_LSP_VARIABLES \
695 /* The lookahead symbol. */ \
698 /* The semantic value of the lookahead symbol. */ \
701 /* Number of parse errors so far. */ \
705 # define YY_DECL_VARIABLES \
706 YY_DECL_NON_LSP_VARIABLES \
708 /* Location data for the lookahead symbol. */ \
711 # define YY_DECL_VARIABLES \
712 YY_DECL_NON_LSP_VARIABLES
716 /* If nonreentrant, generate the variables here. */
723 yyparse (YYPARSE_PARAM_ARG)
726 /* If reentrant, generate the variables here. */
731 register int yystate;
734 /* Number of tokens to shift before error messages enabled. */
736 /* Lookahead token as an internal (translated) token number. */
739 /* Three stacks and their tools:
740 `yyss': related to states,
741 `yyvs': related to semantic values,
742 `yyls': related to locations.
744 Refer to the stacks thru separate pointers, to allow yyoverflow
745 to reallocate them elsewhere. */
747 /* The state stack. */
748 short yyssa[YYINITDEPTH];
750 register short *yyssp;
752 /* The semantic value stack. */
753 YYSTYPE yyvsa[YYINITDEPTH];
754 YYSTYPE *yyvs = yyvsa;
755 register YYSTYPE *yyvsp;
758 /* The location stack. */
759 YYLTYPE yylsa[YYINITDEPTH];
760 YYLTYPE *yyls = yylsa;
765 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
767 # define YYPOPSTACK (yyvsp--, yyssp--)
770 YYSIZE_T yystacksize = YYINITDEPTH;
773 /* The variables used to return semantic value and location from the
780 /* When reducing, the number of symbols on the RHS of the reduced
784 YYDPRINTF ((stderr, "Starting parse\n"));
789 yychar = YYEMPTY; /* Cause a token to be read. */
791 /* Initialize stack pointers.
792 Waste one element of value and location stack
793 so that they stay on the same level as the state stack.
794 The wasted elements are never initialized. */
803 /*------------------------------------------------------------.
804 | yynewstate -- Push a new state, which is found in yystate. |
805 `------------------------------------------------------------*/
807 /* In all cases, when you get here, the value and location stacks
808 have just been pushed. so pushing a state here evens the stacks.
815 if (yyssp >= yyss + yystacksize - 1)
817 /* Get the current used size of the three stacks, in elements. */
818 YYSIZE_T yysize = yyssp - yyss + 1;
822 /* Give user a chance to reallocate the stack. Use copies of
823 these so that the &'s don't force the real ones into
825 YYSTYPE *yyvs1 = yyvs;
828 /* Each stack pointer address is followed by the size of the
829 data in use in that stack, in bytes. */
831 YYLTYPE *yyls1 = yyls;
832 /* This used to be a conditional around just the two extra args,
833 but that might be undefined if yyoverflow is a macro. */
834 yyoverflow ("parser stack overflow",
835 &yyss1, yysize * sizeof (*yyssp),
836 &yyvs1, yysize * sizeof (*yyvsp),
837 &yyls1, yysize * sizeof (*yylsp),
841 yyoverflow ("parser stack overflow",
842 &yyss1, yysize * sizeof (*yyssp),
843 &yyvs1, yysize * sizeof (*yyvsp),
849 #else /* no yyoverflow */
850 # ifndef YYSTACK_RELOCATE
853 /* Extend the stack our own way. */
854 if (yystacksize >= YYMAXDEPTH)
857 if (yystacksize > YYMAXDEPTH)
858 yystacksize = YYMAXDEPTH;
862 union yyalloc *yyptr =
863 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
866 YYSTACK_RELOCATE (yyss);
867 YYSTACK_RELOCATE (yyvs);
869 YYSTACK_RELOCATE (yyls);
871 # undef YYSTACK_RELOCATE
873 YYSTACK_FREE (yyss1);
876 #endif /* no yyoverflow */
878 yyssp = yyss + yysize - 1;
879 yyvsp = yyvs + yysize - 1;
881 yylsp = yyls + yysize - 1;
884 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
885 (unsigned long int) yystacksize));
887 if (yyssp >= yyss + yystacksize - 1)
891 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
901 /* Do appropriate processing given the current state. */
902 /* Read a lookahead token if we need one and don't already have one. */
905 /* First try to decide what to do without reference to lookahead token. */
907 yyn = yypact[yystate];
911 /* Not known => get a lookahead token if don't already have one. */
913 /* yychar is either YYEMPTY or YYEOF
914 or a valid token in external form. */
916 if (yychar == YYEMPTY)
918 YYDPRINTF ((stderr, "Reading a token: "));
922 /* Convert token to internal form (in yychar1) for indexing tables with */
924 if (yychar <= 0) /* This means end of input. */
927 yychar = YYEOF; /* Don't call YYLEX any more */
929 YYDPRINTF ((stderr, "Now at end of input.\n"));
933 yychar1 = YYTRANSLATE (yychar);
936 /* We have to keep this `#if YYDEBUG', since we use variables
937 which are defined only if `YYDEBUG' is set. */
940 YYFPRINTF (stderr, "Next token is %d (%s",
941 yychar, yytname[yychar1]);
942 /* Give the individual parser a way to print the precise
943 meaning of a token, for further debugging info. */
945 YYPRINT (stderr, yychar, yylval);
947 YYFPRINTF (stderr, ")\n");
953 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
958 /* yyn is what to do for this token type in this state.
959 Negative => reduce, -yyn is rule number.
960 Positive => shift, yyn is new state.
961 New state is final state => don't bother to shift,
963 0, or most negative number => error. */
978 /* Shift the lookahead token. */
979 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
980 yychar, yytname[yychar1]));
982 /* Discard the token being shifted unless it is eof. */
991 /* Count tokens shifted since error; after three, turn off error
1000 /*-----------------------------------------------------------.
1001 | yydefault -- do the default action for the current state. |
1002 `-----------------------------------------------------------*/
1004 yyn = yydefact[yystate];
1010 /*-----------------------------.
1011 | yyreduce -- Do a reduction. |
1012 `-----------------------------*/
1014 /* yyn is the number of a rule to reduce with. */
1017 /* If YYLEN is nonzero, implement the default value of the action:
1020 Otherwise, the following line sets YYVAL to the semantic value of
1021 the lookahead token. This behavior is undocumented and Bison
1022 users should not rely upon it. Assigning to YYVAL
1023 unconditionally makes the parser a bit smaller, and it avoids a
1024 GCC warning that YYVAL may be used uninitialized. */
1025 yyval = yyvsp[1-yylen];
1028 /* Similarly for the default location. Let the user run additional
1029 commands if for instance locations are ranges. */
1030 yyloc = yylsp[1-yylen];
1031 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1035 /* We have to keep this `#if YYDEBUG', since we use variables which
1036 are defined only if `YYDEBUG' is set. */
1041 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1044 /* Print the symbols being reduced, and their result. */
1045 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
1046 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1047 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1054 { lslOpList_free (yyvsp[0].operators); ;
1057 { lslOpList x = lslOpList_new ();
1058 g_importedlslOp = yyvsp[0].operator;
1059 lslOpList_add (x, yyvsp[0].operator);
1060 yyval.operators = x; ;
1063 { lslOpList_add (yyvsp[-1].operators, yyvsp[0].operator);
1064 yyval.operators = yyvsp[-1].operators; ;
1067 { yyval.operator = makelslOpNode (yyvsp[-2].name, yyvsp[0].signature); ;
1070 { yyval.name = makeNameNodeId (yyvsp[0].ltok); ;
1073 { yyval.name = makeNameNodeForm (yyvsp[0].opform); ;
1076 { yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;
1079 { yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1082 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1085 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
1088 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
1091 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1094 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1097 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1100 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM,
1101 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1104 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE,
1105 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1108 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE,
1109 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1112 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM,
1113 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1116 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM,
1117 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1120 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT,
1121 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1124 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT,
1125 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1128 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP,
1129 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1132 { yyval.ltok = yyvsp[0].ltok; ;
1135 { yyval.ltok = yyvsp[0].ltok; ;
1138 { yyval.ltok = yyvsp[0].ltok; ;
1141 { yyval.count = 0; ;
1144 { yyval.count = yyvsp[0].count; ;
1147 { yyval.count = 1; ;
1150 { yyval.count = yyvsp[-2].count + 1; ;
1153 { yyval.ltok = yyvsp[0].ltok; ;
1156 { yyval.ltok = yyvsp[0].ltok; ;
1159 { yyval.signature = makesigNode (yyvsp[-1].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
1162 { yyval.ltokenList = ltokenList_new (); ;
1165 { yyval.ltokenList = yyvsp[0].ltokenList; ;
1168 { yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
1171 { yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
1175 yyval.ltok = yyvsp[0].ltok;
1176 ltoken_setText (yyval.ltok, processTraitSortId (ltoken_getText (yyvsp[0].ltok)));
1180 { yyval.ltok = yyvsp[0].ltok; ;
1195 short *yyssp1 = yyss - 1;
1196 YYFPRINTF (stderr, "state stack now");
1197 while (yyssp1 != yyssp)
1198 YYFPRINTF (stderr, " %d", *++yyssp1);
1199 YYFPRINTF (stderr, "\n");
1208 /* Now `shift' the result of the reduction. Determine what state
1209 that goes to, based on the state we popped back to and the rule
1210 number reduced by. */
1214 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1215 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1216 yystate = yytable[yystate];
1218 yystate = yydefgoto[yyn - YYNTBASE];
1223 /*------------------------------------.
1224 | yyerrlab -- here on detecting error |
1225 `------------------------------------*/
1227 /* If not already recovering from an error, report this error. */
1232 #ifdef YYERROR_VERBOSE
1233 yyn = yypact[yystate];
1235 if (yyn > YYFLAG && yyn < YYLAST)
1237 YYSIZE_T yysize = 0;
1242 /* Start YYX at -YYN if negative to avoid negative indexes in
1244 for (yyx = yyn < 0 ? -yyn : 0;
1245 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1246 if (yycheck[yyx + yyn] == yyx)
1247 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1248 yysize += yystrlen ("parse error, unexpected ") + 1;
1249 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1250 yymsg = (char *) YYSTACK_ALLOC (yysize);
1253 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1254 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1259 for (yyx = yyn < 0 ? -yyn : 0;
1260 yyx < (int) (sizeof (yytname) / sizeof (char *));
1262 if (yycheck[yyx + yyn] == yyx)
1264 const char *yyq = ! yycount ? ", expecting " : " or ";
1265 yyp = yystpcpy (yyp, yyq);
1266 yyp = yystpcpy (yyp, yytname[yyx]);
1271 YYSTACK_FREE (yymsg);
1274 yyerror ("parse error; also virtual memory exhausted");
1277 #endif /* defined (YYERROR_VERBOSE) */
1278 yyerror ("parse error");
1283 /*--------------------------------------------------.
1284 | yyerrlab1 -- error raised explicitly by an action |
1285 `--------------------------------------------------*/
1287 if (yyerrstatus == 3)
1289 /* If just tried and failed to reuse lookahead token after an
1290 error, discard it. */
1292 /* return failure if at end of input */
1293 if (yychar == YYEOF)
1295 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1296 yychar, yytname[yychar1]));
1300 /* Else will try to reuse lookahead token after shifting the error
1303 yyerrstatus = 3; /* Each real token shifted decrements this */
1308 /*-------------------------------------------------------------------.
1309 | yyerrdefault -- current state does not do anything special for the |
1311 `-------------------------------------------------------------------*/
1314 /* This is wrong; only states that explicitly want error tokens
1315 should shift them. */
1317 /* If its default is to accept any token, ok. Otherwise pop it. */
1318 yyn = yydefact[yystate];
1324 /*---------------------------------------------------------------.
1325 | yyerrpop -- pop the current state because it cannot handle the |
1327 `---------------------------------------------------------------*/
1340 short *yyssp1 = yyss - 1;
1341 YYFPRINTF (stderr, "Error: state stack now");
1342 while (yyssp1 != yyssp)
1343 YYFPRINTF (stderr, " %d", *++yyssp1);
1344 YYFPRINTF (stderr, "\n");
1352 yyn = yypact[yystate];
1357 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1374 YYDPRINTF ((stderr, "Shifting error token, "));
1385 /*-------------------------------------.
1386 | yyacceptlab -- YYACCEPT comes here. |
1387 `-------------------------------------*/
1392 /*-----------------------------------.
1393 | yyabortlab -- YYABORT comes here. |
1394 `-----------------------------------*/
1399 /*---------------------------------------------.
1400 | yyoverflowab -- parser overflow comes here. |
1401 `---------------------------------------------*/
1403 yyerror ("parser stack overflow");
1410 YYSTACK_FREE (yyss);
1416 # include "bison.reset"
1418 extern char *yytext;
1420 void lslerror (char *s)
1423 (cstring_makeLiteral
1424 ("There has been a problem in the parser with LSL signatures. This is believed to result "
1425 "from a problem with bison v. 1.25. Please try rebuidling Splint "
1426 "using the pre-compiled grammar files by commenting out the "
1427 "BISON= line in the top-level Makefile."));
1430 static void yyprint (FILE *file, int type, YYSTYPE value)
1432 fprintf (file, " (%u:%u type: %d; text: %s) ",
1433 ltoken_getLine (value.ltok),
1434 ltoken_getCol (value.ltok),
1436 ltoken_getRawTextChars (value.ltok));
1439 extern void PrintToken (ltoken tok) {
1442 switch (ltoken_getCode (tok))
1444 case NOTTOKEN: codStr = "*** NOTTOKEN ***"; break;
1445 case LST_QUANTIFIERSYM: codStr = "QUANTIFIERSYM"; break;
1446 case LST_LOGICALOP: codStr = "LOGICALOP: "; break;
1447 case LST_SELECTSYM: codStr = "LST_SELECTSYM"; break;
1448 case LST_OPENSYM: codStr = "LST_OPENSYM"; break;
1449 case LST_SEPSYM: codStr = "SEPSYM"; break;
1450 case LST_CLOSESYM: codStr = "LST_CLOSESYM"; break;
1451 case LST_SIMPLEID: codStr = "LST_SIMPLEID"; break;
1452 case LST_MAPSYM: codStr = "MAPSYM"; break;
1453 case LST_MARKERSYM: codStr = "LST_MARKERSYM"; break;
1454 case LST_COMMENTSYM: codStr = "COMMENTSYM"; break;
1455 case LST_SIMPLEOP: codStr = "SIMPLEOP"; break;
1456 case LST_COLON: codStr = "LST_COLON"; break;
1457 case LST_COMMA: codStr = "COMMA"; break;
1458 case LST_LBRACKET: codStr = "LST_LBRACKET"; break;
1459 case LST_LPAR: codStr = "LST_LPAR"; break;
1460 case LST_RBRACKET: codStr = "LST_RBRACKET"; break;
1461 case LST_RPAR: codStr = "LST_RPAR"; break;
1462 case LST_EQOP: codStr = "LST_EQOP"; break;
1463 case LST_WHITESPACE: codStr = "WHITESPACE,"; break;
1464 case LST_EOL: codStr = "LST_EOL"; break;
1465 case LST_elseTOKEN: codStr = "elseTOKEN"; break;
1466 case LST_ifTOKEN: codStr = "ifTOKEN"; break;
1467 case LST_thenTOKEN: codStr = "thenTOKEN"; break;
1468 case LST_BADTOKEN: codStr = "*** BADTOKEN ***"; break;
1469 case LEOFTOKEN: /* can't reach LEOFTOKEN easily */
1470 codStr = "LEOFTOKEN"; break;
1472 codStr = "*** invalid token code ***";
1476 /* only used for debugging */
1477 printf ("%u:%u: Token Code (%u): %s",
1478 ltoken_getLine (tok), ltoken_getCol (tok),
1479 ltoken_getCode (tok), codStr);
1480 if (ltoken_getRawText (tok) != 0)
1482 printf (", Token String (%lu): %s\n",
1483 ltoken_getRawText (tok), ltoken_getRawTextChars (tok));
1492 ** Resets all flags in bison.head
1514 /*@=evalorderuncon@*/
1523 /*@=elseifcomplete@*/
1527 /*@=readonlytrans@*/
1530 /*@=systemunrecog@*/
1531 /*@=dependenttrans@*/
1532 /*@=unqualifiedtrans@*/
1536 /*drl added 11/27/2001*/
1539 /*drl added 12/11/2002*/