2 ** Inserted at beginning of c files generated by bison
3 ** REMEMBER: Change bison.reset too.
42 /*@-unqualifiedtrans@*/
49 /*drl added 11/27/2001*/
52 /*drl added 12/11/2002*/
57 /* < end of bison.head > */
59 /* A Bison parser, made by GNU Bison 2.3. */
61 /* Skeleton implementation for Bison's Yacc-like parsers in C
63 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
64 Free Software Foundation, Inc.
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)
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.
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. */
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.
91 This special exception was added by the Free Software Foundation in
92 version 2.2 of Bison. */
94 /* C LALR(1) parser skeleton written by Richard Stallman, by
95 simplifying the original so-called "semantic" parser. */
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. */
104 /* Identify Bison output. */
108 #define YYBISON_VERSION "2.3"
111 #define YYSKELETON_NAME "yacc.c"
116 /* Using locations. */
117 #define YYLSP_NEEDED 0
119 /* Substitute the variable and function names. */
120 #define yyparse mtparse
122 #define yyerror mterror
123 #define yylval mtlval
124 #define yychar mtchar
125 #define yydebug mtdebug
126 #define yynerrs mtnerrs
132 /* Put the tokens into the symbol table, so that GDB and other debuggers
149 MT_ANNOTATIONS = 272,
153 MT_PRECONDITIONS = 276,
154 MT_POSTCONDITIONS = 277,
155 MT_LOSEREFERENCE = 278,
174 MT_INTEGRALTYPE = 297,
175 MT_UNSIGNEDINTEGRALTYPE = 298,
176 MT_SIGNEDINTEGRALTYPE = 299,
185 #define MT_BADTOK 258
188 #define MT_GLOBAL 261
189 #define MT_CONTEXT 262
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
199 #define MT_ANNOTATIONS 272
202 #define MT_TRANSFERS 275
203 #define MT_PRECONDITIONS 276
204 #define MT_POSTCONDITIONS 277
205 #define MT_LOSEREFERENCE 278
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
221 #define MT_DOUBLE 294
223 #define MT_ANYTYPE 296
224 #define MT_INTEGRALTYPE 297
225 #define MT_UNSIGNEDINTEGRALTYPE 298
226 #define MT_SIGNEDINTEGRALTYPE 299
228 #define MT_VOLATILE 301
229 #define MT_RESTRICT 302
230 #define MT_STRINGLIT 303
236 /* Copy the first part of user declarations. */
237 #line 30 "mtgrammar.y"
240 # include "bison.reset"
241 # include "splintMacros.nf"
245 extern ctype mtscanner_lookupType (mttok p_tok) /*@modifies p_tok@*/ ;
248 /*@i523@*/ /* can't include these here
249 # include "mtgrammar.h"
250 # include "mtscanner.h"
253 static /*@noreturn@*/ void mterror (char *);
255 /*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
256 extern int mtlex () ;
257 static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
260 # define YYPRINT(file, type, value) yyprint (file, type, value)
264 # include "bison.head"
268 /* Enabling traces. */
273 /* Enabling verbose error messages. */
274 #ifdef YYERROR_VERBOSE
275 # undef YYERROR_VERBOSE
276 # define YYERROR_VERBOSE 1
278 # define YYERROR_VERBOSE 0
281 /* Enabling the token table. */
282 #ifndef YYTOKEN_TABLE
283 # define YYTOKEN_TABLE 0
286 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
287 typedef union YYSTYPE
288 #line 62 "mtgrammar.y"
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;
302 mtMergeItem mtmergeitem;
303 mtMergeClauseList mtmergeclauselist;
304 mtMergeClause mtmergeclause;
305 mtTransferClauseList mttransferclauselist;
306 mtTransferClause mttransferclause;
307 mtTransferAction mttransferaction;
308 mtLoseReferenceList mtlosereferencelist;
309 mtLoseReference mtlosereference;
311 /*@only@*/ cstringList cstringlist;
313 /*@only@*/ qtype qtyp;
317 /* Line 187 of yacc.c. */
318 #line 261 "mtgrammar.tab.c"
320 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
321 # define YYSTYPE_IS_DECLARED 1
322 # define YYSTYPE_IS_TRIVIAL 1
327 /* Copy the second part of user declarations. */
330 /* Line 216 of yacc.c. */
331 #line 274 "mtgrammar.tab.c"
338 typedef YYTYPE_UINT8 yytype_uint8;
340 typedef unsigned char yytype_uint8;
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;
349 typedef short int yytype_int8;
353 typedef YYTYPE_UINT16 yytype_uint16;
355 typedef unsigned short int yytype_uint16;
359 typedef YYTYPE_INT16 yytype_int16;
361 typedef short int yytype_int16;
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
374 # define YYSIZE_T unsigned int
378 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
383 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
384 # define YY_(msgid) dgettext ("bison-runtime", msgid)
388 # define YY_(msgid) msgid
392 /* Suppress unused-variable warnings by "using" E. */
393 #if ! defined lint || defined __GNUC__
394 # define YYUSE(e) ((void) (e))
396 # define YYUSE(e) /* empty */
399 /* Identity function, used to suppress warnings about constant conditions. */
403 #if (defined __STDC__ || defined __C99__FUNC__ \
404 || defined __cplusplus || defined _MSC_VER)
417 #if ! defined yyoverflow || YYERROR_VERBOSE
419 /* The parser invokes alloca or malloc; define the necessary symbols. */
421 # ifdef YYSTACK_USE_ALLOCA
422 # if YYSTACK_USE_ALLOCA
424 # define YYSTACK_ALLOC __builtin_alloca
425 # elif defined __BUILTIN_VA_ARG_INCR
426 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
428 # define YYSTACK_ALLOC __alloca
429 # elif defined _MSC_VER
430 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
431 # define alloca _alloca
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 */
445 # ifdef YYSTACK_ALLOC
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 */
456 # define YYSTACK_ALLOC YYMALLOC
457 # define YYSTACK_FREE YYFREE
458 # ifndef YYSTACK_ALLOC_MAXIMUM
459 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
461 # if (defined __cplusplus && ! defined _STDLIB_H \
462 && ! ((defined YYMALLOC || defined malloc) \
463 && (defined YYFREE || defined free)))
464 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
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 */
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 */
484 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
487 #if (! defined yyoverflow \
488 && (! defined __cplusplus \
489 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
491 /* A type that is properly aligned for any stack member. */
498 /* The size of the maximum gap between one aligned stack and the next. */
499 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
501 /* The size of an array large to enough to hold all stacks, each with
503 # define YYSTACK_BYTES(N) \
504 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
505 + YYSTACK_GAP_MAXIMUM)
507 /* Copy COUNT objects from FROM to TO. The source and destination do
510 # if defined __GNUC__ && 1 < __GNUC__
511 # define YYCOPY(To, From, Count) \
512 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
514 # define YYCOPY(To, From, Count) \
518 for (yyi = 0; yyi < (Count); yyi++) \
519 (To)[yyi] = (From)[yyi]; \
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
530 # define YYSTACK_RELOCATE(Stack) \
533 YYSIZE_T yynewbytes; \
534 YYCOPY (&yyptr->Stack, Stack, yysize); \
535 Stack = &yyptr->Stack; \
536 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
537 yyptr += yynewbytes / sizeof (*yyptr); \
543 /* YYFINAL -- State number of the termination state. */
545 /* YYLAST -- Last index in YYTABLE. */
548 /* YYNTOKENS -- Number of terminals. */
550 /* YYNNTS -- Number of nonterminals. */
552 /* YYNRULES -- Number of rules. */
554 /* YYNRULES -- Number of states. */
555 #define YYNSTATES 136
557 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
559 #define YYMAXUTOK 304
561 #define YYTRANSLATE(YYX) \
562 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
564 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
565 static const yytype_uint8 yytranslate[] =
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,
601 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
603 static const yytype_uint8 yyprhs[] =
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
617 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
618 static const yytype_int8 yyrhs[] =
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
647 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
648 static const yytype_uint16 yyrline[] =
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
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[] =
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",
696 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
698 static const yytype_uint16 yytoknum[] =
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
708 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
709 static const yytype_uint8 yyr1[] =
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,
723 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
724 static const yytype_uint8 yyr2[] =
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,
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[] =
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
759 /* YYDEFGOTO[NTERM-NUM]. */
760 static const yytype_int16 yydefgoto[] =
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,
769 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
771 #define YYPACT_NINF -90
772 static const yytype_int8 yypact[] =
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
790 /* YYPGOTO[NTERM-NUM]. */
791 static const yytype_int8 yypgoto[] =
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,
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[] =
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,
821 static const yytype_int8 yycheck[] =
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,
837 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
838 symbol of state STATE-NUM. */
839 static const yytype_uint8 yystos[] =
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
857 #define yyerrok (yyerrstatus = 0)
858 #define yyclearin (yychar = YYEMPTY)
862 #define YYACCEPT goto yyacceptlab
863 #define YYABORT goto yyabortlab
864 #define YYERROR goto yyerrorlab
867 /* Like YYERROR except do call yyerror. This remains here temporarily
868 to ease the transition to the new meaning of YYERROR, for GCC.
869 Once GCC version 2 has supplanted version 1, this can go. */
871 #define YYFAIL goto yyerrlab
873 #define YYRECOVERING() (!!yyerrstatus)
875 #define YYBACKUP(Token, Value) \
877 if (yychar == YYEMPTY && yylen == 1) \
881 yytoken = YYTRANSLATE (yychar); \
887 yyerror (YY_("syntax error: cannot back up")); \
894 #define YYERRCODE 256
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). */
901 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
902 #ifndef YYLLOC_DEFAULT
903 # define YYLLOC_DEFAULT(Current, Rhs, N) \
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; \
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; \
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. */
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)
934 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
939 /* YYLEX -- calling `yylex' with the right arguments. */
942 # define YYLEX yylex (&yylval, YYLEX_PARAM)
944 # define YYLEX yylex (&yylval)
947 /* Enable debugging if requested. */
951 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
952 # define YYFPRINTF fprintf
955 # define YYDPRINTF(Args) \
961 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
965 YYFPRINTF (stderr, "%s ", Title); \
966 yy_symbol_print (stderr, \
968 YYFPRINTF (stderr, "\n"); \
973 /*--------------------------------.
974 | Print this symbol on YYOUTPUT. |
975 `--------------------------------*/
978 #if (defined __STDC__ || defined __C99__FUNC__ \
979 || defined __cplusplus || defined _MSC_VER)
981 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
984 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
987 YYSTYPE const * const yyvaluep;
993 if (yytype < YYNTOKENS)
994 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1006 /*--------------------------------.
1007 | Print this symbol on YYOUTPUT. |
1008 `--------------------------------*/
1010 #if (defined __STDC__ || defined __C99__FUNC__ \
1011 || defined __cplusplus || defined _MSC_VER)
1013 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1016 yy_symbol_print (yyoutput, yytype, yyvaluep)
1019 YYSTYPE const * const yyvaluep;
1022 if (yytype < YYNTOKENS)
1023 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1025 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1027 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1028 YYFPRINTF (yyoutput, ")");
1031 /*------------------------------------------------------------------.
1032 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1034 `------------------------------------------------------------------*/
1036 #if (defined __STDC__ || defined __C99__FUNC__ \
1037 || defined __cplusplus || defined _MSC_VER)
1039 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1042 yy_stack_print (bottom, top)
1043 yytype_int16 *bottom;
1047 YYFPRINTF (stderr, "Stack now");
1048 for (; bottom <= top; ++bottom)
1049 YYFPRINTF (stderr, " %d", *bottom);
1050 YYFPRINTF (stderr, "\n");
1053 # define YY_STACK_PRINT(Bottom, Top) \
1056 yy_stack_print ((Bottom), (Top)); \
1060 /*------------------------------------------------.
1061 | Report that the YYRULE is going to be reduced. |
1062 `------------------------------------------------*/
1064 #if (defined __STDC__ || defined __C99__FUNC__ \
1065 || defined __cplusplus || defined _MSC_VER)
1067 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1070 yy_reduce_print (yyvsp, yyrule)
1075 int yynrhs = yyr2[yyrule];
1077 unsigned long int yylno = yyrline[yyrule];
1078 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1080 /* The symbols being reduced. */
1081 for (yyi = 0; yyi < yynrhs; yyi++)
1083 fprintf (stderr, " $%d = ", yyi + 1);
1084 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1085 &(yyvsp[(yyi + 1) - (yynrhs)])
1087 fprintf (stderr, "\n");
1091 # define YY_REDUCE_PRINT(Rule) \
1094 yy_reduce_print (yyvsp, Rule); \
1097 /* Nonzero means print parse trace. It is left uninitialized so that
1098 multiple parsers can coexist. */
1100 #else /* !YYDEBUG */
1101 # define YYDPRINTF(Args)
1102 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1103 # define YY_STACK_PRINT(Bottom, Top)
1104 # define YY_REDUCE_PRINT(Rule)
1105 #endif /* !YYDEBUG */
1108 /* YYINITDEPTH -- initial size of the parser's stacks. */
1110 # define YYINITDEPTH 200
1113 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1114 if the built-in stack extension method is used).
1116 Do not make this value too large; the results are undefined if
1117 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1118 evaluated with infinite-precision integer arithmetic. */
1121 # define YYMAXDEPTH 10000
1129 # if defined __GLIBC__ && defined _STRING_H
1130 # define yystrlen strlen
1132 /* Return the length of YYSTR. */
1133 #if (defined __STDC__ || defined __C99__FUNC__ \
1134 || defined __cplusplus || defined _MSC_VER)
1136 yystrlen (const char *yystr)
1144 for (yylen = 0; yystr[yylen]; yylen++)
1152 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1153 # define yystpcpy stpcpy
1155 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1157 #if (defined __STDC__ || defined __C99__FUNC__ \
1158 || defined __cplusplus || defined _MSC_VER)
1160 yystpcpy (char *yydest, const char *yysrc)
1163 yystpcpy (yydest, yysrc)
1169 const char *yys = yysrc;
1171 while ((*yyd++ = *yys++) != '\0')
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
1188 yytnamerr (char *yyres, const char *yystr)
1193 char const *yyp = yystr;
1200 goto do_not_strip_quotes;
1204 goto do_not_strip_quotes;
1217 do_not_strip_quotes: ;
1221 return yystrlen (yystr);
1223 return yystpcpy (yyres, yystr) - yyres;
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. */
1235 yysyntax_error (char *yyresult, int yystate, int yychar)
1237 int yyn = yypact[yystate];
1239 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1243 int yytype = YYTRANSLATE (yychar);
1244 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1245 YYSIZE_T yysize = yysize0;
1247 int yysize_overflow = 0;
1248 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1249 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
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");
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;
1272 /* Start YYX at -YYN if negative to avoid negative indexes in
1274 int yyxbegin = yyn < 0 ? -yyn : 0;
1276 /* Stay within bounds of both yycheck and yytname. */
1277 int yychecklim = YYLAST - yyn + 1;
1278 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1281 yyarg[0] = yytname[yytype];
1282 yyfmt = yystpcpy (yyformat, yyunexpected);
1284 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1285 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1287 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1291 yyformat[sizeof yyunexpected - 1] = '\0';
1294 yyarg[yycount++] = yytname[yyx];
1295 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1296 yysize_overflow |= (yysize1 < yysize);
1298 yyfmt = yystpcpy (yyfmt, yyprefix);
1302 yyf = YY_(yyformat);
1303 yysize1 = yysize + yystrlen (yyf);
1304 yysize_overflow |= (yysize1 < yysize);
1307 if (yysize_overflow)
1308 return YYSIZE_MAXIMUM;
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;
1317 while ((*yyp = *yyf) != '\0')
1319 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1321 yyp += yytnamerr (yyp, yyarg[yyi++]);
1334 #endif /* YYERROR_VERBOSE */
1337 /*-----------------------------------------------.
1338 | Release the memory associated to this symbol. |
1339 `-----------------------------------------------*/
1342 #if (defined __STDC__ || defined __C99__FUNC__ \
1343 || defined __cplusplus || defined _MSC_VER)
1345 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1348 yydestruct (yymsg, yytype, yyvaluep)
1358 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1369 /* Prevent warnings from -Wmissing-prototypes. */
1371 #ifdef YYPARSE_PARAM
1372 #if defined __STDC__ || defined __cplusplus
1373 int yyparse (void *YYPARSE_PARAM);
1377 #else /* ! YYPARSE_PARAM */
1378 #if defined __STDC__ || defined __cplusplus
1383 #endif /* ! YYPARSE_PARAM */
1394 #ifdef YYPARSE_PARAM
1395 #if (defined __STDC__ || defined __C99__FUNC__ \
1396 || defined __cplusplus || defined _MSC_VER)
1398 yyparse (void *YYPARSE_PARAM)
1401 yyparse (YYPARSE_PARAM)
1402 void *YYPARSE_PARAM;
1404 #else /* ! YYPARSE_PARAM */
1405 #if (defined __STDC__ || defined __C99__FUNC__ \
1406 || defined __cplusplus || defined _MSC_VER)
1416 /* The look-ahead symbol. */
1419 /* The semantic value of the look-ahead symbol. */
1422 /* Number of syntax errors so far. */
1428 /* Number of tokens to shift before error messages enabled. */
1430 /* Look-ahead token as an internal (translated) token number. */
1433 /* Buffer for error messages, and its allocated size. */
1435 char *yymsg = yymsgbuf;
1436 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1439 /* Three stacks and their tools:
1440 `yyss': related to states,
1441 `yyvs': related to semantic values,
1442 `yyls': related to locations.
1444 Refer to the stacks thru separate pointers, to allow yyoverflow
1445 to reallocate them elsewhere. */
1447 /* The state stack. */
1448 yytype_int16 yyssa[YYINITDEPTH];
1449 yytype_int16 *yyss = yyssa;
1450 yytype_int16 *yyssp;
1452 /* The semantic value stack. */
1453 YYSTYPE yyvsa[YYINITDEPTH];
1454 YYSTYPE *yyvs = yyvsa;
1459 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1461 YYSIZE_T yystacksize = YYINITDEPTH;
1463 /* The variables used to return semantic value and location from the
1468 /* The number of symbols on the RHS of the reduced rule.
1469 Keep to zero when no symbol should be popped. */
1472 YYDPRINTF ((stderr, "Starting parse\n"));
1477 yychar = YYEMPTY; /* Cause a token to be read. */
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. */
1489 /*------------------------------------------------------------.
1490 | yynewstate -- Push a new state, which is found in yystate. |
1491 `------------------------------------------------------------*/
1493 /* In all cases, when you get here, the value and location stacks
1494 have just been pushed. So pushing a state here evens the stacks. */
1500 if (yyss + yystacksize - 1 <= yyssp)
1502 /* Get the current used size of the three stacks, in elements. */
1503 YYSIZE_T yysize = yyssp - yyss + 1;
1507 /* Give user a chance to reallocate the stack. Use copies of
1508 these so that the &'s don't force the real ones into
1510 YYSTYPE *yyvs1 = yyvs;
1511 yytype_int16 *yyss1 = yyss;
1514 /* Each stack pointer address is followed by the size of the
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"),
1519 &yyss1, yysize * sizeof (*yyssp),
1520 &yyvs1, yysize * sizeof (*yyvsp),
1527 #else /* no yyoverflow */
1528 # ifndef YYSTACK_RELOCATE
1529 goto yyexhaustedlab;
1531 /* Extend the stack our own way. */
1532 if (YYMAXDEPTH <= yystacksize)
1533 goto yyexhaustedlab;
1535 if (YYMAXDEPTH < yystacksize)
1536 yystacksize = YYMAXDEPTH;
1539 yytype_int16 *yyss1 = yyss;
1540 union yyalloc *yyptr =
1541 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1543 goto yyexhaustedlab;
1544 YYSTACK_RELOCATE (yyss);
1545 YYSTACK_RELOCATE (yyvs);
1547 # undef YYSTACK_RELOCATE
1549 YYSTACK_FREE (yyss1);
1552 #endif /* no yyoverflow */
1554 yyssp = yyss + yysize - 1;
1555 yyvsp = yyvs + yysize - 1;
1558 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1559 (unsigned long int) yystacksize));
1561 if (yyss + yystacksize - 1 <= yyssp)
1565 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1574 /* Do appropriate processing given the current state. Read a
1575 look-ahead token if we need one and don't already have one. */
1577 /* First try to decide what to do without reference to look-ahead token. */
1578 yyn = yypact[yystate];
1579 if (yyn == YYPACT_NINF)
1582 /* Not known => get a look-ahead token if don't already have one. */
1584 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1585 if (yychar == YYEMPTY)
1587 YYDPRINTF ((stderr, "Reading a token: "));
1591 if (yychar <= YYEOF)
1593 yychar = yytoken = YYEOF;
1594 YYDPRINTF ((stderr, "Now at end of input.\n"));
1598 yytoken = YYTRANSLATE (yychar);
1599 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1602 /* If the proper action on seeing token YYTOKEN is to reduce or to
1603 detect an error, take that action. */
1605 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1610 if (yyn == 0 || yyn == YYTABLE_NINF)
1619 /* Count tokens shifted since error; after three, turn off error
1624 /* Shift the look-ahead token. */
1625 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1627 /* Discard the shifted token unless it is eof. */
1628 if (yychar != YYEOF)
1637 /*-----------------------------------------------------------.
1638 | yydefault -- do the default action for the current state. |
1639 `-----------------------------------------------------------*/
1641 yyn = yydefact[yystate];
1647 /*-----------------------------.
1648 | yyreduce -- Do a reduction. |
1649 `-----------------------------*/
1651 /* yyn is the number of a rule to reduce with. */
1654 /* If YYLEN is nonzero, implement the default value of the action:
1657 Otherwise, the following line sets YYVAL to garbage.
1658 This behavior is undocumented and Bison
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];
1665 YY_REDUCE_PRINT (yyn);
1669 #line 160 "mtgrammar.y"
1674 #line 161 "mtgrammar.y"
1679 #line 166 "mtgrammar.y"
1680 { mtreader_processDeclaration ((yyvsp[(2) - (3)].mtdecl)); ;}
1684 #line 168 "mtgrammar.y"
1685 { mtreader_processGlobalDeclaration ((yyvsp[(3) - (4)].mtdecl)); ;}
1689 #line 173 "mtgrammar.y"
1690 { (yyval.mtdecl) = mtDeclarationNode_create ((yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].mtpieces)); ;}
1694 #line 177 "mtgrammar.y"
1695 { (yyval.mtpieces) = mtDeclarationPieces_create (); ;}
1699 #line 179 "mtgrammar.y"
1700 { (yyval.mtpieces) = mtDeclarationPieces_append ((yyvsp[(2) - (2)].mtpieces), (yyvsp[(1) - (2)].mtpiece)); ;}
1704 #line 183 "mtgrammar.y"
1705 { (yyval.mtpiece) = mtDeclarationPiece_createContext ((yyvsp[(1) - (1)].mtcontext)); ;}
1709 #line 184 "mtgrammar.y"
1710 { (yyval.mtpiece) = mtDeclarationPiece_createValues ((yyvsp[(1) - (1)].mtvalues)); ;}
1714 #line 185 "mtgrammar.y"
1715 { (yyval.mtpiece) = mtDeclarationPiece_createDefaults ((yyvsp[(1) - (1)].mtdefaults)); ;}
1719 #line 186 "mtgrammar.y"
1720 { (yyval.mtpiece) = mtDeclarationPiece_createValueDefault ((yyvsp[(1) - (1)].tok)); ;}
1724 #line 187 "mtgrammar.y"
1725 { (yyval.mtpiece) = mtDeclarationPiece_createAnnotations ((yyvsp[(1) - (1)].mtannotations)); ;}
1729 #line 188 "mtgrammar.y"
1730 { (yyval.mtpiece) = mtDeclarationPiece_createMerge ((yyvsp[(1) - (1)].mtmerge)); ;}
1734 #line 189 "mtgrammar.y"
1735 { (yyval.mtpiece) = mtDeclarationPiece_createTransfers ((yyvsp[(1) - (1)].mttransferclauselist)); ;}
1739 #line 190 "mtgrammar.y"
1740 { (yyval.mtpiece) = mtDeclarationPiece_createPreconditions ((yyvsp[(1) - (1)].mttransferclauselist)); ;}
1744 #line 191 "mtgrammar.y"
1745 { (yyval.mtpiece) = mtDeclarationPiece_createPostconditions ((yyvsp[(1) - (1)].mttransferclauselist)); ;}
1749 #line 192 "mtgrammar.y"
1750 { (yyval.mtpiece) = mtDeclarationPiece_createLosers ((yyvsp[(1) - (1)].mtlosereferencelist)); ;}
1754 #line 196 "mtgrammar.y"
1755 { (yyval.mtcontext) = (yyvsp[(2) - (2)].mtcontext); ;}
1759 #line 201 "mtgrammar.y"
1760 { (yyval.mtcontext) = mtContextNode_createAny (); ;}
1764 #line 206 "mtgrammar.y"
1765 { (yyval.mtcontext) = mtContextNode_createParameter ((yyvsp[(2) - (2)].ctyp)); ;}
1769 #line 207 "mtgrammar.y"
1770 { (yyval.mtcontext) = mtContextNode_createReference ((yyvsp[(2) - (2)].ctyp)); ;}
1774 #line 208 "mtgrammar.y"
1775 { (yyval.mtcontext) = mtContextNode_createResult ((yyvsp[(2) - (2)].ctyp)); ;}
1779 #line 209 "mtgrammar.y"
1780 { (yyval.mtcontext) = mtContextNode_createClause ((yyvsp[(2) - (2)].ctyp)); ;}
1784 #line 210 "mtgrammar.y"
1785 { (yyval.mtcontext) = mtContextNode_createLiteral ((yyvsp[(2) - (2)].ctyp)); ;}
1789 #line 211 "mtgrammar.y"
1790 { (yyval.mtcontext) = mtContextNode_createNull ((yyvsp[(2) - (2)].ctyp)); ;}
1794 #line 219 "mtgrammar.y"
1795 { (yyval.ctyp) = ctype_unknown; ;}
1799 #line 220 "mtgrammar.y"
1800 { DPRINTF (("Type: %s", qtype_unparse ((yyvsp[(1) - (1)].qtyp)))); (yyval.ctyp) = qtype_getType ((yyvsp[(1) - (1)].qtyp)); ;}
1804 #line 225 "mtgrammar.y"
1805 { (yyval.qtyp) = qtype_newBase ((yyvsp[(1) - (2)].qtyp), (yyvsp[(2) - (2)].ctyp)); ;}
1809 #line 229 "mtgrammar.y"
1810 { (yyval.qtyp) = (yyvsp[(1) - (1)].qtyp); ;}
1814 #line 231 "mtgrammar.y"
1815 { (yyval.qtyp) = qtype_mergeAlt ((yyvsp[(1) - (3)].qtyp), (yyvsp[(3) - (3)].qtyp)); ;}
1819 #line 235 "mtgrammar.y"
1820 { (yyval.qtyp) = qtype_combine ((yyvsp[(2) - (2)].qtyp), (yyvsp[(1) - (2)].ctyp)); ;}
1824 #line 239 "mtgrammar.y"
1825 { (yyval.qtyp) = qtype_unknown (); ;}
1829 #line 240 "mtgrammar.y"
1830 { (yyval.qtyp) = (yyvsp[(1) - (1)].qtyp); ;}
1834 #line 244 "mtgrammar.y"
1835 { (yyval.ctyp) = ctype_adjustPointers ((yyvsp[(1) - (1)].pointers), ctype_unknown); ;}
1839 #line 246 "mtgrammar.y"
1840 { (yyval.ctyp) = ctype_adjustPointers ((yyvsp[(1) - (2)].pointers), (yyvsp[(2) - (2)].ctyp)); ;}
1844 #line 250 "mtgrammar.y"
1845 { (yyval.pointers) = pointers_createMt ((yyvsp[(1) - (1)].tok)); ;}
1849 #line 251 "mtgrammar.y"
1850 { (yyval.pointers) = pointers_createModsMt ((yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].quals)); ;}
1854 #line 252 "mtgrammar.y"
1855 { (yyval.pointers) = pointers_extend (pointers_createMt ((yyvsp[(1) - (2)].tok)), (yyvsp[(2) - (2)].pointers)); ;}
1859 #line 253 "mtgrammar.y"
1860 { (yyval.pointers) = pointers_extend (pointers_createModsMt ((yyvsp[(1) - (3)].tok), (yyvsp[(2) - (3)].quals)), (yyvsp[(3) - (3)].pointers)); ;}
1864 #line 257 "mtgrammar.y"
1865 { (yyval.qual) = qual_createConst (); ;}
1869 #line 258 "mtgrammar.y"
1870 { (yyval.qual) = qual_createVolatile (); ;}
1874 #line 259 "mtgrammar.y"
1875 { (yyval.qual) = qual_createRestrict (); ;}
1879 #line 263 "mtgrammar.y"
1880 { (yyval.quals) = qualList_single ((yyvsp[(1) - (1)].qual)); ;}
1884 #line 264 "mtgrammar.y"
1885 { (yyval.quals) = qualList_add ((yyvsp[(1) - (2)].quals), (yyvsp[(2) - (2)].qual)); ;}
1889 #line 268 "mtgrammar.y"
1890 { (yyval.ctyp) = ctype_expectFunction ((yyvsp[(2) - (3)].ctyp)); ;}
1894 #line 269 "mtgrammar.y"
1895 { (yyval.ctyp) = ctype_makeArray (ctype_unknown); ;}
1899 #line 270 "mtgrammar.y"
1900 { (yyval.ctyp) = ctype_makeArray ((yyvsp[(1) - (3)].ctyp)); ;}
1904 #line 278 "mtgrammar.y"
1905 { (yyval.ctyp) = ctype_char; ;}
1909 #line 279 "mtgrammar.y"
1910 { (yyval.ctyp) = ctype_int; ;}
1914 #line 280 "mtgrammar.y"
1915 { (yyval.ctyp) = ctype_float; ;}
1919 #line 281 "mtgrammar.y"
1920 { (yyval.ctyp) = ctype_double; ;}
1924 #line 282 "mtgrammar.y"
1925 { (yyval.ctyp) = ctype_void; ;}
1929 #line 283 "mtgrammar.y"
1930 { (yyval.ctyp) = ctype_unknown; ;}
1934 #line 284 "mtgrammar.y"
1935 { (yyval.ctyp) = ctype_anyintegral; ;}
1939 #line 285 "mtgrammar.y"
1940 { (yyval.ctyp) = ctype_unsignedintegral; ;}
1944 #line 286 "mtgrammar.y"
1945 { (yyval.ctyp) = ctype_signedintegral; ;}
1949 #line 294 "mtgrammar.y"
1950 { (yyval.ctyp) = mtscanner_lookupType ((yyvsp[(1) - (1)].tok)); ;}
1954 #line 298 "mtgrammar.y"
1955 { (yyval.mtvalues) = mtValuesNode_create ((yyvsp[(2) - (2)].cstringlist)); ;}
1959 #line 302 "mtgrammar.y"
1960 { (yyval.cstringlist) = cstringList_single (mttok_getText ((yyvsp[(1) - (1)].tok))); ;}
1964 #line 304 "mtgrammar.y"
1965 { (yyval.cstringlist) = cstringList_prepend ((yyvsp[(3) - (3)].cstringlist), mttok_getText ((yyvsp[(1) - (3)].tok))); ;}
1969 #line 308 "mtgrammar.y"
1970 { (yyval.tok) = (yyvsp[(2) - (2)].tok); ;}
1974 #line 312 "mtgrammar.y"
1975 { (yyval.mtdefaults) = mtDefaultsNode_create ((yyvsp[(1) - (2)].tok), (yyvsp[(2) - (2)].mtdeflist)); ;}
1979 #line 317 "mtgrammar.y"
1980 { (yyval.mtdeflist) = mtDefaultsDeclList_single (mtDefaultsDecl_create ((yyvsp[(1) - (3)].mtcontext), (yyvsp[(3) - (3)].tok))); ;}
1984 #line 319 "mtgrammar.y"
1985 { (yyval.mtdeflist) = mtDefaultsDeclList_prepend ((yyvsp[(4) - (4)].mtdeflist), mtDefaultsDecl_create ((yyvsp[(1) - (4)].mtcontext), (yyvsp[(3) - (4)].tok))); ;}
1989 #line 323 "mtgrammar.y"
1990 { (yyval.mtannotations) = mtAnnotationsNode_create ((yyvsp[(2) - (2)].mtannotlist)); ;}
1994 #line 327 "mtgrammar.y"
1995 { (yyval.mtannotlist) = mtAnnotationList_single ((yyvsp[(1) - (1)].mtannotdecl)); ;}
1999 #line 329 "mtgrammar.y"
2000 { (yyval.mtannotlist) = mtAnnotationList_prepend ((yyvsp[(2) - (2)].mtannotlist), (yyvsp[(1) - (2)].mtannotdecl)); ;}
2004 #line 334 "mtgrammar.y"
2005 { (yyval.mtannotdecl) = mtAnnotationDecl_create ((yyvsp[(1) - (4)].tok), (yyvsp[(2) - (4)].mtcontext), (yyvsp[(4) - (4)].tok)); ;}
2009 #line 338 "mtgrammar.y"
2010 { (yyval.mtmerge) = mtMergeNode_create ((yyvsp[(2) - (2)].mtmergeclauselist)); ;}
2014 #line 342 "mtgrammar.y"
2015 { (yyval.mtmergeclauselist) = mtMergeClauseList_single ((yyvsp[(1) - (1)].mtmergeclause)); ;}
2019 #line 343 "mtgrammar.y"
2020 { (yyval.mtmergeclauselist) = mtMergeClauseList_prepend ((yyvsp[(2) - (2)].mtmergeclauselist), (yyvsp[(1) - (2)].mtmergeclause)); ;}
2024 #line 348 "mtgrammar.y"
2025 { (yyval.mtmergeclause) = mtMergeClause_create ((yyvsp[(1) - (5)].mtmergeitem), (yyvsp[(3) - (5)].mtmergeitem), (yyvsp[(5) - (5)].mttransferaction)); ;}
2029 #line 352 "mtgrammar.y"
2030 { (yyval.mtmergeitem) = mtMergeItem_createValue ((yyvsp[(1) - (1)].tok)); ;}
2034 #line 353 "mtgrammar.y"
2035 { (yyval.mtmergeitem) = mtMergeItem_createStar ((yyvsp[(1) - (1)].tok)); ;}
2039 #line 357 "mtgrammar.y"
2040 { (yyval.mttransferclauselist) = (yyvsp[(2) - (2)].mttransferclauselist); ;}
2044 #line 361 "mtgrammar.y"
2045 { (yyval.mttransferclauselist) = (yyvsp[(2) - (2)].mttransferclauselist); ;}
2049 #line 365 "mtgrammar.y"
2050 { (yyval.mttransferclauselist) = (yyvsp[(2) - (2)].mttransferclauselist); ;}
2054 #line 369 "mtgrammar.y"
2055 { (yyval.mtlosereferencelist) = (yyvsp[(2) - (2)].mtlosereferencelist); ;}
2059 #line 373 "mtgrammar.y"
2060 { (yyval.mtlosereferencelist) = mtLoseReferenceList_single ((yyvsp[(1) - (1)].mtlosereference)); ;}
2064 #line 374 "mtgrammar.y"
2065 { (yyval.mtlosereferencelist) = mtLoseReferenceList_prepend ((yyvsp[(2) - (2)].mtlosereferencelist), (yyvsp[(1) - (2)].mtlosereference)); ;}
2069 #line 378 "mtgrammar.y"
2070 { (yyval.mtlosereference) = mtLoseReference_create ((yyvsp[(1) - (3)].tok), (yyvsp[(3) - (3)].mttransferaction)); ;}
2074 #line 382 "mtgrammar.y"
2075 { (yyval.mttransferclauselist) = mtTransferClauseList_single ((yyvsp[(1) - (1)].mttransferclause)); ;}
2079 #line 383 "mtgrammar.y"
2080 { (yyval.mttransferclauselist) = mtTransferClauseList_prepend ((yyvsp[(2) - (2)].mttransferclauselist), (yyvsp[(1) - (2)].mttransferclause)); ;}
2084 #line 388 "mtgrammar.y"
2085 { (yyval.mttransferclause) = mtTransferClause_create ((yyvsp[(1) - (5)].tok), (yyvsp[(3) - (5)].tok), (yyvsp[(5) - (5)].mttransferaction)); ;}
2089 #line 392 "mtgrammar.y"
2090 { (yyval.mttransferaction) = mtTransferAction_createValue ((yyvsp[(1) - (1)].tok)); ;}
2094 #line 393 "mtgrammar.y"
2095 { (yyval.mttransferaction) = (yyvsp[(1) - (1)].mttransferaction); ;}
2099 #line 397 "mtgrammar.y"
2100 { (yyval.mttransferaction) = mtTransferAction_createError ((yyvsp[(1) - (1)].tok)); ;}
2104 #line 398 "mtgrammar.y"
2105 { (yyval.mttransferaction) = mtTransferAction_createErrorMessage ((yyvsp[(2) - (2)].tok)); ;}
2109 /* Line 1267 of yacc.c. */
2110 #line 2053 "mtgrammar.tab.c"
2113 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2117 YY_STACK_PRINT (yyss, yyssp);
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. */
2128 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2129 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2130 yystate = yytable[yystate];
2132 yystate = yydefgoto[yyn - YYNTOKENS];
2137 /*------------------------------------.
2138 | yyerrlab -- here on detecting error |
2139 `------------------------------------*/
2141 /* If not already recovering from an error, report this error. */
2145 #if ! YYERROR_VERBOSE
2146 yyerror (YY_("syntax error"));
2149 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2150 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2152 YYSIZE_T yyalloc = 2 * yysize;
2153 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2154 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2155 if (yymsg != yymsgbuf)
2156 YYSTACK_FREE (yymsg);
2157 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2159 yymsg_alloc = yyalloc;
2163 yymsg_alloc = sizeof yymsgbuf;
2167 if (0 < yysize && yysize <= yymsg_alloc)
2169 (void) yysyntax_error (yymsg, yystate, yychar);
2174 yyerror (YY_("syntax error"));
2176 goto yyexhaustedlab;
2184 if (yyerrstatus == 3)
2186 /* If just tried and failed to reuse look-ahead token after an
2187 error, discard it. */
2189 if (yychar <= YYEOF)
2191 /* Return failure if at end of input. */
2192 if (yychar == YYEOF)
2197 yydestruct ("Error: discarding",
2203 /* Else will try to reuse look-ahead token after shifting the error
2208 /*---------------------------------------------------.
2209 | yyerrorlab -- error raised explicitly by YYERROR. |
2210 `---------------------------------------------------*/
2213 /* Pacify compilers like GCC when the user code never invokes
2214 YYERROR and the label yyerrorlab therefore never appears in user
2216 if (/*CONSTCOND*/ 0)
2219 /* Do not reclaim the symbols of the rule which action triggered
2223 YY_STACK_PRINT (yyss, yyssp);
2228 /*-------------------------------------------------------------.
2229 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2230 `-------------------------------------------------------------*/
2232 yyerrstatus = 3; /* Each real token shifted decrements this. */
2236 yyn = yypact[yystate];
2237 if (yyn != YYPACT_NINF)
2240 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2248 /* Pop the current state because it cannot handle the error token. */
2253 yydestruct ("Error: popping",
2254 yystos[yystate], yyvsp);
2257 YY_STACK_PRINT (yyss, yyssp);
2266 /* Shift the error token. */
2267 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2273 /*-------------------------------------.
2274 | yyacceptlab -- YYACCEPT comes here. |
2275 `-------------------------------------*/
2280 /*-----------------------------------.
2281 | yyabortlab -- YYABORT comes here. |
2282 `-----------------------------------*/
2288 /*-------------------------------------------------.
2289 | yyexhaustedlab -- memory exhaustion comes here. |
2290 `-------------------------------------------------*/
2292 yyerror (YY_("memory exhausted"));
2298 if (yychar != YYEOF && yychar != YYEMPTY)
2299 yydestruct ("Cleanup: discarding lookahead",
2301 /* Do not reclaim the symbols of the rule which action triggered
2302 this YYABORT or YYACCEPT. */
2304 YY_STACK_PRINT (yyss, yyssp);
2305 while (yyssp != yyss)
2307 yydestruct ("Cleanup: popping",
2308 yystos[*yyssp], yyvsp);
2313 YYSTACK_FREE (yyss);
2316 if (yymsg != yymsgbuf)
2317 YYSTACK_FREE (yymsg);
2319 /* Make sure YYID is used. */
2320 return YYID (yyresult);
2324 #line 405 "mtgrammar.y"
2327 # include "bison.reset"
2329 extern char *yytext;
2331 static void mterror (char *s)
2337 (message ("Parse error in meta-state file: %s", cstring_fromChars (s)));
2342 (message ("Parse error in meta-state file"));
2347 static void yyprint (FILE *file, int type, YYSTYPE value)
2349 cstring tname = mttok_unparse (value.tok);
2350 fprintf (file, " (%s)", cstring_toCharsSafe (tname));
2351 cstring_free (tname);
2359 ** Resets all flags in bison.head
2381 /*@=evalorderuncon@*/
2390 /*@=elseifcomplete@*/
2394 /*@=readonlytrans@*/
2397 /*@=systemunrecog@*/
2398 /*@=dependenttrans@*/
2399 /*@=unqualifiedtrans@*/
2403 /*drl added 11/27/2001*/
2406 /*drl added 12/11/2002*/