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 by GNU Bison 1.875a. */
59 /* Skeleton parser for Yacc-like parsing with Bison,
60 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
62 This program is free software; you can redistribute it and/or modify
63 it under the terms of the GNU General Public License as published by
64 the Free Software Foundation; either version 2, or (at your option)
67 This program is distributed in the hope that it will be useful,
68 but WITHOUT ANY WARRANTY; without even the implied warranty of
69 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
70 GNU General Public License for more details.
72 You should have received a copy of the GNU General Public License
73 along with this program; if not, write to the Free Software
74 Foundation, Inc., 59 Temple Place - Suite 330,
75 Boston, MA 02111-1307, USA. */
77 /* As a special exception, when this file is copied by Bison into a
78 Bison output file, you may use that output file without restriction.
79 This special exception was added by the Free Software Foundation
80 in version 1.24 of Bison. */
82 /* Written by Richard Stallman by simplifying the original so called
83 ``semantic'' parser. */
85 /* All symbols defined below should begin with yy or YY, to avoid
86 infringing on user name space. This should be done even for local
87 variables, as they might otherwise be expanded by user macros.
88 There are some unavoidable exceptions within include files to
89 define necessary library symbols; they are noted "INFRINGES ON
90 USER NAME SPACE" below. */
92 /* Identify Bison output. */
96 #define YYSKELETON_NAME "yacc.c"
101 /* Using locations. */
102 #define YYLSP_NEEDED 0
104 /* If NAME_PREFIX is specified substitute the variables and functions
106 #define yyparse lslparse
108 #define yyerror lslerror
109 #define yylval lsllval
110 #define yychar lslchar
111 #define yydebug lsldebug
112 #define yynerrs lslnerrs
118 /* Put the tokens into the symbol table, so that GDB and other debuggers
126 LST_FIELDMAPSYM = 263,
140 LST_COMMENTSYM = 277,
141 LST_WHITESPACE = 278,
142 LST_QUANTIFIERSYM = 279,
143 LST_EQUATIONSYM = 280,
145 LST_COMPOSESYM = 282,
148 LST_assertsTOKEN = 285,
149 LST_assumesTOKEN = 286,
151 LST_convertsTOKEN = 288,
152 LST_enumerationTOKEN = 289,
153 LST_equationsTOKEN = 290,
154 LST_exemptingTOKEN = 291,
156 LST_generatedTOKEN = 293,
157 LST_impliesTOKEN = 294,
158 LST_includesTOKEN = 295,
159 LST_introducesTOKEN = 296,
161 LST_partitionedTOKEN = 298,
162 LST_traitTOKEN = 299,
163 LST_tupleTOKEN = 300,
164 LST_unionTOKEN = 301,
168 #define LST_SIMPLEID 258
169 #define LST_LOGICALOP 259
171 #define LST_SIMPLEOP 261
172 #define LST_MAPSYM 262
173 #define LST_FIELDMAPSYM 263
174 #define LST_MARKERSYM 264
175 #define LST_ifTOKEN 265
176 #define LST_thenTOKEN 266
177 #define LST_elseTOKEN 267
178 #define LST_LBRACKET 268
179 #define LST_RBRACKET 269
180 #define LST_SELECTSYM 270
181 #define LST_SEPSYM 271
182 #define LST_OPENSYM 272
183 #define LST_CLOSESYM 273
184 #define LST_COLON 274
185 #define LST_COMMA 275
187 #define LST_COMMENTSYM 277
188 #define LST_WHITESPACE 278
189 #define LST_QUANTIFIERSYM 279
190 #define LST_EQUATIONSYM 280
191 #define LST_EQSEPSYM 281
192 #define LST_COMPOSESYM 282
195 #define LST_assertsTOKEN 285
196 #define LST_assumesTOKEN 286
197 #define LST_byTOKEN 287
198 #define LST_convertsTOKEN 288
199 #define LST_enumerationTOKEN 289
200 #define LST_equationsTOKEN 290
201 #define LST_exemptingTOKEN 291
202 #define LST_forTOKEN 292
203 #define LST_generatedTOKEN 293
204 #define LST_impliesTOKEN 294
205 #define LST_includesTOKEN 295
206 #define LST_introducesTOKEN 296
207 #define LST_ofTOKEN 297
208 #define LST_partitionedTOKEN 298
209 #define LST_traitTOKEN 299
210 #define LST_tupleTOKEN 300
211 #define LST_unionTOKEN 301
212 #define LST_BADTOKEN 302
217 /* Copy the first part of user declarations. */
222 # include "splintMacros.nf"
224 # include "lslparse.h"
225 # include "signature.h"
227 static void lslerror (char *);
228 extern int lsllex ();
230 /*@dependent@*/ /*@null@*/ lslOp importedlslOp;
232 /*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
233 static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
236 # define YYPRINT(file, type, value) yyprint (file, type, value)
246 /* Enabling traces. */
251 /* Enabling verbose error messages. */
252 #ifdef YYERROR_VERBOSE
253 # undef YYERROR_VERBOSE
254 # define YYERROR_VERBOSE 1
256 # define YYERROR_VERBOSE 0
259 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
261 typedef union YYSTYPE {
262 ltoken ltok; /* a leaf is also an ltoken */
264 /*@only@*/ ltokenList ltokenList;
265 /*@only@*/ opFormNode opform;
266 /*@owned@*/ sigNode signature;
267 /*@only@*/ nameNode name;
268 /*@owned@*/ lslOp operator;
269 /*@only@*/ lslOpList operators;
270 /*@-redef@*/ /*@-matchfields@*/
272 /* Line 191 of yacc.c. */
274 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
275 # define YYSTYPE_IS_DECLARED 1
276 # define YYSTYPE_IS_TRIVIAL 1
281 /* Copy the second part of user declarations. */
284 /* Line 214 of yacc.c. */
287 #if ! defined (yyoverflow) || YYERROR_VERBOSE
289 /* The parser invokes alloca or malloc; define the necessary symbols. */
291 # if YYSTACK_USE_ALLOCA
292 # define YYSTACK_ALLOC alloca
294 # ifndef YYSTACK_USE_ALLOCA
295 # if defined (alloca) || defined (_ALLOCA_H)
296 # define YYSTACK_ALLOC alloca
299 # define YYSTACK_ALLOC __builtin_alloca
305 # ifdef YYSTACK_ALLOC
306 /* Pacify GCC's `empty if-body' warning. */
307 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
309 # if defined (__STDC__) || defined (__cplusplus)
310 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
311 # define YYSIZE_T size_t
313 # define YYSTACK_ALLOC malloc
314 # define YYSTACK_FREE free
316 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
319 #if (! defined (yyoverflow) \
320 && (! defined (__cplusplus) \
321 || (YYSTYPE_IS_TRIVIAL)))
323 /* A type that is properly aligned for any stack member. */
330 /* The size of the maximum gap between one aligned stack and the next. */
331 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
333 /* The size of an array large to enough to hold all stacks, each with
335 # define YYSTACK_BYTES(N) \
336 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
337 + YYSTACK_GAP_MAXIMUM)
339 /* Copy COUNT objects from FROM to TO. The source and destination do
343 # define YYCOPY(To, From, Count) \
344 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
346 # define YYCOPY(To, From, Count) \
349 register YYSIZE_T yyi; \
350 for (yyi = 0; yyi < (Count); yyi++) \
351 (To)[yyi] = (From)[yyi]; \
357 /* Relocate STACK from its old location to the new one. The
358 local variables YYSIZE and YYSTACKSIZE give the old and new number of
359 elements in the stack, and YYPTR gives the new location of the
360 stack. Advance YYPTR to a properly aligned location for the next
362 # define YYSTACK_RELOCATE(Stack) \
365 YYSIZE_T yynewbytes; \
366 YYCOPY (&yyptr->Stack, Stack, yysize); \
367 Stack = &yyptr->Stack; \
368 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
369 yyptr += yynewbytes / sizeof (*yyptr); \
375 #if defined (__STDC__) || defined (__cplusplus)
376 typedef signed char yysigned_char;
378 typedef short yysigned_char;
381 /* YYFINAL -- State number of the termination state. */
383 /* YYLAST -- Last index in YYTABLE. */
386 /* YYNTOKENS -- Number of terminals. */
388 /* YYNNTS -- Number of nonterminals. */
390 /* YYNRULES -- Number of rules. */
392 /* YYNRULES -- Number of states. */
395 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
397 #define YYMAXUTOK 302
399 #define YYTRANSLATE(YYX) \
400 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
402 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
403 static const unsigned char yytranslate[] =
405 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
406 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
407 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
415 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
431 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
432 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
433 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
434 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
439 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
441 static const unsigned char yyprhs[] =
443 0, 0, 3, 5, 7, 10, 14, 16, 18, 25,
444 27, 30, 33, 37, 41, 46, 51, 57, 61, 66,
445 71, 77, 80, 84, 88, 90, 92, 94, 95, 97,
446 99, 103, 105, 107, 111, 112, 114, 116, 120, 122
449 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
450 static const yysigned_char yyrhs[] =
452 49, 0, -1, 50, -1, 51, -1, 50, 51, -1,
453 52, 19, 58, -1, 62, -1, 53, -1, 10, 9,
454 11, 9, 12, 9, -1, 54, -1, 9, 54, -1,
455 54, 9, -1, 9, 54, 9, -1, 17, 55, 18,
456 -1, 9, 17, 55, 18, -1, 17, 55, 18, 9,
457 -1, 9, 17, 55, 18, 9, -1, 13, 55, 14,
458 -1, 9, 13, 55, 14, -1, 13, 55, 14, 9,
459 -1, 9, 13, 55, 14, 9, -1, 15, 3, -1,
460 9, 15, 3, -1, 9, 8, 3, -1, 6, -1,
461 4, -1, 5, -1, -1, 56, -1, 9, -1, 56,
462 57, 9, -1, 20, -1, 16, -1, 59, 7, 61,
463 -1, -1, 60, -1, 61, -1, 60, 20, 61, -1,
467 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
468 static const unsigned short yyrline[] =
470 0, 139, 139, 142, 147, 152, 159, 161, 166, 168,
471 170, 172, 174, 176, 178, 180, 182, 185, 188, 191,
472 194, 197, 200, 205, 210, 212, 214, 219, 220, 224,
473 226, 230, 232, 236, 241, 242, 246, 248, 252, 259
477 #if YYDEBUG || YYERROR_VERBOSE
478 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
479 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
480 static const char *const yytname[] =
482 "$end", "error", "$undefined", "LST_SIMPLEID", "LST_LOGICALOP",
483 "LST_EQOP", "LST_SIMPLEOP", "LST_MAPSYM", "LST_FIELDMAPSYM",
484 "LST_MARKERSYM", "LST_ifTOKEN", "LST_thenTOKEN", "LST_elseTOKEN",
485 "LST_LBRACKET", "LST_RBRACKET", "LST_SELECTSYM", "LST_SEPSYM",
486 "LST_OPENSYM", "LST_CLOSESYM", "LST_COLON", "LST_COMMA", "LST_EOL",
487 "LST_COMMENTSYM", "LST_WHITESPACE", "LST_QUANTIFIERSYM",
488 "LST_EQUATIONSYM", "LST_EQSEPSYM", "LST_COMPOSESYM", "LST_LPAR",
489 "LST_RPAR", "LST_assertsTOKEN", "LST_assumesTOKEN", "LST_byTOKEN",
490 "LST_convertsTOKEN", "LST_enumerationTOKEN", "LST_equationsTOKEN",
491 "LST_exemptingTOKEN", "LST_forTOKEN", "LST_generatedTOKEN",
492 "LST_impliesTOKEN", "LST_includesTOKEN", "LST_introducesTOKEN",
493 "LST_ofTOKEN", "LST_partitionedTOKEN", "LST_traitTOKEN",
494 "LST_tupleTOKEN", "LST_unionTOKEN", "LST_BADTOKEN", "$accept", "top",
495 "operatorList", "operator", "name", "opForm", "anyOp", "middle",
496 "placeList", "separator", "signature", "domain", "sortList", "sortId",
502 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
504 static const unsigned short yytoknum[] =
506 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
507 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
508 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
509 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
510 295, 296, 297, 298, 299, 300, 301, 302
514 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
515 static const unsigned char yyr1[] =
517 0, 48, 49, 50, 50, 51, 52, 52, 53, 53,
518 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
519 53, 53, 53, 53, 54, 54, 54, 55, 55, 56,
520 56, 57, 57, 58, 59, 59, 60, 60, 61, 62
523 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
524 static const unsigned char yyr2[] =
526 0, 2, 1, 1, 2, 3, 1, 1, 6, 1,
527 2, 2, 3, 3, 4, 4, 5, 3, 4, 4,
528 5, 2, 3, 3, 1, 1, 1, 0, 1, 1,
529 3, 1, 1, 3, 0, 1, 1, 3, 1, 1
532 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
533 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
534 means the default is an error. */
535 static const unsigned char yydefact[] =
537 0, 39, 25, 26, 24, 0, 0, 27, 0, 27,
538 0, 2, 3, 0, 7, 9, 6, 0, 27, 0,
539 27, 10, 0, 29, 0, 28, 21, 0, 1, 4,
540 34, 11, 23, 0, 22, 0, 12, 0, 17, 32,
541 31, 0, 13, 38, 5, 0, 35, 36, 18, 14,
542 0, 19, 30, 15, 0, 0, 20, 16, 0, 33,
546 /* YYDEFGOTO[NTERM-NUM]. */
547 static const yysigned_char yydefgoto[] =
549 -1, 10, 11, 12, 13, 14, 15, 24, 25, 41,
553 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
555 #define YYPACT_NINF -34
556 static const yysigned_char yypact[] =
558 -3, -34, -34, -34, -34, 11, -4, 2, 10, 2,
559 23, -3, -34, 6, -34, 18, -34, 26, 2, 27,
560 2, 22, 21, -34, 19, -12, -34, 16, -34, -34,
561 32, -34, -34, 24, -34, 25, -34, 28, 30, -34,
562 -34, 31, 33, -34, -34, 29, 34, -34, 35, 36,
563 37, -34, -34, -34, 32, 32, -34, -34, 38, -34,
567 /* YYPGOTO[NTERM-NUM]. */
568 static const yysigned_char yypgoto[] =
570 -34, -34, -34, 39, -34, -34, 41, 0, -34, -34,
571 -34, -34, -34, -33, -34
574 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
575 positive, shift that token. If negative, reduce the rule which
576 number is the opposite. If zero, do what YYDEFACT says.
577 If YYTABLE_NINF, syntax error. */
578 #define YYTABLE_NINF -1
579 static const unsigned char yytable[] =
581 1, 2, 3, 4, 39, 22, 5, 6, 40, 27,
582 7, 23, 8, 26, 9, 2, 3, 4, 33, 17,
583 35, 59, 60, 28, 18, 30, 19, 31, 20, 32,
584 34, 36, 37, 38, 42, 43, 54, 50, 48, 51,
585 52, 0, 53, 49, 56, 57, 21, 61, 0, 58,
589 static const yysigned_char yycheck[] =
591 3, 4, 5, 6, 16, 9, 9, 10, 20, 9,
592 13, 9, 15, 3, 17, 4, 5, 6, 18, 8,
593 20, 54, 55, 0, 13, 19, 15, 9, 17, 3,
594 3, 9, 11, 14, 18, 3, 7, 9, 14, 9,
595 9, -1, 9, 18, 9, 9, 5, 9, -1, 12,
599 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
600 symbol of state STATE-NUM. */
601 static const unsigned char yystos[] =
603 0, 3, 4, 5, 6, 9, 10, 13, 15, 17,
604 49, 50, 51, 52, 53, 54, 62, 8, 13, 15,
605 17, 54, 9, 9, 55, 56, 3, 55, 0, 51,
606 19, 9, 3, 55, 3, 55, 9, 11, 14, 16,
607 20, 57, 18, 3, 58, 59, 60, 61, 14, 18,
608 9, 9, 9, 9, 7, 20, 9, 9, 12, 61,
612 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
613 # define YYSIZE_T __SIZE_TYPE__
615 #if ! defined (YYSIZE_T) && defined (size_t)
616 # define YYSIZE_T size_t
618 #if ! defined (YYSIZE_T)
619 # if defined (__STDC__) || defined (__cplusplus)
620 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
621 # define YYSIZE_T size_t
624 #if ! defined (YYSIZE_T)
625 # define YYSIZE_T unsigned int
628 #define yyerrok (yyerrstatus = 0)
629 #define yyclearin (yychar = YYEMPTY)
633 #define YYACCEPT goto yyacceptlab
634 #define YYABORT goto yyabortlab
635 #define YYERROR goto yyerrlab1
638 /* Like YYERROR except do call yyerror. This remains here temporarily
639 to ease the transition to the new meaning of YYERROR, for GCC.
640 Once GCC version 2 has supplanted version 1, this can go. */
642 #define YYFAIL goto yyerrlab
644 #define YYRECOVERING() (!!yyerrstatus)
646 #define YYBACKUP(Token, Value) \
648 if (yychar == YYEMPTY && yylen == 1) \
652 yytoken = YYTRANSLATE (yychar); \
658 yyerror ("syntax error: cannot back up");\
664 #define YYERRCODE 256
666 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
669 #ifndef YYLLOC_DEFAULT
670 # define YYLLOC_DEFAULT(Current, Rhs, N) \
671 Current.first_line = Rhs[1].first_line; \
672 Current.first_column = Rhs[1].first_column; \
673 Current.last_line = Rhs[N].last_line; \
674 Current.last_column = Rhs[N].last_column;
677 /* YYLEX -- calling `yylex' with the right arguments. */
680 # define YYLEX yylex (&yylval, YYLEX_PARAM)
682 # define YYLEX yylex (&yylval)
685 /* Enable debugging if requested. */
689 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
690 # define YYFPRINTF fprintf
693 # define YYDPRINTF(Args) \
699 # define YYDSYMPRINT(Args) \
705 # define YYDSYMPRINTF(Title, Token, Value, Location) \
709 YYFPRINTF (stderr, "%s ", Title); \
710 yysymprint (stderr, \
712 YYFPRINTF (stderr, "\n"); \
716 /*------------------------------------------------------------------.
717 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
719 `------------------------------------------------------------------*/
721 #if defined (__STDC__) || defined (__cplusplus)
723 yy_stack_print (short *bottom, short *top)
726 yy_stack_print (bottom, top)
731 YYFPRINTF (stderr, "Stack now");
732 for (/* Nothing. */; bottom <= top; ++bottom)
733 YYFPRINTF (stderr, " %d", *bottom);
734 YYFPRINTF (stderr, "\n");
737 # define YY_STACK_PRINT(Bottom, Top) \
740 yy_stack_print ((Bottom), (Top)); \
744 /*------------------------------------------------.
745 | Report that the YYRULE is going to be reduced. |
746 `------------------------------------------------*/
748 #if defined (__STDC__) || defined (__cplusplus)
750 yy_reduce_print (int yyrule)
753 yy_reduce_print (yyrule)
758 unsigned int yylineno = yyrline[yyrule];
759 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
760 yyrule - 1, yylineno);
761 /* Print the symbols being reduced, and their result. */
762 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
763 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
764 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
767 # define YY_REDUCE_PRINT(Rule) \
770 yy_reduce_print (Rule); \
773 /* Nonzero means print parse trace. It is left uninitialized so that
774 multiple parsers can coexist. */
777 # define YYDPRINTF(Args)
778 # define YYDSYMPRINT(Args)
779 # define YYDSYMPRINTF(Title, Token, Value, Location)
780 # define YY_STACK_PRINT(Bottom, Top)
781 # define YY_REDUCE_PRINT(Rule)
782 #endif /* !YYDEBUG */
785 /* YYINITDEPTH -- initial size of the parser's stacks. */
787 # define YYINITDEPTH 200
790 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
791 if the built-in stack extension method is used).
793 Do not make this value too large; the results are undefined if
794 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
795 evaluated with infinite-precision integer arithmetic. */
802 # define YYMAXDEPTH 10000
810 # if defined (__GLIBC__) && defined (_STRING_H)
811 # define yystrlen strlen
813 /* Return the length of YYSTR. */
815 # if defined (__STDC__) || defined (__cplusplus)
816 yystrlen (const char *yystr)
822 register const char *yys = yystr;
824 while (*yys++ != '\0')
827 return yys - yystr - 1;
833 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
834 # define yystpcpy stpcpy
836 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
839 # if defined (__STDC__) || defined (__cplusplus)
840 yystpcpy (char *yydest, const char *yysrc)
842 yystpcpy (yydest, yysrc)
847 register char *yyd = yydest;
848 register const char *yys = yysrc;
850 while ((*yyd++ = *yys++) != '\0')
858 #endif /* !YYERROR_VERBOSE */
863 /*--------------------------------.
864 | Print this symbol on YYOUTPUT. |
865 `--------------------------------*/
867 #if defined (__STDC__) || defined (__cplusplus)
869 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
872 yysymprint (yyoutput, yytype, yyvaluep)
878 /* Pacify ``unused variable'' warnings. */
881 if (yytype < YYNTOKENS)
883 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
885 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
889 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
896 YYFPRINTF (yyoutput, ")");
899 #endif /* ! YYDEBUG */
900 /*-----------------------------------------------.
901 | Release the memory associated to this symbol. |
902 `-----------------------------------------------*/
904 #if defined (__STDC__) || defined (__cplusplus)
906 yydestruct (int yytype, YYSTYPE *yyvaluep)
909 yydestruct (yytype, yyvaluep)
914 /* Pacify ``unused variable'' warnings. */
926 /* Prevent warnings from -Wmissing-prototypes. */
929 # if defined (__STDC__) || defined (__cplusplus)
930 int yyparse (void *YYPARSE_PARAM);
934 #else /* ! YYPARSE_PARAM */
935 #if defined (__STDC__) || defined (__cplusplus)
940 #endif /* ! YYPARSE_PARAM */
952 # if defined (__STDC__) || defined (__cplusplus)
953 int yyparse (void *YYPARSE_PARAM)
955 int yyparse (YYPARSE_PARAM)
958 #else /* ! YYPARSE_PARAM */
959 #if defined (__STDC__) || defined (__cplusplus)
969 /* The lookahead symbol. */
972 /* The semantic value of the lookahead symbol. */
975 /* Number of syntax errors so far. */
978 register int yystate;
981 /* Number of tokens to shift before error messages enabled. */
983 /* Lookahead token as an internal (translated) token number. */
986 /* Three stacks and their tools:
987 `yyss': related to states,
988 `yyvs': related to semantic values,
989 `yyls': related to locations.
991 Refer to the stacks thru separate pointers, to allow yyoverflow
992 to reallocate them elsewhere. */
994 /* The state stack. */
995 short yyssa[YYINITDEPTH];
997 register short *yyssp;
999 /* The semantic value stack. */
1000 YYSTYPE yyvsa[YYINITDEPTH];
1001 YYSTYPE *yyvs = yyvsa;
1002 register YYSTYPE *yyvsp;
1006 #define YYPOPSTACK (yyvsp--, yyssp--)
1008 YYSIZE_T yystacksize = YYINITDEPTH;
1010 /* The variables used to return semantic value and location from the
1015 /* When reducing, the number of symbols on the RHS of the reduced
1019 YYDPRINTF ((stderr, "Starting parse\n"));
1024 yychar = YYEMPTY; /* Cause a token to be read. */
1026 /* Initialize stack pointers.
1027 Waste one element of value and location stack
1028 so that they stay on the same level as the state stack.
1029 The wasted elements are never initialized. */
1036 /*------------------------------------------------------------.
1037 | yynewstate -- Push a new state, which is found in yystate. |
1038 `------------------------------------------------------------*/
1040 /* In all cases, when you get here, the value and location stacks
1041 have just been pushed. so pushing a state here evens the stacks.
1048 if (yyss + yystacksize - 1 <= yyssp)
1050 /* Get the current used size of the three stacks, in elements. */
1051 YYSIZE_T yysize = yyssp - yyss + 1;
1055 /* Give user a chance to reallocate the stack. Use copies of
1056 these so that the &'s don't force the real ones into
1058 YYSTYPE *yyvs1 = yyvs;
1059 short *yyss1 = yyss;
1062 /* Each stack pointer address is followed by the size of the
1063 data in use in that stack, in bytes. This used to be a
1064 conditional around just the two extra args, but that might
1065 be undefined if yyoverflow is a macro. */
1066 yyoverflow ("parser stack overflow",
1067 &yyss1, yysize * sizeof (*yyssp),
1068 &yyvs1, yysize * sizeof (*yyvsp),
1075 #else /* no yyoverflow */
1076 # ifndef YYSTACK_RELOCATE
1079 /* Extend the stack our own way. */
1080 if (YYMAXDEPTH <= yystacksize)
1083 if (YYMAXDEPTH < yystacksize)
1084 yystacksize = YYMAXDEPTH;
1087 short *yyss1 = yyss;
1088 union yyalloc *yyptr =
1089 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1092 YYSTACK_RELOCATE (yyss);
1093 YYSTACK_RELOCATE (yyvs);
1095 # undef YYSTACK_RELOCATE
1097 YYSTACK_FREE (yyss1);
1100 #endif /* no yyoverflow */
1102 yyssp = yyss + yysize - 1;
1103 yyvsp = yyvs + yysize - 1;
1106 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1107 (unsigned long int) yystacksize));
1109 if (yyss + yystacksize - 1 <= yyssp)
1113 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1122 /* Do appropriate processing given the current state. */
1123 /* Read a lookahead token if we need one and don't already have one. */
1126 /* First try to decide what to do without reference to lookahead token. */
1128 yyn = yypact[yystate];
1129 if (yyn == YYPACT_NINF)
1132 /* Not known => get a lookahead token if don't already have one. */
1134 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1135 if (yychar == YYEMPTY)
1137 YYDPRINTF ((stderr, "Reading a token: "));
1141 if (yychar <= YYEOF)
1143 yychar = yytoken = YYEOF;
1144 YYDPRINTF ((stderr, "Now at end of input.\n"));
1148 yytoken = YYTRANSLATE (yychar);
1149 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1152 /* If the proper action on seeing token YYTOKEN is to reduce or to
1153 detect an error, take that action. */
1155 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1160 if (yyn == 0 || yyn == YYTABLE_NINF)
1169 /* Shift the lookahead token. */
1170 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1172 /* Discard the token being shifted unless it is eof. */
1173 if (yychar != YYEOF)
1179 /* Count tokens shifted since error; after three, turn off error
1188 /*-----------------------------------------------------------.
1189 | yydefault -- do the default action for the current state. |
1190 `-----------------------------------------------------------*/
1192 yyn = yydefact[yystate];
1198 /*-----------------------------.
1199 | yyreduce -- Do a reduction. |
1200 `-----------------------------*/
1202 /* yyn is the number of a rule to reduce with. */
1205 /* If YYLEN is nonzero, implement the default value of the action:
1208 Otherwise, the following line sets YYVAL to garbage.
1209 This behavior is undocumented and Bison
1210 users should not rely upon it. Assigning to YYVAL
1211 unconditionally makes the parser a bit smaller, and it avoids a
1212 GCC warning that YYVAL may be used uninitialized. */
1213 yyval = yyvsp[1-yylen];
1216 YY_REDUCE_PRINT (yyn);
1221 { lslOpList_free (yyvsp[0].operators); ;}
1226 { lslOpList x = lslOpList_new ();
1227 g_importedlslOp = yyvsp[0].operator;
1228 lslOpList_add (x, yyvsp[0].operator);
1229 yyval.operators = x; ;}
1234 { lslOpList_add (yyvsp[-1].operators, yyvsp[0].operator);
1235 yyval.operators = yyvsp[-1].operators; ;}
1240 { yyval.operator = makelslOpNode (yyvsp[-2].name, yyvsp[0].signature); ;}
1245 { yyval.name = makeNameNodeId (yyvsp[0].ltok); ;}
1250 { yyval.name = makeNameNodeForm (yyvsp[0].opform); ;}
1255 { yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;}
1260 { yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;}
1265 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;}
1270 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;}
1275 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;}
1280 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;}
1285 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;}
1290 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;}
1295 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM,
1296 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;}
1301 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE,
1302 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;}
1307 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE,
1308 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;}
1313 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM,
1314 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;}
1319 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM,
1320 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;}
1325 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT,
1326 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;}
1331 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT,
1332 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;}
1337 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP,
1338 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;}
1343 { yyval.ltok = yyvsp[0].ltok; ;}
1348 { yyval.ltok = yyvsp[0].ltok; ;}
1353 { yyval.ltok = yyvsp[0].ltok; ;}
1358 { yyval.count = 0; ;}
1363 { yyval.count = yyvsp[0].count; ;}
1368 { yyval.count = 1; ;}
1373 { yyval.count = yyvsp[-2].count + 1; ;}
1378 { yyval.ltok = yyvsp[0].ltok; ;}
1383 { yyval.ltok = yyvsp[0].ltok; ;}
1388 { yyval.signature = makesigNode (yyvsp[-1].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;}
1393 { yyval.ltokenList = ltokenList_new (); ;}
1398 { yyval.ltokenList = yyvsp[0].ltokenList; ;}
1403 { yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;}
1408 { yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;}
1414 yyval.ltok = yyvsp[0].ltok;
1415 ltoken_setText (yyval.ltok, processTraitSortId (ltoken_getText (yyvsp[0].ltok)));
1421 { yyval.ltok = yyvsp[0].ltok; ;}
1427 /* Line 999 of yacc.c. */
1434 YY_STACK_PRINT (yyss, yyssp);
1439 /* Now `shift' the result of the reduction. Determine what state
1440 that goes to, based on the state we popped back to and the rule
1441 number reduced by. */
1445 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1446 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1447 yystate = yytable[yystate];
1449 yystate = yydefgoto[yyn - YYNTOKENS];
1454 /*------------------------------------.
1455 | yyerrlab -- here on detecting error |
1456 `------------------------------------*/
1458 /* If not already recovering from an error, report this error. */
1463 yyn = yypact[yystate];
1465 if (YYPACT_NINF < yyn && yyn < YYLAST)
1467 YYSIZE_T yysize = 0;
1468 int yytype = YYTRANSLATE (yychar);
1473 /* Start YYX at -YYN if negative to avoid negative indexes in
1475 for (yyx = yyn < 0 ? -yyn : 0;
1476 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1477 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1478 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1479 yysize += yystrlen ("syntax error, unexpected ") + 1;
1480 yysize += yystrlen (yytname[yytype]);
1481 yymsg = (char *) YYSTACK_ALLOC (yysize);
1484 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1485 yyp = yystpcpy (yyp, yytname[yytype]);
1490 for (yyx = yyn < 0 ? -yyn : 0;
1491 yyx < (int) (sizeof (yytname) / sizeof (char *));
1493 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1495 const char *yyq = ! yycount ? ", expecting " : " or ";
1496 yyp = yystpcpy (yyp, yyq);
1497 yyp = yystpcpy (yyp, yytname[yyx]);
1502 YYSTACK_FREE (yymsg);
1505 yyerror ("syntax error; also virtual memory exhausted");
1508 #endif /* YYERROR_VERBOSE */
1509 yyerror ("syntax error");
1514 if (yyerrstatus == 3)
1516 /* If just tried and failed to reuse lookahead token after an
1517 error, discard it. */
1519 /* Return failure if at end of input. */
1520 if (yychar == YYEOF)
1522 /* Pop the error token. */
1524 /* Pop the rest of the stack. */
1525 while (yyss < yyssp)
1527 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1528 yydestruct (yystos[*yyssp], yyvsp);
1534 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1535 yydestruct (yytoken, &yylval);
1540 /* Else will try to reuse lookahead token after shifting the error
1545 /*----------------------------------------------------.
1546 | yyerrlab1 -- error raised explicitly by an action. |
1547 `----------------------------------------------------*/
1549 yyerrstatus = 3; /* Each real token shifted decrements this. */
1553 yyn = yypact[yystate];
1554 if (yyn != YYPACT_NINF)
1557 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1565 /* Pop the current state because it cannot handle the error token. */
1569 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1570 yydestruct (yystos[yystate], yyvsp);
1574 YY_STACK_PRINT (yyss, yyssp);
1580 YYDPRINTF ((stderr, "Shifting error token, "));
1589 /*-------------------------------------.
1590 | yyacceptlab -- YYACCEPT comes here. |
1591 `-------------------------------------*/
1596 /*-----------------------------------.
1597 | yyabortlab -- YYABORT comes here. |
1598 `-----------------------------------*/
1604 /*----------------------------------------------.
1605 | yyoverflowlab -- parser overflow comes here. |
1606 `----------------------------------------------*/
1608 yyerror ("parser stack overflow");
1616 YYSTACK_FREE (yyss);
1625 # include "bison.reset"
1627 extern char *yytext;
1629 void lslerror (char *s)
1632 (cstring_makeLiteral
1633 ("There has been a problem in the parser with LSL signatures. This is believed to result "
1634 "from a problem with bison v. 1.25. Please try rebuidling Splint "
1635 "using the pre-compiled grammar files by commenting out the "
1636 "BISON= line in the top-level Makefile."));
1639 static void yyprint (FILE *file, int type, YYSTYPE value)
1641 fprintf (file, " (%u:%u type: %d; text: %s) ",
1642 ltoken_getLine (value.ltok),
1643 ltoken_getCol (value.ltok),
1645 ltoken_getRawTextChars (value.ltok));
1648 extern void PrintToken (ltoken tok) {
1651 switch (ltoken_getCode (tok))
1653 case NOTTOKEN: codStr = "*** NOTTOKEN ***"; break;
1654 case LST_QUANTIFIERSYM: codStr = "QUANTIFIERSYM"; break;
1655 case LST_LOGICALOP: codStr = "LOGICALOP: "; break;
1656 case LST_SELECTSYM: codStr = "LST_SELECTSYM"; break;
1657 case LST_OPENSYM: codStr = "LST_OPENSYM"; break;
1658 case LST_SEPSYM: codStr = "SEPSYM"; break;
1659 case LST_CLOSESYM: codStr = "LST_CLOSESYM"; break;
1660 case LST_SIMPLEID: codStr = "LST_SIMPLEID"; break;
1661 case LST_MAPSYM: codStr = "MAPSYM"; break;
1662 case LST_MARKERSYM: codStr = "LST_MARKERSYM"; break;
1663 case LST_COMMENTSYM: codStr = "COMMENTSYM"; break;
1664 case LST_SIMPLEOP: codStr = "SIMPLEOP"; break;
1665 case LST_COLON: codStr = "LST_COLON"; break;
1666 case LST_COMMA: codStr = "COMMA"; break;
1667 case LST_LBRACKET: codStr = "LST_LBRACKET"; break;
1668 case LST_LPAR: codStr = "LST_LPAR"; break;
1669 case LST_RBRACKET: codStr = "LST_RBRACKET"; break;
1670 case LST_RPAR: codStr = "LST_RPAR"; break;
1671 case LST_EQOP: codStr = "LST_EQOP"; break;
1672 case LST_WHITESPACE: codStr = "WHITESPACE,"; break;
1673 case LST_EOL: codStr = "LST_EOL"; break;
1674 case LST_elseTOKEN: codStr = "elseTOKEN"; break;
1675 case LST_ifTOKEN: codStr = "ifTOKEN"; break;
1676 case LST_thenTOKEN: codStr = "thenTOKEN"; break;
1677 case LST_BADTOKEN: codStr = "*** BADTOKEN ***"; break;
1678 case LEOFTOKEN: /* can't reach LEOFTOKEN easily */
1679 codStr = "LEOFTOKEN"; break;
1681 codStr = "*** invalid token code ***";
1685 /* only used for debugging */
1686 printf ("%u:%u: Token Code (%u): %s",
1687 ltoken_getLine (tok), ltoken_getCol (tok),
1688 ltoken_getCode (tok), codStr);
1689 if (ltoken_getRawText (tok) != 0)
1691 printf (", Token String (%lu): %s\n",
1692 ltoken_getRawText (tok), ltoken_getRawTextChars (tok));
1702 ** Resets all flags in bison.head
1724 /*@=evalorderuncon@*/
1733 /*@=elseifcomplete@*/
1737 /*@=readonlytrans@*/
1740 /*@=systemunrecog@*/
1741 /*@=dependenttrans@*/
1742 /*@=unqualifiedtrans@*/
1746 /*drl added 11/27/2001*/
1749 /*drl added 12/11/2002*/