]>
Commit | Line | Data |
---|---|---|
8e37b772 | 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@*/ | |
8e37b772 | 47 | /*@-declundef@*/ |
48 | ||
bbed3d50 | 49 | /*drl added 11/27/2001*/ |
bb7c2085 | 50 | /*@-bounds@*/ |
e015e087 | 51 | |
52 | /*drl added 12/11/2002*/ | |
53 | /*@-type@*/ | |
54 | ||
69db2541 | 55 | /*@-enummemuse@*/ |
56 | ||
8e37b772 | 57 | /* < end of bison.head > */ |
58 | ||
69db2541 | 59 | /* A Bison parser, made by GNU Bison 2.3. */ |
60 | ||
61 | /* Skeleton implementation for Bison's Yacc-like parsers in C | |
62 | ||
63 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 | |
64 | Free Software Foundation, Inc. | |
65 | ||
66 | This program is free software; you can redistribute it and/or modify | |
67 | it under the terms of the GNU General Public License as published by | |
68 | the Free Software Foundation; either version 2, or (at your option) | |
69 | any later version. | |
70 | ||
71 | This program is distributed in the hope that it will be useful, | |
72 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
73 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
74 | GNU General Public License for more details. | |
75 | ||
76 | You should have received a copy of the GNU General Public License | |
77 | along with this program; if not, write to the Free Software | |
78 | Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
79 | Boston, MA 02110-1301, USA. */ | |
80 | ||
81 | /* As a special exception, you may create a larger work that contains | |
82 | part or all of the Bison parser skeleton and distribute that work | |
83 | under terms of your choice, so long as that work isn't itself a | |
84 | parser generator using the skeleton or a modified version thereof | |
85 | as a parser skeleton. Alternatively, if you modify or redistribute | |
86 | the parser skeleton itself, you may (at your option) remove this | |
87 | special exception, which will cause the skeleton and the resulting | |
88 | Bison output files to be licensed under the GNU General Public | |
89 | License without this special exception. | |
8e37b772 | 90 | |
69db2541 | 91 | This special exception was added by the Free Software Foundation in |
92 | version 2.2 of Bison. */ | |
8e37b772 | 93 | |
69db2541 | 94 | /* C LALR(1) parser skeleton written by Richard Stallman, by |
95 | simplifying the original so-called "semantic" parser. */ | |
96 | ||
97 | /* All symbols defined below should begin with yy or YY, to avoid | |
98 | infringing on user name space. This should be done even for local | |
99 | variables, as they might otherwise be expanded by user macros. | |
100 | There are some unavoidable exceptions within include files to | |
101 | define necessary library symbols; they are noted "INFRINGES ON | |
102 | USER NAME SPACE" below. */ | |
103 | ||
104 | /* Identify Bison output. */ | |
105 | #define YYBISON 1 | |
106 | ||
107 | /* Bison version. */ | |
108 | #define YYBISON_VERSION "2.3" | |
109 | ||
110 | /* Skeleton name. */ | |
111 | #define YYSKELETON_NAME "yacc.c" | |
112 | ||
113 | /* Pure parsers. */ | |
114 | #define YYPURE 1 | |
115 | ||
116 | /* Using locations. */ | |
117 | #define YYLSP_NEEDED 0 | |
118 | ||
119 | /* Substitute the variable and function names. */ | |
8e37b772 | 120 | #define yyparse mtparse |
69db2541 | 121 | #define yylex mtlex |
8e37b772 | 122 | #define yyerror mterror |
69db2541 | 123 | #define yylval mtlval |
124 | #define yychar mtchar | |
8e37b772 | 125 | #define yydebug mtdebug |
126 | #define yynerrs mtnerrs | |
8e37b772 | 127 | |
8e37b772 | 128 | |
69db2541 | 129 | /* Tokens. */ |
130 | #ifndef YYTOKENTYPE | |
131 | # define YYTOKENTYPE | |
132 | /* Put the tokens into the symbol table, so that GDB and other debuggers | |
133 | know about them. */ | |
134 | enum yytokentype { | |
135 | MT_BADTOK = 258, | |
136 | MT_END = 259, | |
137 | MT_STATE = 260, | |
138 | MT_GLOBAL = 261, | |
139 | MT_CONTEXT = 262, | |
140 | MT_ONEOF = 263, | |
141 | MT_DEFAULTS = 264, | |
142 | MT_DEFAULT = 265, | |
143 | MT_REFERENCE = 266, | |
144 | MT_PARAMETER = 267, | |
145 | MT_RESULT = 268, | |
146 | MT_CLAUSE = 269, | |
147 | MT_LITERAL = 270, | |
148 | MT_NULL = 271, | |
149 | MT_ANNOTATIONS = 272, | |
150 | MT_ARROW = 273, | |
151 | MT_MERGE = 274, | |
152 | MT_TRANSFERS = 275, | |
153 | MT_PRECONDITIONS = 276, | |
154 | MT_POSTCONDITIONS = 277, | |
155 | MT_LOSEREFERENCE = 278, | |
156 | MT_AS = 279, | |
157 | MT_ERROR = 280, | |
158 | MT_PLUS = 281, | |
159 | MT_STAR = 282, | |
160 | MT_BAR = 283, | |
161 | MT_LPAREN = 284, | |
162 | MT_RPAREN = 285, | |
163 | MT_LBRACKET = 286, | |
164 | MT_RBRACKET = 287, | |
165 | MT_LBRACE = 288, | |
166 | MT_RBRACE = 289, | |
167 | MT_COMMA = 290, | |
168 | MT_CHAR = 291, | |
169 | MT_INT = 292, | |
170 | MT_FLOAT = 293, | |
171 | MT_DOUBLE = 294, | |
172 | MT_VOID = 295, | |
173 | MT_ANYTYPE = 296, | |
174 | MT_INTEGRALTYPE = 297, | |
175 | MT_UNSIGNEDINTEGRALTYPE = 298, | |
176 | MT_SIGNEDINTEGRALTYPE = 299, | |
177 | MT_CONST = 300, | |
178 | MT_VOLATILE = 301, | |
179 | MT_RESTRICT = 302, | |
180 | MT_STRINGLIT = 303, | |
181 | MT_IDENT = 304 | |
182 | }; | |
183 | #endif | |
184 | /* Tokens. */ | |
185 | #define MT_BADTOK 258 | |
186 | #define MT_END 259 | |
187 | #define MT_STATE 260 | |
188 | #define MT_GLOBAL 261 | |
189 | #define MT_CONTEXT 262 | |
190 | #define MT_ONEOF 263 | |
191 | #define MT_DEFAULTS 264 | |
192 | #define MT_DEFAULT 265 | |
193 | #define MT_REFERENCE 266 | |
194 | #define MT_PARAMETER 267 | |
195 | #define MT_RESULT 268 | |
196 | #define MT_CLAUSE 269 | |
197 | #define MT_LITERAL 270 | |
198 | #define MT_NULL 271 | |
199 | #define MT_ANNOTATIONS 272 | |
200 | #define MT_ARROW 273 | |
201 | #define MT_MERGE 274 | |
202 | #define MT_TRANSFERS 275 | |
203 | #define MT_PRECONDITIONS 276 | |
204 | #define MT_POSTCONDITIONS 277 | |
205 | #define MT_LOSEREFERENCE 278 | |
206 | #define MT_AS 279 | |
207 | #define MT_ERROR 280 | |
208 | #define MT_PLUS 281 | |
209 | #define MT_STAR 282 | |
210 | #define MT_BAR 283 | |
211 | #define MT_LPAREN 284 | |
212 | #define MT_RPAREN 285 | |
213 | #define MT_LBRACKET 286 | |
214 | #define MT_RBRACKET 287 | |
215 | #define MT_LBRACE 288 | |
216 | #define MT_RBRACE 289 | |
217 | #define MT_COMMA 290 | |
218 | #define MT_CHAR 291 | |
219 | #define MT_INT 292 | |
220 | #define MT_FLOAT 293 | |
221 | #define MT_DOUBLE 294 | |
222 | #define MT_VOID 295 | |
223 | #define MT_ANYTYPE 296 | |
224 | #define MT_INTEGRALTYPE 297 | |
225 | #define MT_UNSIGNEDINTEGRALTYPE 298 | |
226 | #define MT_SIGNEDINTEGRALTYPE 299 | |
227 | #define MT_CONST 300 | |
228 | #define MT_VOLATILE 301 | |
229 | #define MT_RESTRICT 302 | |
230 | #define MT_STRINGLIT 303 | |
231 | #define MT_IDENT 304 | |
232 | ||
233 | ||
234 | ||
235 | ||
236 | /* Copy the first part of user declarations. */ | |
237 | #line 30 "mtgrammar.y" | |
238 | ||
8e37b772 | 239 | |
240 | # include "bison.reset" | |
1b8ae690 | 241 | # include "splintMacros.nf" |
b73d1009 | 242 | # include "basic.h" |
8e37b772 | 243 | |
3e3ec469 | 244 | # ifndef S_SPLINT_S |
8e37b772 | 245 | extern ctype mtscanner_lookupType (mttok p_tok) /*@modifies p_tok@*/ ; |
246 | # endif | |
247 | ||
248 | /*@i523@*/ /* can't include these here | |
249 | # include "mtgrammar.h" | |
250 | # include "mtscanner.h" | |
251 | */ | |
252 | ||
4dd72714 | 253 | static /*@noreturn@*/ void mterror (char *); |
8e37b772 | 254 | |
255 | /*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */ | |
4dd72714 | 256 | extern int mtlex () ; |
8e37b772 | 257 | static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */); |
258 | /*@=noparams@*/ | |
259 | ||
260 | # define YYPRINT(file, type, value) yyprint (file, type, value) | |
261 | ||
262 | # define YYDEBUG 1 | |
263 | ||
264 | # include "bison.head" | |
265 | ||
266 | ||
69db2541 | 267 | |
268 | /* Enabling traces. */ | |
269 | #ifndef YYDEBUG | |
270 | # define YYDEBUG 1 | |
271 | #endif | |
272 | ||
273 | /* Enabling verbose error messages. */ | |
274 | #ifdef YYERROR_VERBOSE | |
275 | # undef YYERROR_VERBOSE | |
276 | # define YYERROR_VERBOSE 1 | |
277 | #else | |
278 | # define YYERROR_VERBOSE 0 | |
279 | #endif | |
280 | ||
281 | /* Enabling the token table. */ | |
282 | #ifndef YYTOKEN_TABLE | |
283 | # define YYTOKEN_TABLE 0 | |
284 | #endif | |
285 | ||
286 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | |
287 | typedef union YYSTYPE | |
288 | #line 62 "mtgrammar.y" | |
289 | { | |
8e37b772 | 290 | mttok tok; |
291 | mtDeclarationNode mtdecl; | |
292 | mtDeclarationPiece mtpiece; | |
293 | mtDeclarationPieces mtpieces; | |
294 | mtContextNode mtcontext; | |
295 | mtValuesNode mtvalues; | |
296 | mtDefaultsNode mtdefaults; | |
297 | mtDefaultsDeclList mtdeflist; | |
298 | mtAnnotationsNode mtannotations; | |
299 | mtAnnotationList mtannotlist; | |
300 | mtAnnotationDecl mtannotdecl; | |
301 | mtMergeNode mtmerge; | |
302 | mtMergeItem mtmergeitem; | |
303 | mtMergeClauseList mtmergeclauselist; | |
304 | mtMergeClause mtmergeclause; | |
305 | mtTransferClauseList mttransferclauselist; | |
306 | mtTransferClause mttransferclause; | |
307 | mtTransferAction mttransferaction; | |
308 | mtLoseReferenceList mtlosereferencelist; | |
309 | mtLoseReference mtlosereference; | |
f9264521 | 310 | pointers pointers; |
8e37b772 | 311 | /*@only@*/ cstringList cstringlist; |
312 | ctype ctyp; | |
313 | /*@only@*/ qtype qtyp; | |
f9264521 | 314 | qual qual; |
315 | qualList quals; | |
69db2541 | 316 | } |
317 | /* Line 187 of yacc.c. */ | |
318 | #line 261 "mtgrammar.tab.c" | |
319 | YYSTYPE; | |
320 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ | |
321 | # define YYSTYPE_IS_DECLARED 1 | |
3e7d9038 | 322 | # define YYSTYPE_IS_TRIVIAL 1 |
e8b84478 | 323 | #endif |
e8b84478 | 324 | |
8e37b772 | 325 | |
326 | ||
69db2541 | 327 | /* Copy the second part of user declarations. */ |
8f58355a | 328 | |
8f58355a | 329 | |
69db2541 | 330 | /* Line 216 of yacc.c. */ |
331 | #line 274 "mtgrammar.tab.c" | |
8e37b772 | 332 | |
69db2541 | 333 | #ifdef short |
334 | # undef short | |
210066f9 | 335 | #endif |
336 | ||
69db2541 | 337 | #ifdef YYTYPE_UINT8 |
338 | typedef YYTYPE_UINT8 yytype_uint8; | |
339 | #else | |
340 | typedef unsigned char yytype_uint8; | |
8e37b772 | 341 | #endif |
342 | ||
69db2541 | 343 | #ifdef YYTYPE_INT8 |
344 | typedef YYTYPE_INT8 yytype_int8; | |
345 | #elif (defined __STDC__ || defined __C99__FUNC__ \ | |
346 | || defined __cplusplus || defined _MSC_VER) | |
347 | typedef signed char yytype_int8; | |
348 | #else | |
349 | typedef short int yytype_int8; | |
8e37b772 | 350 | #endif |
351 | ||
69db2541 | 352 | #ifdef YYTYPE_UINT16 |
353 | typedef YYTYPE_UINT16 yytype_uint16; | |
354 | #else | |
355 | typedef unsigned short int yytype_uint16; | |
356 | #endif | |
8e37b772 | 357 | |
69db2541 | 358 | #ifdef YYTYPE_INT16 |
359 | typedef YYTYPE_INT16 yytype_int16; | |
360 | #else | |
361 | typedef short int yytype_int16; | |
362 | #endif | |
8e37b772 | 363 | |
69db2541 | 364 | #ifndef YYSIZE_T |
365 | # ifdef __SIZE_TYPE__ | |
366 | # define YYSIZE_T __SIZE_TYPE__ | |
367 | # elif defined size_t | |
368 | # define YYSIZE_T size_t | |
369 | # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ | |
370 | || defined __cplusplus || defined _MSC_VER) | |
371 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | |
372 | # define YYSIZE_T size_t | |
373 | # else | |
374 | # define YYSIZE_T unsigned int | |
375 | # endif | |
376 | #endif | |
210066f9 | 377 | |
69db2541 | 378 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
210066f9 | 379 | |
69db2541 | 380 | #ifndef YY_ |
381 | # if YYENABLE_NLS | |
382 | # if ENABLE_NLS | |
383 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ | |
384 | # define YY_(msgid) dgettext ("bison-runtime", msgid) | |
385 | # endif | |
386 | # endif | |
387 | # ifndef YY_ | |
388 | # define YY_(msgid) msgid | |
389 | # endif | |
390 | #endif | |
210066f9 | 391 | |
69db2541 | 392 | /* Suppress unused-variable warnings by "using" E. */ |
393 | #if ! defined lint || defined __GNUC__ | |
394 | # define YYUSE(e) ((void) (e)) | |
395 | #else | |
396 | # define YYUSE(e) /* empty */ | |
397 | #endif | |
3e7d9038 | 398 | |
69db2541 | 399 | /* Identity function, used to suppress warnings about constant conditions. */ |
400 | #ifndef lint | |
401 | # define YYID(n) (n) | |
402 | #else | |
403 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
404 | || defined __cplusplus || defined _MSC_VER) | |
405 | static int | |
406 | YYID (int i) | |
407 | #else | |
408 | static int | |
409 | YYID (i) | |
410 | int i; | |
411 | #endif | |
3e7d9038 | 412 | { |
69db2541 | 413 | return i; |
414 | } | |
415 | #endif | |
210066f9 | 416 | |
69db2541 | 417 | #if ! defined yyoverflow || YYERROR_VERBOSE |
210066f9 | 418 | |
419 | /* The parser invokes alloca or malloc; define the necessary symbols. */ | |
420 | ||
69db2541 | 421 | # ifdef YYSTACK_USE_ALLOCA |
422 | # if YYSTACK_USE_ALLOCA | |
423 | # ifdef __GNUC__ | |
424 | # define YYSTACK_ALLOC __builtin_alloca | |
425 | # elif defined __BUILTIN_VA_ARG_INCR | |
426 | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ | |
427 | # elif defined _AIX | |
428 | # define YYSTACK_ALLOC __alloca | |
429 | # elif defined _MSC_VER | |
430 | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ | |
431 | # define alloca _alloca | |
210066f9 | 432 | # else |
69db2541 | 433 | # define YYSTACK_ALLOC alloca |
434 | # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ | |
435 | || defined __cplusplus || defined _MSC_VER) | |
436 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | |
437 | # ifndef _STDLIB_H | |
438 | # define _STDLIB_H 1 | |
439 | # endif | |
210066f9 | 440 | # endif |
441 | # endif | |
442 | # endif | |
443 | # endif | |
444 | ||
445 | # ifdef YYSTACK_ALLOC | |
69db2541 | 446 | /* Pacify GCC's `empty if-body' warning. */ |
447 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) | |
448 | # ifndef YYSTACK_ALLOC_MAXIMUM | |
449 | /* The OS might guarantee only one guard page at the bottom of the stack, | |
450 | and a page size can be as small as 4096 bytes. So we cannot safely | |
451 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number | |
452 | to allow for a few compiler-allocated temporary stack slots. */ | |
453 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ | |
454 | # endif | |
210066f9 | 455 | # else |
69db2541 | 456 | # define YYSTACK_ALLOC YYMALLOC |
457 | # define YYSTACK_FREE YYFREE | |
458 | # ifndef YYSTACK_ALLOC_MAXIMUM | |
459 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM | |
460 | # endif | |
461 | # if (defined __cplusplus && ! defined _STDLIB_H \ | |
462 | && ! ((defined YYMALLOC || defined malloc) \ | |
463 | && (defined YYFREE || defined free))) | |
210066f9 | 464 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
69db2541 | 465 | # ifndef _STDLIB_H |
466 | # define _STDLIB_H 1 | |
467 | # endif | |
468 | # endif | |
469 | # ifndef YYMALLOC | |
470 | # define YYMALLOC malloc | |
471 | # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ | |
472 | || defined __cplusplus || defined _MSC_VER) | |
473 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ | |
474 | # endif | |
475 | # endif | |
476 | # ifndef YYFREE | |
477 | # define YYFREE free | |
478 | # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ | |
479 | || defined __cplusplus || defined _MSC_VER) | |
480 | void free (void *); /* INFRINGES ON USER NAME SPACE */ | |
481 | # endif | |
210066f9 | 482 | # endif |
210066f9 | 483 | # endif |
69db2541 | 484 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
210066f9 | 485 | |
486 | ||
69db2541 | 487 | #if (! defined yyoverflow \ |
488 | && (! defined __cplusplus \ | |
489 | || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) | |
210066f9 | 490 | |
491 | /* A type that is properly aligned for any stack member. */ | |
492 | union yyalloc | |
8f58355a | 493 | { |
69db2541 | 494 | yytype_int16 yyss; |
210066f9 | 495 | YYSTYPE yyvs; |
69db2541 | 496 | }; |
3e7d9038 | 497 | |
210066f9 | 498 | /* The size of the maximum gap between one aligned stack and the next. */ |
69db2541 | 499 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
210066f9 | 500 | |
501 | /* The size of an array large to enough to hold all stacks, each with | |
502 | N elements. */ | |
69db2541 | 503 | # define YYSTACK_BYTES(N) \ |
504 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ | |
505 | + YYSTACK_GAP_MAXIMUM) | |
210066f9 | 506 | |
507 | /* Copy COUNT objects from FROM to TO. The source and destination do | |
508 | not overlap. */ | |
509 | # ifndef YYCOPY | |
69db2541 | 510 | # if defined __GNUC__ && 1 < __GNUC__ |
210066f9 | 511 | # define YYCOPY(To, From, Count) \ |
512 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | |
513 | # else | |
514 | # define YYCOPY(To, From, Count) \ | |
515 | do \ | |
516 | { \ | |
69db2541 | 517 | YYSIZE_T yyi; \ |
210066f9 | 518 | for (yyi = 0; yyi < (Count); yyi++) \ |
519 | (To)[yyi] = (From)[yyi]; \ | |
520 | } \ | |
69db2541 | 521 | while (YYID (0)) |
210066f9 | 522 | # endif |
523 | # endif | |
524 | ||
525 | /* Relocate STACK from its old location to the new one. The | |
526 | local variables YYSIZE and YYSTACKSIZE give the old and new number of | |
527 | elements in the stack, and YYPTR gives the new location of the | |
528 | stack. Advance YYPTR to a properly aligned location for the next | |
529 | stack. */ | |
530 | # define YYSTACK_RELOCATE(Stack) \ | |
531 | do \ | |
532 | { \ | |
533 | YYSIZE_T yynewbytes; \ | |
534 | YYCOPY (&yyptr->Stack, Stack, yysize); \ | |
535 | Stack = &yyptr->Stack; \ | |
69db2541 | 536 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
210066f9 | 537 | yyptr += yynewbytes / sizeof (*yyptr); \ |
538 | } \ | |
69db2541 | 539 | while (YYID (0)) |
210066f9 | 540 | |
541 | #endif | |
542 | ||
69db2541 | 543 | /* YYFINAL -- State number of the termination state. */ |
544 | #define YYFINAL 8 | |
545 | /* YYLAST -- Last index in YYTABLE. */ | |
546 | #define YYLAST 114 | |
547 | ||
548 | /* YYNTOKENS -- Number of terminals. */ | |
549 | #define YYNTOKENS 50 | |
550 | /* YYNNTS -- Number of nonterminals. */ | |
551 | #define YYNNTS 44 | |
552 | /* YYNRULES -- Number of rules. */ | |
553 | #define YYNRULES 94 | |
554 | /* YYNRULES -- Number of states. */ | |
555 | #define YYNSTATES 136 | |
556 | ||
557 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ | |
558 | #define YYUNDEFTOK 2 | |
559 | #define YYMAXUTOK 304 | |
560 | ||
561 | #define YYTRANSLATE(YYX) \ | |
562 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) | |
563 | ||
564 | /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ | |
565 | static const yytype_uint8 yytranslate[] = | |
566 | { | |
567 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
568 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
569 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
570 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
571 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
572 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
573 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
574 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
575 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
576 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
577 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
578 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
579 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
580 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
581 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
582 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
583 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
584 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
585 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
586 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
587 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
588 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
589 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
590 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
591 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
592 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, | |
593 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, | |
594 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | |
595 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, | |
596 | 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, | |
597 | 45, 46, 47, 48, 49 | |
598 | }; | |
599 | ||
600 | #if YYDEBUG | |
601 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in | |
602 | YYRHS. */ | |
603 | static const yytype_uint8 yyprhs[] = | |
604 | { | |
605 | 0, 0, 3, 4, 6, 10, 15, 18, 19, 22, | |
606 | 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, | |
607 | 45, 46, 48, 51, 54, 57, 60, 63, 66, 67, | |
608 | 69, 71, 74, 76, 80, 83, 84, 86, 88, 90, | |
609 | 93, 95, 98, 101, 105, 107, 109, 111, 113, 116, | |
610 | 120, 123, 127, 129, 131, 133, 135, 137, 139, 141, | |
611 | 143, 145, 147, 149, 152, 154, 158, 161, 164, 168, | |
612 | 173, 176, 178, 181, 186, 189, 191, 194, 200, 202, | |
613 | 204, 207, 210, 213, 216, 218, 221, 225, 227, 230, | |
614 | 236, 238, 240, 242, 245 | |
615 | }; | |
616 | ||
617 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ | |
618 | static const yytype_int8 yyrhs[] = | |
619 | { | |
620 | 51, 0, -1, -1, 52, -1, 5, 53, 4, -1, | |
621 | 6, 5, 53, 4, -1, 49, 54, -1, -1, 55, | |
622 | 54, -1, 56, -1, 71, -1, 74, -1, 73, -1, | |
623 | 76, -1, 79, -1, 85, -1, 83, -1, 84, -1, | |
624 | 86, -1, 7, 58, -1, -1, 58, -1, 12, 59, | |
625 | -1, 11, 59, -1, 13, 59, -1, 14, 59, -1, | |
626 | 15, 59, -1, 16, 59, -1, -1, 60, -1, 61, | |
627 | -1, 61, 64, -1, 62, -1, 61, 28, 60, -1, | |
628 | 69, 63, -1, -1, 61, -1, 65, -1, 68, -1, | |
629 | 65, 68, -1, 27, -1, 27, 67, -1, 27, 65, | |
630 | -1, 27, 67, 65, -1, 45, -1, 46, -1, 47, | |
631 | -1, 66, -1, 67, 66, -1, 29, 64, 30, -1, | |
632 | 31, 32, -1, 68, 31, 32, -1, 36, -1, 37, | |
633 | -1, 38, -1, 39, -1, 40, -1, 41, -1, 42, | |
634 | -1, 43, -1, 44, -1, 70, -1, 49, -1, 8, | |
635 | 72, -1, 49, -1, 49, 35, 72, -1, 10, 93, | |
636 | -1, 9, 75, -1, 58, 18, 93, -1, 58, 18, | |
637 | 93, 75, -1, 17, 77, -1, 78, -1, 78, 77, | |
638 | -1, 49, 57, 18, 93, -1, 19, 80, -1, 81, | |
639 | -1, 81, 80, -1, 82, 26, 82, 18, 91, -1, | |
640 | 93, -1, 27, -1, 21, 89, -1, 22, 89, -1, | |
641 | 20, 89, -1, 23, 87, -1, 88, -1, 88, 87, | |
642 | -1, 93, 18, 92, -1, 90, -1, 90, 89, -1, | |
643 | 93, 24, 93, 18, 91, -1, 93, -1, 92, -1, | |
644 | 25, -1, 25, 48, -1, 49, -1 | |
645 | }; | |
210066f9 | 646 | |
69db2541 | 647 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
648 | static const yytype_uint16 yyrline[] = | |
649 | { | |
650 | 0, 160, 160, 161, 165, 167, 172, 177, 178, 183, | |
651 | 184, 185, 186, 187, 188, 189, 190, 191, 192, 196, | |
652 | 201, 202, 206, 207, 208, 209, 210, 211, 219, 220, | |
653 | 224, 225, 229, 230, 235, 239, 240, 244, 245, 246, | |
654 | 250, 251, 252, 253, 257, 258, 259, 263, 264, 268, | |
655 | 269, 270, 278, 279, 280, 281, 282, 283, 284, 285, | |
656 | 286, 287, 294, 298, 302, 303, 308, 312, 316, 318, | |
657 | 323, 327, 328, 333, 338, 342, 343, 347, 352, 353, | |
658 | 357, 361, 365, 369, 373, 374, 378, 382, 383, 387, | |
659 | 392, 393, 397, 398, 402 | |
660 | }; | |
8e37b772 | 661 | #endif |
69db2541 | 662 | |
663 | #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE | |
664 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. | |
665 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ | |
666 | static const char *const yytname[] = | |
667 | { | |
668 | "$end", "error", "$undefined", "MT_BADTOK", "MT_END", "MT_STATE", | |
669 | "MT_GLOBAL", "MT_CONTEXT", "MT_ONEOF", "MT_DEFAULTS", "MT_DEFAULT", | |
670 | "MT_REFERENCE", "MT_PARAMETER", "MT_RESULT", "MT_CLAUSE", "MT_LITERAL", | |
671 | "MT_NULL", "MT_ANNOTATIONS", "MT_ARROW", "MT_MERGE", "MT_TRANSFERS", | |
672 | "MT_PRECONDITIONS", "MT_POSTCONDITIONS", "MT_LOSEREFERENCE", "MT_AS", | |
673 | "MT_ERROR", "MT_PLUS", "MT_STAR", "MT_BAR", "MT_LPAREN", "MT_RPAREN", | |
674 | "MT_LBRACKET", "MT_RBRACKET", "MT_LBRACE", "MT_RBRACE", "MT_COMMA", | |
675 | "MT_CHAR", "MT_INT", "MT_FLOAT", "MT_DOUBLE", "MT_VOID", "MT_ANYTYPE", | |
676 | "MT_INTEGRALTYPE", "MT_UNSIGNEDINTEGRALTYPE", "MT_SIGNEDINTEGRALTYPE", | |
677 | "MT_CONST", "MT_VOLATILE", "MT_RESTRICT", "MT_STRINGLIT", "MT_IDENT", | |
678 | "$accept", "file", "mtsDeclaration", "declarationNode", | |
679 | "declarationPieces", "declarationPiece", "contextDeclaration", | |
680 | "optContextSelection", "contextSelection", "optType", "typeExpression", | |
681 | "completeType", "completeTypeAux", "optCompleteType", "abstractDecl", | |
682 | "pointers", "innerMods", "innerModsList", "abstractDeclBase", | |
683 | "typeSpecifier", "typeName", "valuesDeclaration", "valuesList", | |
684 | "defaultNode", "defaultsDeclaration", "defaultDeclarationList", | |
685 | "annotationsDeclaration", "annotationsDeclarationList", | |
686 | "annotationDeclaration", "mergeDeclaration", "mergeClauses", | |
687 | "mergeClause", "mergeItem", "preconditionsDeclaration", | |
688 | "postconditionsDeclaration", "transfersDeclaration", | |
689 | "loseReferenceDeclaration", "lostClauses", "lostClause", | |
690 | "transferClauses", "transferClause", "transferAction", "errorAction", | |
691 | "valueChoice", 0 | |
692 | }; | |
3e7d9038 | 693 | #endif |
69db2541 | 694 | |
695 | # ifdef YYPRINT | |
696 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to | |
697 | token YYLEX-NUM. */ | |
698 | static const yytype_uint16 yytoknum[] = | |
699 | { | |
700 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | |
701 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, | |
702 | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, | |
703 | 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, | |
704 | 295, 296, 297, 298, 299, 300, 301, 302, 303, 304 | |
705 | }; | |
3e7d9038 | 706 | # endif |
69db2541 | 707 | |
708 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | |
709 | static const yytype_uint8 yyr1[] = | |
710 | { | |
711 | 0, 50, 51, 51, 52, 52, 53, 54, 54, 55, | |
712 | 55, 55, 55, 55, 55, 55, 55, 55, 55, 56, | |
713 | 57, 57, 58, 58, 58, 58, 58, 58, 59, 59, | |
714 | 60, 60, 61, 61, 62, 63, 63, 64, 64, 64, | |
715 | 65, 65, 65, 65, 66, 66, 66, 67, 67, 68, | |
716 | 68, 68, 69, 69, 69, 69, 69, 69, 69, 69, | |
717 | 69, 69, 70, 71, 72, 72, 73, 74, 75, 75, | |
718 | 76, 77, 77, 78, 79, 80, 80, 81, 82, 82, | |
719 | 83, 84, 85, 86, 87, 87, 88, 89, 89, 90, | |
720 | 91, 91, 92, 92, 93 | |
721 | }; | |
722 | ||
723 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | |
724 | static const yytype_uint8 yyr2[] = | |
725 | { | |
726 | 0, 2, 0, 1, 3, 4, 2, 0, 2, 1, | |
727 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, | |
728 | 0, 1, 2, 2, 2, 2, 2, 2, 0, 1, | |
729 | 1, 2, 1, 3, 2, 0, 1, 1, 1, 2, | |
730 | 1, 2, 2, 3, 1, 1, 1, 1, 2, 3, | |
731 | 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, | |
732 | 1, 1, 1, 2, 1, 3, 2, 2, 3, 4, | |
733 | 2, 1, 2, 4, 2, 1, 2, 5, 1, 1, | |
734 | 2, 2, 2, 2, 1, 2, 3, 1, 2, 5, | |
735 | 1, 1, 1, 2, 1 | |
736 | }; | |
737 | ||
738 | /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state | |
739 | STATE-NUM when YYTABLE doesn't specify something else to do. Zero | |
740 | means the default is an error. */ | |
741 | static const yytype_uint8 yydefact[] = | |
742 | { | |
743 | 2, 0, 0, 0, 3, 7, 0, 0, 1, 0, | |
744 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, | |
745 | 7, 9, 10, 12, 11, 13, 14, 16, 17, 15, | |
746 | 18, 4, 0, 28, 28, 28, 28, 28, 28, 19, | |
747 | 64, 63, 0, 67, 94, 66, 20, 70, 71, 79, | |
748 | 74, 75, 0, 78, 82, 87, 0, 80, 81, 83, | |
749 | 84, 0, 8, 5, 52, 53, 54, 55, 56, 57, | |
750 | 58, 59, 60, 62, 23, 29, 30, 32, 35, 61, | |
751 | 22, 24, 25, 26, 27, 0, 0, 0, 21, 72, | |
752 | 76, 0, 88, 0, 85, 0, 40, 0, 0, 0, | |
753 | 31, 37, 38, 36, 34, 65, 68, 0, 0, 0, | |
754 | 92, 86, 44, 45, 46, 42, 47, 41, 33, 0, | |
755 | 50, 39, 0, 69, 73, 0, 0, 93, 43, 48, | |
756 | 49, 51, 77, 91, 90, 89 | |
757 | }; | |
758 | ||
759 | /* YYDEFGOTO[NTERM-NUM]. */ | |
760 | static const yytype_int16 yydefgoto[] = | |
761 | { | |
762 | -1, 3, 4, 6, 19, 20, 21, 87, 42, 74, | |
763 | 75, 76, 77, 104, 100, 101, 116, 117, 102, 78, | |
764 | 79, 22, 41, 23, 24, 43, 25, 47, 48, 26, | |
765 | 50, 51, 52, 27, 28, 29, 30, 59, 60, 54, | |
766 | 55, 132, 133, 56 | |
767 | }; | |
768 | ||
769 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | |
770 | STATE-NUM. */ | |
771 | #define YYPACT_NINF -90 | |
772 | static const yytype_int8 yypact[] = | |
773 | { | |
774 | 21, -35, 10, 35, -90, 2, 33, -35, -90, 52, | |
775 | -9, 52, 11, 12, -19, 11, 11, 11, 11, -90, | |
776 | 2, -90, -90, -90, -90, -90, -90, -90, -90, -90, | |
777 | -90, -90, 37, 13, 13, 13, 13, 13, 13, -90, | |
778 | 23, -90, 41, -90, -90, -90, 52, -90, 12, -90, | |
779 | -90, -19, 44, -90, -90, 11, 48, -90, -90, -90, | |
780 | 11, 57, -90, -90, -90, -90, -90, -90, -90, -90, | |
781 | -90, -90, -90, -90, -90, -90, -11, -90, 13, -90, | |
782 | -90, -90, -90, -90, -90, -9, 11, 58, -90, -90, | |
783 | -90, -19, -90, 11, -90, 53, -14, 13, 42, 45, | |
784 | -90, 5, 49, 54, -90, -90, 52, 11, 65, 66, | |
785 | 38, -90, -90, -90, -90, -90, -90, -14, -90, 55, | |
786 | -90, 49, 56, -90, -90, -20, -20, -90, -90, -90, | |
787 | -90, -90, -90, -90, -90, -90 | |
788 | }; | |
789 | ||
790 | /* YYPGOTO[NTERM-NUM]. */ | |
791 | static const yytype_int8 yypgoto[] = | |
792 | { | |
793 | -90, -90, -90, 80, 69, -90, -90, -90, -8, 9, | |
794 | -7, 14, -90, -90, -5, -89, -26, -90, -4, -90, | |
795 | -90, -90, 15, -90, -90, -10, -90, 46, -90, -90, | |
796 | 47, -90, 8, -90, -90, -90, -90, 43, -90, -13, | |
797 | -90, -25, 7, -12 | |
798 | }; | |
799 | ||
800 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | |
801 | positive, shift that token. If negative, reduce the rule which | |
802 | number is the opposite. If zero, do what YYDEFACT says. | |
803 | If YYTABLE_NINF, syntax error. */ | |
804 | #define YYTABLE_NINF -1 | |
805 | static const yytype_uint8 yytable[] = | |
806 | { | |
807 | 45, 39, 53, 57, 58, 110, 61, 115, 49, 9, | |
808 | 10, 11, 12, 96, 5, 7, 96, 97, 98, 13, | |
809 | 99, 14, 15, 16, 17, 18, 1, 2, 128, 44, | |
810 | 44, 112, 113, 114, 98, 8, 99, 31, 88, 53, | |
811 | 40, 63, 92, 80, 81, 82, 83, 84, 61, 64, | |
812 | 65, 66, 67, 68, 69, 70, 71, 72, 85, 86, | |
813 | 44, 46, 73, 33, 34, 35, 36, 37, 38, 96, | |
814 | 91, 98, 93, 99, 106, 95, 107, 120, 110, 53, | |
815 | 122, 109, 97, 125, 126, 130, 127, 32, 131, 62, | |
816 | 118, 129, 103, 119, 89, 124, 123, 121, 90, 108, | |
817 | 105, 135, 111, 94, 0, 0, 0, 0, 0, 0, | |
818 | 0, 0, 0, 134, 134 | |
819 | }; | |
820 | ||
821 | static const yytype_int8 yycheck[] = | |
822 | { | |
823 | 12, 9, 14, 16, 17, 25, 18, 96, 27, 7, | |
824 | 8, 9, 10, 27, 49, 5, 27, 28, 29, 17, | |
825 | 31, 19, 20, 21, 22, 23, 5, 6, 117, 49, | |
826 | 49, 45, 46, 47, 29, 0, 31, 4, 46, 51, | |
827 | 49, 4, 55, 34, 35, 36, 37, 38, 60, 36, | |
828 | 37, 38, 39, 40, 41, 42, 43, 44, 35, 18, | |
829 | 49, 49, 49, 11, 12, 13, 14, 15, 16, 27, | |
830 | 26, 29, 24, 31, 86, 18, 18, 32, 25, 91, | |
831 | 31, 93, 28, 18, 18, 30, 48, 7, 32, 20, | |
832 | 97, 117, 78, 98, 48, 107, 106, 101, 51, 91, | |
833 | 85, 126, 95, 60, -1, -1, -1, -1, -1, -1, | |
834 | -1, -1, -1, 125, 126 | |
835 | }; | |
836 | ||
837 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing | |
838 | symbol of state STATE-NUM. */ | |
839 | static const yytype_uint8 yystos[] = | |
840 | { | |
841 | 0, 5, 6, 51, 52, 49, 53, 5, 0, 7, | |
842 | 8, 9, 10, 17, 19, 20, 21, 22, 23, 54, | |
843 | 55, 56, 71, 73, 74, 76, 79, 83, 84, 85, | |
844 | 86, 4, 53, 11, 12, 13, 14, 15, 16, 58, | |
845 | 49, 72, 58, 75, 49, 93, 49, 77, 78, 27, | |
846 | 80, 81, 82, 93, 89, 90, 93, 89, 89, 87, | |
847 | 88, 93, 54, 4, 36, 37, 38, 39, 40, 41, | |
848 | 42, 43, 44, 49, 59, 60, 61, 62, 69, 70, | |
849 | 59, 59, 59, 59, 59, 35, 18, 57, 58, 77, | |
850 | 80, 26, 89, 24, 87, 18, 27, 28, 29, 31, | |
851 | 64, 65, 68, 61, 63, 72, 93, 18, 82, 93, | |
852 | 25, 92, 45, 46, 47, 65, 66, 67, 60, 64, | |
853 | 32, 68, 31, 75, 93, 18, 18, 48, 65, 66, | |
854 | 30, 32, 91, 92, 93, 91 | |
855 | }; | |
e8b84478 | 856 | |
8e37b772 | 857 | #define yyerrok (yyerrstatus = 0) |
858 | #define yyclearin (yychar = YYEMPTY) | |
69db2541 | 859 | #define YYEMPTY (-2) |
8e37b772 | 860 | #define YYEOF 0 |
69db2541 | 861 | |
8e37b772 | 862 | #define YYACCEPT goto yyacceptlab |
69db2541 | 863 | #define YYABORT goto yyabortlab |
864 | #define YYERROR goto yyerrorlab | |
865 | ||
866 | ||
3e7d9038 | 867 | /* Like YYERROR except do call yyerror. This remains here temporarily |
868 | to ease the transition to the new meaning of YYERROR, for GCC. | |
8e37b772 | 869 | Once GCC version 2 has supplanted version 1, this can go. */ |
69db2541 | 870 | |
8e37b772 | 871 | #define YYFAIL goto yyerrlab |
69db2541 | 872 | |
8e37b772 | 873 | #define YYRECOVERING() (!!yyerrstatus) |
69db2541 | 874 | |
3e7d9038 | 875 | #define YYBACKUP(Token, Value) \ |
8e37b772 | 876 | do \ |
877 | if (yychar == YYEMPTY && yylen == 1) \ | |
3e7d9038 | 878 | { \ |
879 | yychar = (Token); \ | |
880 | yylval = (Value); \ | |
69db2541 | 881 | yytoken = YYTRANSLATE (yychar); \ |
882 | YYPOPSTACK (1); \ | |
8e37b772 | 883 | goto yybackup; \ |
884 | } \ | |
885 | else \ | |
69db2541 | 886 | { \ |
887 | yyerror (YY_("syntax error: cannot back up")); \ | |
3e7d9038 | 888 | YYERROR; \ |
889 | } \ | |
69db2541 | 890 | while (YYID (0)) |
891 | ||
8e37b772 | 892 | |
893 | #define YYTERROR 1 | |
894 | #define YYERRCODE 256 | |
895 | ||
210066f9 | 896 | |
69db2541 | 897 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. |
898 | If N is 0, then set CURRENT to the empty location which ends | |
899 | the previous symbol: RHS[0] (always defined). */ | |
8e37b772 | 900 | |
69db2541 | 901 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) |
3e7d9038 | 902 | #ifndef YYLLOC_DEFAULT |
69db2541 | 903 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
904 | do \ | |
905 | if (YYID (N)) \ | |
906 | { \ | |
907 | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ | |
908 | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ | |
909 | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ | |
910 | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ | |
911 | } \ | |
912 | else \ | |
913 | { \ | |
914 | (Current).first_line = (Current).last_line = \ | |
915 | YYRHSLOC (Rhs, 0).last_line; \ | |
916 | (Current).first_column = (Current).last_column = \ | |
917 | YYRHSLOC (Rhs, 0).last_column; \ | |
918 | } \ | |
919 | while (YYID (0)) | |
8e37b772 | 920 | #endif |
921 | ||
210066f9 | 922 | |
69db2541 | 923 | /* YY_LOCATION_PRINT -- Print the location on the stream. |
924 | This macro was not mandated originally: define only if we know | |
925 | we won't break user code: when these are the locations we know. */ | |
3e7d9038 | 926 | |
69db2541 | 927 | #ifndef YY_LOCATION_PRINT |
928 | # if YYLTYPE_IS_TRIVIAL | |
929 | # define YY_LOCATION_PRINT(File, Loc) \ | |
930 | fprintf (File, "%d.%d-%d.%d", \ | |
931 | (Loc).first_line, (Loc).first_column, \ | |
932 | (Loc).last_line, (Loc).last_column) | |
933 | # else | |
934 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) | |
935 | # endif | |
936 | #endif | |
937 | ||
938 | ||
939 | /* YYLEX -- calling `yylex' with the right arguments. */ | |
210066f9 | 940 | |
69db2541 | 941 | #ifdef YYLEX_PARAM |
942 | # define YYLEX yylex (&yylval, YYLEX_PARAM) | |
943 | #else | |
944 | # define YYLEX yylex (&yylval) | |
945 | #endif | |
3e7d9038 | 946 | |
947 | /* Enable debugging if requested. */ | |
948 | #if YYDEBUG | |
949 | ||
950 | # ifndef YYFPRINTF | |
951 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ | |
952 | # define YYFPRINTF fprintf | |
953 | # endif | |
8e37b772 | 954 | |
3e7d9038 | 955 | # define YYDPRINTF(Args) \ |
956 | do { \ | |
957 | if (yydebug) \ | |
958 | YYFPRINTF Args; \ | |
69db2541 | 959 | } while (YYID (0)) |
960 | ||
961 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ | |
962 | do { \ | |
963 | if (yydebug) \ | |
964 | { \ | |
965 | YYFPRINTF (stderr, "%s ", Title); \ | |
966 | yy_symbol_print (stderr, \ | |
967 | Type, Value); \ | |
968 | YYFPRINTF (stderr, "\n"); \ | |
969 | } \ | |
970 | } while (YYID (0)) | |
971 | ||
972 | ||
973 | /*--------------------------------. | |
974 | | Print this symbol on YYOUTPUT. | | |
975 | `--------------------------------*/ | |
976 | ||
977 | /*ARGSUSED*/ | |
978 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
979 | || defined __cplusplus || defined _MSC_VER) | |
980 | static void | |
981 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
982 | #else | |
983 | static void | |
984 | yy_symbol_value_print (yyoutput, yytype, yyvaluep) | |
985 | FILE *yyoutput; | |
986 | int yytype; | |
987 | YYSTYPE const * const yyvaluep; | |
988 | #endif | |
989 | { | |
990 | if (!yyvaluep) | |
991 | return; | |
992 | # ifdef YYPRINT | |
993 | if (yytype < YYNTOKENS) | |
994 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | |
995 | # else | |
996 | YYUSE (yyoutput); | |
997 | # endif | |
998 | switch (yytype) | |
999 | { | |
1000 | default: | |
1001 | break; | |
1002 | } | |
1003 | } | |
1004 | ||
1005 | ||
1006 | /*--------------------------------. | |
1007 | | Print this symbol on YYOUTPUT. | | |
1008 | `--------------------------------*/ | |
1009 | ||
1010 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1011 | || defined __cplusplus || defined _MSC_VER) | |
1012 | static void | |
1013 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
1014 | #else | |
1015 | static void | |
1016 | yy_symbol_print (yyoutput, yytype, yyvaluep) | |
1017 | FILE *yyoutput; | |
1018 | int yytype; | |
1019 | YYSTYPE const * const yyvaluep; | |
1020 | #endif | |
1021 | { | |
1022 | if (yytype < YYNTOKENS) | |
1023 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); | |
1024 | else | |
1025 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); | |
1026 | ||
1027 | yy_symbol_value_print (yyoutput, yytype, yyvaluep); | |
1028 | YYFPRINTF (yyoutput, ")"); | |
1029 | } | |
1030 | ||
1031 | /*------------------------------------------------------------------. | |
1032 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | | |
1033 | | TOP (included). | | |
1034 | `------------------------------------------------------------------*/ | |
1035 | ||
1036 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1037 | || defined __cplusplus || defined _MSC_VER) | |
1038 | static void | |
1039 | yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) | |
1040 | #else | |
1041 | static void | |
1042 | yy_stack_print (bottom, top) | |
1043 | yytype_int16 *bottom; | |
1044 | yytype_int16 *top; | |
1045 | #endif | |
1046 | { | |
1047 | YYFPRINTF (stderr, "Stack now"); | |
1048 | for (; bottom <= top; ++bottom) | |
1049 | YYFPRINTF (stderr, " %d", *bottom); | |
1050 | YYFPRINTF (stderr, "\n"); | |
1051 | } | |
1052 | ||
1053 | # define YY_STACK_PRINT(Bottom, Top) \ | |
1054 | do { \ | |
1055 | if (yydebug) \ | |
1056 | yy_stack_print ((Bottom), (Top)); \ | |
1057 | } while (YYID (0)) | |
1058 | ||
1059 | ||
1060 | /*------------------------------------------------. | |
1061 | | Report that the YYRULE is going to be reduced. | | |
1062 | `------------------------------------------------*/ | |
1063 | ||
1064 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1065 | || defined __cplusplus || defined _MSC_VER) | |
1066 | static void | |
1067 | yy_reduce_print (YYSTYPE *yyvsp, int yyrule) | |
1068 | #else | |
1069 | static void | |
1070 | yy_reduce_print (yyvsp, yyrule) | |
1071 | YYSTYPE *yyvsp; | |
1072 | int yyrule; | |
1073 | #endif | |
1074 | { | |
1075 | int yynrhs = yyr2[yyrule]; | |
1076 | int yyi; | |
1077 | unsigned long int yylno = yyrline[yyrule]; | |
1078 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", | |
1079 | yyrule - 1, yylno); | |
1080 | /* The symbols being reduced. */ | |
1081 | for (yyi = 0; yyi < yynrhs; yyi++) | |
1082 | { | |
1083 | fprintf (stderr, " $%d = ", yyi + 1); | |
1084 | yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], | |
1085 | &(yyvsp[(yyi + 1) - (yynrhs)]) | |
1086 | ); | |
1087 | fprintf (stderr, "\n"); | |
1088 | } | |
1089 | } | |
1090 | ||
1091 | # define YY_REDUCE_PRINT(Rule) \ | |
1092 | do { \ | |
1093 | if (yydebug) \ | |
1094 | yy_reduce_print (yyvsp, Rule); \ | |
1095 | } while (YYID (0)) | |
1096 | ||
3e7d9038 | 1097 | /* Nonzero means print parse trace. It is left uninitialized so that |
1098 | multiple parsers can coexist. */ | |
1099 | int yydebug; | |
1100 | #else /* !YYDEBUG */ | |
1101 | # define YYDPRINTF(Args) | |
69db2541 | 1102 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
1103 | # define YY_STACK_PRINT(Bottom, Top) | |
1104 | # define YY_REDUCE_PRINT(Rule) | |
3e7d9038 | 1105 | #endif /* !YYDEBUG */ |
1106 | ||
69db2541 | 1107 | |
3e7d9038 | 1108 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
8e37b772 | 1109 | #ifndef YYINITDEPTH |
3e7d9038 | 1110 | # define YYINITDEPTH 200 |
8e37b772 | 1111 | #endif |
1112 | ||
3e7d9038 | 1113 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
1114 | if the built-in stack extension method is used). | |
1115 | ||
1116 | Do not make this value too large; the results are undefined if | |
69db2541 | 1117 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
3e7d9038 | 1118 | evaluated with infinite-precision integer arithmetic. */ |
e8b84478 | 1119 | |
8e37b772 | 1120 | #ifndef YYMAXDEPTH |
3e7d9038 | 1121 | # define YYMAXDEPTH 10000 |
8e37b772 | 1122 | #endif |
69db2541 | 1123 | |
8e37b772 | 1124 | \f |
69db2541 | 1125 | |
1126 | #if YYERROR_VERBOSE | |
3e7d9038 | 1127 | |
1128 | # ifndef yystrlen | |
69db2541 | 1129 | # if defined __GLIBC__ && defined _STRING_H |
3e7d9038 | 1130 | # define yystrlen strlen |
1131 | # else | |
1132 | /* Return the length of YYSTR. */ | |
69db2541 | 1133 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1134 | || defined __cplusplus || defined _MSC_VER) | |
3e7d9038 | 1135 | static YYSIZE_T |
3e7d9038 | 1136 | yystrlen (const char *yystr) |
69db2541 | 1137 | #else |
1138 | static YYSIZE_T | |
3e7d9038 | 1139 | yystrlen (yystr) |
69db2541 | 1140 | const char *yystr; |
1141 | #endif | |
8e37b772 | 1142 | { |
69db2541 | 1143 | YYSIZE_T yylen; |
1144 | for (yylen = 0; yystr[yylen]; yylen++) | |
3e7d9038 | 1145 | continue; |
69db2541 | 1146 | return yylen; |
3e7d9038 | 1147 | } |
1148 | # endif | |
1149 | # endif | |
e8b84478 | 1150 | |
3e7d9038 | 1151 | # ifndef yystpcpy |
69db2541 | 1152 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
3e7d9038 | 1153 | # define yystpcpy stpcpy |
1154 | # else | |
1155 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
1156 | YYDEST. */ | |
69db2541 | 1157 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
1158 | || defined __cplusplus || defined _MSC_VER) | |
3e7d9038 | 1159 | static char * |
3e7d9038 | 1160 | yystpcpy (char *yydest, const char *yysrc) |
69db2541 | 1161 | #else |
1162 | static char * | |
3e7d9038 | 1163 | yystpcpy (yydest, yysrc) |
69db2541 | 1164 | char *yydest; |
1165 | const char *yysrc; | |
1166 | #endif | |
e8b84478 | 1167 | { |
69db2541 | 1168 | char *yyd = yydest; |
1169 | const char *yys = yysrc; | |
e8b84478 | 1170 | |
3e7d9038 | 1171 | while ((*yyd++ = *yys++) != '\0') |
1172 | continue; | |
e8b84478 | 1173 | |
3e7d9038 | 1174 | return yyd - 1; |
1175 | } | |
1176 | # endif | |
1177 | # endif | |
8f58355a | 1178 | |
69db2541 | 1179 | # ifndef yytnamerr |
1180 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary | |
1181 | quotes and backslashes, so that it's suitable for yyerror. The | |
1182 | heuristic is that double-quoting is unnecessary unless the string | |
1183 | contains an apostrophe, a comma, or backslash (other than | |
1184 | backslash-backslash). YYSTR is taken from yytname. If YYRES is | |
1185 | null, do not copy; instead, return the length of what the result | |
1186 | would have been. */ | |
1187 | static YYSIZE_T | |
1188 | yytnamerr (char *yyres, const char *yystr) | |
1189 | { | |
1190 | if (*yystr == '"') | |
1191 | { | |
1192 | YYSIZE_T yyn = 0; | |
1193 | char const *yyp = yystr; | |
1194 | ||
1195 | for (;;) | |
1196 | switch (*++yyp) | |
1197 | { | |
1198 | case '\'': | |
1199 | case ',': | |
1200 | goto do_not_strip_quotes; | |
1201 | ||
1202 | case '\\': | |
1203 | if (*++yyp != '\\') | |
1204 | goto do_not_strip_quotes; | |
1205 | /* Fall through. */ | |
1206 | default: | |
1207 | if (yyres) | |
1208 | yyres[yyn] = *yyp; | |
1209 | yyn++; | |
1210 | break; | |
1211 | ||
1212 | case '"': | |
1213 | if (yyres) | |
1214 | yyres[yyn] = '\0'; | |
1215 | return yyn; | |
1216 | } | |
1217 | do_not_strip_quotes: ; | |
1218 | } | |
210066f9 | 1219 | |
69db2541 | 1220 | if (! yyres) |
1221 | return yystrlen (yystr); | |
8e37b772 | 1222 | |
69db2541 | 1223 | return yystpcpy (yyres, yystr) - yyres; |
1224 | } | |
3e7d9038 | 1225 | # endif |
69db2541 | 1226 | |
1227 | /* Copy into YYRESULT an error message about the unexpected token | |
1228 | YYCHAR while in state YYSTATE. Return the number of bytes copied, | |
1229 | including the terminating null byte. If YYRESULT is null, do not | |
1230 | copy anything; just return the number of bytes that would be | |
1231 | copied. As a special case, return 0 if an ordinary "syntax error" | |
1232 | message will do. Return YYSIZE_MAXIMUM if overflow occurs during | |
1233 | size calculation. */ | |
1234 | static YYSIZE_T | |
1235 | yysyntax_error (char *yyresult, int yystate, int yychar) | |
1236 | { | |
1237 | int yyn = yypact[yystate]; | |
1238 | ||
1239 | if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) | |
1240 | return 0; | |
1241 | else | |
1242 | { | |
1243 | int yytype = YYTRANSLATE (yychar); | |
1244 | YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); | |
1245 | YYSIZE_T yysize = yysize0; | |
1246 | YYSIZE_T yysize1; | |
1247 | int yysize_overflow = 0; | |
1248 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | |
1249 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | |
1250 | int yyx; | |
1251 | ||
1252 | # if 0 | |
1253 | /* This is so xgettext sees the translatable formats that are | |
1254 | constructed on the fly. */ | |
1255 | YY_("syntax error, unexpected %s"); | |
1256 | YY_("syntax error, unexpected %s, expecting %s"); | |
1257 | YY_("syntax error, unexpected %s, expecting %s or %s"); | |
1258 | YY_("syntax error, unexpected %s, expecting %s or %s or %s"); | |
1259 | YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); | |
210066f9 | 1260 | # endif |
69db2541 | 1261 | char *yyfmt; |
1262 | char const *yyf; | |
1263 | static char const yyunexpected[] = "syntax error, unexpected %s"; | |
1264 | static char const yyexpecting[] = ", expecting %s"; | |
1265 | static char const yyor[] = " or %s"; | |
1266 | char yyformat[sizeof yyunexpected | |
1267 | + sizeof yyexpecting - 1 | |
1268 | + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) | |
1269 | * (sizeof yyor - 1))]; | |
1270 | char const *yyprefix = yyexpecting; | |
1271 | ||
1272 | /* Start YYX at -YYN if negative to avoid negative indexes in | |
1273 | YYCHECK. */ | |
1274 | int yyxbegin = yyn < 0 ? -yyn : 0; | |
1275 | ||
1276 | /* Stay within bounds of both yycheck and yytname. */ | |
1277 | int yychecklim = YYLAST - yyn + 1; | |
1278 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; | |
1279 | int yycount = 1; | |
1280 | ||
1281 | yyarg[0] = yytname[yytype]; | |
1282 | yyfmt = yystpcpy (yyformat, yyunexpected); | |
1283 | ||
1284 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) | |
1285 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) | |
1286 | { | |
1287 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) | |
1288 | { | |
1289 | yycount = 1; | |
1290 | yysize = yysize0; | |
1291 | yyformat[sizeof yyunexpected - 1] = '\0'; | |
1292 | break; | |
1293 | } | |
1294 | yyarg[yycount++] = yytname[yyx]; | |
1295 | yysize1 = yysize + yytnamerr (0, yytname[yyx]); | |
1296 | yysize_overflow |= (yysize1 < yysize); | |
1297 | yysize = yysize1; | |
1298 | yyfmt = yystpcpy (yyfmt, yyprefix); | |
1299 | yyprefix = yyor; | |
1300 | } | |
1301 | ||
1302 | yyf = YY_(yyformat); | |
1303 | yysize1 = yysize + yystrlen (yyf); | |
1304 | yysize_overflow |= (yysize1 < yysize); | |
1305 | yysize = yysize1; | |
1306 | ||
1307 | if (yysize_overflow) | |
1308 | return YYSIZE_MAXIMUM; | |
1309 | ||
1310 | if (yyresult) | |
1311 | { | |
1312 | /* Avoid sprintf, as that infringes on the user's name space. | |
1313 | Don't have undefined behavior even if the translation | |
1314 | produced a string with the wrong number of "%s"s. */ | |
1315 | char *yyp = yyresult; | |
1316 | int yyi = 0; | |
1317 | while ((*yyp = *yyf) != '\0') | |
1318 | { | |
1319 | if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) | |
1320 | { | |
1321 | yyp += yytnamerr (yyp, yyarg[yyi++]); | |
1322 | yyf += 2; | |
1323 | } | |
1324 | else | |
1325 | { | |
1326 | yyp++; | |
1327 | yyf++; | |
1328 | } | |
1329 | } | |
1330 | } | |
1331 | return yysize; | |
1332 | } | |
1333 | } | |
1334 | #endif /* YYERROR_VERBOSE */ | |
1335 | \f | |
1336 | ||
1337 | /*-----------------------------------------------. | |
1338 | | Release the memory associated to this symbol. | | |
1339 | `-----------------------------------------------*/ | |
1340 | ||
1341 | /*ARGSUSED*/ | |
1342 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1343 | || defined __cplusplus || defined _MSC_VER) | |
1344 | static void | |
1345 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) | |
1346 | #else | |
1347 | static void | |
1348 | yydestruct (yymsg, yytype, yyvaluep) | |
1349 | const char *yymsg; | |
1350 | int yytype; | |
1351 | YYSTYPE *yyvaluep; | |
8e37b772 | 1352 | #endif |
69db2541 | 1353 | { |
1354 | YYUSE (yyvaluep); | |
3e7d9038 | 1355 | |
69db2541 | 1356 | if (!yymsg) |
1357 | yymsg = "Deleting"; | |
1358 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | |
1359 | ||
1360 | switch (yytype) | |
1361 | { | |
1362 | ||
1363 | default: | |
1364 | break; | |
1365 | } | |
1366 | } | |
1367 | \f | |
1368 | ||
1369 | /* Prevent warnings from -Wmissing-prototypes. */ | |
3e7d9038 | 1370 | |
69db2541 | 1371 | #ifdef YYPARSE_PARAM |
1372 | #if defined __STDC__ || defined __cplusplus | |
1373 | int yyparse (void *YYPARSE_PARAM); | |
1374 | #else | |
1375 | int yyparse (); | |
1376 | #endif | |
1377 | #else /* ! YYPARSE_PARAM */ | |
1378 | #if defined __STDC__ || defined __cplusplus | |
1379 | int yyparse (void); | |
210066f9 | 1380 | #else |
69db2541 | 1381 | int yyparse (); |
210066f9 | 1382 | #endif |
69db2541 | 1383 | #endif /* ! YYPARSE_PARAM */ |
8e37b772 | 1384 | |
3e7d9038 | 1385 | |
3e7d9038 | 1386 | |
3e7d9038 | 1387 | |
69db2541 | 1388 | |
1389 | ||
1390 | /*----------. | |
1391 | | yyparse. | | |
1392 | `----------*/ | |
1393 | ||
1394 | #ifdef YYPARSE_PARAM | |
1395 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1396 | || defined __cplusplus || defined _MSC_VER) | |
1397 | int | |
1398 | yyparse (void *YYPARSE_PARAM) | |
1399 | #else | |
1400 | int | |
1401 | yyparse (YYPARSE_PARAM) | |
1402 | void *YYPARSE_PARAM; | |
1403 | #endif | |
1404 | #else /* ! YYPARSE_PARAM */ | |
1405 | #if (defined __STDC__ || defined __C99__FUNC__ \ | |
1406 | || defined __cplusplus || defined _MSC_VER) | |
8e37b772 | 1407 | int |
69db2541 | 1408 | yyparse (void) |
1409 | #else | |
1410 | int | |
1411 | yyparse () | |
1412 | ||
1413 | #endif | |
1414 | #endif | |
8e37b772 | 1415 | { |
69db2541 | 1416 | /* The look-ahead symbol. */ |
1417 | int yychar; | |
1418 | ||
1419 | /* The semantic value of the look-ahead symbol. */ | |
1420 | YYSTYPE yylval; | |
1421 | ||
1422 | /* Number of syntax errors so far. */ | |
1423 | int yynerrs; | |
3e7d9038 | 1424 | |
69db2541 | 1425 | int yystate; |
1426 | int yyn; | |
3e7d9038 | 1427 | int yyresult; |
1428 | /* Number of tokens to shift before error messages enabled. */ | |
1429 | int yyerrstatus; | |
69db2541 | 1430 | /* Look-ahead token as an internal (translated) token number. */ |
1431 | int yytoken = 0; | |
1432 | #if YYERROR_VERBOSE | |
1433 | /* Buffer for error messages, and its allocated size. */ | |
1434 | char yymsgbuf[128]; | |
1435 | char *yymsg = yymsgbuf; | |
1436 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; | |
1437 | #endif | |
3e7d9038 | 1438 | |
1439 | /* Three stacks and their tools: | |
1440 | `yyss': related to states, | |
1441 | `yyvs': related to semantic values, | |
1442 | `yyls': related to locations. | |
1443 | ||
1444 | Refer to the stacks thru separate pointers, to allow yyoverflow | |
1445 | to reallocate them elsewhere. */ | |
1446 | ||
69db2541 | 1447 | /* The state stack. */ |
1448 | yytype_int16 yyssa[YYINITDEPTH]; | |
1449 | yytype_int16 *yyss = yyssa; | |
1450 | yytype_int16 *yyssp; | |
8e37b772 | 1451 | |
3e7d9038 | 1452 | /* The semantic value stack. */ |
1453 | YYSTYPE yyvsa[YYINITDEPTH]; | |
1454 | YYSTYPE *yyvs = yyvsa; | |
69db2541 | 1455 | YYSTYPE *yyvsp; |
e8b84478 | 1456 | |
8e37b772 | 1457 | |
8e37b772 | 1458 | |
69db2541 | 1459 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
8e37b772 | 1460 | |
69db2541 | 1461 | YYSIZE_T yystacksize = YYINITDEPTH; |
210066f9 | 1462 | |
3e7d9038 | 1463 | /* The variables used to return semantic value and location from the |
1464 | action routines. */ | |
1465 | YYSTYPE yyval; | |
8e37b772 | 1466 | |
69db2541 | 1467 | |
1468 | /* The number of symbols on the RHS of the reduced rule. | |
1469 | Keep to zero when no symbol should be popped. */ | |
1470 | int yylen = 0; | |
8e37b772 | 1471 | |
3e7d9038 | 1472 | YYDPRINTF ((stderr, "Starting parse\n")); |
8e37b772 | 1473 | |
1474 | yystate = 0; | |
1475 | yyerrstatus = 0; | |
1476 | yynerrs = 0; | |
1477 | yychar = YYEMPTY; /* Cause a token to be read. */ | |
1478 | ||
1479 | /* Initialize stack pointers. | |
1480 | Waste one element of value and location stack | |
1481 | so that they stay on the same level as the state stack. | |
1482 | The wasted elements are never initialized. */ | |
1483 | ||
3e7d9038 | 1484 | yyssp = yyss; |
8e37b772 | 1485 | yyvsp = yyvs; |
69db2541 | 1486 | |
3e7d9038 | 1487 | goto yysetstate; |
8e37b772 | 1488 | |
3e7d9038 | 1489 | /*------------------------------------------------------------. |
1490 | | yynewstate -- Push a new state, which is found in yystate. | | |
1491 | `------------------------------------------------------------*/ | |
1492 | yynewstate: | |
1493 | /* In all cases, when you get here, the value and location stacks | |
69db2541 | 1494 | have just been pushed. So pushing a state here evens the stacks. */ |
3e7d9038 | 1495 | yyssp++; |
8e37b772 | 1496 | |
3e7d9038 | 1497 | yysetstate: |
1498 | *yyssp = yystate; | |
8e37b772 | 1499 | |
69db2541 | 1500 | if (yyss + yystacksize - 1 <= yyssp) |
8e37b772 | 1501 | { |
8e37b772 | 1502 | /* Get the current used size of the three stacks, in elements. */ |
3e7d9038 | 1503 | YYSIZE_T yysize = yyssp - yyss + 1; |
8e37b772 | 1504 | |
1505 | #ifdef yyoverflow | |
3e7d9038 | 1506 | { |
69db2541 | 1507 | /* Give user a chance to reallocate the stack. Use copies of |
3e7d9038 | 1508 | these so that the &'s don't force the real ones into |
1509 | memory. */ | |
1510 | YYSTYPE *yyvs1 = yyvs; | |
69db2541 | 1511 | yytype_int16 *yyss1 = yyss; |
1512 | ||
3e7d9038 | 1513 | |
8f58355a | 1514 | /* Each stack pointer address is followed by the size of the |
69db2541 | 1515 | data in use in that stack, in bytes. This used to be a |
1516 | conditional around just the two extra args, but that might | |
1517 | be undefined if yyoverflow is a macro. */ | |
1518 | yyoverflow (YY_("memory exhausted"), | |
3e7d9038 | 1519 | &yyss1, yysize * sizeof (*yyssp), |
1520 | &yyvs1, yysize * sizeof (*yyvsp), | |
69db2541 | 1521 | |
3e7d9038 | 1522 | &yystacksize); |
69db2541 | 1523 | |
3e7d9038 | 1524 | yyss = yyss1; |
1525 | yyvs = yyvs1; | |
1526 | } | |
8e37b772 | 1527 | #else /* no yyoverflow */ |
3e7d9038 | 1528 | # ifndef YYSTACK_RELOCATE |
69db2541 | 1529 | goto yyexhaustedlab; |
3e7d9038 | 1530 | # else |
8e37b772 | 1531 | /* Extend the stack our own way. */ |
69db2541 | 1532 | if (YYMAXDEPTH <= yystacksize) |
1533 | goto yyexhaustedlab; | |
8e37b772 | 1534 | yystacksize *= 2; |
69db2541 | 1535 | if (YYMAXDEPTH < yystacksize) |
8e37b772 | 1536 | yystacksize = YYMAXDEPTH; |
3e7d9038 | 1537 | |
1538 | { | |
69db2541 | 1539 | yytype_int16 *yyss1 = yyss; |
3e7d9038 | 1540 | union yyalloc *yyptr = |
1541 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
1542 | if (! yyptr) | |
69db2541 | 1543 | goto yyexhaustedlab; |
3e7d9038 | 1544 | YYSTACK_RELOCATE (yyss); |
1545 | YYSTACK_RELOCATE (yyvs); | |
69db2541 | 1546 | |
1547 | # undef YYSTACK_RELOCATE | |
3e7d9038 | 1548 | if (yyss1 != yyssa) |
1549 | YYSTACK_FREE (yyss1); | |
1550 | } | |
1551 | # endif | |
8e37b772 | 1552 | #endif /* no yyoverflow */ |
1553 | ||
3e7d9038 | 1554 | yyssp = yyss + yysize - 1; |
1555 | yyvsp = yyvs + yysize - 1; | |
69db2541 | 1556 | |
8e37b772 | 1557 | |
3e7d9038 | 1558 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
1559 | (unsigned long int) yystacksize)); | |
8e37b772 | 1560 | |
69db2541 | 1561 | if (yyss + yystacksize - 1 <= yyssp) |
8e37b772 | 1562 | YYABORT; |
1563 | } | |
1564 | ||
3e7d9038 | 1565 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
8e37b772 | 1566 | |
1567 | goto yybackup; | |
3e7d9038 | 1568 | |
3e7d9038 | 1569 | /*-----------. |
1570 | | yybackup. | | |
1571 | `-----------*/ | |
1572 | yybackup: | |
8e37b772 | 1573 | |
69db2541 | 1574 | /* Do appropriate processing given the current state. Read a |
1575 | look-ahead token if we need one and don't already have one. */ | |
8e37b772 | 1576 | |
69db2541 | 1577 | /* First try to decide what to do without reference to look-ahead token. */ |
8e37b772 | 1578 | yyn = yypact[yystate]; |
69db2541 | 1579 | if (yyn == YYPACT_NINF) |
8e37b772 | 1580 | goto yydefault; |
1581 | ||
69db2541 | 1582 | /* Not known => get a look-ahead token if don't already have one. */ |
210066f9 | 1583 | |
69db2541 | 1584 | /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ |
8e37b772 | 1585 | if (yychar == YYEMPTY) |
1586 | { | |
3e7d9038 | 1587 | YYDPRINTF ((stderr, "Reading a token: ")); |
8e37b772 | 1588 | yychar = YYLEX; |
1589 | } | |
1590 | ||
69db2541 | 1591 | if (yychar <= YYEOF) |
8e37b772 | 1592 | { |
69db2541 | 1593 | yychar = yytoken = YYEOF; |
3e7d9038 | 1594 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
8e37b772 | 1595 | } |
1596 | else | |
1597 | { | |
69db2541 | 1598 | yytoken = YYTRANSLATE (yychar); |
1599 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); | |
8e37b772 | 1600 | } |
1601 | ||
69db2541 | 1602 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
1603 | detect an error, take that action. */ | |
1604 | yyn += yytoken; | |
1605 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) | |
8e37b772 | 1606 | goto yydefault; |
8e37b772 | 1607 | yyn = yytable[yyn]; |
69db2541 | 1608 | if (yyn <= 0) |
8e37b772 | 1609 | { |
69db2541 | 1610 | if (yyn == 0 || yyn == YYTABLE_NINF) |
8e37b772 | 1611 | goto yyerrlab; |
1612 | yyn = -yyn; | |
1613 | goto yyreduce; | |
1614 | } | |
8e37b772 | 1615 | |
1616 | if (yyn == YYFINAL) | |
1617 | YYACCEPT; | |
1618 | ||
3e7d9038 | 1619 | /* Count tokens shifted since error; after three, turn off error |
1620 | status. */ | |
1621 | if (yyerrstatus) | |
1622 | yyerrstatus--; | |
8e37b772 | 1623 | |
69db2541 | 1624 | /* Shift the look-ahead token. */ |
1625 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); | |
1626 | ||
1627 | /* Discard the shifted token unless it is eof. */ | |
1628 | if (yychar != YYEOF) | |
1629 | yychar = YYEMPTY; | |
1630 | ||
8e37b772 | 1631 | yystate = yyn; |
69db2541 | 1632 | *++yyvsp = yylval; |
1633 | ||
8e37b772 | 1634 | goto yynewstate; |
1635 | ||
e8b84478 | 1636 | |
3e7d9038 | 1637 | /*-----------------------------------------------------------. |
1638 | | yydefault -- do the default action for the current state. | | |
1639 | `-----------------------------------------------------------*/ | |
1640 | yydefault: | |
8e37b772 | 1641 | yyn = yydefact[yystate]; |
1642 | if (yyn == 0) | |
1643 | goto yyerrlab; | |
3e7d9038 | 1644 | goto yyreduce; |
1645 | ||
8e37b772 | 1646 | |
3e7d9038 | 1647 | /*-----------------------------. |
1648 | | yyreduce -- Do a reduction. | | |
1649 | `-----------------------------*/ | |
8e37b772 | 1650 | yyreduce: |
3e7d9038 | 1651 | /* yyn is the number of a rule to reduce with. */ |
8e37b772 | 1652 | yylen = yyr2[yyn]; |
8e37b772 | 1653 | |
3e7d9038 | 1654 | /* If YYLEN is nonzero, implement the default value of the action: |
1655 | `$$ = $1'. | |
1656 | ||
69db2541 | 1657 | Otherwise, the following line sets YYVAL to garbage. |
1658 | This behavior is undocumented and Bison | |
3e7d9038 | 1659 | users should not rely upon it. Assigning to YYVAL |
1660 | unconditionally makes the parser a bit smaller, and it avoids a | |
1661 | GCC warning that YYVAL may be used uninitialized. */ | |
1662 | yyval = yyvsp[1-yylen]; | |
1663 | ||
3e7d9038 | 1664 | |
69db2541 | 1665 | YY_REDUCE_PRINT (yyn); |
1666 | switch (yyn) | |
8e37b772 | 1667 | { |
69db2541 | 1668 | case 2: |
1669 | #line 160 "mtgrammar.y" | |
1670 | {;} | |
1671 | break; | |
1672 | ||
1673 | case 3: | |
1674 | #line 161 "mtgrammar.y" | |
1675 | {;} | |
1676 | break; | |
1677 | ||
1678 | case 4: | |
1679 | #line 166 "mtgrammar.y" | |
1680 | { mtreader_processDeclaration ((yyvsp[(2) - (3)].mtdecl)); ;} | |
1681 | break; | |
1682 | ||
1683 | case 5: | |
1684 | #line 168 "mtgrammar.y" | |
1685 | { mtreader_processGlobalDeclaration ((yyvsp[(3) - (4)].mtdecl)); ;} | |
1686 | break; | |
1687 | ||
1688 | case 6: | |
1689 | #line 173 "mtgrammar.y" | |
1690 | { (yyval.mtdecl) = mtDeclarationNode_create ((yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].mtpieces)); ;} | |
1691 | break; | |
1692 | ||
1693 | case 7: | |
1694 | #line 177 "mtgrammar.y" | |
1695 | { (yyval.mtpieces) = mtDeclarationPieces_create (); ;} | |
1696 | break; | |
1697 | ||
1698 | case 8: | |
1699 | #line 179 "mtgrammar.y" | |
1700 | { (yyval.mtpieces) = mtDeclarationPieces_append ((yyvsp[(2) - (2)].mtpieces), (yyvsp[(1) - (2)].mtpiece)); ;} | |
1701 | break; | |
1702 | ||
1703 | case 9: | |
1704 | #line 183 "mtgrammar.y" | |
1705 | { (yyval.mtpiece) = mtDeclarationPiece_createContext ((yyvsp[(1) - (1)].mtcontext)); ;} | |
1706 | break; | |
1707 | ||
1708 | case 10: | |
1709 | #line 184 "mtgrammar.y" | |
1710 | { (yyval.mtpiece) = mtDeclarationPiece_createValues ((yyvsp[(1) - (1)].mtvalues)); ;} | |
1711 | break; | |
1712 | ||
1713 | case 11: | |
1714 | #line 185 "mtgrammar.y" | |
1715 | { (yyval.mtpiece) = mtDeclarationPiece_createDefaults ((yyvsp[(1) - (1)].mtdefaults)); ;} | |
1716 | break; | |
1717 | ||
1718 | case 12: | |
1719 | #line 186 "mtgrammar.y" | |
1720 | { (yyval.mtpiece) = mtDeclarationPiece_createValueDefault ((yyvsp[(1) - (1)].tok)); ;} | |
1721 | break; | |
1722 | ||
1723 | case 13: | |
1724 | #line 187 "mtgrammar.y" | |
1725 | { (yyval.mtpiece) = mtDeclarationPiece_createAnnotations ((yyvsp[(1) - (1)].mtannotations)); ;} | |
1726 | break; | |
1727 | ||
1728 | case 14: | |
1729 | #line 188 "mtgrammar.y" | |
1730 | { (yyval.mtpiece) = mtDeclarationPiece_createMerge ((yyvsp[(1) - (1)].mtmerge)); ;} | |
1731 | break; | |
1732 | ||
1733 | case 15: | |
1734 | #line 189 "mtgrammar.y" | |
1735 | { (yyval.mtpiece) = mtDeclarationPiece_createTransfers ((yyvsp[(1) - (1)].mttransferclauselist)); ;} | |
1736 | break; | |
1737 | ||
1738 | case 16: | |
1739 | #line 190 "mtgrammar.y" | |
1740 | { (yyval.mtpiece) = mtDeclarationPiece_createPreconditions ((yyvsp[(1) - (1)].mttransferclauselist)); ;} | |
1741 | break; | |
1742 | ||
1743 | case 17: | |
1744 | #line 191 "mtgrammar.y" | |
1745 | { (yyval.mtpiece) = mtDeclarationPiece_createPostconditions ((yyvsp[(1) - (1)].mttransferclauselist)); ;} | |
1746 | break; | |
1747 | ||
1748 | case 18: | |
1749 | #line 192 "mtgrammar.y" | |
1750 | { (yyval.mtpiece) = mtDeclarationPiece_createLosers ((yyvsp[(1) - (1)].mtlosereferencelist)); ;} | |
1751 | break; | |
1752 | ||
1753 | case 19: | |
1754 | #line 196 "mtgrammar.y" | |
1755 | { (yyval.mtcontext) = (yyvsp[(2) - (2)].mtcontext); ;} | |
1756 | break; | |
1757 | ||
1758 | case 20: | |
1759 | #line 201 "mtgrammar.y" | |
1760 | { (yyval.mtcontext) = mtContextNode_createAny (); ;} | |
1761 | break; | |
1762 | ||
1763 | case 22: | |
1764 | #line 206 "mtgrammar.y" | |
1765 | { (yyval.mtcontext) = mtContextNode_createParameter ((yyvsp[(2) - (2)].ctyp)); ;} | |
1766 | break; | |
1767 | ||
1768 | case 23: | |
1769 | #line 207 "mtgrammar.y" | |
1770 | { (yyval.mtcontext) = mtContextNode_createReference ((yyvsp[(2) - (2)].ctyp)); ;} | |
1771 | break; | |
1772 | ||
1773 | case 24: | |
1774 | #line 208 "mtgrammar.y" | |
1775 | { (yyval.mtcontext) = mtContextNode_createResult ((yyvsp[(2) - (2)].ctyp)); ;} | |
1776 | break; | |
1777 | ||
1778 | case 25: | |
1779 | #line 209 "mtgrammar.y" | |
1780 | { (yyval.mtcontext) = mtContextNode_createClause ((yyvsp[(2) - (2)].ctyp)); ;} | |
1781 | break; | |
1782 | ||
1783 | case 26: | |
1784 | #line 210 "mtgrammar.y" | |
1785 | { (yyval.mtcontext) = mtContextNode_createLiteral ((yyvsp[(2) - (2)].ctyp)); ;} | |
1786 | break; | |
1787 | ||
1788 | case 27: | |
1789 | #line 211 "mtgrammar.y" | |
1790 | { (yyval.mtcontext) = mtContextNode_createNull ((yyvsp[(2) - (2)].ctyp)); ;} | |
1791 | break; | |
1792 | ||
1793 | case 28: | |
1794 | #line 219 "mtgrammar.y" | |
1795 | { (yyval.ctyp) = ctype_unknown; ;} | |
1796 | break; | |
1797 | ||
1798 | case 29: | |
1799 | #line 220 "mtgrammar.y" | |
1800 | { DPRINTF (("Type: %s", qtype_unparse ((yyvsp[(1) - (1)].qtyp)))); (yyval.ctyp) = qtype_getType ((yyvsp[(1) - (1)].qtyp)); ;} | |
1801 | break; | |
1802 | ||
1803 | case 31: | |
1804 | #line 225 "mtgrammar.y" | |
1805 | { (yyval.qtyp) = qtype_newBase ((yyvsp[(1) - (2)].qtyp), (yyvsp[(2) - (2)].ctyp)); ;} | |
1806 | break; | |
1807 | ||
1808 | case 32: | |
1809 | #line 229 "mtgrammar.y" | |
1810 | { (yyval.qtyp) = (yyvsp[(1) - (1)].qtyp); ;} | |
1811 | break; | |
1812 | ||
1813 | case 33: | |
1814 | #line 231 "mtgrammar.y" | |
1815 | { (yyval.qtyp) = qtype_mergeAlt ((yyvsp[(1) - (3)].qtyp), (yyvsp[(3) - (3)].qtyp)); ;} | |
1816 | break; | |
1817 | ||
1818 | case 34: | |
1819 | #line 235 "mtgrammar.y" | |
1820 | { (yyval.qtyp) = qtype_combine ((yyvsp[(2) - (2)].qtyp), (yyvsp[(1) - (2)].ctyp)); ;} | |
1821 | break; | |
1822 | ||
1823 | case 35: | |
1824 | #line 239 "mtgrammar.y" | |
1825 | { (yyval.qtyp) = qtype_unknown (); ;} | |
1826 | break; | |
1827 | ||
1828 | case 36: | |
1829 | #line 240 "mtgrammar.y" | |
1830 | { (yyval.qtyp) = (yyvsp[(1) - (1)].qtyp); ;} | |
1831 | break; | |
1832 | ||
1833 | case 37: | |
1834 | #line 244 "mtgrammar.y" | |
1835 | { (yyval.ctyp) = ctype_adjustPointers ((yyvsp[(1) - (1)].pointers), ctype_unknown); ;} | |
1836 | break; | |
1837 | ||
1838 | case 39: | |
1839 | #line 246 "mtgrammar.y" | |
1840 | { (yyval.ctyp) = ctype_adjustPointers ((yyvsp[(1) - (2)].pointers), (yyvsp[(2) - (2)].ctyp)); ;} | |
1841 | break; | |
1842 | ||
1843 | case 40: | |
1844 | #line 250 "mtgrammar.y" | |
1845 | { (yyval.pointers) = pointers_createMt ((yyvsp[(1) - (1)].tok)); ;} | |
1846 | break; | |
1847 | ||
1848 | case 41: | |
1849 | #line 251 "mtgrammar.y" | |
1850 | { (yyval.pointers) = pointers_createModsMt ((yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].quals)); ;} | |
1851 | break; | |
1852 | ||
1853 | case 42: | |
1854 | #line 252 "mtgrammar.y" | |
1855 | { (yyval.pointers) = pointers_extend (pointers_createMt ((yyvsp[(1) - (2)].tok)), (yyvsp[(2) - (2)].pointers)); ;} | |
1856 | break; | |
1857 | ||
1858 | case 43: | |
1859 | #line 253 "mtgrammar.y" | |
1860 | { (yyval.pointers) = pointers_extend (pointers_createModsMt ((yyvsp[(1) - (3)].tok), (yyvsp[(2) - (3)].quals)), (yyvsp[(3) - (3)].pointers)); ;} | |
1861 | break; | |
1862 | ||
1863 | case 44: | |
1864 | #line 257 "mtgrammar.y" | |
1865 | { (yyval.qual) = qual_createConst (); ;} | |
1866 | break; | |
1867 | ||
1868 | case 45: | |
1869 | #line 258 "mtgrammar.y" | |
1870 | { (yyval.qual) = qual_createVolatile (); ;} | |
1871 | break; | |
1872 | ||
1873 | case 46: | |
1874 | #line 259 "mtgrammar.y" | |
1875 | { (yyval.qual) = qual_createRestrict (); ;} | |
1876 | break; | |
1877 | ||
1878 | case 47: | |
1879 | #line 263 "mtgrammar.y" | |
1880 | { (yyval.quals) = qualList_single ((yyvsp[(1) - (1)].qual)); ;} | |
1881 | break; | |
1882 | ||
1883 | case 48: | |
1884 | #line 264 "mtgrammar.y" | |
1885 | { (yyval.quals) = qualList_add ((yyvsp[(1) - (2)].quals), (yyvsp[(2) - (2)].qual)); ;} | |
1886 | break; | |
1887 | ||
1888 | case 49: | |
1889 | #line 268 "mtgrammar.y" | |
1890 | { (yyval.ctyp) = ctype_expectFunction ((yyvsp[(2) - (3)].ctyp)); ;} | |
1891 | break; | |
1892 | ||
1893 | case 50: | |
1894 | #line 269 "mtgrammar.y" | |
1895 | { (yyval.ctyp) = ctype_makeArray (ctype_unknown); ;} | |
1896 | break; | |
1897 | ||
1898 | case 51: | |
1899 | #line 270 "mtgrammar.y" | |
1900 | { (yyval.ctyp) = ctype_makeArray ((yyvsp[(1) - (3)].ctyp)); ;} | |
1901 | break; | |
1902 | ||
1903 | case 52: | |
1904 | #line 278 "mtgrammar.y" | |
1905 | { (yyval.ctyp) = ctype_char; ;} | |
1906 | break; | |
1907 | ||
1908 | case 53: | |
1909 | #line 279 "mtgrammar.y" | |
1910 | { (yyval.ctyp) = ctype_int; ;} | |
1911 | break; | |
1912 | ||
1913 | case 54: | |
1914 | #line 280 "mtgrammar.y" | |
1915 | { (yyval.ctyp) = ctype_float; ;} | |
1916 | break; | |
1917 | ||
1918 | case 55: | |
1919 | #line 281 "mtgrammar.y" | |
1920 | { (yyval.ctyp) = ctype_double; ;} | |
1921 | break; | |
1922 | ||
1923 | case 56: | |
1924 | #line 282 "mtgrammar.y" | |
1925 | { (yyval.ctyp) = ctype_void; ;} | |
1926 | break; | |
1927 | ||
1928 | case 57: | |
1929 | #line 283 "mtgrammar.y" | |
1930 | { (yyval.ctyp) = ctype_unknown; ;} | |
1931 | break; | |
1932 | ||
1933 | case 58: | |
1934 | #line 284 "mtgrammar.y" | |
1935 | { (yyval.ctyp) = ctype_anyintegral; ;} | |
1936 | break; | |
1937 | ||
1938 | case 59: | |
1939 | #line 285 "mtgrammar.y" | |
1940 | { (yyval.ctyp) = ctype_unsignedintegral; ;} | |
1941 | break; | |
1942 | ||
1943 | case 60: | |
1944 | #line 286 "mtgrammar.y" | |
1945 | { (yyval.ctyp) = ctype_signedintegral; ;} | |
1946 | break; | |
1947 | ||
1948 | case 62: | |
1949 | #line 294 "mtgrammar.y" | |
1950 | { (yyval.ctyp) = mtscanner_lookupType ((yyvsp[(1) - (1)].tok)); ;} | |
1951 | break; | |
1952 | ||
1953 | case 63: | |
1954 | #line 298 "mtgrammar.y" | |
1955 | { (yyval.mtvalues) = mtValuesNode_create ((yyvsp[(2) - (2)].cstringlist)); ;} | |
1956 | break; | |
1957 | ||
1958 | case 64: | |
1959 | #line 302 "mtgrammar.y" | |
1960 | { (yyval.cstringlist) = cstringList_single (mttok_getText ((yyvsp[(1) - (1)].tok))); ;} | |
1961 | break; | |
1962 | ||
1963 | case 65: | |
1964 | #line 304 "mtgrammar.y" | |
1965 | { (yyval.cstringlist) = cstringList_prepend ((yyvsp[(3) - (3)].cstringlist), mttok_getText ((yyvsp[(1) - (3)].tok))); ;} | |
1966 | break; | |
1967 | ||
1968 | case 66: | |
1969 | #line 308 "mtgrammar.y" | |
1970 | { (yyval.tok) = (yyvsp[(2) - (2)].tok); ;} | |
1971 | break; | |
1972 | ||
1973 | case 67: | |
1974 | #line 312 "mtgrammar.y" | |
1975 | { (yyval.mtdefaults) = mtDefaultsNode_create ((yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].mtdeflist)); ;} | |
1976 | break; | |
1977 | ||
1978 | case 68: | |
1979 | #line 317 "mtgrammar.y" | |
1980 | { (yyval.mtdeflist) = mtDefaultsDeclList_single (mtDefaultsDecl_create ((yyvsp[(1) - (3)].mtcontext), (yyvsp[(3) - (3)].tok))); ;} | |
1981 | break; | |
1982 | ||
1983 | case 69: | |
1984 | #line 319 "mtgrammar.y" | |
1985 | { (yyval.mtdeflist) = mtDefaultsDeclList_prepend ((yyvsp[(4) - (4)].mtdeflist), mtDefaultsDecl_create ((yyvsp[(1) - (4)].mtcontext), (yyvsp[(3) - (4)].tok))); ;} | |
1986 | break; | |
1987 | ||
1988 | case 70: | |
1989 | #line 323 "mtgrammar.y" | |
1990 | { (yyval.mtannotations) = mtAnnotationsNode_create ((yyvsp[(2) - (2)].mtannotlist)); ;} | |
1991 | break; | |
1992 | ||
1993 | case 71: | |
1994 | #line 327 "mtgrammar.y" | |
1995 | { (yyval.mtannotlist) = mtAnnotationList_single ((yyvsp[(1) - (1)].mtannotdecl)); ;} | |
1996 | break; | |
1997 | ||
1998 | case 72: | |
1999 | #line 329 "mtgrammar.y" | |
2000 | { (yyval.mtannotlist) = mtAnnotationList_prepend ((yyvsp[(2) - (2)].mtannotlist), (yyvsp[(1) - (2)].mtannotdecl)); ;} | |
2001 | break; | |
2002 | ||
2003 | case 73: | |
2004 | #line 334 "mtgrammar.y" | |
2005 | { (yyval.mtannotdecl) = mtAnnotationDecl_create ((yyvsp[(1) - (4)].tok), (yyvsp[(2) - (4)].mtcontext), (yyvsp[(4) - (4)].tok)); ;} | |
2006 | break; | |
2007 | ||
2008 | case 74: | |
2009 | #line 338 "mtgrammar.y" | |
2010 | { (yyval.mtmerge) = mtMergeNode_create ((yyvsp[(2) - (2)].mtmergeclauselist)); ;} | |
2011 | break; | |
2012 | ||
2013 | case 75: | |
2014 | #line 342 "mtgrammar.y" | |
2015 | { (yyval.mtmergeclauselist) = mtMergeClauseList_single ((yyvsp[(1) - (1)].mtmergeclause)); ;} | |
2016 | break; | |
2017 | ||
2018 | case 76: | |
2019 | #line 343 "mtgrammar.y" | |
2020 | { (yyval.mtmergeclauselist) = mtMergeClauseList_prepend ((yyvsp[(2) - (2)].mtmergeclauselist), (yyvsp[(1) - (2)].mtmergeclause)); ;} | |
2021 | break; | |
2022 | ||
2023 | case 77: | |
2024 | #line 348 "mtgrammar.y" | |
2025 | { (yyval.mtmergeclause) = mtMergeClause_create ((yyvsp[(1) - (5)].mtmergeitem), (yyvsp[(3) - (5)].mtmergeitem), (yyvsp[(5) - (5)].mttransferaction)); ;} | |
2026 | break; | |
2027 | ||
2028 | case 78: | |
2029 | #line 352 "mtgrammar.y" | |
2030 | { (yyval.mtmergeitem) = mtMergeItem_createValue ((yyvsp[(1) - (1)].tok)); ;} | |
2031 | break; | |
2032 | ||
2033 | case 79: | |
2034 | #line 353 "mtgrammar.y" | |
2035 | { (yyval.mtmergeitem) = mtMergeItem_createStar ((yyvsp[(1) - (1)].tok)); ;} | |
2036 | break; | |
2037 | ||
2038 | case 80: | |
2039 | #line 357 "mtgrammar.y" | |
2040 | { (yyval.mttransferclauselist) = (yyvsp[(2) - (2)].mttransferclauselist); ;} | |
2041 | break; | |
2042 | ||
2043 | case 81: | |
2044 | #line 361 "mtgrammar.y" | |
2045 | { (yyval.mttransferclauselist) = (yyvsp[(2) - (2)].mttransferclauselist); ;} | |
2046 | break; | |
2047 | ||
2048 | case 82: | |
2049 | #line 365 "mtgrammar.y" | |
2050 | { (yyval.mttransferclauselist) = (yyvsp[(2) - (2)].mttransferclauselist); ;} | |
2051 | break; | |
2052 | ||
2053 | case 83: | |
2054 | #line 369 "mtgrammar.y" | |
2055 | { (yyval.mtlosereferencelist) = (yyvsp[(2) - (2)].mtlosereferencelist); ;} | |
2056 | break; | |
2057 | ||
2058 | case 84: | |
2059 | #line 373 "mtgrammar.y" | |
2060 | { (yyval.mtlosereferencelist) = mtLoseReferenceList_single ((yyvsp[(1) - (1)].mtlosereference)); ;} | |
2061 | break; | |
2062 | ||
2063 | case 85: | |
2064 | #line 374 "mtgrammar.y" | |
2065 | { (yyval.mtlosereferencelist) = mtLoseReferenceList_prepend ((yyvsp[(2) - (2)].mtlosereferencelist), (yyvsp[(1) - (2)].mtlosereference)); ;} | |
2066 | break; | |
2067 | ||
2068 | case 86: | |
2069 | #line 378 "mtgrammar.y" | |
2070 | { (yyval.mtlosereference) = mtLoseReference_create ((yyvsp[(1) - (3)].tok), (yyvsp[(3) - (3)].mttransferaction)); ;} | |
2071 | break; | |
2072 | ||
2073 | case 87: | |
2074 | #line 382 "mtgrammar.y" | |
2075 | { (yyval.mttransferclauselist) = mtTransferClauseList_single ((yyvsp[(1) - (1)].mttransferclause)); ;} | |
2076 | break; | |
2077 | ||
2078 | case 88: | |
2079 | #line 383 "mtgrammar.y" | |
2080 | { (yyval.mttransferclauselist) = mtTransferClauseList_prepend ((yyvsp[(2) - (2)].mttransferclauselist), (yyvsp[(1) - (2)].mttransferclause)); ;} | |
2081 | break; | |
2082 | ||
2083 | case 89: | |
2084 | #line 388 "mtgrammar.y" | |
2085 | { (yyval.mttransferclause) = mtTransferClause_create ((yyvsp[(1) - (5)].tok), (yyvsp[(3) - (5)].tok), (yyvsp[(5) - (5)].mttransferaction)); ;} | |
2086 | break; | |
2087 | ||
2088 | case 90: | |
2089 | #line 392 "mtgrammar.y" | |
2090 | { (yyval.mttransferaction) = mtTransferAction_createValue ((yyvsp[(1) - (1)].tok)); ;} | |
2091 | break; | |
2092 | ||
2093 | case 91: | |
2094 | #line 393 "mtgrammar.y" | |
2095 | { (yyval.mttransferaction) = (yyvsp[(1) - (1)].mttransferaction); ;} | |
2096 | break; | |
2097 | ||
2098 | case 92: | |
2099 | #line 397 "mtgrammar.y" | |
2100 | { (yyval.mttransferaction) = mtTransferAction_createError ((yyvsp[(1) - (1)].tok)); ;} | |
2101 | break; | |
2102 | ||
2103 | case 93: | |
2104 | #line 398 "mtgrammar.y" | |
2105 | { (yyval.mttransferaction) = mtTransferAction_createErrorMessage ((yyvsp[(2) - (2)].tok)); ;} | |
2106 | break; | |
2107 | ||
2108 | ||
2109 | /* Line 1267 of yacc.c. */ | |
2110 | #line 2053 "mtgrammar.tab.c" | |
2111 | default: break; | |
8f58355a | 2112 | } |
69db2541 | 2113 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
210066f9 | 2114 | |
69db2541 | 2115 | YYPOPSTACK (yylen); |
2116 | yylen = 0; | |
2117 | YY_STACK_PRINT (yyss, yyssp); | |
8e37b772 | 2118 | |
2119 | *++yyvsp = yyval; | |
69db2541 | 2120 | |
8e37b772 | 2121 | |
3e7d9038 | 2122 | /* Now `shift' the result of the reduction. Determine what state |
2123 | that goes to, based on the state we popped back to and the rule | |
2124 | number reduced by. */ | |
8e37b772 | 2125 | |
2126 | yyn = yyr1[yyn]; | |
2127 | ||
69db2541 | 2128 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
2129 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
8e37b772 | 2130 | yystate = yytable[yystate]; |
2131 | else | |
69db2541 | 2132 | yystate = yydefgoto[yyn - YYNTOKENS]; |
8e37b772 | 2133 | |
2134 | goto yynewstate; | |
2135 | ||
8e37b772 | 2136 | |
3e7d9038 | 2137 | /*------------------------------------. |
2138 | | yyerrlab -- here on detecting error | | |
2139 | `------------------------------------*/ | |
2140 | yyerrlab: | |
2141 | /* If not already recovering from an error, report this error. */ | |
2142 | if (!yyerrstatus) | |
8e37b772 | 2143 | { |
2144 | ++yynerrs; | |
69db2541 | 2145 | #if ! YYERROR_VERBOSE |
2146 | yyerror (YY_("syntax error")); | |
2147 | #else | |
2148 | { | |
2149 | YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); | |
2150 | if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) | |
2151 | { | |
2152 | YYSIZE_T yyalloc = 2 * yysize; | |
2153 | if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) | |
2154 | yyalloc = YYSTACK_ALLOC_MAXIMUM; | |
2155 | if (yymsg != yymsgbuf) | |
3e7d9038 | 2156 | YYSTACK_FREE (yymsg); |
69db2541 | 2157 | yymsg = (char *) YYSTACK_ALLOC (yyalloc); |
2158 | if (yymsg) | |
2159 | yymsg_alloc = yyalloc; | |
2160 | else | |
2161 | { | |
2162 | yymsg = yymsgbuf; | |
2163 | yymsg_alloc = sizeof yymsgbuf; | |
2164 | } | |
2165 | } | |
2166 | ||
2167 | if (0 < yysize && yysize <= yymsg_alloc) | |
2168 | { | |
2169 | (void) yysyntax_error (yymsg, yystate, yychar); | |
2170 | yyerror (yymsg); | |
2171 | } | |
2172 | else | |
2173 | { | |
2174 | yyerror (YY_("syntax error")); | |
2175 | if (yysize != 0) | |
2176 | goto yyexhaustedlab; | |
2177 | } | |
2178 | } | |
2179 | #endif | |
8e37b772 | 2180 | } |
e55c0c6d | 2181 | |
3e7d9038 | 2182 | |
69db2541 | 2183 | |
8e37b772 | 2184 | if (yyerrstatus == 3) |
2185 | { | |
69db2541 | 2186 | /* If just tried and failed to reuse look-ahead token after an |
3e7d9038 | 2187 | error, discard it. */ |
8e37b772 | 2188 | |
69db2541 | 2189 | if (yychar <= YYEOF) |
2190 | { | |
2191 | /* Return failure if at end of input. */ | |
2192 | if (yychar == YYEOF) | |
2193 | YYABORT; | |
2194 | } | |
2195 | else | |
2196 | { | |
2197 | yydestruct ("Error: discarding", | |
2198 | yytoken, &yylval); | |
2199 | yychar = YYEMPTY; | |
2200 | } | |
8e37b772 | 2201 | } |
2202 | ||
69db2541 | 2203 | /* Else will try to reuse look-ahead token after shifting the error |
3e7d9038 | 2204 | token. */ |
69db2541 | 2205 | goto yyerrlab1; |
8e37b772 | 2206 | |
210066f9 | 2207 | |
69db2541 | 2208 | /*---------------------------------------------------. |
2209 | | yyerrorlab -- error raised explicitly by YYERROR. | | |
2210 | `---------------------------------------------------*/ | |
2211 | yyerrorlab: | |
210066f9 | 2212 | |
69db2541 | 2213 | /* Pacify compilers like GCC when the user code never invokes |
2214 | YYERROR and the label yyerrorlab therefore never appears in user | |
2215 | code. */ | |
2216 | if (/*CONSTCOND*/ 0) | |
2217 | goto yyerrorlab; | |
210066f9 | 2218 | |
69db2541 | 2219 | /* Do not reclaim the symbols of the rule which action triggered |
2220 | this YYERROR. */ | |
2221 | YYPOPSTACK (yylen); | |
2222 | yylen = 0; | |
2223 | YY_STACK_PRINT (yyss, yyssp); | |
2224 | yystate = *yyssp; | |
2225 | goto yyerrlab1; | |
8e37b772 | 2226 | |
8e37b772 | 2227 | |
69db2541 | 2228 | /*-------------------------------------------------------------. |
2229 | | yyerrlab1 -- common code for both syntax error and YYERROR. | | |
2230 | `-------------------------------------------------------------*/ | |
2231 | yyerrlab1: | |
2232 | yyerrstatus = 3; /* Each real token shifted decrements this. */ | |
210066f9 | 2233 | |
69db2541 | 2234 | for (;;) |
8e37b772 | 2235 | { |
69db2541 | 2236 | yyn = yypact[yystate]; |
2237 | if (yyn != YYPACT_NINF) | |
2238 | { | |
2239 | yyn += YYTERROR; | |
2240 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
2241 | { | |
2242 | yyn = yytable[yyn]; | |
2243 | if (0 < yyn) | |
2244 | break; | |
2245 | } | |
2246 | } | |
8e37b772 | 2247 | |
69db2541 | 2248 | /* Pop the current state because it cannot handle the error token. */ |
2249 | if (yyssp == yyss) | |
2250 | YYABORT; | |
8e37b772 | 2251 | |
8e37b772 | 2252 | |
69db2541 | 2253 | yydestruct ("Error: popping", |
2254 | yystos[yystate], yyvsp); | |
2255 | YYPOPSTACK (1); | |
2256 | yystate = *yyssp; | |
2257 | YY_STACK_PRINT (yyss, yyssp); | |
8e37b772 | 2258 | } |
8e37b772 | 2259 | |
2260 | if (yyn == YYFINAL) | |
2261 | YYACCEPT; | |
2262 | ||
8e37b772 | 2263 | *++yyvsp = yylval; |
69db2541 | 2264 | |
2265 | ||
2266 | /* Shift the error token. */ | |
2267 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); | |
8e37b772 | 2268 | |
2269 | yystate = yyn; | |
2270 | goto yynewstate; | |
2271 | ||
8e37b772 | 2272 | |
3e7d9038 | 2273 | /*-------------------------------------. |
2274 | | yyacceptlab -- YYACCEPT comes here. | | |
2275 | `-------------------------------------*/ | |
2276 | yyacceptlab: | |
2277 | yyresult = 0; | |
2278 | goto yyreturn; | |
2279 | ||
2280 | /*-----------------------------------. | |
2281 | | yyabortlab -- YYABORT comes here. | | |
2282 | `-----------------------------------*/ | |
2283 | yyabortlab: | |
2284 | yyresult = 1; | |
2285 | goto yyreturn; | |
2286 | ||
69db2541 | 2287 | #ifndef yyoverflow |
2288 | /*-------------------------------------------------. | |
2289 | | yyexhaustedlab -- memory exhaustion comes here. | | |
2290 | `-------------------------------------------------*/ | |
2291 | yyexhaustedlab: | |
2292 | yyerror (YY_("memory exhausted")); | |
3e7d9038 | 2293 | yyresult = 2; |
2294 | /* Fall through. */ | |
69db2541 | 2295 | #endif |
3e7d9038 | 2296 | |
2297 | yyreturn: | |
69db2541 | 2298 | if (yychar != YYEOF && yychar != YYEMPTY) |
2299 | yydestruct ("Cleanup: discarding lookahead", | |
2300 | yytoken, &yylval); | |
2301 | /* Do not reclaim the symbols of the rule which action triggered | |
2302 | this YYABORT or YYACCEPT. */ | |
2303 | YYPOPSTACK (yylen); | |
2304 | YY_STACK_PRINT (yyss, yyssp); | |
2305 | while (yyssp != yyss) | |
2306 | { | |
2307 | yydestruct ("Cleanup: popping", | |
2308 | yystos[*yyssp], yyvsp); | |
2309 | YYPOPSTACK (1); | |
2310 | } | |
3e7d9038 | 2311 | #ifndef yyoverflow |
2312 | if (yyss != yyssa) | |
2313 | YYSTACK_FREE (yyss); | |
8e37b772 | 2314 | #endif |
69db2541 | 2315 | #if YYERROR_VERBOSE |
2316 | if (yymsg != yymsgbuf) | |
2317 | YYSTACK_FREE (yymsg); | |
2318 | #endif | |
2319 | /* Make sure YYID is used. */ | |
2320 | return YYID (yyresult); | |
8e37b772 | 2321 | } |
8e37b772 | 2322 | |
2323 | ||
69db2541 | 2324 | #line 405 "mtgrammar.y" |
2325 | ||
2326 | ||
8e37b772 | 2327 | # include "bison.reset" |
2328 | ||
2329 | extern char *yytext; | |
2330 | ||
2331 | static void mterror (char *s) | |
2332 | { | |
2333 | ||
2334 | if (s != NULL) | |
2335 | { | |
2336 | llparseerror | |
2337 | (message ("Parse error in meta-state file: %s", cstring_fromChars (s))); | |
2338 | } | |
2339 | else | |
2340 | { | |
2341 | llparseerror | |
2342 | (message ("Parse error in meta-state file")); | |
2343 | } | |
2344 | ||
2345 | } | |
2346 | ||
2347 | static void yyprint (FILE *file, int type, YYSTYPE value) | |
2348 | { | |
2349 | cstring tname = mttok_unparse (value.tok); | |
2350 | fprintf (file, " (%s)", cstring_toCharsSafe (tname)); | |
2351 | cstring_free (tname); | |
2352 | } | |
2353 | ||
2354 | ||
2355 | ||
2356 | ||
69db2541 | 2357 | |
8e37b772 | 2358 | /* |
2359 | ** Resets all flags in bison.head | |
2360 | */ | |
2361 | ||
2362 | ||
2363 | /*@=allmacros@*/ | |
2364 | /*@=boolint@*/ | |
2365 | /*@=charint@*/ | |
2366 | /*@=macroparams@*/ | |
2367 | /*@=macroundef@*/ | |
2368 | /*@=unreachable@*/ | |
2369 | /*@=macrospec@*/ | |
2370 | /*@=varuse@*/ | |
2371 | /*@=ignorequals@*/ | |
2372 | /*@=macrostmt@*/ | |
2373 | /*@=noeffect@*/ | |
2374 | /*@=shadow@*/ | |
2375 | /*@=exitarg@*/ | |
2376 | /*@=macroredef@*/ | |
2377 | /*@=uniondef@*/ | |
2378 | /*@=compdef@*/ | |
2379 | /*@=matchfields@*/ | |
2380 | /*@=exportlocal@*/ | |
2381 | /*@=evalorderuncon@*/ | |
2382 | /*@=exportheader@*/ | |
2383 | /*@=typeuse@*/ | |
2384 | /*@=redecl@*/ | |
2385 | /*@=redef@*/ | |
2386 | /*@=noparams@*/ | |
2387 | /*@=ansireserved@*/ | |
2388 | /*@=fielduse@*/ | |
2389 | /*@=ifblock@*/ | |
2390 | /*@=elseifcomplete@*/ | |
2391 | /*@=whileblock@*/ | |
2392 | /*@=forblock@*/ | |
2393 | /*@=branchstate@*/ | |
2394 | /*@=readonlytrans@*/ | |
2395 | /*@=namechecks@*/ | |
2396 | /*@=usedef@*/ | |
2397 | /*@=systemunrecog@*/ | |
2398 | /*@=dependenttrans@*/ | |
2399 | /*@=unqualifiedtrans@*/ | |
2400 | /*@=declundef@*/ | |
bbed3d50 | 2401 | |
2402 | ||
2403 | /*drl added 11/27/2001*/ | |
bb7c2085 | 2404 | /*@=bounds@*/ |
e015e087 | 2405 | |
2406 | /*drl added 12/11/2002*/ | |
2407 | /*@=type@*/ | |
69db2541 | 2408 | |
2409 | /*@=enummemuse@*/ |