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