]> andersk Git - splint.git/blame - src/signature.c.der
Fixed bug in Makefile.am.
[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@*/
885824d3 51/* < end of bison.head > */
52
d0b80d80 53/* A Bison parser, made from signature.y
54 by GNU bison 1.35. */
885824d3 55
56#define YYBISON 1 /* Identify Bison output. */
57
58#define yyparse lslparse
59#define yylex lsllex
60#define yyerror lslerror
61#define yylval lsllval
62#define yychar lslchar
63#define yydebug lsldebug
64#define yynerrs lslnerrs
d0b80d80 65# define LST_SIMPLEID 257
66# define LST_LOGICALOP 258
67# define LST_EQOP 259
68# define LST_SIMPLEOP 260
69# define LST_MAPSYM 261
70# define LST_FIELDMAPSYM 262
71# define LST_MARKERSYM 263
72# define LST_ifTOKEN 264
73# define LST_thenTOKEN 265
74# define LST_elseTOKEN 266
75# define LST_LBRACKET 267
76# define LST_RBRACKET 268
77# define LST_SELECTSYM 269
78# define LST_SEPSYM 270
79# define LST_OPENSYM 271
80# define LST_CLOSESYM 272
81# define LST_COLON 273
82# define LST_COMMA 274
83# define LST_EOL 275
84# define LST_COMMENTSYM 276
85# define LST_WHITESPACE 277
86# define LST_QUANTIFIERSYM 278
87# define LST_EQUATIONSYM 279
88# define LST_EQSEPSYM 280
89# define LST_COMPOSESYM 281
90# define LST_LPAR 282
91# define LST_RPAR 283
92# define LST_assertsTOKEN 284
93# define LST_assumesTOKEN 285
94# define LST_byTOKEN 286
95# define LST_convertsTOKEN 287
96# define LST_enumerationTOKEN 288
97# define LST_equationsTOKEN 289
98# define LST_exemptingTOKEN 290
99# define LST_forTOKEN 291
100# define LST_generatedTOKEN 292
101# define LST_impliesTOKEN 293
102# define LST_includesTOKEN 294
103# define LST_introducesTOKEN 295
104# define LST_ofTOKEN 296
105# define LST_partitionedTOKEN 297
106# define LST_traitTOKEN 298
107# define LST_tupleTOKEN 299
108# define LST_unionTOKEN 300
109# define LST_BADTOKEN 301
885824d3 110
885824d3 111
112
885824d3 113# include <stdio.h>
1b8ae690 114# include "splintMacros.nf"
885824d3 115# include "llbasic.h"
116# include "lslparse.h"
117# include "signature.h"
118
4dd72714 119static void lslerror (char *);
120extern int lsllex ();
121
885824d3 122/*@dependent@*/ /*@null@*/ lslOp importedlslOp;
123
124/*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
125static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
126/*@=noparams@*/
127
128# define YYPRINT(file, type, value) yyprint (file, type, value)
129
130# define YYDEBUG 1
131
bbed3d50 132/*@-redef@*/
133/*@-readonlytrans@*/
134/*@-nullassign@*/
885824d3 135
136
d0b80d80 137#ifndef YYSTYPE
885824d3 138typedef union {
139 ltoken ltok; /* a leaf is also an ltoken */
140 unsigned int count;
141 /*@only@*/ ltokenList ltokenList;
142 /*@only@*/ opFormNode opform;
143 /*@owned@*/ sigNode signature;
144 /*@only@*/ nameNode name;
145 /*@owned@*/ lslOp operator;
146 /*@only@*/ lslOpList operators;
bbed3d50 147 /*@-redef@*/ /*@-matchfields@*/
d0b80d80 148} yystype;
149# define YYSTYPE yystype
150# define YYSTYPE_IS_TRIVIAL 1
a889b5ee 151#endif
d0b80d80 152#ifndef YYDEBUG
153# define YYDEBUG 1
a889b5ee 154#endif
155
885824d3 156
157
158#define YYFINAL 62
159#define YYFLAG -32768
160#define YYNTBASE 48
161
d0b80d80 162/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
bbed3d50 163#define YYTRANSLATE(x) ((unsigned)(x) <= 301 ? yytranslate[x] : 62)
885824d3 164
d0b80d80 165/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
166static const char yytranslate[] =
167{
168 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
169 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
170 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
171 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
172 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
173 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
174 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
175 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
176 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
177 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
178 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
179 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
180 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
181 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
182 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
183 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
184 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
185 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
186 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
187 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
188 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
189 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
190 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
191 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
192 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
193 2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
194 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
195 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
196 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
197 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
198 46, 47
885824d3 199};
200
d0b80d80 201#if YYDEBUG
202static const short yyprhs[] =
203{
204 0, 0, 2, 4, 7, 11, 13, 15, 22, 24,
205 27, 30, 34, 38, 43, 48, 54, 58, 63, 68,
206 74, 77, 81, 85, 87, 89, 91, 92, 94, 96,
207 100, 102, 104, 108, 109, 111, 113, 117, 119
885824d3 208};
d0b80d80 209static const short yyrhs[] =
210{
211 49, 0, 50, 0, 49, 50, 0, 51, 19, 57,
212 0, 61, 0, 52, 0, 10, 9, 11, 9, 12,
213 9, 0, 53, 0, 9, 53, 0, 53, 9, 0,
214 9, 53, 9, 0, 17, 54, 18, 0, 9, 17,
215 54, 18, 0, 17, 54, 18, 9, 0, 9, 17,
216 54, 18, 9, 0, 13, 54, 14, 0, 9, 13,
217 54, 14, 0, 13, 54, 14, 9, 0, 9, 13,
218 54, 14, 9, 0, 15, 3, 0, 9, 15, 3,
219 0, 9, 8, 3, 0, 6, 0, 4, 0, 5,
220 0, 0, 55, 0, 9, 0, 55, 56, 9, 0,
221 20, 0, 16, 0, 58, 7, 60, 0, 0, 59,
222 0, 60, 0, 59, 20, 60, 0, 3, 0, 3,
223 0
885824d3 224};
225
226#endif
227
d0b80d80 228#if YYDEBUG
229/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
230static const short yyrline[] =
231{
232 0, 139, 141, 146, 150, 156, 158, 162, 164, 166,
233 168, 170, 172, 174, 176, 178, 181, 184, 187, 190,
234 193, 196, 201, 206, 208, 210, 213, 215, 218, 220,
235 223, 225, 228, 231, 233, 236, 238, 241, 247
885824d3 236};
237#endif
238
239
d0b80d80 240#if (YYDEBUG) || defined YYERROR_VERBOSE
241
242/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
243static const char *const yytname[] =
244{
245 "$", "error", "$undefined.", "LST_SIMPLEID", "LST_LOGICALOP", "LST_EQOP",
246 "LST_SIMPLEOP", "LST_MAPSYM", "LST_FIELDMAPSYM", "LST_MARKERSYM",
247 "LST_ifTOKEN", "LST_thenTOKEN", "LST_elseTOKEN", "LST_LBRACKET",
248 "LST_RBRACKET", "LST_SELECTSYM", "LST_SEPSYM", "LST_OPENSYM",
249 "LST_CLOSESYM", "LST_COLON", "LST_COMMA", "LST_EOL", "LST_COMMENTSYM",
250 "LST_WHITESPACE", "LST_QUANTIFIERSYM", "LST_EQUATIONSYM",
251 "LST_EQSEPSYM", "LST_COMPOSESYM", "LST_LPAR", "LST_RPAR",
252 "LST_assertsTOKEN", "LST_assumesTOKEN", "LST_byTOKEN",
253 "LST_convertsTOKEN", "LST_enumerationTOKEN", "LST_equationsTOKEN",
254 "LST_exemptingTOKEN", "LST_forTOKEN", "LST_generatedTOKEN",
255 "LST_impliesTOKEN", "LST_includesTOKEN", "LST_introducesTOKEN",
256 "LST_ofTOKEN", "LST_partitionedTOKEN", "LST_traitTOKEN",
257 "LST_tupleTOKEN", "LST_unionTOKEN", "LST_BADTOKEN", "top",
258 "operatorList", "operator", "name", "opForm", "anyOp", "middle",
259 "placeList", "separator", "signature", "domain", "sortList", "sortId",
260 "opId", 0
885824d3 261};
262#endif
263
d0b80d80 264/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
265static const short yyr1[] =
266{
267 0, 48, 49, 49, 50, 51, 51, 52, 52, 52,
268 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
269 52, 52, 52, 53, 53, 53, 54, 54, 55, 55,
270 56, 56, 57, 58, 58, 59, 59, 60, 61
885824d3 271};
272
d0b80d80 273/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
274static const short yyr2[] =
275{
276 0, 1, 1, 2, 3, 1, 1, 6, 1, 2,
277 2, 3, 3, 4, 4, 5, 3, 4, 4, 5,
278 2, 3, 3, 1, 1, 1, 0, 1, 1, 3,
279 1, 1, 3, 0, 1, 1, 3, 1, 1
885824d3 280};
281
d0b80d80 282/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
283 doesn't specify something else to do. Zero means the default is an
284 error. */
285static const short yydefact[] =
286{
287 0, 38, 24, 25, 23, 0, 0, 26, 0, 26,
288 1, 2, 0, 6, 8, 5, 0, 26, 0, 26,
289 9, 0, 28, 0, 27, 20, 0, 3, 33, 10,
290 22, 0, 21, 0, 11, 0, 16, 31, 30, 0,
291 12, 37, 4, 0, 34, 35, 17, 13, 0, 18,
292 29, 14, 0, 0, 19, 15, 0, 32, 36, 7,
293 0, 0, 0
885824d3 294};
295
d0b80d80 296static const short yydefgoto[] =
297{
298 60, 10, 11, 12, 13, 14, 23, 24, 39, 42,
299 43, 44, 45, 15
885824d3 300};
301
d0b80d80 302static const short yypact[] =
303{
304 -3,-32768,-32768,-32768,-32768, 11, -4, 0, 8, 0,
305 -3,-32768, -1,-32768, 13,-32768, 17, 0, 22, 0,
306 18, 20,-32768, 19, -12,-32768, 14,-32768, 31,-32768,
307 -32768, 21,-32768, 23,-32768, 27, 28,-32768,-32768, 29,
308 30,-32768,-32768, 33, 24,-32768, 34, 36, 35,-32768,
309 -32768,-32768, 31, 31,-32768,-32768, 37,-32768,-32768,-32768,
310 42, 48,-32768
885824d3 311};
312
d0b80d80 313static const short yypgoto[] =
314{
315 -32768,-32768, 39,-32768,-32768, 45, 4,-32768,-32768,-32768,
316 -32768,-32768, -23,-32768
885824d3 317};
318
319
320#define YYLAST 50
321
322
d0b80d80 323static const short yytable[] =
324{
325 1, 2, 3, 4, 37, 21, 5, 6, 38, 22,
326 7, 25, 8, 26, 9, 2, 3, 4, 28, 16,
327 30, 31, 29, 33, 17, 32, 18, 34, 19, 57,
328 58, 35, 40, 36, 41, 46, 48, 49, 50, 51,
329 52, 47, 61, 54, 53, 55, 59, 56, 62, 27,
330 20
885824d3 331};
332
d0b80d80 333static const short yycheck[] =
334{
335 3, 4, 5, 6, 16, 9, 9, 10, 20, 9,
336 13, 3, 15, 9, 17, 4, 5, 6, 19, 8,
337 3, 17, 9, 19, 13, 3, 15, 9, 17, 52,
338 53, 11, 18, 14, 3, 14, 9, 9, 9, 9,
339 7, 18, 0, 9, 20, 9, 9, 12, 0, 10,
340 5
885824d3 341};
342#define YYPURE 1
343
344/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
3e3ec469 345
885824d3 346/* Skeleton output parser for bison,
d0b80d80 347
348 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
349 Foundation, Inc.
885824d3 350
351 This program is free software; you can redistribute it and/or modify
352 it under the terms of the GNU General Public License as published by
353 the Free Software Foundation; either version 2, or (at your option)
354 any later version.
355
356 This program is distributed in the hope that it will be useful,
357 but WITHOUT ANY WARRANTY; without even the implied warranty of
358 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
359 GNU General Public License for more details.
360
361 You should have received a copy of the GNU General Public License
362 along with this program; if not, write to the Free Software
bbed3d50 363 Foundation, Inc., 59 Temple Place - Suite 330,
364 Boston, MA 02111-1307, USA. */
885824d3 365
366/* As a special exception, when this file is copied by Bison into a
367 Bison output file, you may use that output file without restriction.
368 This special exception was added by the Free Software Foundation
369 in version 1.24 of Bison. */
370
d0b80d80 371/* This is the parser code that is written into each bison parser when
372 the %semantic_parser declaration is not specified in the grammar.
373 It was written by Richard Stallman by simplifying the hairy parser
374 used when %semantic_parser is specified. */
375
376/* All symbols defined below should begin with yy or YY, to avoid
377 infringing on user name space. This should be done even for local
378 variables, as they might otherwise be expanded by user macros.
379 There are some unavoidable exceptions within include files to
380 define necessary library symbols; they are noted "INFRINGES ON
381 USER NAME SPACE" below. */
382
383#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
384
385/* The parser invokes alloca or malloc; define the necessary symbols. */
386
387# if YYSTACK_USE_ALLOCA
388# define YYSTACK_ALLOC alloca
389# else
390# ifndef YYSTACK_USE_ALLOCA
391# if defined (alloca) || defined (_ALLOCA_H)
392# define YYSTACK_ALLOC alloca
393# else
394# ifdef __GNUC__
395# define YYSTACK_ALLOC __builtin_alloca
396# endif
397# endif
398# endif
399# endif
400
401# ifdef YYSTACK_ALLOC
402 /* Pacify GCC's `empty if-body' warning. */
403# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
404# else
405# if defined (__STDC__) || defined (__cplusplus)
406# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
407# define YYSIZE_T size_t
408# endif
409# define YYSTACK_ALLOC malloc
410# define YYSTACK_FREE free
411# endif
412#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
413
414
415#if (! defined (yyoverflow) \
416 && (! defined (__cplusplus) \
417 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
418
419/* A type that is properly aligned for any stack member. */
420union yyalloc
421{
422 short yyss;
423 YYSTYPE yyvs;
424# if YYLSP_NEEDED
425 YYLTYPE yyls;
426# endif
427};
428
429/* The size of the maximum gap between one aligned stack and the next. */
430# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
431
432/* The size of an array large to enough to hold all stacks, each with
433 N elements. */
434# if YYLSP_NEEDED
435# define YYSTACK_BYTES(N) \
436 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
437 + 2 * YYSTACK_GAP_MAX)
438# else
439# define YYSTACK_BYTES(N) \
440 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
441 + YYSTACK_GAP_MAX)
442# endif
443
444/* Copy COUNT objects from FROM to TO. The source and destination do
445 not overlap. */
446# ifndef YYCOPY
447# if 1 < __GNUC__
448# define YYCOPY(To, From, Count) \
449 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
450# else
451# define YYCOPY(To, From, Count) \
452 do \
453 { \
454 register YYSIZE_T yyi; \
455 for (yyi = 0; yyi < (Count); yyi++) \
456 (To)[yyi] = (From)[yyi]; \
457 } \
458 while (0)
459# endif
460# endif
461
462/* Relocate STACK from its old location to the new one. The
463 local variables YYSIZE and YYSTACKSIZE give the old and new number of
464 elements in the stack, and YYPTR gives the new location of the
465 stack. Advance YYPTR to a properly aligned location for the next
466 stack. */
467# define YYSTACK_RELOCATE(Stack) \
468 do \
469 { \
470 YYSIZE_T yynewbytes; \
471 YYCOPY (&yyptr->Stack, Stack, yysize); \
472 Stack = &yyptr->Stack; \
473 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
474 yyptr += yynewbytes / sizeof (*yyptr); \
475 } \
476 while (0)
bbed3d50 477
a889b5ee 478#endif
d0b80d80 479
480
481#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
482# define YYSIZE_T __SIZE_TYPE__
bbed3d50 483#endif
d0b80d80 484#if ! defined (YYSIZE_T) && defined (size_t)
485# define YYSIZE_T size_t
486#endif
487#if ! defined (YYSIZE_T)
488# if defined (__STDC__) || defined (__cplusplus)
489# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
490# define YYSIZE_T size_t
491# endif
492#endif
493#if ! defined (YYSIZE_T)
494# define YYSIZE_T unsigned int
e55c0c6d 495#endif
a889b5ee 496
885824d3 497#define yyerrok (yyerrstatus = 0)
498#define yyclearin (yychar = YYEMPTY)
499#define YYEMPTY -2
500#define YYEOF 0
bbed3d50 501#define YYACCEPT goto yyacceptlab
502#define YYABORT goto yyabortlab
885824d3 503#define YYERROR goto yyerrlab1
d0b80d80 504/* Like YYERROR except do call yyerror. This remains here temporarily
505 to ease the transition to the new meaning of YYERROR, for GCC.
885824d3 506 Once GCC version 2 has supplanted version 1, this can go. */
507#define YYFAIL goto yyerrlab
508#define YYRECOVERING() (!!yyerrstatus)
d0b80d80 509#define YYBACKUP(Token, Value) \
885824d3 510do \
511 if (yychar == YYEMPTY && yylen == 1) \
d0b80d80 512 { \
513 yychar = (Token); \
514 yylval = (Value); \
885824d3 515 yychar1 = YYTRANSLATE (yychar); \
516 YYPOPSTACK; \
517 goto yybackup; \
518 } \
519 else \
d0b80d80 520 { \
521 yyerror ("syntax error: cannot back up"); \
522 YYERROR; \
523 } \
885824d3 524while (0)
525
526#define YYTERROR 1
527#define YYERRCODE 256
528
a889b5ee 529
d0b80d80 530/* YYLLOC_DEFAULT -- Compute the default location (before the actions
531 are run).
a889b5ee 532
d0b80d80 533 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
534 first token. By default, to implement support for ranges, extend
535 its range to the last symbol. */
885824d3 536
d0b80d80 537#ifndef YYLLOC_DEFAULT
538# define YYLLOC_DEFAULT(Current, Rhs, N) \
539 Current.last_line = Rhs[N].last_line; \
540 Current.last_column = Rhs[N].last_column;
a889b5ee 541#endif
542
885824d3 543
d0b80d80 544/* YYLEX -- calling `yylex' with the right arguments. */
545
546#if YYPURE
547# if YYLSP_NEEDED
548# ifdef YYLEX_PARAM
549# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
550# else
551# define YYLEX yylex (&yylval, &yylloc)
552# endif
553# else /* !YYLSP_NEEDED */
554# ifdef YYLEX_PARAM
555# define YYLEX yylex (&yylval, YYLEX_PARAM)
556# else
557# define YYLEX yylex (&yylval)
558# endif
559# endif /* !YYLSP_NEEDED */
560#else /* !YYPURE */
561# define YYLEX yylex ()
562#endif /* !YYPURE */
563
564
565/* Enable debugging if requested. */
566#if YYDEBUG
567
568# ifndef YYFPRINTF
569# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
570# define YYFPRINTF fprintf
571# endif
572
573# define YYDPRINTF(Args) \
574do { \
575 if (yydebug) \
576 YYFPRINTF Args; \
577} while (0)
578/* Nonzero means print parse trace. It is left uninitialized so that
579 multiple parsers can coexist. */
580int yydebug;
581#else /* !YYDEBUG */
582# define YYDPRINTF(Args)
583#endif /* !YYDEBUG */
584
585/* YYINITDEPTH -- initial size of the parser's stacks. */
885824d3 586#ifndef YYINITDEPTH
d0b80d80 587# define YYINITDEPTH 200
885824d3 588#endif
589
d0b80d80 590/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
591 if the built-in stack extension method is used).
592
593 Do not make this value too large; the results are undefined if
594 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
595 evaluated with infinite-precision integer arithmetic. */
a889b5ee 596
885824d3 597#if YYMAXDEPTH == 0
d0b80d80 598# undef YYMAXDEPTH
885824d3 599#endif
600
601#ifndef YYMAXDEPTH
d0b80d80 602# define YYMAXDEPTH 10000
885824d3 603#endif
1ac6313d 604\f
d0b80d80 605#ifdef YYERROR_VERBOSE
885824d3 606
d0b80d80 607# ifndef yystrlen
608# if defined (__GLIBC__) && defined (_STRING_H)
609# define yystrlen strlen
610# else
611/* Return the length of YYSTR. */
612static YYSIZE_T
613# if defined (__STDC__) || defined (__cplusplus)
614yystrlen (const char *yystr)
615# else
616yystrlen (yystr)
617 const char *yystr;
618# endif
619{
620 register const char *yys = yystr;
885824d3 621
d0b80d80 622 while (*yys++ != '\0')
623 continue;
a889b5ee 624
d0b80d80 625 return yys - yystr - 1;
626}
627# endif
628# endif
629
630# ifndef yystpcpy
631# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
632# define yystpcpy stpcpy
633# else
634/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
635 YYDEST. */
636static char *
637# if defined (__STDC__) || defined (__cplusplus)
638yystpcpy (char *yydest, const char *yysrc)
639# else
640yystpcpy (yydest, yysrc)
641 char *yydest;
642 const char *yysrc;
643# endif
a889b5ee 644{
d0b80d80 645 register char *yyd = yydest;
646 register const char *yys = yysrc;
a889b5ee 647
d0b80d80 648 while ((*yyd++ = *yys++) != '\0')
649 continue;
a889b5ee 650
d0b80d80 651 return yyd - 1;
652}
653# endif
654# endif
885824d3 655#endif
656\f
3e3ec469 657
885824d3 658
659/* The user can define YYPARSE_PARAM as the name of an argument to be passed
660 into yyparse. The argument should have type void *.
661 It should actually point to an object.
662 Grammar actions can access the variable by casting it
663 to the proper pointer type. */
664
665#ifdef YYPARSE_PARAM
d0b80d80 666# if defined (__STDC__) || defined (__cplusplus)
667# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
668# define YYPARSE_PARAM_DECL
669# else
670# define YYPARSE_PARAM_ARG YYPARSE_PARAM
671# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
672# endif
673#else /* !YYPARSE_PARAM */
674# define YYPARSE_PARAM_ARG
675# define YYPARSE_PARAM_DECL
676#endif /* !YYPARSE_PARAM */
885824d3 677
bbed3d50 678/* Prevent warning if -Wstrict-prototypes. */
679#ifdef __GNUC__
d0b80d80 680# ifdef YYPARSE_PARAM
bbed3d50 681int yyparse (void *);
d0b80d80 682# else
bbed3d50 683int yyparse (void);
d0b80d80 684# endif
bbed3d50 685#endif
d0b80d80 686
687/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
688 variables are global, or local to YYPARSE. */
689
690#define YY_DECL_NON_LSP_VARIABLES \
691/* The lookahead symbol. */ \
692int yychar; \
693 \
694/* The semantic value of the lookahead symbol. */ \
695YYSTYPE yylval; \
696 \
697/* Number of parse errors so far. */ \
698int yynerrs;
699
700#if YYLSP_NEEDED
701# define YY_DECL_VARIABLES \
702YY_DECL_NON_LSP_VARIABLES \
703 \
704/* Location data for the lookahead symbol. */ \
705YYLTYPE yylloc;
706#else
707# define YY_DECL_VARIABLES \
708YY_DECL_NON_LSP_VARIABLES
bbed3d50 709#endif
710
d0b80d80 711
712/* If nonreentrant, generate the variables here. */
713
714#if !YYPURE
715YY_DECL_VARIABLES
716#endif /* !YYPURE */
717
885824d3 718int
d0b80d80 719yyparse (YYPARSE_PARAM_ARG)
885824d3 720 YYPARSE_PARAM_DECL
721{
d0b80d80 722 /* If reentrant, generate the variables here. */
723#if YYPURE
724 YY_DECL_VARIABLES
725#endif /* !YYPURE */
726
885824d3 727 register int yystate;
728 register int yyn;
d0b80d80 729 int yyresult;
730 /* Number of tokens to shift before error messages enabled. */
731 int yyerrstatus;
732 /* Lookahead token as an internal (translated) token number. */
733 int yychar1 = 0;
734
735 /* Three stacks and their tools:
736 `yyss': related to states,
737 `yyvs': related to semantic values,
738 `yyls': related to locations.
739
740 Refer to the stacks thru separate pointers, to allow yyoverflow
741 to reallocate them elsewhere. */
742
743 /* The state stack. */
744 short yyssa[YYINITDEPTH];
745 short *yyss = yyssa;
885824d3 746 register short *yyssp;
a889b5ee 747
d0b80d80 748 /* The semantic value stack. */
749 YYSTYPE yyvsa[YYINITDEPTH];
750 YYSTYPE *yyvs = yyvsa;
751 register YYSTYPE *yyvsp;
885824d3 752
d0b80d80 753#if YYLSP_NEEDED
754 /* The location stack. */
755 YYLTYPE yylsa[YYINITDEPTH];
885824d3 756 YYLTYPE *yyls = yylsa;
757 YYLTYPE *yylsp;
d0b80d80 758#endif
885824d3 759
d0b80d80 760#if YYLSP_NEEDED
761# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
885824d3 762#else
d0b80d80 763# define YYPOPSTACK (yyvsp--, yyssp--)
885824d3 764#endif
765
d0b80d80 766 YYSIZE_T yystacksize = YYINITDEPTH;
885824d3 767
885824d3 768
d0b80d80 769 /* The variables used to return semantic value and location from the
770 action routines. */
771 YYSTYPE yyval;
772#if YYLSP_NEEDED
773 YYLTYPE yyloc;
774#endif
885824d3 775
d0b80d80 776 /* When reducing, the number of symbols on the RHS of the reduced
777 rule. */
885824d3 778 int yylen;
779
d0b80d80 780 YYDPRINTF ((stderr, "Starting parse\n"));
885824d3 781
782 yystate = 0;
783 yyerrstatus = 0;
784 yynerrs = 0;
785 yychar = YYEMPTY; /* Cause a token to be read. */
786
787 /* Initialize stack pointers.
788 Waste one element of value and location stack
789 so that they stay on the same level as the state stack.
790 The wasted elements are never initialized. */
791
d0b80d80 792 yyssp = yyss;
885824d3 793 yyvsp = yyvs;
d0b80d80 794#if YYLSP_NEEDED
885824d3 795 yylsp = yyls;
796#endif
d0b80d80 797 goto yysetstate;
885824d3 798
d0b80d80 799/*------------------------------------------------------------.
800| yynewstate -- Push a new state, which is found in yystate. |
801`------------------------------------------------------------*/
802 yynewstate:
803 /* In all cases, when you get here, the value and location stacks
804 have just been pushed. so pushing a state here evens the stacks.
805 */
806 yyssp++;
885824d3 807
d0b80d80 808 yysetstate:
809 *yyssp = yystate;
885824d3 810
811 if (yyssp >= yyss + yystacksize - 1)
812 {
885824d3 813 /* Get the current used size of the three stacks, in elements. */
d0b80d80 814 YYSIZE_T yysize = yyssp - yyss + 1;
885824d3 815
816#ifdef yyoverflow
d0b80d80 817 {
818 /* Give user a chance to reallocate the stack. Use copies of
819 these so that the &'s don't force the real ones into
820 memory. */
821 YYSTYPE *yyvs1 = yyvs;
822 short *yyss1 = yyss;
823
824 /* Each stack pointer address is followed by the size of the
825 data in use in that stack, in bytes. */
826# if YYLSP_NEEDED
827 YYLTYPE *yyls1 = yyls;
828 /* This used to be a conditional around just the two extra args,
829 but that might be undefined if yyoverflow is a macro. */
830 yyoverflow ("parser stack overflow",
831 &yyss1, yysize * sizeof (*yyssp),
832 &yyvs1, yysize * sizeof (*yyvsp),
833 &yyls1, yysize * sizeof (*yylsp),
834 &yystacksize);
835 yyls = yyls1;
836# else
837 yyoverflow ("parser stack overflow",
838 &yyss1, yysize * sizeof (*yyssp),
839 &yyvs1, yysize * sizeof (*yyvsp),
840 &yystacksize);
841# endif
842 yyss = yyss1;
843 yyvs = yyvs1;
844 }
885824d3 845#else /* no yyoverflow */
d0b80d80 846# ifndef YYSTACK_RELOCATE
847 goto yyoverflowlab;
848# else
885824d3 849 /* Extend the stack our own way. */
850 if (yystacksize >= YYMAXDEPTH)
d0b80d80 851 goto yyoverflowlab;
885824d3 852 yystacksize *= 2;
853 if (yystacksize > YYMAXDEPTH)
854 yystacksize = YYMAXDEPTH;
d0b80d80 855
856 {
857 short *yyss1 = yyss;
858 union yyalloc *yyptr =
859 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
860 if (! yyptr)
861 goto yyoverflowlab;
862 YYSTACK_RELOCATE (yyss);
863 YYSTACK_RELOCATE (yyvs);
864# if YYLSP_NEEDED
865 YYSTACK_RELOCATE (yyls);
866# endif
867# undef YYSTACK_RELOCATE
868 if (yyss1 != yyssa)
869 YYSTACK_FREE (yyss1);
870 }
871# endif
885824d3 872#endif /* no yyoverflow */
873
d0b80d80 874 yyssp = yyss + yysize - 1;
875 yyvsp = yyvs + yysize - 1;
876#if YYLSP_NEEDED
877 yylsp = yyls + yysize - 1;
885824d3 878#endif
879
d0b80d80 880 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
881 (unsigned long int) yystacksize));
885824d3 882
883 if (yyssp >= yyss + yystacksize - 1)
884 YYABORT;
885 }
886
d0b80d80 887 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
885824d3 888
889 goto yybackup;
d0b80d80 890
891
892/*-----------.
893| yybackup. |
894`-----------*/
895yybackup:
885824d3 896
897/* Do appropriate processing given the current state. */
898/* Read a lookahead token if we need one and don't already have one. */
899/* yyresume: */
900
901 /* First try to decide what to do without reference to lookahead token. */
902
903 yyn = yypact[yystate];
904 if (yyn == YYFLAG)
905 goto yydefault;
906
907 /* Not known => get a lookahead token if don't already have one. */
908
909 /* yychar is either YYEMPTY or YYEOF
910 or a valid token in external form. */
911
912 if (yychar == YYEMPTY)
913 {
d0b80d80 914 YYDPRINTF ((stderr, "Reading a token: "));
885824d3 915 yychar = YYLEX;
916 }
917
918 /* Convert token to internal form (in yychar1) for indexing tables with */
919
920 if (yychar <= 0) /* This means end of input. */
921 {
922 yychar1 = 0;
923 yychar = YYEOF; /* Don't call YYLEX any more */
924
d0b80d80 925 YYDPRINTF ((stderr, "Now at end of input.\n"));
885824d3 926 }
927 else
928 {
d0b80d80 929 yychar1 = YYTRANSLATE (yychar);
885824d3 930
d0b80d80 931#if YYDEBUG
932 /* We have to keep this `#if YYDEBUG', since we use variables
933 which are defined only if `YYDEBUG' is set. */
885824d3 934 if (yydebug)
935 {
d0b80d80 936 YYFPRINTF (stderr, "Next token is %d (%s",
937 yychar, yytname[yychar1]);
938 /* Give the individual parser a way to print the precise
939 meaning of a token, for further debugging info. */
940# ifdef YYPRINT
885824d3 941 YYPRINT (stderr, yychar, yylval);
d0b80d80 942# endif
943 YYFPRINTF (stderr, ")\n");
885824d3 944 }
945#endif
946 }
947
948 yyn += yychar1;
949 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
950 goto yydefault;
951
952 yyn = yytable[yyn];
953
954 /* yyn is what to do for this token type in this state.
955 Negative => reduce, -yyn is rule number.
956 Positive => shift, yyn is new state.
957 New state is final state => don't bother to shift,
958 just return success.
959 0, or most negative number => error. */
960
961 if (yyn < 0)
962 {
963 if (yyn == YYFLAG)
964 goto yyerrlab;
965 yyn = -yyn;
966 goto yyreduce;
967 }
968 else if (yyn == 0)
969 goto yyerrlab;
970
971 if (yyn == YYFINAL)
972 YYACCEPT;
973
974 /* Shift the lookahead token. */
d0b80d80 975 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
976 yychar, yytname[yychar1]));
885824d3 977
978 /* Discard the token being shifted unless it is eof. */
979 if (yychar != YYEOF)
980 yychar = YYEMPTY;
981
982 *++yyvsp = yylval;
d0b80d80 983#if YYLSP_NEEDED
885824d3 984 *++yylsp = yylloc;
985#endif
986
d0b80d80 987 /* Count tokens shifted since error; after three, turn off error
988 status. */
989 if (yyerrstatus)
990 yyerrstatus--;
885824d3 991
992 yystate = yyn;
993 goto yynewstate;
994
a889b5ee 995
d0b80d80 996/*-----------------------------------------------------------.
997| yydefault -- do the default action for the current state. |
998`-----------------------------------------------------------*/
999yydefault:
885824d3 1000 yyn = yydefact[yystate];
1001 if (yyn == 0)
1002 goto yyerrlab;
d0b80d80 1003 goto yyreduce;
885824d3 1004
d0b80d80 1005
1006/*-----------------------------.
1007| yyreduce -- Do a reduction. |
1008`-----------------------------*/
885824d3 1009yyreduce:
d0b80d80 1010 /* yyn is the number of a rule to reduce with. */
885824d3 1011 yylen = yyr2[yyn];
885824d3 1012
d0b80d80 1013 /* If YYLEN is nonzero, implement the default value of the action:
1014 `$$ = $1'.
1015
1016 Otherwise, the following line sets YYVAL to the semantic value of
1017 the lookahead token. This behavior is undocumented and Bison
1018 users should not rely upon it. Assigning to YYVAL
1019 unconditionally makes the parser a bit smaller, and it avoids a
1020 GCC warning that YYVAL may be used uninitialized. */
1021 yyval = yyvsp[1-yylen];
1022
1023#if YYLSP_NEEDED
1024 /* Similarly for the default location. Let the user run additional
1025 commands if for instance locations are ranges. */
1026 yyloc = yylsp[1-yylen];
1027 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1028#endif
1029
1030#if YYDEBUG
1031 /* We have to keep this `#if YYDEBUG', since we use variables which
1032 are defined only if `YYDEBUG' is set. */
885824d3 1033 if (yydebug)
1034 {
d0b80d80 1035 int yyi;
885824d3 1036
d0b80d80 1037 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
1038 yyn, yyrline[yyn]);
885824d3 1039
1040 /* Print the symbols being reduced, and their result. */
d0b80d80 1041 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
1042 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
1043 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
885824d3 1044 }
1045#endif
1046
885824d3 1047 switch (yyn) {
1048
1049case 1:
885824d3 1050{ lslOpList_free (yyvsp[0].operators); ;
1051 break;}
1052case 2:
885824d3 1053{ lslOpList x = lslOpList_new ();
1054 g_importedlslOp = yyvsp[0].operator;
1055 lslOpList_add (x, yyvsp[0].operator);
1056 yyval.operators = x; ;
1057 break;}
1058case 3:
885824d3 1059{ lslOpList_add (yyvsp[-1].operators, yyvsp[0].operator);
1060 yyval.operators = yyvsp[-1].operators; ;
1061 break;}
1062case 4:
885824d3 1063{ yyval.operator = makelslOpNode (yyvsp[-2].name, yyvsp[0].signature); ;
1064 break;}
1065case 5:
885824d3 1066{ yyval.name = makeNameNodeId (yyvsp[0].ltok); ;
1067 break;}
1068case 6:
885824d3 1069{ yyval.name = makeNameNodeForm (yyvsp[0].opform); ;
1070 break;}
1071case 7:
885824d3 1072{ yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;
1073 break;}
1074case 8:
885824d3 1075{ yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1076 break;}
1077case 9:
885824d3 1078{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1079 break;}
1080case 10:
885824d3 1081{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
1082 break;}
1083case 11:
885824d3 1084{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
1085 break;}
1086case 12:
885824d3 1087{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1088 break;}
1089case 13:
885824d3 1090{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1091 break;}
1092case 14:
885824d3 1093{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1094 break;}
1095case 15:
885824d3 1096{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM,
1097 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1098 break;}
1099case 16:
885824d3 1100{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE,
1101 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1102 break;}
1103case 17:
885824d3 1104{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE,
1105 opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
1106 break;}
1107case 18:
885824d3 1108{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM,
1109 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1110 break;}
1111case 19:
885824d3 1112{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM,
1113 opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
1114 break;}
1115case 20:
885824d3 1116{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT,
1117 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1118 break;}
1119case 21:
885824d3 1120{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT,
1121 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1122 break;}
1123case 22:
885824d3 1124{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP,
1125 opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
1126 break;}
1127case 23:
885824d3 1128{ yyval.ltok = yyvsp[0].ltok; ;
1129 break;}
1130case 24:
885824d3 1131{ yyval.ltok = yyvsp[0].ltok; ;
1132 break;}
1133case 25:
885824d3 1134{ yyval.ltok = yyvsp[0].ltok; ;
1135 break;}
1136case 26:
885824d3 1137{ yyval.count = 0; ;
1138 break;}
1139case 27:
885824d3 1140{ yyval.count = yyvsp[0].count; ;
1141 break;}
1142case 28:
885824d3 1143{ yyval.count = 1; ;
1144 break;}
1145case 29:
885824d3 1146{ yyval.count = yyvsp[-2].count + 1; ;
1147 break;}
1148case 30:
885824d3 1149{ yyval.ltok = yyvsp[0].ltok; ;
1150 break;}
1151case 31:
885824d3 1152{ yyval.ltok = yyvsp[0].ltok; ;
1153 break;}
1154case 32:
885824d3 1155{ yyval.signature = makesigNode (yyvsp[-1].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
1156 break;}
1157case 33:
885824d3 1158{ yyval.ltokenList = ltokenList_new (); ;
1159 break;}
1160case 34:
885824d3 1161{ yyval.ltokenList = yyvsp[0].ltokenList; ;
1162 break;}
1163case 35:
885824d3 1164{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
1165 break;}
1166case 36:
885824d3 1167{ yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
1168 break;}
1169case 37:
885824d3 1170{
1171 yyval.ltok = yyvsp[0].ltok;
1172 ltoken_setText (yyval.ltok, processTraitSortId (ltoken_getText (yyvsp[0].ltok)));
1173 ;
1174 break;}
1175case 38:
885824d3 1176{ yyval.ltok = yyvsp[0].ltok; ;
1177 break;}
1178}
d0b80d80 1179
3e3ec469 1180
885824d3 1181\f
1182 yyvsp -= yylen;
1183 yyssp -= yylen;
d0b80d80 1184#if YYLSP_NEEDED
885824d3 1185 yylsp -= yylen;
1186#endif
1187
d0b80d80 1188#if YYDEBUG
885824d3 1189 if (yydebug)
1190 {
d0b80d80 1191 short *yyssp1 = yyss - 1;
1192 YYFPRINTF (stderr, "state stack now");
1193 while (yyssp1 != yyssp)
1194 YYFPRINTF (stderr, " %d", *++yyssp1);
1195 YYFPRINTF (stderr, "\n");
885824d3 1196 }
1197#endif
1198
1199 *++yyvsp = yyval;
d0b80d80 1200#if YYLSP_NEEDED
1201 *++yylsp = yyloc;
885824d3 1202#endif
1203
d0b80d80 1204 /* Now `shift' the result of the reduction. Determine what state
1205 that goes to, based on the state we popped back to and the rule
1206 number reduced by. */
885824d3 1207
1208 yyn = yyr1[yyn];
1209
1210 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1211 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1212 yystate = yytable[yystate];
1213 else
1214 yystate = yydefgoto[yyn - YYNTBASE];
1215
1216 goto yynewstate;
1217
885824d3 1218
d0b80d80 1219/*------------------------------------.
1220| yyerrlab -- here on detecting error |
1221`------------------------------------*/
1222yyerrlab:
1223 /* If not already recovering from an error, report this error. */
1224 if (!yyerrstatus)
885824d3 1225 {
1226 ++yynerrs;
1227
1228#ifdef YYERROR_VERBOSE
1229 yyn = yypact[yystate];
1230
1231 if (yyn > YYFLAG && yyn < YYLAST)
1232 {
d0b80d80 1233 YYSIZE_T yysize = 0;
1234 char *yymsg;
1235 int yyx, yycount;
1236
1237 yycount = 0;
1238 /* Start YYX at -YYN if negative to avoid negative indexes in
1239 YYCHECK. */
1240 for (yyx = yyn < 0 ? -yyn : 0;
1241 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1242 if (yycheck[yyx + yyn] == yyx)
1243 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1244 yysize += yystrlen ("parse error, unexpected ") + 1;
1245 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1246 yymsg = (char *) YYSTACK_ALLOC (yysize);
1247 if (yymsg != 0)
885824d3 1248 {
d0b80d80 1249 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1250 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
885824d3 1251
d0b80d80 1252 if (yycount < 5)
885824d3 1253 {
d0b80d80 1254 yycount = 0;
1255 for (yyx = yyn < 0 ? -yyn : 0;
1256 yyx < (int) (sizeof (yytname) / sizeof (char *));
1257 yyx++)
1258 if (yycheck[yyx + yyn] == yyx)
885824d3 1259 {
d0b80d80 1260 const char *yyq = ! yycount ? ", expecting " : " or ";
1261 yyp = yystpcpy (yyp, yyq);
1262 yyp = yystpcpy (yyp, yytname[yyx]);
1263 yycount++;
885824d3 1264 }
1265 }
d0b80d80 1266 yyerror (yymsg);
1267 YYSTACK_FREE (yymsg);
885824d3 1268 }
1269 else
d0b80d80 1270 yyerror ("parse error; also virtual memory exhausted");
885824d3 1271 }
1272 else
d0b80d80 1273#endif /* defined (YYERROR_VERBOSE) */
1274 yyerror ("parse error");
885824d3 1275 }
a889b5ee 1276 goto yyerrlab1;
e55c0c6d 1277
d0b80d80 1278
1279/*--------------------------------------------------.
1280| yyerrlab1 -- error raised explicitly by an action |
1281`--------------------------------------------------*/
1282yyerrlab1:
885824d3 1283 if (yyerrstatus == 3)
1284 {
d0b80d80 1285 /* If just tried and failed to reuse lookahead token after an
1286 error, discard it. */
885824d3 1287
1288 /* return failure if at end of input */
1289 if (yychar == YYEOF)
1290 YYABORT;
d0b80d80 1291 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1292 yychar, yytname[yychar1]));
885824d3 1293 yychar = YYEMPTY;
1294 }
1295
d0b80d80 1296 /* Else will try to reuse lookahead token after shifting the error
1297 token. */
885824d3 1298
1299 yyerrstatus = 3; /* Each real token shifted decrements this */
1300
1301 goto yyerrhandle;
1302
885824d3 1303
d0b80d80 1304/*-------------------------------------------------------------------.
1305| yyerrdefault -- current state does not do anything special for the |
1306| error token. |
1307`-------------------------------------------------------------------*/
1308yyerrdefault:
885824d3 1309#if 0
1310 /* This is wrong; only states that explicitly want error tokens
1311 should shift them. */
d0b80d80 1312
1313 /* If its default is to accept any token, ok. Otherwise pop it. */
1314 yyn = yydefact[yystate];
1315 if (yyn)
1316 goto yydefault;
885824d3 1317#endif
1318
885824d3 1319
d0b80d80 1320/*---------------------------------------------------------------.
1321| yyerrpop -- pop the current state because it cannot handle the |
1322| error token |
1323`---------------------------------------------------------------*/
1324yyerrpop:
1325 if (yyssp == yyss)
1326 YYABORT;
885824d3 1327 yyvsp--;
1328 yystate = *--yyssp;
d0b80d80 1329#if YYLSP_NEEDED
885824d3 1330 yylsp--;
1331#endif
1332
d0b80d80 1333#if YYDEBUG
885824d3 1334 if (yydebug)
1335 {
d0b80d80 1336 short *yyssp1 = yyss - 1;
1337 YYFPRINTF (stderr, "Error: state stack now");
1338 while (yyssp1 != yyssp)
1339 YYFPRINTF (stderr, " %d", *++yyssp1);
1340 YYFPRINTF (stderr, "\n");
885824d3 1341 }
1342#endif
1343
d0b80d80 1344/*--------------.
1345| yyerrhandle. |
1346`--------------*/
885824d3 1347yyerrhandle:
885824d3 1348 yyn = yypact[yystate];
1349 if (yyn == YYFLAG)
1350 goto yyerrdefault;
1351
1352 yyn += YYTERROR;
1353 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1354 goto yyerrdefault;
1355
1356 yyn = yytable[yyn];
1357 if (yyn < 0)
1358 {
1359 if (yyn == YYFLAG)
1360 goto yyerrpop;
1361 yyn = -yyn;
1362 goto yyreduce;
1363 }
1364 else if (yyn == 0)
1365 goto yyerrpop;
1366
1367 if (yyn == YYFINAL)
1368 YYACCEPT;
1369
d0b80d80 1370 YYDPRINTF ((stderr, "Shifting error token, "));
885824d3 1371
1372 *++yyvsp = yylval;
d0b80d80 1373#if YYLSP_NEEDED
885824d3 1374 *++yylsp = yylloc;
1375#endif
1376
1377 yystate = yyn;
1378 goto yynewstate;
bbed3d50 1379
bbed3d50 1380
d0b80d80 1381/*-------------------------------------.
1382| yyacceptlab -- YYACCEPT comes here. |
1383`-------------------------------------*/
1384yyacceptlab:
1385 yyresult = 0;
1386 goto yyreturn;
1387
1388/*-----------------------------------.
1389| yyabortlab -- YYABORT comes here. |
1390`-----------------------------------*/
1391yyabortlab:
1392 yyresult = 1;
1393 goto yyreturn;
1394
1395/*---------------------------------------------.
1396| yyoverflowab -- parser overflow comes here. |
1397`---------------------------------------------*/
1398yyoverflowlab:
1399 yyerror ("parser stack overflow");
1400 yyresult = 2;
1401 /* Fall through. */
1402
1403yyreturn:
1404#ifndef yyoverflow
1405 if (yyss != yyssa)
1406 YYSTACK_FREE (yyss);
bbed3d50 1407#endif
d0b80d80 1408 return yyresult;
885824d3 1409}
885824d3 1410
1411
1412# include "bison.reset"
1413
1414extern char *yytext;
1415
1416void lslerror (char *s)
1417{
bbed3d50 1418 llfatalbug
1419 (cstring_makeLiteral
1420 ("There has been a problem in the parser with LSL signatures. This is believed to result "
1b8ae690 1421 "from a problem with bison v. 1.25. Please try rebuidling Splint "
bbed3d50 1422 "using the pre-compiled grammar files by commenting out the "
1423 "BISON= line in the top-level Makefile."));
885824d3 1424}
1425
1426static void yyprint (FILE *file, int type, YYSTYPE value)
1427{
1428 fprintf (file, " (%u:%u type: %d; text: %s) ",
1429 ltoken_getLine (value.ltok),
1430 ltoken_getCol (value.ltok),
1431 type,
1432 ltoken_getRawTextChars (value.ltok));
1433}
1434
1435extern void PrintToken (ltoken tok) {
1436 char *codStr;
1437
1438 switch (ltoken_getCode (tok))
1439 {
1440 case NOTTOKEN: codStr = "*** NOTTOKEN ***"; break;
1441 case LST_QUANTIFIERSYM: codStr = "QUANTIFIERSYM"; break;
1442 case LST_LOGICALOP: codStr = "LOGICALOP: "; break;
1443 case LST_SELECTSYM: codStr = "LST_SELECTSYM"; break;
1444 case LST_OPENSYM: codStr = "LST_OPENSYM"; break;
1445 case LST_SEPSYM: codStr = "SEPSYM"; break;
1446 case LST_CLOSESYM: codStr = "LST_CLOSESYM"; break;
1447 case LST_SIMPLEID: codStr = "LST_SIMPLEID"; break;
1448 case LST_MAPSYM: codStr = "MAPSYM"; break;
1449 case LST_MARKERSYM: codStr = "LST_MARKERSYM"; break;
1450 case LST_COMMENTSYM: codStr = "COMMENTSYM"; break;
1451 case LST_SIMPLEOP: codStr = "SIMPLEOP"; break;
1452 case LST_COLON: codStr = "LST_COLON"; break;
1453 case LST_COMMA: codStr = "COMMA"; break;
1454 case LST_LBRACKET: codStr = "LST_LBRACKET"; break;
1455 case LST_LPAR: codStr = "LST_LPAR"; break;
1456 case LST_RBRACKET: codStr = "LST_RBRACKET"; break;
1457 case LST_RPAR: codStr = "LST_RPAR"; break;
1458 case LST_EQOP: codStr = "LST_EQOP"; break;
1459 case LST_WHITESPACE: codStr = "WHITESPACE,"; break;
1460 case LST_EOL: codStr = "LST_EOL"; break;
1461 case LST_elseTOKEN: codStr = "elseTOKEN"; break;
1462 case LST_ifTOKEN: codStr = "ifTOKEN"; break;
1463 case LST_thenTOKEN: codStr = "thenTOKEN"; break;
1464 case LST_BADTOKEN: codStr = "*** BADTOKEN ***"; break;
1465 case LEOFTOKEN: /* can't reach LEOFTOKEN easily */
1466 codStr = "LEOFTOKEN"; break;
1467 default:
1468 codStr = "*** invalid token code ***";
1469 break;
1470 } /* end switch */
1471
1472 /* only used for debugging */
1473 printf ("%u:%u: Token Code (%u): %s",
1474 ltoken_getLine (tok), ltoken_getCol (tok),
1475 ltoken_getCode (tok), codStr);
1476 if (ltoken_getRawText (tok) != 0)
1477 {
1478 printf (", Token String (%lu): %s\n",
1479 ltoken_getRawText (tok), ltoken_getRawTextChars (tok));
1480 }
1481 else printf ("\n");
1482}
1483
1484
1485
1486
bbed3d50 1487/*
1488** Resets all flags in bison.head
1489*/
1490
1491
1492/*@=allmacros@*/
1493/*@=boolint@*/
1494/*@=charint@*/
1495/*@=macroparams@*/
1496/*@=macroundef@*/
1497/*@=unreachable@*/
1498/*@=macrospec@*/
1499/*@=varuse@*/
1500/*@=ignorequals@*/
1501/*@=macrostmt@*/
1502/*@=noeffect@*/
1503/*@=shadow@*/
1504/*@=exitarg@*/
1505/*@=macroredef@*/
1506/*@=uniondef@*/
1507/*@=compdef@*/
1508/*@=matchfields@*/
1509/*@=exportlocal@*/
1510/*@=evalorderuncon@*/
1511/*@=exportheader@*/
1512/*@=typeuse@*/
1513/*@=redecl@*/
1514/*@=redef@*/
1515/*@=noparams@*/
1516/*@=ansireserved@*/
1517/*@=fielduse@*/
1518/*@=ifblock@*/
1519/*@=elseifcomplete@*/
1520/*@=whileblock@*/
1521/*@=forblock@*/
1522/*@=branchstate@*/
1523/*@=readonlytrans@*/
1524/*@=namechecks@*/
1525/*@=usedef@*/
1526/*@=systemunrecog@*/
1527/*@=dependenttrans@*/
1528/*@=unqualifiedtrans@*/
1529/*@=declundef@*/
1530
1531
1532/*drl added 11/27/2001*/
bb7c2085 1533/*@=bounds@*/
This page took 0.296978 seconds and 5 git commands to generate.