]> andersk Git - splint.git/blame - src/signature.c.der
Added support for omitted if clauses in conditionals, patch provided by peteran.
[splint.git] / src / signature.c.der
CommitLineData
885824d3 1/*
2** Inserted at beginning of c files generated by bison
3** REMEMBER: Change bison.reset too.
4*/
5
6/*@-allmacros@*/
7/*@+boolint@*/
8/*@+charint@*/
9/*@-macroparams@*/
10/*@-macroundef@*/
11/*@-unreachable@*/
12/*@-macrospec@*/
13/*@-varuse@*/
14/*@+ignorequals@*/
15/*@-macrostmt@*/
16/*@-noeffect@*/
17/*@-shadow@*/
18/*@-exitarg@*/
19/*@-macroredef@*/
20/*@-uniondef@*/
21/*@-compdef@*/
22/*@-matchfields@*/
23/*@-exportlocal@*/
24/*@-evalorderuncon@*/
25/*@-exportheader@*/
26/*@-typeuse@*/
27/*@-redecl@*/
28/*@-redef@*/
29/*@-noparams@*/
30/*@-ansireserved@*/
31/*@-fielduse@*/
32/*@-ifblock@*/
33/*@-elseifcomplete@*/
34/*@-whileblock@*/
35/*@-forblock@*/
36/*@-branchstate@*/
37/*@-readonlytrans@*/
38/*@-namechecks@*/
39/*@-usedef@*/
40/*@-systemunrecog@*/
41/*@-dependenttrans@*/
42/*@-unqualifiedtrans@*/
43/*@-nullassign@*/
bb7c2085 44/*@-nullpass@*/
45/*@-nullptrarith*/
46/*@-usereleased@*/
bbed3d50 47/*@-declundef@*/
885824d3 48
bbed3d50 49/*drl added 11/27/2001*/
bb7c2085 50/*@-bounds@*/
e015e087 51
52/*drl added 12/11/2002*/
53/*@-type@*/
54
885824d3 55/* < end of bison.head > */
56
368f75ae 57/* A Bison parser, made from signature.y
58 by GNU bison 1.35. */
885824d3 59
368f75ae 60#define YYBISON 1 /* Identify Bison output. */
885824d3 61
62#define yyparse lslparse
368f75ae 63#define yylex lsllex
885824d3 64#define yyerror lslerror
368f75ae 65#define yylval lsllval
66#define yychar lslchar
885824d3 67#define yydebug lsldebug
68#define yynerrs lslnerrs
368f75ae 69# define LST_SIMPLEID 257
70# define LST_LOGICALOP 258
71# define LST_EQOP 259
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
87# define LST_EOL 275
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
94# define LST_LPAR 282
95# define LST_RPAR 283
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
885824d3 114
885824d3 115
116
885824d3 117# include <stdio.h>
1b8ae690 118# include "splintMacros.nf"
b73d1009 119# include "basic.h"
885824d3 120# include "lslparse.h"
121# include "signature.h"
122
4dd72714 123static void lslerror (char *);
124extern int lsllex ();
125
885824d3 126/*@dependent@*/ /*@null@*/ lslOp importedlslOp;
127
128/*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
129static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
130/*@=noparams@*/
131
132# define YYPRINT(file, type, value) yyprint (file, type, value)
133
134# define YYDEBUG 1
135
bbed3d50 136/*@-redef@*/
137/*@-readonlytrans@*/
138/*@-nullassign@*/
885824d3 139
140
368f75ae 141#ifndef YYSTYPE
142typedef union {
885824d3 143 ltoken ltok; /* a leaf is also an ltoken */
144 unsigned int count;
145 /*@only@*/ ltokenList ltokenList;
146 /*@only@*/ opFormNode opform;
147 /*@owned@*/ sigNode signature;
148 /*@only@*/ nameNode name;
149 /*@owned@*/ lslOp operator;
150 /*@only@*/ lslOpList operators;
bbed3d50 151 /*@-redef@*/ /*@-matchfields@*/
368f75ae 152} yystype;
153# define YYSTYPE yystype
8f58355a 154# define YYSTYPE_IS_TRIVIAL 1
885824d3 155#endif
368f75ae 156#ifndef YYDEBUG
157# define YYDEBUG 1
158#endif
159
160
161
162#define YYFINAL 62
163#define YYFLAG -32768
164#define YYNTBASE 48
165
166/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
167#define YYTRANSLATE(x) ((unsigned)(x) <= 301 ? yytranslate[x] : 62)
168
169/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
170static const char yytranslate[] =
171{
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,
202 46, 47
203};
204
205#if YYDEBUG
206static const short yyprhs[] =
207{
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
212};
213static const short yyrhs[] =
214{
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,
227 0
228};
229
230#endif
231
232#if YYDEBUG
233/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
234static const short yyrline[] =
235{
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
240};
241#endif
242
243
244#if (YYDEBUG) || defined YYERROR_VERBOSE
245
246/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
247static const char *const yytname[] =
248{
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",
264 "opId", 0
265};
266#endif
267
268/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
269static const short yyr1[] =
270{
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
275};
276
277/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
278static const short yyr2[] =
279{
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
284};
285
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
288 error. */
289static const short yydefact[] =
290{
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,
297 0, 0, 0
298};
299
300static const short yydefgoto[] =
301{
302 60, 10, 11, 12, 13, 14, 23, 24, 39, 42,
303 43, 44, 45, 15
304};
305
306static const short yypact[] =
307{
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,
314 42, 48,-32768
315};
316
317static const short yypgoto[] =
318{
319 -32768,-32768, 39,-32768,-32768, 45, 4,-32768,-32768,-32768,
320 -32768,-32768, -23,-32768
321};
322
323
324#define YYLAST 50
325
326
327static const short yytable[] =
328{
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,
334 20
335};
885824d3 336
368f75ae 337static const short yycheck[] =
338{
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,
344 5
345};
346#define YYPURE 1
885824d3 347
368f75ae 348/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
3e3ec469 349
368f75ae 350/* Skeleton output parser for bison,
e5081f8c 351
368f75ae 352 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
353 Foundation, Inc.
885824d3 354
368f75ae 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)
358 any later version.
885824d3 359
368f75ae 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.
885824d3 364
368f75ae 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. */
369
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. */
374
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. */
379
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. */
386
387#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
e5081f8c 388
389/* The parser invokes alloca or malloc; define the necessary symbols. */
390
391# if YYSTACK_USE_ALLOCA
392# define YYSTACK_ALLOC alloca
393# else
394# ifndef YYSTACK_USE_ALLOCA
395# if defined (alloca) || defined (_ALLOCA_H)
396# define YYSTACK_ALLOC alloca
397# else
398# ifdef __GNUC__
399# define YYSTACK_ALLOC __builtin_alloca
400# endif
401# endif
402# endif
403# endif
404
405# ifdef YYSTACK_ALLOC
406 /* Pacify GCC's `empty if-body' warning. */
407# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
408# else
409# if defined (__STDC__) || defined (__cplusplus)
410# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
411# define YYSIZE_T size_t
412# endif
413# define YYSTACK_ALLOC malloc
414# define YYSTACK_FREE free
415# endif
368f75ae 416#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
e5081f8c 417
418
419#if (! defined (yyoverflow) \
420 && (! defined (__cplusplus) \
368f75ae 421 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
e5081f8c 422
423/* A type that is properly aligned for any stack member. */
424union yyalloc
425{
426 short yyss;
427 YYSTYPE yyvs;
368f75ae 428# if YYLSP_NEEDED
429 YYLTYPE yyls;
430# endif
431};
e5081f8c 432
433/* The size of the maximum gap between one aligned stack and the next. */
368f75ae 434# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
e5081f8c 435
436/* The size of an array large to enough to hold all stacks, each with
437 N elements. */
368f75ae 438# if YYLSP_NEEDED
439# define YYSTACK_BYTES(N) \
440 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
441 + 2 * YYSTACK_GAP_MAX)
442# else
443# define YYSTACK_BYTES(N) \
e5081f8c 444 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
368f75ae 445 + YYSTACK_GAP_MAX)
446# endif
e5081f8c 447
448/* Copy COUNT objects from FROM to TO. The source and destination do
449 not overlap. */
450# ifndef YYCOPY
451# if 1 < __GNUC__
452# define YYCOPY(To, From, Count) \
453 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
454# else
455# define YYCOPY(To, From, Count) \
456 do \
457 { \
458 register YYSIZE_T yyi; \
459 for (yyi = 0; yyi < (Count); yyi++) \
460 (To)[yyi] = (From)[yyi]; \
461 } \
462 while (0)
463# endif
464# endif
465
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
470 stack. */
471# define YYSTACK_RELOCATE(Stack) \
472 do \
473 { \
474 YYSIZE_T yynewbytes; \
475 YYCOPY (&yyptr->Stack, Stack, yysize); \
476 Stack = &yyptr->Stack; \
368f75ae 477 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
e5081f8c 478 yyptr += yynewbytes / sizeof (*yyptr); \
479 } \
480 while (0)
d0b80d80 481
d0b80d80 482#endif
e5081f8c 483
484
485#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
486# define YYSIZE_T __SIZE_TYPE__
d0b80d80 487#endif
e5081f8c 488#if ! defined (YYSIZE_T) && defined (size_t)
489# define YYSIZE_T size_t
490#endif
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
495# endif
496#endif
497#if ! defined (YYSIZE_T)
498# define YYSIZE_T unsigned int
e55c0c6d 499#endif
0866200b 500
885824d3 501#define yyerrok (yyerrstatus = 0)
502#define yyclearin (yychar = YYEMPTY)
368f75ae 503#define YYEMPTY -2
885824d3 504#define YYEOF 0
bbed3d50 505#define YYACCEPT goto yyacceptlab
368f75ae 506#define YYABORT goto yyabortlab
885824d3 507#define YYERROR goto yyerrlab1
e5081f8c 508/* Like YYERROR except do call yyerror. This remains here temporarily
509 to ease the transition to the new meaning of YYERROR, for GCC.
885824d3 510 Once GCC version 2 has supplanted version 1, this can go. */
511#define YYFAIL goto yyerrlab
512#define YYRECOVERING() (!!yyerrstatus)
e5081f8c 513#define YYBACKUP(Token, Value) \
885824d3 514do \
515 if (yychar == YYEMPTY && yylen == 1) \
e5081f8c 516 { \
517 yychar = (Token); \
518 yylval = (Value); \
368f75ae 519 yychar1 = YYTRANSLATE (yychar); \
885824d3 520 YYPOPSTACK; \
521 goto yybackup; \
522 } \
523 else \
e5081f8c 524 { \
368f75ae 525 yyerror ("syntax error: cannot back up"); \
e5081f8c 526 YYERROR; \
527 } \
885824d3 528while (0)
529
530#define YYTERROR 1
531#define YYERRCODE 256
532
368f75ae 533
e5081f8c 534/* YYLLOC_DEFAULT -- Compute the default location (before the actions
368f75ae 535 are run).
536
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. */
885824d3 540
e5081f8c 541#ifndef YYLLOC_DEFAULT
368f75ae 542# define YYLLOC_DEFAULT(Current, Rhs, N) \
543 Current.last_line = Rhs[N].last_line; \
544 Current.last_column = Rhs[N].last_column;
885824d3 545#endif
546
368f75ae 547
e5081f8c 548/* YYLEX -- calling `yylex' with the right arguments. */
549
368f75ae 550#if YYPURE
551# if YYLSP_NEEDED
552# ifdef YYLEX_PARAM
553# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
554# else
555# define YYLEX yylex (&yylval, &yylloc)
556# endif
557# else /* !YYLSP_NEEDED */
558# ifdef YYLEX_PARAM
559# define YYLEX yylex (&yylval, YYLEX_PARAM)
560# else
561# define YYLEX yylex (&yylval)
562# endif
563# endif /* !YYLSP_NEEDED */
564#else /* !YYPURE */
565# define YYLEX yylex ()
566#endif /* !YYPURE */
567
e5081f8c 568
569/* Enable debugging if requested. */
570#if YYDEBUG
571
572# ifndef YYFPRINTF
573# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
574# define YYFPRINTF fprintf
575# endif
576
577# define YYDPRINTF(Args) \
578do { \
579 if (yydebug) \
580 YYFPRINTF Args; \
581} while (0)
582/* Nonzero means print parse trace. It is left uninitialized so that
583 multiple parsers can coexist. */
584int yydebug;
585#else /* !YYDEBUG */
586# define YYDPRINTF(Args)
587#endif /* !YYDEBUG */
588
589/* YYINITDEPTH -- initial size of the parser's stacks. */
0866200b 590#ifndef YYINITDEPTH
e5081f8c 591# define YYINITDEPTH 200
0866200b 592#endif
d0b80d80 593
e5081f8c 594/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
595 if the built-in stack extension method is used).
596
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. */
a889b5ee 600
885824d3 601#if YYMAXDEPTH == 0
e5081f8c 602# undef YYMAXDEPTH
885824d3 603#endif
604
605#ifndef YYMAXDEPTH
e5081f8c 606# define YYMAXDEPTH 10000
885824d3 607#endif
1ac6313d 608\f
368f75ae 609#ifdef YYERROR_VERBOSE
885824d3 610
e5081f8c 611# ifndef yystrlen
612# if defined (__GLIBC__) && defined (_STRING_H)
613# define yystrlen strlen
614# else
615/* Return the length of YYSTR. */
616static YYSIZE_T
617# if defined (__STDC__) || defined (__cplusplus)
618yystrlen (const char *yystr)
619# else
620yystrlen (yystr)
621 const char *yystr;
622# endif
623{
624 register const char *yys = yystr;
a889b5ee 625
e5081f8c 626 while (*yys++ != '\0')
627 continue;
0866200b 628
e5081f8c 629 return yys - yystr - 1;
630}
631# endif
632# endif
633
634# ifndef yystpcpy
635# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
636# define yystpcpy stpcpy
637# else
638/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
639 YYDEST. */
640static char *
641# if defined (__STDC__) || defined (__cplusplus)
642yystpcpy (char *yydest, const char *yysrc)
643# else
644yystpcpy (yydest, yysrc)
645 char *yydest;
646 const char *yysrc;
647# endif
0866200b 648{
e5081f8c 649 register char *yyd = yydest;
650 register const char *yys = yysrc;
a889b5ee 651
e5081f8c 652 while ((*yyd++ = *yys++) != '\0')
653 continue;
0866200b 654
e5081f8c 655 return yyd - 1;
656}
657# endif
658# endif
8f58355a 659#endif
8f58355a 660\f
885824d3 661
368f75ae 662
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. */
885824d3 668
669#ifdef YYPARSE_PARAM
e5081f8c 670# if defined (__STDC__) || defined (__cplusplus)
368f75ae 671# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
672# define YYPARSE_PARAM_DECL
e5081f8c 673# else
368f75ae 674# define YYPARSE_PARAM_ARG YYPARSE_PARAM
675# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
e5081f8c 676# endif
368f75ae 677#else /* !YYPARSE_PARAM */
678# define YYPARSE_PARAM_ARG
679# define YYPARSE_PARAM_DECL
680#endif /* !YYPARSE_PARAM */
681
682/* Prevent warning if -Wstrict-prototypes. */
683#ifdef __GNUC__
684# ifdef YYPARSE_PARAM
685int yyparse (void *);
686# else
bbed3d50 687int yyparse (void);
368f75ae 688# endif
bbed3d50 689#endif
e5081f8c 690
368f75ae 691/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
692 variables are global, or local to YYPARSE. */
693
694#define YY_DECL_NON_LSP_VARIABLES \
695/* The lookahead symbol. */ \
696int yychar; \
697 \
698/* The semantic value of the lookahead symbol. */ \
699YYSTYPE yylval; \
700 \
701/* Number of parse errors so far. */ \
702int yynerrs;
bbed3d50 703
368f75ae 704#if YYLSP_NEEDED
705# define YY_DECL_VARIABLES \
706YY_DECL_NON_LSP_VARIABLES \
707 \
708/* Location data for the lookahead symbol. */ \
709YYLTYPE yylloc;
710#else
711# define YY_DECL_VARIABLES \
712YY_DECL_NON_LSP_VARIABLES
713#endif
e5081f8c 714
e5081f8c 715
368f75ae 716/* If nonreentrant, generate the variables here. */
e5081f8c 717
368f75ae 718#if !YYPURE
719YY_DECL_VARIABLES
720#endif /* !YYPURE */
8f58355a 721
885824d3 722int
368f75ae 723yyparse (YYPARSE_PARAM_ARG)
724 YYPARSE_PARAM_DECL
885824d3 725{
368f75ae 726 /* If reentrant, generate the variables here. */
727#if YYPURE
728 YY_DECL_VARIABLES
729#endif /* !YYPURE */
e5081f8c 730
885824d3 731 register int yystate;
732 register int yyn;
e5081f8c 733 int yyresult;
734 /* Number of tokens to shift before error messages enabled. */
735 int yyerrstatus;
736 /* Lookahead token as an internal (translated) token number. */
368f75ae 737 int yychar1 = 0;
e5081f8c 738
739 /* Three stacks and their tools:
740 `yyss': related to states,
741 `yyvs': related to semantic values,
742 `yyls': related to locations.
743
744 Refer to the stacks thru separate pointers, to allow yyoverflow
745 to reallocate them elsewhere. */
746
368f75ae 747 /* The state stack. */
e5081f8c 748 short yyssa[YYINITDEPTH];
749 short *yyss = yyssa;
885824d3 750 register short *yyssp;
885824d3 751
e5081f8c 752 /* The semantic value stack. */
753 YYSTYPE yyvsa[YYINITDEPTH];
754 YYSTYPE *yyvs = yyvsa;
755 register YYSTYPE *yyvsp;
0866200b 756
368f75ae 757#if YYLSP_NEEDED
758 /* The location stack. */
759 YYLTYPE yylsa[YYINITDEPTH];
760 YYLTYPE *yyls = yylsa;
761 YYLTYPE *yylsp;
762#endif
885824d3 763
368f75ae 764#if YYLSP_NEEDED
765# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
766#else
767# define YYPOPSTACK (yyvsp--, yyssp--)
768#endif
885824d3 769
8f58355a 770 YYSIZE_T yystacksize = YYINITDEPTH;
0866200b 771
368f75ae 772
e5081f8c 773 /* The variables used to return semantic value and location from the
774 action routines. */
775 YYSTYPE yyval;
368f75ae 776#if YYLSP_NEEDED
777 YYLTYPE yyloc;
778#endif
885824d3 779
e5081f8c 780 /* When reducing, the number of symbols on the RHS of the reduced
368f75ae 781 rule. */
885824d3 782 int yylen;
783
e5081f8c 784 YYDPRINTF ((stderr, "Starting parse\n"));
885824d3 785
786 yystate = 0;
787 yyerrstatus = 0;
788 yynerrs = 0;
789 yychar = YYEMPTY; /* Cause a token to be read. */
790
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. */
795
e5081f8c 796 yyssp = yyss;
885824d3 797 yyvsp = yyvs;
368f75ae 798#if YYLSP_NEEDED
799 yylsp = yyls;
800#endif
e5081f8c 801 goto yysetstate;
885824d3 802
e5081f8c 803/*------------------------------------------------------------.
804| yynewstate -- Push a new state, which is found in yystate. |
805`------------------------------------------------------------*/
806 yynewstate:
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.
809 */
810 yyssp++;
885824d3 811
e5081f8c 812 yysetstate:
813 *yyssp = yystate;
885824d3 814
368f75ae 815 if (yyssp >= yyss + yystacksize - 1)
885824d3 816 {
885824d3 817 /* Get the current used size of the three stacks, in elements. */
e5081f8c 818 YYSIZE_T yysize = yyssp - yyss + 1;
885824d3 819
820#ifdef yyoverflow
e5081f8c 821 {
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
824 memory. */
825 YYSTYPE *yyvs1 = yyvs;
826 short *yyss1 = yyss;
827
828 /* Each stack pointer address is followed by the size of the
368f75ae 829 data in use in that stack, in bytes. */
830# if YYLSP_NEEDED
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. */
e5081f8c 834 yyoverflow ("parser stack overflow",
835 &yyss1, yysize * sizeof (*yyssp),
836 &yyvs1, yysize * sizeof (*yyvsp),
368f75ae 837 &yyls1, yysize * sizeof (*yylsp),
e5081f8c 838 &yystacksize);
368f75ae 839 yyls = yyls1;
840# else
841 yyoverflow ("parser stack overflow",
842 &yyss1, yysize * sizeof (*yyssp),
843 &yyvs1, yysize * sizeof (*yyvsp),
844 &yystacksize);
845# endif
e5081f8c 846 yyss = yyss1;
847 yyvs = yyvs1;
848 }
885824d3 849#else /* no yyoverflow */
e5081f8c 850# ifndef YYSTACK_RELOCATE
851 goto yyoverflowlab;
852# else
885824d3 853 /* Extend the stack our own way. */
368f75ae 854 if (yystacksize >= YYMAXDEPTH)
e5081f8c 855 goto yyoverflowlab;
885824d3 856 yystacksize *= 2;
368f75ae 857 if (yystacksize > YYMAXDEPTH)
885824d3 858 yystacksize = YYMAXDEPTH;
e5081f8c 859
860 {
861 short *yyss1 = yyss;
862 union yyalloc *yyptr =
863 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
864 if (! yyptr)
865 goto yyoverflowlab;
866 YYSTACK_RELOCATE (yyss);
867 YYSTACK_RELOCATE (yyvs);
368f75ae 868# if YYLSP_NEEDED
869 YYSTACK_RELOCATE (yyls);
870# endif
871# undef YYSTACK_RELOCATE
e5081f8c 872 if (yyss1 != yyssa)
873 YYSTACK_FREE (yyss1);
874 }
875# endif
885824d3 876#endif /* no yyoverflow */
877
e5081f8c 878 yyssp = yyss + yysize - 1;
879 yyvsp = yyvs + yysize - 1;
368f75ae 880#if YYLSP_NEEDED
881 yylsp = yyls + yysize - 1;
882#endif
885824d3 883
e5081f8c 884 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
885 (unsigned long int) yystacksize));
885824d3 886
368f75ae 887 if (yyssp >= yyss + yystacksize - 1)
885824d3 888 YYABORT;
889 }
890
e5081f8c 891 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
885824d3 892
893 goto yybackup;
e5081f8c 894
368f75ae 895
e5081f8c 896/*-----------.
897| yybackup. |
898`-----------*/
899yybackup:
885824d3 900
901/* Do appropriate processing given the current state. */
902/* Read a lookahead token if we need one and don't already have one. */
903/* yyresume: */
904
905 /* First try to decide what to do without reference to lookahead token. */
906
907 yyn = yypact[yystate];
368f75ae 908 if (yyn == YYFLAG)
885824d3 909 goto yydefault;
910
911 /* Not known => get a lookahead token if don't already have one. */
912
368f75ae 913 /* yychar is either YYEMPTY or YYEOF
914 or a valid token in external form. */
915
885824d3 916 if (yychar == YYEMPTY)
917 {
e5081f8c 918 YYDPRINTF ((stderr, "Reading a token: "));
885824d3 919 yychar = YYLEX;
920 }
921
368f75ae 922 /* Convert token to internal form (in yychar1) for indexing tables with */
923
924 if (yychar <= 0) /* This means end of input. */
885824d3 925 {
368f75ae 926 yychar1 = 0;
927 yychar = YYEOF; /* Don't call YYLEX any more */
928
e5081f8c 929 YYDPRINTF ((stderr, "Now at end of input.\n"));
885824d3 930 }
931 else
932 {
368f75ae 933 yychar1 = YYTRANSLATE (yychar);
934
935#if YYDEBUG
936 /* We have to keep this `#if YYDEBUG', since we use variables
937 which are defined only if `YYDEBUG' is set. */
938 if (yydebug)
939 {
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. */
944# ifdef YYPRINT
945 YYPRINT (stderr, yychar, yylval);
946# endif
947 YYFPRINTF (stderr, ")\n");
948 }
949#endif
885824d3 950 }
951
368f75ae 952 yyn += yychar1;
953 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
885824d3 954 goto yydefault;
368f75ae 955
885824d3 956 yyn = yytable[yyn];
368f75ae 957
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,
962 just return success.
963 0, or most negative number => error. */
964
965 if (yyn < 0)
885824d3 966 {
368f75ae 967 if (yyn == YYFLAG)
885824d3 968 goto yyerrlab;
969 yyn = -yyn;
970 goto yyreduce;
971 }
368f75ae 972 else if (yyn == 0)
973 goto yyerrlab;
885824d3 974
975 if (yyn == YYFINAL)
976 YYACCEPT;
977
978 /* Shift the lookahead token. */
368f75ae 979 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
980 yychar, yytname[yychar1]));
885824d3 981
982 /* Discard the token being shifted unless it is eof. */
983 if (yychar != YYEOF)
984 yychar = YYEMPTY;
985
986 *++yyvsp = yylval;
368f75ae 987#if YYLSP_NEEDED
988 *++yylsp = yylloc;
989#endif
885824d3 990
e5081f8c 991 /* Count tokens shifted since error; after three, turn off error
992 status. */
993 if (yyerrstatus)
994 yyerrstatus--;
885824d3 995
996 yystate = yyn;
997 goto yynewstate;
998
0866200b 999
e5081f8c 1000/*-----------------------------------------------------------.
1001| yydefault -- do the default action for the current state. |
1002`-----------------------------------------------------------*/
1003yydefault:
885824d3 1004 yyn = yydefact[yystate];
1005 if (yyn == 0)
1006 goto yyerrlab;
e5081f8c 1007 goto yyreduce;
885824d3 1008
e5081f8c 1009
1010/*-----------------------------.
1011| yyreduce -- Do a reduction. |
1012`-----------------------------*/
885824d3 1013yyreduce:
e5081f8c 1014 /* yyn is the number of a rule to reduce with. */
885824d3 1015 yylen = yyr2[yyn];
885824d3 1016
e5081f8c 1017 /* If YYLEN is nonzero, implement the default value of the action:
1018 `$$ = $1'.
1019
368f75ae 1020 Otherwise, the following line sets YYVAL to the semantic value of
1021 the lookahead token. This behavior is undocumented and Bison
e5081f8c 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];
1026
368f75ae 1027#if YYLSP_NEEDED
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);
1032#endif
e5081f8c 1033
368f75ae 1034#if YYDEBUG
1035 /* We have to keep this `#if YYDEBUG', since we use variables which
1036 are defined only if `YYDEBUG' is set. */
1037 if (yydebug)
885824d3 1038 {
368f75ae 1039 int yyi;
885824d3 1040
368f75ae 1041 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1042 yyn, yyrline[yyn]);
1043
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]]);
1048 }
1049#endif
885824d3 1050
368f75ae 1051 switch (yyn) {
885824d3 1052
368f75ae 1053case 1:
1054{ lslOpList_free (yyvsp[0].operators); ;
1055 break;}
1056case 2:
1057{ lslOpList x = lslOpList_new ();
885824d3 1058 g_importedlslOp = yyvsp[0].operator;
1059 lslOpList_add (x, yyvsp[0].operator);
368f75ae 1060 yyval.operators = x; ;
1061 break;}
1062case 3:
1063{ lslOpList_add (yyvsp[-1].operators, yyvsp[0].operator);
1064 yyval.operators = yyvsp[-1].operators; ;
1065 break;}
1066case 4:
1067{ yyval.operator = makelslOpNode (yyvsp[-2].name, yyvsp[0].signature); ;
1068 break;}
1069case 5:
1070{ yyval.name = makeNameNodeId (yyvsp[0].ltok); ;
1071 break;}
1072case 6:
1073{ yyval.name = makeNameNodeForm (yyvsp[0].opform); ;
1074 break;}
1075case 7:
1076{ yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;
1077 break;}
1078case 8:
1079{ yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1080 break;}
1081case 9:
1082{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1083 break;}
1084case 10:
1085{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
1086 break;}
1087case 11:
1088{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
1089 break;}
1090case 12:
1091{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1092 break;}
1093case 13:
1094{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1095 break;}
1096case 14:
1097{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1098 break;}
1099case 15:
1100{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM,
1101 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1102 break;}
1103case 16:
1104{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE,
1105 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1106 break;}
1107case 17:
1108{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE,
1109 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1110 break;}
1111case 18:
1112{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM,
1113 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1114 break;}
1115case 19:
1116{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM,
1117 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1118 break;}
1119case 20:
1120{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT,
1121 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1122 break;}
1123case 21:
1124{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT,
1125 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1126 break;}
1127case 22:
1128{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP,
1129 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1130 break;}
1131case 23:
1132{ yyval.ltok = yyvsp[0].ltok; ;
1133 break;}
1134case 24:
1135{ yyval.ltok = yyvsp[0].ltok; ;
1136 break;}
1137case 25:
1138{ yyval.ltok = yyvsp[0].ltok; ;
1139 break;}
1140case 26:
1141{ yyval.count = 0; ;
1142 break;}
1143case 27:
1144{ yyval.count = yyvsp[0].count; ;
1145 break;}
1146case 28:
1147{ yyval.count = 1; ;
1148 break;}
1149case 29:
1150{ yyval.count = yyvsp[-2].count + 1; ;
1151 break;}
1152case 30:
1153{ yyval.ltok = yyvsp[0].ltok; ;
1154 break;}
1155case 31:
1156{ yyval.ltok = yyvsp[0].ltok; ;
1157 break;}
1158case 32:
1159{ yyval.signature = makesigNode (yyvsp[-1].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
1160 break;}
1161case 33:
1162{ yyval.ltokenList = ltokenList_new (); ;
1163 break;}
1164case 34:
1165{ yyval.ltokenList = yyvsp[0].ltokenList; ;
1166 break;}
1167case 35:
1168{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
1169 break;}
1170case 36:
1171{ yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
1172 break;}
1173case 37:
1174{
885824d3 1175 yyval.ltok = yyvsp[0].ltok;
1176 ltoken_setText (yyval.ltok, processTraitSortId (ltoken_getText (yyvsp[0].ltok)));
368f75ae 1177 ;
1178 break;}
1179case 38:
1180{ yyval.ltok = yyvsp[0].ltok; ;
1181 break;}
1182}
8f58355a 1183
3e3ec469 1184
885824d3 1185\f
1186 yyvsp -= yylen;
1187 yyssp -= yylen;
368f75ae 1188#if YYLSP_NEEDED
1189 yylsp -= yylen;
1190#endif
885824d3 1191
368f75ae 1192#if YYDEBUG
1193 if (yydebug)
1194 {
1195 short *yyssp1 = yyss - 1;
1196 YYFPRINTF (stderr, "state stack now");
1197 while (yyssp1 != yyssp)
1198 YYFPRINTF (stderr, " %d", *++yyssp1);
1199 YYFPRINTF (stderr, "\n");
1200 }
1201#endif
885824d3 1202
1203 *++yyvsp = yyval;
368f75ae 1204#if YYLSP_NEEDED
1205 *++yylsp = yyloc;
1206#endif
885824d3 1207
e5081f8c 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. */
885824d3 1211
1212 yyn = yyr1[yyn];
1213
368f75ae 1214 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1215 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
885824d3 1216 yystate = yytable[yystate];
1217 else
368f75ae 1218 yystate = yydefgoto[yyn - YYNTBASE];
885824d3 1219
1220 goto yynewstate;
1221
885824d3 1222
e5081f8c 1223/*------------------------------------.
1224| yyerrlab -- here on detecting error |
1225`------------------------------------*/
1226yyerrlab:
1227 /* If not already recovering from an error, report this error. */
1228 if (!yyerrstatus)
885824d3 1229 {
1230 ++yynerrs;
368f75ae 1231
1232#ifdef YYERROR_VERBOSE
885824d3 1233 yyn = yypact[yystate];
1234
368f75ae 1235 if (yyn > YYFLAG && yyn < YYLAST)
885824d3 1236 {
e5081f8c 1237 YYSIZE_T yysize = 0;
1238 char *yymsg;
1239 int yyx, yycount;
1240
1241 yycount = 0;
1242 /* Start YYX at -YYN if negative to avoid negative indexes in
1243 YYCHECK. */
1244 for (yyx = yyn < 0 ? -yyn : 0;
1245 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
368f75ae 1246 if (yycheck[yyx + yyn] == yyx)
e5081f8c 1247 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
368f75ae 1248 yysize += yystrlen ("parse error, unexpected ") + 1;
1249 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
e5081f8c 1250 yymsg = (char *) YYSTACK_ALLOC (yysize);
1251 if (yymsg != 0)
885824d3 1252 {
368f75ae 1253 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1254 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
885824d3 1255
e5081f8c 1256 if (yycount < 5)
885824d3 1257 {
e5081f8c 1258 yycount = 0;
1259 for (yyx = yyn < 0 ? -yyn : 0;
1260 yyx < (int) (sizeof (yytname) / sizeof (char *));
1261 yyx++)
368f75ae 1262 if (yycheck[yyx + yyn] == yyx)
885824d3 1263 {
e5081f8c 1264 const char *yyq = ! yycount ? ", expecting " : " or ";
1265 yyp = yystpcpy (yyp, yyq);
1266 yyp = yystpcpy (yyp, yytname[yyx]);
1267 yycount++;
885824d3 1268 }
1269 }
e5081f8c 1270 yyerror (yymsg);
1271 YYSTACK_FREE (yymsg);
885824d3 1272 }
1273 else
368f75ae 1274 yyerror ("parse error; also virtual memory exhausted");
885824d3 1275 }
1276 else
368f75ae 1277#endif /* defined (YYERROR_VERBOSE) */
1278 yyerror ("parse error");
885824d3 1279 }
368f75ae 1280 goto yyerrlab1;
d0b80d80 1281
e5081f8c 1282
368f75ae 1283/*--------------------------------------------------.
1284| yyerrlab1 -- error raised explicitly by an action |
1285`--------------------------------------------------*/
1286yyerrlab1:
885824d3 1287 if (yyerrstatus == 3)
1288 {
e5081f8c 1289 /* If just tried and failed to reuse lookahead token after an
1290 error, discard it. */
885824d3 1291
368f75ae 1292 /* return failure if at end of input */
885824d3 1293 if (yychar == YYEOF)
368f75ae 1294 YYABORT;
1295 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1296 yychar, yytname[yychar1]));
885824d3 1297 yychar = YYEMPTY;
1298 }
1299
e5081f8c 1300 /* Else will try to reuse lookahead token after shifting the error
1301 token. */
885824d3 1302
368f75ae 1303 yyerrstatus = 3; /* Each real token shifted decrements this */
1304
1305 goto yyerrhandle;
1306
1307
1308/*-------------------------------------------------------------------.
1309| yyerrdefault -- current state does not do anything special for the |
1310| error token. |
1311`-------------------------------------------------------------------*/
1312yyerrdefault:
1313#if 0
1314 /* This is wrong; only states that explicitly want error tokens
1315 should shift them. */
1316
1317 /* If its default is to accept any token, ok. Otherwise pop it. */
1318 yyn = yydefact[yystate];
1319 if (yyn)
1320 goto yydefault;
1321#endif
885824d3 1322
885824d3 1323
368f75ae 1324/*---------------------------------------------------------------.
1325| yyerrpop -- pop the current state because it cannot handle the |
1326| error token |
1327`---------------------------------------------------------------*/
1328yyerrpop:
1329 if (yyssp == yyss)
1330 YYABORT;
1331 yyvsp--;
1332 yystate = *--yyssp;
1333#if YYLSP_NEEDED
1334 yylsp--;
1335#endif
1336
1337#if YYDEBUG
1338 if (yydebug)
885824d3 1339 {
368f75ae 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");
1345 }
1346#endif
885824d3 1347
368f75ae 1348/*--------------.
1349| yyerrhandle. |
1350`--------------*/
1351yyerrhandle:
1352 yyn = yypact[yystate];
1353 if (yyn == YYFLAG)
1354 goto yyerrdefault;
885824d3 1355
368f75ae 1356 yyn += YYTERROR;
1357 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1358 goto yyerrdefault;
885824d3 1359
368f75ae 1360 yyn = yytable[yyn];
1361 if (yyn < 0)
1362 {
1363 if (yyn == YYFLAG)
1364 goto yyerrpop;
1365 yyn = -yyn;
1366 goto yyreduce;
885824d3 1367 }
368f75ae 1368 else if (yyn == 0)
1369 goto yyerrpop;
885824d3 1370
1371 if (yyn == YYFINAL)
1372 YYACCEPT;
1373
e5081f8c 1374 YYDPRINTF ((stderr, "Shifting error token, "));
885824d3 1375
1376 *++yyvsp = yylval;
368f75ae 1377#if YYLSP_NEEDED
1378 *++yylsp = yylloc;
1379#endif
885824d3 1380
1381 yystate = yyn;
1382 goto yynewstate;
bbed3d50 1383
bbed3d50 1384
e5081f8c 1385/*-------------------------------------.
1386| yyacceptlab -- YYACCEPT comes here. |
1387`-------------------------------------*/
1388yyacceptlab:
1389 yyresult = 0;
1390 goto yyreturn;
1391
1392/*-----------------------------------.
1393| yyabortlab -- YYABORT comes here. |
1394`-----------------------------------*/
1395yyabortlab:
1396 yyresult = 1;
1397 goto yyreturn;
1398
368f75ae 1399/*---------------------------------------------.
1400| yyoverflowab -- parser overflow comes here. |
1401`---------------------------------------------*/
e5081f8c 1402yyoverflowlab:
1403 yyerror ("parser stack overflow");
1404 yyresult = 2;
1405 /* Fall through. */
1406
1407yyreturn:
1408#ifndef yyoverflow
1409 if (yyss != yyssa)
1410 YYSTACK_FREE (yyss);
bbed3d50 1411#endif
e5081f8c 1412 return yyresult;
885824d3 1413}
885824d3 1414
1415
1416# include "bison.reset"
1417
1418extern char *yytext;
1419
1420void lslerror (char *s)
1421{
bbed3d50 1422 llfatalbug
1423 (cstring_makeLiteral
1424 ("There has been a problem in the parser with LSL signatures. This is believed to result "
1b8ae690 1425 "from a problem with bison v. 1.25. Please try rebuidling Splint "
bbed3d50 1426 "using the pre-compiled grammar files by commenting out the "
1427 "BISON= line in the top-level Makefile."));
885824d3 1428}
1429
1430static void yyprint (FILE *file, int type, YYSTYPE value)
1431{
1432 fprintf (file, " (%u:%u type: %d; text: %s) ",
1433 ltoken_getLine (value.ltok),
1434 ltoken_getCol (value.ltok),
1435 type,
1436 ltoken_getRawTextChars (value.ltok));
1437}
1438
1439extern void PrintToken (ltoken tok) {
1440 char *codStr;
1441
1442 switch (ltoken_getCode (tok))
1443 {
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;
1471 default:
1472 codStr = "*** invalid token code ***";
1473 break;
1474 } /* end switch */
1475
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)
1481 {
1482 printf (", Token String (%lu): %s\n",
1483 ltoken_getRawText (tok), ltoken_getRawTextChars (tok));
1484 }
1485 else printf ("\n");
1486}
1487
1488
1489
1490
bbed3d50 1491/*
1492** Resets all flags in bison.head
1493*/
1494
1495
1496/*@=allmacros@*/
1497/*@=boolint@*/
1498/*@=charint@*/
1499/*@=macroparams@*/
1500/*@=macroundef@*/
1501/*@=unreachable@*/
1502/*@=macrospec@*/
1503/*@=varuse@*/
1504/*@=ignorequals@*/
1505/*@=macrostmt@*/
1506/*@=noeffect@*/
1507/*@=shadow@*/
1508/*@=exitarg@*/
1509/*@=macroredef@*/
1510/*@=uniondef@*/
1511/*@=compdef@*/
1512/*@=matchfields@*/
1513/*@=exportlocal@*/
1514/*@=evalorderuncon@*/
1515/*@=exportheader@*/
1516/*@=typeuse@*/
1517/*@=redecl@*/
1518/*@=redef@*/
1519/*@=noparams@*/
1520/*@=ansireserved@*/
1521/*@=fielduse@*/
1522/*@=ifblock@*/
1523/*@=elseifcomplete@*/
1524/*@=whileblock@*/
1525/*@=forblock@*/
1526/*@=branchstate@*/
1527/*@=readonlytrans@*/
1528/*@=namechecks@*/
1529/*@=usedef@*/
1530/*@=systemunrecog@*/
1531/*@=dependenttrans@*/
1532/*@=unqualifiedtrans@*/
1533/*@=declundef@*/
1534
1535
1536/*drl added 11/27/2001*/
bb7c2085 1537/*@=bounds@*/
e015e087 1538
1539/*drl added 12/11/2002*/
1540/*@=type@*/
This page took 0.441813 seconds and 5 git commands to generate.