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 > */
54 /* A Bison parser, made from signature.y
55 by GNU Bison version 1.28 */
57 #define YYBISON 1 /* Identify Bison output. */
59 #define yyparse lslparse
61 #define yyerror lslerror
62 #define yylval lsllval
63 #define yychar lslchar
64 #define yydebug lsldebug
65 #define yynerrs lslnerrs
66 #define LST_SIMPLEID 257
67 #define LST_LOGICALOP 258
69 #define LST_SIMPLEOP 260
70 #define LST_MAPSYM 261
71 #define LST_FIELDMAPSYM 262
72 #define LST_MARKERSYM 263
73 #define LST_ifTOKEN 264
74 #define LST_thenTOKEN 265
75 #define LST_elseTOKEN 266
76 #define LST_LBRACKET 267
77 #define LST_RBRACKET 268
78 #define LST_SELECTSYM 269
79 #define LST_SEPSYM 270
80 #define LST_OPENSYM 271
81 #define LST_CLOSESYM 272
85 #define LST_COMMENTSYM 276
86 #define LST_WHITESPACE 277
87 #define LST_QUANTIFIERSYM 278
88 #define LST_EQUATIONSYM 279
89 #define LST_EQSEPSYM 280
90 #define LST_COMPOSESYM 281
93 #define LST_assertsTOKEN 284
94 #define LST_assumesTOKEN 285
95 #define LST_byTOKEN 286
96 #define LST_convertsTOKEN 287
97 #define LST_enumerationTOKEN 288
98 #define LST_equationsTOKEN 289
99 #define LST_exemptingTOKEN 290
100 #define LST_forTOKEN 291
101 #define LST_generatedTOKEN 292
102 #define LST_impliesTOKEN 293
103 #define LST_includesTOKEN 294
104 #define LST_introducesTOKEN 295
105 #define LST_ofTOKEN 296
106 #define LST_partitionedTOKEN 297
107 #define LST_traitTOKEN 298
108 #define LST_tupleTOKEN 299
109 #define LST_unionTOKEN 300
110 #define LST_BADTOKEN 301
115 # include "lclintMacros.nf"
116 # include "llbasic.h"
117 # include "lslparse.h"
118 # include "signature.h"
120 void lslerror (char *);
121 /*@dependent@*/ /*@null@*/ lslOp importedlslOp;
123 /*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
124 static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
127 # define YYPRINT(file, type, value) yyprint (file, type, value)
137 ltoken ltok; /* a leaf is also an ltoken */
139 /*@only@*/ ltokenList ltokenList;
140 /*@only@*/ opFormNode opform;
141 /*@owned@*/ sigNode signature;
142 /*@only@*/ nameNode name;
143 /*@owned@*/ lslOp operator;
144 /*@only@*/ lslOpList operators;
145 /*@-redef@*/ /*@-matchfields@*/
162 #define YYFLAG -32768
165 #define YYTRANSLATE(x) ((unsigned)(x) <= 301 ? yytranslate[x] : 62)
167 static const char yytranslate[] = { 0,
168 2, 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, 1, 3, 4, 5, 6,
194 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
195 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
196 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
197 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
202 static const short yyprhs[] = { 0,
203 0, 2, 4, 7, 11, 13, 15, 22, 24, 27,
204 30, 34, 38, 43, 48, 54, 58, 63, 68, 74,
205 77, 81, 85, 87, 89, 91, 92, 94, 96, 100,
206 102, 104, 108, 109, 111, 113, 117, 119
209 static const short yyrhs[] = { 49,
210 0, 50, 0, 49, 50, 0, 51, 19, 57, 0,
211 61, 0, 52, 0, 10, 9, 11, 9, 12, 9,
212 0, 53, 0, 9, 53, 0, 53, 9, 0, 9,
213 53, 9, 0, 17, 54, 18, 0, 9, 17, 54,
214 18, 0, 17, 54, 18, 9, 0, 9, 17, 54,
215 18, 9, 0, 13, 54, 14, 0, 9, 13, 54,
216 14, 0, 13, 54, 14, 9, 0, 9, 13, 54,
217 14, 9, 0, 15, 3, 0, 9, 15, 3, 0,
218 9, 8, 3, 0, 6, 0, 4, 0, 5, 0,
219 0, 55, 0, 9, 0, 55, 56, 9, 0, 20,
220 0, 16, 0, 58, 7, 60, 0, 0, 59, 0,
221 60, 0, 59, 20, 60, 0, 3, 0, 3, 0
227 static const short yyrline[] = { 0,
228 137, 139, 144, 148, 154, 156, 160, 162, 164, 166,
229 168, 170, 172, 174, 176, 179, 182, 185, 188, 191,
230 194, 199, 204, 206, 208, 211, 213, 216, 218, 221,
231 223, 226, 229, 231, 234, 236, 239, 245
236 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
238 static const char * const yytname[] = { "$","error","$undefined.","LST_SIMPLEID",
239 "LST_LOGICALOP","LST_EQOP","LST_SIMPLEOP","LST_MAPSYM","LST_FIELDMAPSYM","LST_MARKERSYM",
240 "LST_ifTOKEN","LST_thenTOKEN","LST_elseTOKEN","LST_LBRACKET","LST_RBRACKET",
241 "LST_SELECTSYM","LST_SEPSYM","LST_OPENSYM","LST_CLOSESYM","LST_COLON","LST_COMMA",
242 "LST_EOL","LST_COMMENTSYM","LST_WHITESPACE","LST_QUANTIFIERSYM","LST_EQUATIONSYM",
243 "LST_EQSEPSYM","LST_COMPOSESYM","LST_LPAR","LST_RPAR","LST_assertsTOKEN","LST_assumesTOKEN",
244 "LST_byTOKEN","LST_convertsTOKEN","LST_enumerationTOKEN","LST_equationsTOKEN",
245 "LST_exemptingTOKEN","LST_forTOKEN","LST_generatedTOKEN","LST_impliesTOKEN",
246 "LST_includesTOKEN","LST_introducesTOKEN","LST_ofTOKEN","LST_partitionedTOKEN",
247 "LST_traitTOKEN","LST_tupleTOKEN","LST_unionTOKEN","LST_BADTOKEN","top","operatorList",
248 "operator","name","opForm","anyOp","middle","placeList","separator","signature",
249 "domain","sortList","sortId","opId", NULL
253 static const short yyr1[] = { 0,
254 48, 49, 49, 50, 51, 51, 52, 52, 52, 52,
255 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
256 52, 52, 53, 53, 53, 54, 54, 55, 55, 56,
257 56, 57, 58, 58, 59, 59, 60, 61
260 static const short yyr2[] = { 0,
261 1, 1, 2, 3, 1, 1, 6, 1, 2, 2,
262 3, 3, 4, 4, 5, 3, 4, 4, 5, 2,
263 3, 3, 1, 1, 1, 0, 1, 1, 3, 1,
264 1, 3, 0, 1, 1, 3, 1, 1
267 static const short yydefact[] = { 0,
268 38, 24, 25, 23, 0, 0, 26, 0, 26, 1,
269 2, 0, 6, 8, 5, 0, 26, 0, 26, 9,
270 0, 28, 0, 27, 20, 0, 3, 33, 10, 22,
271 0, 21, 0, 11, 0, 16, 31, 30, 0, 12,
272 37, 4, 0, 34, 35, 17, 13, 0, 18, 29,
273 14, 0, 0, 19, 15, 0, 32, 36, 7, 0,
277 static const short yydefgoto[] = { 60,
278 10, 11, 12, 13, 14, 23, 24, 39, 42, 43,
282 static const short yypact[] = { -3,
283 -32768,-32768,-32768,-32768, 11, -4, 0, 8, 0, -3,
284 -32768, -1,-32768, 13,-32768, 17, 0, 22, 0, 18,
285 20,-32768, 19, -12,-32768, 14,-32768, 31,-32768,-32768,
286 21,-32768, 23,-32768, 27, 28,-32768,-32768, 29, 30,
287 -32768,-32768, 33, 24,-32768, 34, 36, 35,-32768,-32768,
288 -32768, 31, 31,-32768,-32768, 37,-32768,-32768,-32768, 42,
292 static const short yypgoto[] = {-32768,
293 -32768, 39,-32768,-32768, 45, 4,-32768,-32768,-32768,-32768,
301 static const short yytable[] = { 1,
302 2, 3, 4, 37, 21, 5, 6, 38, 22, 7,
303 25, 8, 26, 9, 2, 3, 4, 28, 16, 30,
304 31, 29, 33, 17, 32, 18, 34, 19, 57, 58,
305 35, 40, 36, 41, 46, 48, 49, 50, 51, 52,
306 47, 61, 54, 53, 55, 59, 56, 62, 27, 20
309 static const short yycheck[] = { 3,
310 4, 5, 6, 16, 9, 9, 10, 20, 9, 13,
311 3, 15, 9, 17, 4, 5, 6, 19, 8, 3,
312 17, 9, 19, 13, 3, 15, 9, 17, 52, 53,
313 11, 18, 14, 3, 14, 9, 9, 9, 9, 7,
314 18, 0, 9, 20, 9, 9, 12, 0, 10, 5
318 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
320 /* This file comes from bison-1.28. */
322 /* Skeleton output parser for bison,
323 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
325 This program is free software; you can redistribute it and/or modify
326 it under the terms of the GNU General Public License as published by
327 the Free Software Foundation; either version 2, or (at your option)
330 This program is distributed in the hope that it will be useful,
331 but WITHOUT ANY WARRANTY; without even the implied warranty of
332 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
333 GNU General Public License for more details.
335 You should have received a copy of the GNU General Public License
336 along with this program; if not, write to the Free Software
337 Foundation, Inc., 59 Temple Place - Suite 330,
338 Boston, MA 02111-1307, USA. */
340 /* As a special exception, when this file is copied by Bison into a
341 Bison output file, you may use that output file without restriction.
342 This special exception was added by the Free Software Foundation
343 in version 1.24 of Bison. */
345 /* This is the parser code that is written into each bison parser
346 when the %semantic_parser declaration is not specified in the grammar.
347 It was written by Richard Stallman by simplifying the hairy parser
348 used when %semantic_parser is specified. */
350 #ifndef YYSTACK_USE_ALLOCA
352 #define YYSTACK_USE_ALLOCA
353 #else /* alloca not defined */
355 #define YYSTACK_USE_ALLOCA
356 #define alloca __builtin_alloca
357 #else /* not GNU C. */
358 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
359 #define YYSTACK_USE_ALLOCA
361 #else /* not sparc */
362 /* We think this test detects Watcom and Microsoft C. */
363 /* This used to test MSDOS, but that is a bad idea
364 since that symbol is in the user namespace. */
365 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
366 #if 0 /* No need for malloc.h, which pollutes the namespace;
367 instead, just don't use alloca. */
370 #else /* not MSDOS, or __TURBOC__ */
372 /* I don't know what this was needed for, but it pollutes the namespace.
373 So I turned it off. rms, 2 May 1997. */
374 /* #include <malloc.h> */
376 #define YYSTACK_USE_ALLOCA
377 #else /* not MSDOS, or __TURBOC__, or _AIX */
379 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
380 and on HPUX 10. Eventually we can turn this on. */
381 #define YYSTACK_USE_ALLOCA
382 #define alloca __builtin_alloca
385 #endif /* not _AIX */
386 #endif /* not MSDOS, or __TURBOC__ */
387 #endif /* not sparc */
388 #endif /* not GNU C */
389 #endif /* alloca not defined */
390 #endif /* YYSTACK_USE_ALLOCA not defined */
392 #ifdef YYSTACK_USE_ALLOCA
393 #define YYSTACK_ALLOC alloca
395 #define YYSTACK_ALLOC malloc
398 /* Note: there must be only one dollar sign in this file.
399 It is replaced by the list of actions, each action
400 as one case of the switch. */
402 #define yyerrok (yyerrstatus = 0)
403 #define yyclearin (yychar = YYEMPTY)
406 #define YYACCEPT goto yyacceptlab
407 #define YYABORT goto yyabortlab
408 #define YYERROR goto yyerrlab1
409 /* Like YYERROR except do call yyerror.
410 This remains here temporarily to ease the
411 transition to the new meaning of YYERROR, for GCC.
412 Once GCC version 2 has supplanted version 1, this can go. */
413 #define YYFAIL goto yyerrlab
414 #define YYRECOVERING() (!!yyerrstatus)
415 #define YYBACKUP(token, value) \
417 if (yychar == YYEMPTY && yylen == 1) \
418 { yychar = (token), yylval = (value); \
419 yychar1 = YYTRANSLATE (yychar); \
424 { yyerror ("syntax error: cannot back up"); YYERROR; } \
428 #define YYERRCODE 256
431 #define YYLEX yylex()
437 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
439 #define YYLEX yylex(&yylval, &yylloc)
441 #else /* not YYLSP_NEEDED */
443 #define YYLEX yylex(&yylval, YYLEX_PARAM)
445 #define YYLEX yylex(&yylval)
447 #endif /* not YYLSP_NEEDED */
450 /* If nonreentrant, generate the variables here */
454 int yychar; /* the lookahead symbol */
455 YYSTYPE yylval; /* the semantic value of the */
456 /* lookahead symbol */
459 YYLTYPE yylloc; /* location data for the lookahead */
463 int yynerrs; /* number of parse errors so far */
464 #endif /* not YYPURE */
467 int yydebug; /* nonzero means print parse trace */
468 /* Since this is uninitialized, it does not stop multiple parsers
472 /* YYINITDEPTH indicates the initial size of the parser's stacks */
475 #define YYINITDEPTH 200
478 /* YYMAXDEPTH is the maximum size the stacks can grow to
479 (effective only if the built-in stack extension method is used). */
486 #define YYMAXDEPTH 10000
489 /* Define __yy_memcpy. Note that the size argument
490 should be passed with type unsigned int, because that is what the non-GCC
491 definitions require. With GCC, __builtin_memcpy takes an arg
492 of type size_t, but it can handle unsigned int. */
494 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
495 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
496 #else /* not GNU C or C++ */
499 /* This is the most reliable way to avoid incompatibilities
500 in available built-in functions on various systems. */
502 __yy_memcpy (to, from, count)
507 register char *f = from;
508 register char *t = to;
509 register int i = count;
515 #else /* __cplusplus */
517 /* This is the most reliable way to avoid incompatibilities
518 in available built-in functions on various systems. */
520 __yy_memcpy (char *to, char *from, unsigned int count)
522 register char *t = to;
523 register char *f = from;
524 register int i = count;
535 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
536 into yyparse. The argument should have type void *.
537 It should actually point to an object.
538 Grammar actions can access the variable by casting it
539 to the proper pointer type. */
543 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
544 #define YYPARSE_PARAM_DECL
545 #else /* not __cplusplus */
546 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
547 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
548 #endif /* not __cplusplus */
549 #else /* not YYPARSE_PARAM */
550 #define YYPARSE_PARAM_ARG
551 #define YYPARSE_PARAM_DECL
552 #endif /* not YYPARSE_PARAM */
554 /* Prevent warning if -Wstrict-prototypes. */
557 int yyparse (void *);
564 yyparse(YYPARSE_PARAM_ARG)
567 register int yystate;
569 register short *yyssp;
570 register YYSTYPE *yyvsp;
571 int yyerrstatus; /* number of tokens to shift before error messages enabled */
572 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
574 short yyssa[YYINITDEPTH]; /* the state stack */
575 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
577 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
578 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
581 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
582 YYLTYPE *yyls = yylsa;
585 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
587 #define YYPOPSTACK (yyvsp--, yyssp--)
590 int yystacksize = YYINITDEPTH;
591 int yyfree_stacks = 0;
602 YYSTYPE yyval; /* the variable used to return */
603 /* semantic values from the action */
610 fprintf(stderr, "Starting parse\n");
616 yychar = YYEMPTY; /* Cause a token to be read. */
618 /* Initialize stack pointers.
619 Waste one element of value and location stack
620 so that they stay on the same level as the state stack.
621 The wasted elements are never initialized. */
629 /* Push a new state, which is found in yystate . */
630 /* In all cases, when you get here, the value and location stacks
631 have just been pushed. so pushing a state here evens the stacks. */
636 if (yyssp >= yyss + yystacksize - 1)
638 /* Give user a chance to reallocate the stack */
639 /* Use copies of these so that the &'s don't force the real ones into memory. */
640 YYSTYPE *yyvs1 = yyvs;
643 YYLTYPE *yyls1 = yyls;
646 /* Get the current used size of the three stacks, in elements. */
647 int size = yyssp - yyss + 1;
650 /* Each stack pointer address is followed by the size of
651 the data in use in that stack, in bytes. */
653 /* This used to be a conditional around just the two extra args,
654 but that might be undefined if yyoverflow is a macro. */
655 yyoverflow("parser stack overflow",
656 &yyss1, size * sizeof (*yyssp),
657 &yyvs1, size * sizeof (*yyvsp),
658 &yyls1, size * sizeof (*yylsp),
661 yyoverflow("parser stack overflow",
662 &yyss1, size * sizeof (*yyssp),
663 &yyvs1, size * sizeof (*yyvsp),
667 yyss = yyss1; yyvs = yyvs1;
671 #else /* no yyoverflow */
672 /* Extend the stack our own way. */
673 if (yystacksize >= YYMAXDEPTH)
675 yyerror("parser stack overflow");
687 if (yystacksize > YYMAXDEPTH)
688 yystacksize = YYMAXDEPTH;
689 #ifndef YYSTACK_USE_ALLOCA
692 yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
693 __yy_memcpy ((char *)yyss, (char *)yyss1,
694 size * (unsigned int) sizeof (*yyssp));
695 yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
696 __yy_memcpy ((char *)yyvs, (char *)yyvs1,
697 size * (unsigned int) sizeof (*yyvsp));
699 yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
700 __yy_memcpy ((char *)yyls, (char *)yyls1,
701 size * (unsigned int) sizeof (*yylsp));
703 #endif /* no yyoverflow */
705 yyssp = yyss + size - 1;
706 yyvsp = yyvs + size - 1;
708 yylsp = yyls + size - 1;
713 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
716 if (yyssp >= yyss + yystacksize - 1)
722 fprintf(stderr, "Entering state %d\n", yystate);
728 /* Do appropriate processing given the current state. */
729 /* Read a lookahead token if we need one and don't already have one. */
732 /* First try to decide what to do without reference to lookahead token. */
734 yyn = yypact[yystate];
738 /* Not known => get a lookahead token if don't already have one. */
740 /* yychar is either YYEMPTY or YYEOF
741 or a valid token in external form. */
743 if (yychar == YYEMPTY)
747 fprintf(stderr, "Reading a token: ");
752 /* Convert token to internal form (in yychar1) for indexing tables with */
754 if (yychar <= 0) /* This means end of input. */
757 yychar = YYEOF; /* Don't call YYLEX any more */
761 fprintf(stderr, "Now at end of input.\n");
766 yychar1 = YYTRANSLATE(yychar);
771 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
772 /* Give the individual parser a way to print the precise meaning
773 of a token, for further debugging info. */
775 YYPRINT (stderr, yychar, yylval);
777 fprintf (stderr, ")\n");
783 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
788 /* yyn is what to do for this token type in this state.
789 Negative => reduce, -yyn is rule number.
790 Positive => shift, yyn is new state.
791 New state is final state => don't bother to shift,
793 0, or most negative number => error. */
808 /* Shift the lookahead token. */
812 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
815 /* Discard the token being shifted unless it is eof. */
824 /* count tokens shifted since error; after three, turn off error status. */
825 if (yyerrstatus) yyerrstatus--;
830 /* Do the default action for the current state. */
833 yyn = yydefact[yystate];
837 /* Do a reduction. yyn is the number of a rule to reduce with. */
841 yyval = yyvsp[1-yylen]; /* implement default value of the action */
848 fprintf (stderr, "Reducing via rule %d (line %d), ",
851 /* Print the symbols being reduced, and their result. */
852 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
853 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
854 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
862 { lslOpList_free (yyvsp[0].operators); ;
865 { lslOpList x = lslOpList_new ();
866 g_importedlslOp = yyvsp[0].operator;
867 lslOpList_add (x, yyvsp[0].operator);
868 yyval.operators = x; ;
871 { lslOpList_add (yyvsp[-1].operators, yyvsp[0].operator);
872 yyval.operators = yyvsp[-1].operators; ;
875 { yyval.operator = makelslOpNode (yyvsp[-2].name, yyvsp[0].signature); ;
878 { yyval.name = makeNameNodeId (yyvsp[0].ltok); ;
881 { yyval.name = makeNameNodeForm (yyvsp[0].opform); ;
884 { yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;
887 { yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
890 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
893 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
896 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
899 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
902 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
905 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
908 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM,
909 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
912 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE,
913 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
916 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE,
917 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
920 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM,
921 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
924 { yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM,
925 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
928 { yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT,
929 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
932 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT,
933 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
936 { yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP,
937 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
940 { yyval.ltok = yyvsp[0].ltok; ;
943 { yyval.ltok = yyvsp[0].ltok; ;
946 { yyval.ltok = yyvsp[0].ltok; ;
952 { yyval.count = yyvsp[0].count; ;
958 { yyval.count = yyvsp[-2].count + 1; ;
961 { yyval.ltok = yyvsp[0].ltok; ;
964 { yyval.ltok = yyvsp[0].ltok; ;
967 { yyval.signature = makesigNode (yyvsp[-1].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
970 { yyval.ltokenList = ltokenList_new (); ;
973 { yyval.ltokenList = yyvsp[0].ltokenList; ;
976 { yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
979 { yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
983 yyval.ltok = yyvsp[0].ltok;
984 ltoken_setText (yyval.ltok, processTraitSortId (ltoken_getText (yyvsp[0].ltok)));
988 { yyval.ltok = yyvsp[0].ltok; ;
991 /* the action file gets copied in in place of this dollarsign */
1003 short *ssp1 = yyss - 1;
1004 fprintf (stderr, "state stack now");
1005 while (ssp1 != yyssp)
1006 fprintf (stderr, " %d", *++ssp1);
1007 fprintf (stderr, "\n");
1017 yylsp->first_line = yylloc.first_line;
1018 yylsp->first_column = yylloc.first_column;
1019 yylsp->last_line = (yylsp-1)->last_line;
1020 yylsp->last_column = (yylsp-1)->last_column;
1025 yylsp->last_line = (yylsp+yylen-1)->last_line;
1026 yylsp->last_column = (yylsp+yylen-1)->last_column;
1030 /* Now "shift" the result of the reduction.
1031 Determine what state that goes to,
1032 based on the state we popped back to
1033 and the rule number reduced by. */
1037 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1038 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1039 yystate = yytable[yystate];
1041 yystate = yydefgoto[yyn - YYNTBASE];
1045 yyerrlab: /* here on detecting error */
1048 /* If not already recovering from an error, report this error. */
1052 #ifdef YYERROR_VERBOSE
1053 yyn = yypact[yystate];
1055 if (yyn > YYFLAG && yyn < YYLAST)
1062 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1063 for (x = (yyn < 0 ? -yyn : 0);
1064 x < (sizeof(yytname) / sizeof(char *)); x++)
1065 if (yycheck[x + yyn] == x)
1066 size += strlen(yytname[x]) + 15, count++;
1067 msg = (char *) malloc(size + 15);
1070 strcpy(msg, "parse error");
1075 for (x = (yyn < 0 ? -yyn : 0);
1076 x < (sizeof(yytname) / sizeof(char *)); x++)
1077 if (yycheck[x + yyn] == x)
1079 strcat(msg, count == 0 ? ", expecting `" : " or `");
1080 strcat(msg, yytname[x]);
1089 yyerror ("parse error; also virtual memory exceeded");
1092 #endif /* YYERROR_VERBOSE */
1093 yyerror("parse error");
1097 yyerrlab1: /* here on error raised explicitly by an action */
1099 if (yyerrstatus == 3)
1101 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1103 /* return failure if at end of input */
1104 if (yychar == YYEOF)
1109 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1115 /* Else will try to reuse lookahead token
1116 after shifting the error token. */
1118 yyerrstatus = 3; /* Each real token shifted decrements this */
1122 yyerrdefault: /* current state does not do anything special for the error token. */
1125 /* This is wrong; only states that explicitly want error tokens
1126 should shift them. */
1127 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1128 if (yyn) goto yydefault;
1131 yyerrpop: /* pop the current state because it cannot handle the error token */
1133 if (yyssp == yyss) YYABORT;
1143 short *ssp1 = yyss - 1;
1144 fprintf (stderr, "Error: state stack now");
1145 while (ssp1 != yyssp)
1146 fprintf (stderr, " %d", *++ssp1);
1147 fprintf (stderr, "\n");
1153 yyn = yypact[yystate];
1158 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1177 fprintf(stderr, "Shifting error token, ");
1189 /* YYACCEPT comes here. */
1201 /* YYABORT comes here. */
1214 # include "bison.reset"
1216 extern char *yytext;
1218 void lslerror (char *s)
1221 (cstring_makeLiteral
1222 ("There has been a problem in the parser with LSL signatures. This is believed to result "
1223 "from a problem with bison v. 1.25. Please try rebuidling LCLint "
1224 "using the pre-compiled grammar files by commenting out the "
1225 "BISON= line in the top-level Makefile."));
1228 static void yyprint (FILE *file, int type, YYSTYPE value)
1230 fprintf (file, " (%u:%u type: %d; text: %s) ",
1231 ltoken_getLine (value.ltok),
1232 ltoken_getCol (value.ltok),
1234 ltoken_getRawTextChars (value.ltok));
1237 extern void PrintToken (ltoken tok) {
1240 switch (ltoken_getCode (tok))
1242 case NOTTOKEN: codStr = "*** NOTTOKEN ***"; break;
1243 case LST_QUANTIFIERSYM: codStr = "QUANTIFIERSYM"; break;
1244 case LST_LOGICALOP: codStr = "LOGICALOP: "; break;
1245 case LST_SELECTSYM: codStr = "LST_SELECTSYM"; break;
1246 case LST_OPENSYM: codStr = "LST_OPENSYM"; break;
1247 case LST_SEPSYM: codStr = "SEPSYM"; break;
1248 case LST_CLOSESYM: codStr = "LST_CLOSESYM"; break;
1249 case LST_SIMPLEID: codStr = "LST_SIMPLEID"; break;
1250 case LST_MAPSYM: codStr = "MAPSYM"; break;
1251 case LST_MARKERSYM: codStr = "LST_MARKERSYM"; break;
1252 case LST_COMMENTSYM: codStr = "COMMENTSYM"; break;
1253 case LST_SIMPLEOP: codStr = "SIMPLEOP"; break;
1254 case LST_COLON: codStr = "LST_COLON"; break;
1255 case LST_COMMA: codStr = "COMMA"; break;
1256 case LST_LBRACKET: codStr = "LST_LBRACKET"; break;
1257 case LST_LPAR: codStr = "LST_LPAR"; break;
1258 case LST_RBRACKET: codStr = "LST_RBRACKET"; break;
1259 case LST_RPAR: codStr = "LST_RPAR"; break;
1260 case LST_EQOP: codStr = "LST_EQOP"; break;
1261 case LST_WHITESPACE: codStr = "WHITESPACE,"; break;
1262 case LST_EOL: codStr = "LST_EOL"; break;
1263 case LST_elseTOKEN: codStr = "elseTOKEN"; break;
1264 case LST_ifTOKEN: codStr = "ifTOKEN"; break;
1265 case LST_thenTOKEN: codStr = "thenTOKEN"; break;
1266 case LST_BADTOKEN: codStr = "*** BADTOKEN ***"; break;
1267 case LEOFTOKEN: /* can't reach LEOFTOKEN easily */
1268 codStr = "LEOFTOKEN"; break;
1270 codStr = "*** invalid token code ***";
1274 /* only used for debugging */
1275 printf ("%u:%u: Token Code (%u): %s",
1276 ltoken_getLine (tok), ltoken_getCol (tok),
1277 ltoken_getCode (tok), codStr);
1278 if (ltoken_getRawText (tok) != 0)
1280 printf (", Token String (%lu): %s\n",
1281 ltoken_getRawText (tok), ltoken_getRawTextChars (tok));
1290 ** Resets all flags in bison.head
1312 /*@=evalorderuncon@*/
1321 /*@=elseifcomplete@*/
1325 /*@=readonlytrans@*/
1328 /*@=systemunrecog@*/
1329 /*@=dependenttrans@*/
1330 /*@=unqualifiedtrans@*/
1334 /*drl added 11/27/2001*/