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