diff options
Diffstat (limited to 'cpp/src/Slice/Grammar.cpp')
-rw-r--r-- | cpp/src/Slice/Grammar.cpp | 3935 |
1 files changed, 3935 insertions, 0 deletions
diff --git a/cpp/src/Slice/Grammar.cpp b/cpp/src/Slice/Grammar.cpp new file mode 100644 index 00000000000..9bb2471675e --- /dev/null +++ b/cpp/src/Slice/Grammar.cpp @@ -0,0 +1,3935 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 1 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + +/* Substitute the variable and function names. */ +#define yyparse slice_parse +#define yylex slice_lex +#define yyerror slice_error +#define yylval slice_lval +#define yychar slice_char +#define yydebug slice_debug +#define yynerrs slice_nerrs + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ICE_MODULE = 258, + ICE_CLASS = 259, + ICE_INTERFACE = 260, + ICE_EXCEPTION = 261, + ICE_STRUCT = 262, + ICE_SEQUENCE = 263, + ICE_DICTIONARY = 264, + ICE_ENUM = 265, + ICE_OUT = 266, + ICE_EXTENDS = 267, + ICE_IMPLEMENTS = 268, + ICE_THROWS = 269, + ICE_VOID = 270, + ICE_BYTE = 271, + ICE_BOOL = 272, + ICE_SHORT = 273, + ICE_INT = 274, + ICE_LONG = 275, + ICE_FLOAT = 276, + ICE_DOUBLE = 277, + ICE_STRING = 278, + ICE_OBJECT = 279, + ICE_LOCAL_OBJECT = 280, + ICE_LOCAL = 281, + ICE_CONST = 282, + ICE_FALSE = 283, + ICE_TRUE = 284, + ICE_IDEMPOTENT = 285, + ICE_SCOPE_DELIMITER = 286, + ICE_IDENTIFIER = 287, + ICE_STRING_LITERAL = 288, + ICE_INTEGER_LITERAL = 289, + ICE_FLOATING_POINT_LITERAL = 290, + ICE_IDENT_OP = 291, + ICE_KEYWORD_OP = 292, + ICE_METADATA_OPEN = 293, + ICE_METADATA_CLOSE = 294, + ICE_GLOBAL_METADATA_OPEN = 295, + ICE_GLOBAL_METADATA_CLOSE = 296, + BAD_CHAR = 297 + }; +#endif +/* Tokens. */ +#define ICE_MODULE 258 +#define ICE_CLASS 259 +#define ICE_INTERFACE 260 +#define ICE_EXCEPTION 261 +#define ICE_STRUCT 262 +#define ICE_SEQUENCE 263 +#define ICE_DICTIONARY 264 +#define ICE_ENUM 265 +#define ICE_OUT 266 +#define ICE_EXTENDS 267 +#define ICE_IMPLEMENTS 268 +#define ICE_THROWS 269 +#define ICE_VOID 270 +#define ICE_BYTE 271 +#define ICE_BOOL 272 +#define ICE_SHORT 273 +#define ICE_INT 274 +#define ICE_LONG 275 +#define ICE_FLOAT 276 +#define ICE_DOUBLE 277 +#define ICE_STRING 278 +#define ICE_OBJECT 279 +#define ICE_LOCAL_OBJECT 280 +#define ICE_LOCAL 281 +#define ICE_CONST 282 +#define ICE_FALSE 283 +#define ICE_TRUE 284 +#define ICE_IDEMPOTENT 285 +#define ICE_SCOPE_DELIMITER 286 +#define ICE_IDENTIFIER 287 +#define ICE_STRING_LITERAL 288 +#define ICE_INTEGER_LITERAL 289 +#define ICE_FLOATING_POINT_LITERAL 290 +#define ICE_IDENT_OP 291 +#define ICE_KEYWORD_OP 292 +#define ICE_METADATA_OPEN 293 +#define ICE_METADATA_CLOSE 294 +#define ICE_GLOBAL_METADATA_OPEN 295 +#define ICE_GLOBAL_METADATA_CLOSE 296 +#define BAD_CHAR 297 + + + + +/* Copy the first part of user declarations. */ +#line 1 "Grammar.y" + + +// ********************************************************************** +// +// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <Slice/GrammarUtil.h> +#include <IceUtil/UUID.h> +#include <cstring> + +#ifdef _MSC_VER +// I get these warnings from some bison versions: +// warning C4102: 'yyoverflowlab' : unreferenced label +# pragma warning( disable : 4102 ) +// warning C4065: switch statement contains 'default' but no 'case' labels +# pragma warning( disable : 4065 ) +#endif + +using namespace std; +using namespace Slice; + +void +slice_error(const char* s) +{ + // yacc and recent versions of Bison use "syntax error" instead + // of "parse error". + + if (strcmp(s, "parse error") == 0) + { + unit->error("syntax error"); + } + else + { + unit->error(s); + } +} + + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef int YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 216 of yacc.c. */ +#line 242 "Grammar.tab.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 13 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 797 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 52 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 67 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 182 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 266 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 297 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 47, 51, 2, 48, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 43, + 49, 46, 50, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 44, 2, 45, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 5, 9, 13, 14, 15, 19, 20, + 26, 27, 32, 35, 36, 38, 40, 42, 44, 46, + 48, 50, 52, 54, 56, 58, 60, 62, 63, 70, + 73, 76, 79, 80, 88, 91, 92, 97, 101, 104, + 105, 108, 110, 113, 116, 119, 120, 127, 132, 136, + 139, 140, 142, 145, 148, 151, 152, 161, 164, 165, + 168, 169, 174, 178, 181, 182, 184, 188, 191, 193, + 195, 197, 200, 204, 207, 211, 212, 218, 219, 225, + 227, 229, 232, 235, 238, 239, 247, 251, 253, 255, + 258, 259, 264, 268, 271, 272, 274, 278, 280, 282, + 284, 292, 300, 311, 322, 325, 328, 329, 336, 342, + 346, 348, 350, 352, 353, 355, 356, 357, 361, 367, + 372, 379, 383, 389, 392, 393, 395, 398, 402, 404, + 406, 408, 410, 412, 414, 416, 418, 420, 423, 425, + 427, 430, 433, 435, 439, 441, 443, 444, 446, 448, + 450, 452, 454, 456, 463, 469, 471, 473, 475, 477, + 479, 481, 483, 485, 487, 489, 491, 493, 495, 497, + 499, 501, 503, 505, 507, 509, 511, 513, 515, 517, + 519, 521, 523 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = +{ + 53, 0, -1, 56, -1, 40, 114, 41, -1, 38, + 114, 39, -1, -1, -1, 54, 57, 56, -1, -1, + 55, 60, 58, 43, 56, -1, -1, 1, 43, 59, + 56, -1, 55, 60, -1, -1, 61, -1, 78, -1, + 79, -1, 92, -1, 93, -1, 64, -1, 65, -1, + 72, -1, 73, -1, 101, -1, 102, -1, 104, -1, + 117, -1, -1, 3, 32, 62, 44, 56, 45, -1, + 6, 32, -1, 6, 118, -1, 115, 63, -1, -1, + 115, 63, 67, 66, 44, 68, 45, -1, 12, 111, + -1, -1, 55, 70, 43, 68, -1, 1, 43, 68, + -1, 55, 70, -1, -1, 112, 32, -1, 84, -1, + 7, 32, -1, 7, 118, -1, 115, 71, -1, -1, + 115, 71, 74, 44, 75, 45, -1, 55, 76, 43, + 75, -1, 1, 43, 75, -1, 55, 76, -1, -1, + 84, -1, 4, 32, -1, 4, 118, -1, 115, 77, + -1, -1, 115, 77, 81, 82, 80, 44, 83, 45, + -1, 12, 111, -1, -1, 13, 95, -1, -1, 55, + 90, 43, 83, -1, 1, 43, 83, -1, 55, 90, + -1, -1, 69, -1, 69, 46, 116, -1, 112, 118, + -1, 112, -1, 112, -1, 15, -1, 85, 36, -1, + 30, 85, 36, -1, 85, 37, -1, 30, 85, 37, + -1, -1, 86, 109, 47, 88, 110, -1, -1, 86, + 1, 47, 89, 110, -1, 84, -1, 87, -1, 5, + 32, -1, 5, 118, -1, 115, 91, -1, -1, 115, + 91, 96, 94, 44, 97, 45, -1, 111, 48, 95, + -1, 111, -1, 24, -1, 12, 95, -1, -1, 55, + 98, 43, 97, -1, 1, 43, 97, -1, 55, 98, + -1, -1, 87, -1, 100, 48, 99, -1, 100, -1, + 111, -1, 118, -1, 115, 8, 49, 55, 112, 50, + 32, -1, 115, 8, 49, 55, 112, 50, 118, -1, + 115, 9, 49, 55, 112, 48, 55, 112, 50, 32, + -1, 115, 9, 49, 55, 112, 48, 55, 112, 50, + 118, -1, 10, 32, -1, 10, 118, -1, -1, 115, + 103, 105, 44, 106, 45, -1, 115, 10, 44, 106, + 45, -1, 107, 48, 106, -1, 107, -1, 32, -1, + 118, -1, -1, 11, -1, -1, -1, 108, 55, 69, + -1, 109, 48, 108, 55, 69, -1, 108, 55, 112, + 118, -1, 109, 48, 108, 55, 112, 118, -1, 108, + 55, 112, -1, 109, 48, 108, 55, 112, -1, 14, + 99, -1, -1, 32, -1, 31, 32, -1, 111, 31, + 32, -1, 16, -1, 17, -1, 18, -1, 19, -1, + 20, -1, 21, -1, 22, -1, 23, -1, 24, -1, + 24, 51, -1, 25, -1, 111, -1, 111, 51, -1, + 33, 113, -1, 33, -1, 114, 48, 113, -1, 113, + -1, 26, -1, -1, 34, -1, 35, -1, 111, -1, + 33, -1, 28, -1, 29, -1, 27, 55, 112, 32, + 46, 116, -1, 27, 55, 112, 46, 116, -1, 3, + -1, 4, -1, 5, -1, 6, -1, 7, -1, 8, + -1, 9, -1, 10, -1, 11, -1, 12, -1, 13, + -1, 14, -1, 15, -1, 16, -1, 17, -1, 18, + -1, 19, -1, 20, -1, 21, -1, 22, -1, 23, + -1, 24, -1, 25, -1, 26, -1, 27, -1, 28, + -1, 29, -1, 30, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 104, 104, 112, 121, 126, 135, 134, 144, 143, + 154, 153, 158, 163, 170, 174, 178, 182, 186, 190, + 194, 198, 202, 206, 210, 214, 218, 228, 227, 261, + 265, 276, 287, 286, 313, 322, 330, 339, 342, 347, + 354, 367, 373, 377, 388, 399, 398, 434, 443, 446, + 451, 458, 464, 468, 479, 493, 492, 532, 567, 575, + 580, 588, 597, 600, 605, 612, 635, 660, 682, 708, + 709, 718, 742, 766, 790, 820, 819, 842, 841, 864, + 865, 871, 875, 886, 901, 900, 935, 970, 1005, 1015, + 1020, 1028, 1037, 1040, 1045, 1052, 1058, 1065, 1077, 1089, + 1100, 1109, 1124, 1135, 1152, 1156, 1168, 1167, 1191, 1206, + 1212, 1220, 1232, 1240, 1249, 1256, 1267, 1269, 1287, 1305, + 1317, 1329, 1340, 1356, 1361, 1369, 1372, 1378, 1391, 1395, + 1399, 1403, 1407, 1411, 1415, 1419, 1423, 1427, 1431, 1435, + 1454, 1495, 1501, 1509, 1516, 1528, 1535, 1545, 1558, 1571, + 1617, 1628, 1639, 1655, 1664, 1678, 1681, 1684, 1687, 1690, + 1693, 1696, 1699, 1702, 1705, 1708, 1711, 1714, 1717, 1720, + 1723, 1726, 1729, 1732, 1735, 1738, 1741, 1744, 1747, 1750, + 1753, 1756, 1759 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "ICE_MODULE", "ICE_CLASS", + "ICE_INTERFACE", "ICE_EXCEPTION", "ICE_STRUCT", "ICE_SEQUENCE", + "ICE_DICTIONARY", "ICE_ENUM", "ICE_OUT", "ICE_EXTENDS", "ICE_IMPLEMENTS", + "ICE_THROWS", "ICE_VOID", "ICE_BYTE", "ICE_BOOL", "ICE_SHORT", "ICE_INT", + "ICE_LONG", "ICE_FLOAT", "ICE_DOUBLE", "ICE_STRING", "ICE_OBJECT", + "ICE_LOCAL_OBJECT", "ICE_LOCAL", "ICE_CONST", "ICE_FALSE", "ICE_TRUE", + "ICE_IDEMPOTENT", "ICE_SCOPE_DELIMITER", "ICE_IDENTIFIER", + "ICE_STRING_LITERAL", "ICE_INTEGER_LITERAL", + "ICE_FLOATING_POINT_LITERAL", "ICE_IDENT_OP", "ICE_KEYWORD_OP", + "ICE_METADATA_OPEN", "ICE_METADATA_CLOSE", "ICE_GLOBAL_METADATA_OPEN", + "ICE_GLOBAL_METADATA_CLOSE", "BAD_CHAR", "';'", "'{'", "'}'", "'='", + "')'", "','", "'<'", "'>'", "'*'", "$accept", "start", + "global_meta_data", "meta_data", "definitions", "@1", "@2", "@3", + "definition", "module_def", "@4", "exception_id", "exception_decl", + "exception_def", "@5", "exception_extends", "exception_exports", + "type_id", "exception_export", "struct_id", "struct_decl", "struct_def", + "@6", "struct_exports", "struct_export", "class_id", "class_decl", + "class_def", "@7", "class_extends", "implements", "class_exports", + "data_member", "return_type", "operation_preamble", "operation", "@8", + "@9", "class_export", "interface_id", "interface_decl", "interface_def", + "@10", "interface_list", "interface_extends", "interface_exports", + "interface_export", "exception_list", "exception", "sequence_def", + "dictionary_def", "enum_id", "enum_def", "@11", "enumerator_list", + "enumerator", "out_qualifier", "parameters", "throws", "scoped_name", + "type", "string_literal", "string_list", "local_qualifier", + "const_initializer", "const_def", "keyword", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 59, 123, 125, 61, 41, 44, 60, + 62, 42 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 52, 53, 54, 55, 55, 57, 56, 58, 56, + 59, 56, 56, 56, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 60, 60, 60, 60, 62, 61, 63, + 63, 64, 66, 65, 67, 67, 68, 68, 68, 68, + 69, 70, 71, 71, 72, 74, 73, 75, 75, 75, + 75, 76, 77, 77, 78, 80, 79, 81, 81, 82, + 82, 83, 83, 83, 83, 84, 84, 84, 84, 85, + 85, 86, 86, 86, 86, 88, 87, 89, 87, 90, + 90, 91, 91, 92, 94, 93, 95, 95, 95, 96, + 96, 97, 97, 97, 97, 98, 99, 99, 100, 100, + 101, 101, 102, 102, 103, 103, 105, 104, 104, 106, + 106, 107, 107, 107, 108, 108, 109, 109, 109, 109, + 109, 109, 109, 110, 110, 111, 111, 111, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 113, 113, 114, 114, 115, 115, 116, 116, 116, + 116, 116, 116, 117, 117, 118, 118, 118, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, + 118, 118, 118 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 3, 3, 0, 0, 3, 0, 5, + 0, 4, 2, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 6, 2, + 2, 2, 0, 7, 2, 0, 4, 3, 2, 0, + 2, 1, 2, 2, 2, 0, 6, 4, 3, 2, + 0, 1, 2, 2, 2, 0, 8, 2, 0, 2, + 0, 4, 3, 2, 0, 1, 3, 2, 1, 1, + 1, 2, 3, 2, 3, 0, 5, 0, 5, 1, + 1, 2, 2, 2, 0, 7, 3, 1, 1, 2, + 0, 4, 3, 2, 0, 1, 3, 1, 1, 1, + 7, 7, 10, 10, 2, 2, 0, 6, 5, 3, + 1, 1, 1, 0, 1, 0, 0, 3, 5, 4, + 6, 3, 5, 2, 0, 1, 2, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, + 2, 2, 1, 3, 1, 1, 0, 1, 1, 1, + 1, 1, 1, 6, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 0, 0, 0, 0, 6, 146, 2, 10, 142, + 144, 0, 0, 1, 0, 0, 145, 5, 12, 14, + 19, 20, 21, 22, 15, 16, 17, 18, 23, 24, + 25, 0, 26, 0, 141, 4, 0, 3, 7, 27, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, + 44, 54, 83, 106, 11, 143, 0, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 138, 0, 125, 139, + 0, 0, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 52, 53, 81, 82, 29, 30, 42, 43, 5, 5, + 104, 113, 105, 0, 32, 0, 0, 60, 0, 84, + 0, 0, 137, 126, 0, 140, 0, 0, 9, 0, + 0, 111, 0, 110, 112, 34, 0, 0, 57, 0, + 55, 88, 89, 87, 0, 113, 0, 127, 0, 151, + 152, 150, 147, 148, 149, 154, 0, 0, 108, 113, + 0, 0, 0, 0, 59, 0, 0, 0, 0, 28, + 153, 0, 5, 109, 0, 0, 0, 0, 65, 49, + 51, 68, 46, 0, 86, 0, 0, 0, 107, 100, + 101, 0, 0, 38, 41, 33, 48, 0, 0, 40, + 67, 0, 0, 0, 0, 70, 0, 0, 0, 95, + 93, 69, 85, 0, 37, 0, 66, 47, 0, 79, + 80, 63, 68, 56, 92, 0, 71, 73, 0, 114, + 5, 0, 0, 0, 36, 62, 0, 72, 74, 77, + 0, 75, 115, 91, 102, 103, 61, 124, 117, 121, + 124, 5, 0, 78, 119, 76, 0, 123, 97, 98, + 99, 118, 122, 0, 120, 96 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 4, 5, 6, 7, 14, 41, 33, 18, 19, + 56, 49, 20, 21, 136, 114, 176, 178, 193, 50, + 22, 23, 115, 163, 179, 51, 24, 25, 165, 117, + 140, 203, 180, 207, 208, 209, 250, 247, 221, 52, + 26, 27, 144, 142, 119, 187, 210, 257, 258, 28, + 29, 53, 30, 120, 132, 133, 230, 231, 253, 69, + 181, 10, 11, 31, 155, 32, 134 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -224 +static const yytype_int16 yypact[] = +{ + 435, -12, -11, -11, 70, -224, 63, -224, -224, -11, + -224, -21, -22, -224, 78, 33, -224, 35, 54, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, 128, -224, 78, -224, -224, -11, -224, -224, -224, + 765, 60, 538, 568, 598, 628, 26, 62, 402, -5, + 68, 12, -1, -224, -224, -224, 69, -224, -224, -224, + -224, -224, -224, -224, -224, 66, -224, 82, -224, 43, + 64, 78, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -224, -224, 35, 35, + -224, 658, -224, -3, -224, 71, -3, 106, 40, -224, + 85, 359, -224, -224, 98, -224, 94, 93, -224, 765, + 765, -224, 97, 91, -224, 113, 101, 284, 113, 40, + -224, -224, -224, -10, 102, 658, 104, -224, 93, -224, + -224, -224, -224, -224, 113, -224, 103, 99, -224, 658, + 316, 108, 765, 107, -224, 110, 40, 220, 112, -224, + -224, 688, 35, -224, 115, 765, 117, 284, 118, 120, + -224, 718, -224, 252, -224, 122, 357, 123, -224, -224, + -224, 765, 316, 124, -224, -224, -224, 93, 284, -224, + -224, 126, 357, 125, 220, -224, 432, 32, 29, -224, + 130, -224, -224, 121, -224, 316, -224, -224, 252, -224, + -224, 131, 473, -224, -224, 65, -224, -224, 132, -224, + 35, 59, 220, 748, -224, -224, 252, -224, -224, -224, + 765, -224, 166, -224, -224, -224, -224, 164, -224, 718, + 164, 35, 508, -224, -224, -224, 765, -224, 135, 113, + -224, -224, 718, 508, -224, -224 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -224, -224, -224, -17, -13, -224, -224, -224, -224, -224, + -224, -224, -224, -224, -224, -224, -158, -223, -224, -224, + -224, -224, -224, -161, -224, -224, -224, -224, -224, -224, + -224, -138, -160, -26, -224, -18, -224, -224, -224, -224, + -224, -224, -224, -107, -224, -191, -224, -78, -224, -224, + -224, -224, -224, -224, -50, -224, -56, -224, -62, -104, + -30, 27, 186, -224, -142, -224, -40 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -117 +static const yytype_int16 yytable[] = +{ + 40, 38, 101, 103, 105, 107, 170, 113, 112, 135, + 70, 118, 138, 224, 143, 194, 196, 248, 35, 37, + 54, 124, 9, 154, 116, -58, 36, 36, 67, 68, + 228, 8, 164, 261, 214, 143, 34, 217, 166, -35, + 229, 243, 219, -90, 154, -115, -115, -115, -115, -115, + -115, -115, -115, -115, -115, 216, -58, 234, 128, 184, + -115, -115, 143, 55, 141, 39, 15, -115, 226, 227, + 13, 67, 68, 2, 124, 108, -116, -116, -13, 1, + 235, -5, -5, -5, -5, -5, -5, -5, -5, 16, + 17, 129, 130, 154, 125, 168, 126, -8, 246, 156, + 157, 237, 238, 71, -5, -5, 241, 242, 146, 173, + 127, 109, -45, 121, 123, 137, 2, 122, 3, 139, + 162, 149, 150, -13, 67, 68, 151, 152, 153, 145, + 147, 190, 42, 43, 44, 45, 46, 47, 48, 159, + 148, 200, 158, 175, 124, 160, 167, 172, 259, 169, + 186, 177, 182, 171, 183, 191, 211, 188, 192, 259, + 162, 213, 195, 198, 197, 204, 202, 215, 212, 218, + 223, 233, 222, 232, 236, 175, 211, 229, 252, 239, + 225, 162, 200, 263, 220, 265, 251, 186, 255, 12, + 0, 0, 0, 245, 0, 0, 0, 0, 175, 0, + 0, 202, 0, 0, 0, 0, 0, 0, 0, 254, + 249, 0, 260, 240, 0, 186, 0, 0, 0, 202, + 0, 185, 264, 260, 0, 0, 262, 0, 0, 0, + 0, 0, 0, 0, 256, -5, -5, -5, -5, -5, + -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, + -5, -5, -5, 201, 0, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, -94, 0, -5, -5, -5, + -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, + 0, 0, -5, -5, -5, 161, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 0, -64, 0, 0, + -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, + 0, 0, 0, 0, 0, -5, -5, 174, 0, 0, + 0, 0, 2, 0, 0, 0, 0, 0, 0, -50, + 0, 0, -5, -5, -5, -5, -5, -5, -5, -5, + -5, -5, 0, 0, 0, 0, 0, -5, -5, 0, + 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, + 1, -39, -5, -5, -5, -5, -5, -5, -5, -5, + 0, 0, 205, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 0, 0, -5, -5, 206, 67, 68, + 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, + 0, 0, 0, 0, -13, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 0, 110, -13, 1, 0, -5, -5, + -5, -5, -5, -5, -5, -5, 111, 205, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 0, 0, + 0, -5, -5, 67, 68, 0, 0, 0, 0, 0, + 0, 0, 0, 2, 0, 3, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 0, 199, 0, 0, 0, -69, + -69, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 67, + 68, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 0, + 100, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 0, + 102, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 0, + 104, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 0, + 106, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 0, + 131, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 0, + 189, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 0, + 199, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 0, + 244, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 0, 0, 0, 0, 0, 67, 68 +}; + +static const yytype_int16 yycheck[] = +{ + 17, 14, 42, 43, 44, 45, 148, 12, 48, 113, + 40, 12, 116, 204, 118, 175, 177, 240, 39, 41, + 33, 31, 33, 127, 12, 13, 48, 48, 31, 32, + 1, 43, 139, 256, 192, 139, 9, 198, 48, 44, + 11, 232, 202, 44, 148, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 197, 44, 215, 71, 166, + 31, 32, 166, 36, 24, 32, 3, 38, 36, 37, + 0, 31, 32, 38, 31, 49, 47, 48, 0, 1, + 218, 3, 4, 5, 6, 7, 8, 9, 10, 26, + 27, 108, 109, 197, 51, 145, 32, 43, 236, 129, + 130, 36, 37, 43, 26, 27, 47, 48, 121, 159, + 46, 49, 44, 44, 32, 44, 38, 51, 40, 13, + 137, 28, 29, 45, 31, 32, 33, 34, 35, 44, + 32, 171, 4, 5, 6, 7, 8, 9, 10, 48, + 46, 181, 45, 160, 31, 44, 44, 48, 252, 45, + 167, 43, 45, 50, 44, 172, 186, 45, 43, 263, + 177, 191, 45, 43, 46, 43, 183, 43, 45, 43, + 45, 50, 202, 43, 43, 192, 206, 11, 14, 47, + 206, 198, 222, 48, 202, 263, 242, 204, 250, 3, + -1, -1, -1, 233, -1, -1, -1, -1, 215, -1, + -1, 218, -1, -1, -1, -1, -1, -1, -1, 249, + 240, -1, 252, 230, -1, 232, -1, -1, -1, 236, + -1, 1, 262, 263, -1, -1, 256, -1, -1, -1, + -1, -1, -1, -1, 251, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, + 30, 31, 32, 1, -1, -1, -1, -1, 38, -1, + -1, -1, -1, -1, -1, 45, -1, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, + -1, -1, 30, 31, 32, 1, -1, -1, -1, -1, + 38, -1, -1, -1, -1, -1, -1, 45, -1, -1, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + -1, -1, -1, -1, -1, 31, 32, 1, -1, -1, + -1, -1, 38, -1, -1, -1, -1, -1, -1, 45, + -1, -1, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, -1, -1, -1, -1, -1, 31, 32, -1, + -1, -1, -1, -1, 38, -1, -1, -1, -1, -1, + 1, 45, 3, 4, 5, 6, 7, 8, 9, 10, + -1, -1, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, -1, -1, 26, 27, 30, 31, 32, + -1, -1, -1, -1, -1, -1, -1, 38, -1, 40, + -1, -1, -1, -1, 45, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, -1, 32, 0, 1, -1, 3, 4, + 5, 6, 7, 8, 9, 10, 44, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, + -1, 26, 27, 31, 32, -1, -1, -1, -1, -1, + -1, -1, -1, 38, -1, 40, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, -1, 32, -1, -1, -1, 36, + 37, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, + 32, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, + 32, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, + 32, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, + 32, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, + 32, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, + 32, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, + 32, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, + 32, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, -1, -1, -1, -1, -1, 31, 32 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 1, 38, 40, 53, 54, 55, 56, 43, 33, + 113, 114, 114, 0, 57, 3, 26, 27, 60, 61, + 64, 65, 72, 73, 78, 79, 92, 93, 101, 102, + 104, 115, 117, 59, 113, 39, 48, 41, 56, 32, + 55, 58, 4, 5, 6, 7, 8, 9, 10, 63, + 71, 77, 91, 103, 56, 113, 62, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 31, 32, 111, + 112, 43, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 32, 118, 32, 118, 32, 118, 32, 118, 49, 49, + 32, 44, 118, 12, 67, 74, 12, 81, 12, 96, + 105, 44, 51, 32, 31, 51, 32, 46, 56, 55, + 55, 32, 106, 107, 118, 111, 66, 44, 111, 13, + 82, 24, 95, 111, 94, 44, 56, 32, 46, 28, + 29, 33, 34, 35, 111, 116, 112, 112, 45, 48, + 44, 1, 55, 75, 95, 80, 48, 44, 106, 45, + 116, 50, 48, 106, 1, 55, 68, 43, 69, 76, + 84, 112, 45, 44, 95, 1, 55, 97, 45, 32, + 118, 55, 43, 70, 84, 45, 75, 46, 43, 32, + 118, 1, 55, 83, 43, 15, 30, 85, 86, 87, + 98, 112, 45, 112, 68, 43, 116, 75, 43, 84, + 87, 90, 112, 45, 97, 85, 36, 37, 1, 11, + 108, 109, 43, 50, 68, 83, 43, 36, 37, 47, + 55, 47, 48, 97, 32, 118, 83, 89, 69, 112, + 88, 108, 14, 110, 118, 110, 55, 99, 100, 111, + 118, 69, 112, 48, 118, 99 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, YYLEX_PARAM) +#else +# define YYLEX yylex (&yylval) +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + /* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: +#line 105 "Grammar.y" + { +;} + break; + + case 3: +#line 113 "Grammar.y" + { + (yyval) = (yyvsp[(2) - (3)]); +;} + break; + + case 4: +#line 122 "Grammar.y" + { + (yyval) = (yyvsp[(2) - (3)]); +;} + break; + + case 5: +#line 126 "Grammar.y" + { + (yyval) = new StringListTok; +;} + break; + + case 6: +#line 135 "Grammar.y" + { + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (1)])); + if(!metaData->v.empty()) + { + unit->addGlobalMetaData(metaData->v); + } +;} + break; + + case 8: +#line 144 "Grammar.y" + { + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (2)])); + ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (2)])); + if(contained && !metaData->v.empty()) + { + contained->setMetaData(metaData->v); + } +;} + break; + + case 10: +#line 154 "Grammar.y" + { + yyerrok; +;} + break; + + case 12: +#line 159 "Grammar.y" + { + unit->error("`;' missing after definition"); +;} + break; + + case 13: +#line 163 "Grammar.y" + { +;} + break; + + case 14: +#line 171 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0 || ModulePtr::dynamicCast((yyvsp[(1) - (1)]))); +;} + break; + + case 15: +#line 175 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0 || ClassDeclPtr::dynamicCast((yyvsp[(1) - (1)]))); +;} + break; + + case 16: +#line 179 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0 || ClassDefPtr::dynamicCast((yyvsp[(1) - (1)]))); +;} + break; + + case 17: +#line 183 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0 || ClassDeclPtr::dynamicCast((yyvsp[(1) - (1)]))); +;} + break; + + case 18: +#line 187 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0 || ClassDefPtr::dynamicCast((yyvsp[(1) - (1)]))); +;} + break; + + case 19: +#line 191 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0); +;} + break; + + case 20: +#line 195 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0 || ExceptionPtr::dynamicCast((yyvsp[(1) - (1)]))); +;} + break; + + case 21: +#line 199 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0); +;} + break; + + case 22: +#line 203 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0 || StructPtr::dynamicCast((yyvsp[(1) - (1)]))); +;} + break; + + case 23: +#line 207 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0 || SequencePtr::dynamicCast((yyvsp[(1) - (1)]))); +;} + break; + + case 24: +#line 211 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0 || DictionaryPtr::dynamicCast((yyvsp[(1) - (1)]))); +;} + break; + + case 25: +#line 215 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0 || EnumPtr::dynamicCast((yyvsp[(1) - (1)]))); +;} + break; + + case 26: +#line 219 "Grammar.y" + { + assert((yyvsp[(1) - (1)]) == 0 || ConstPtr::dynamicCast((yyvsp[(1) - (1)]))); +;} + break; + + case 27: +#line 228 "Grammar.y" + { + unit->setSeenDefinition(); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + ContainerPtr cont = unit->currentContainer(); + ModulePtr module = cont->createModule(ident->v); + if(module) + { + cont->checkIntroduced(ident->v, module); + unit->pushContainer(module); + (yyval) = module; + } + else + { + (yyval) = 0; + } +;} + break; + + case 28: +#line 245 "Grammar.y" + { + if((yyvsp[(3) - (6)])) + { + unit->popContainer(); + (yyval) = (yyvsp[(3) - (6)]); + } + else + { + (yyval) = 0; + } +;} + break; + + case 29: +#line 262 "Grammar.y" + { + (yyval) = (yyvsp[(2) - (2)]); +;} + break; + + case 30: +#line 266 "Grammar.y" + { + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + unit->error("keyword `" + ident->v + "' cannot be used as exception name"); + (yyval) = (yyvsp[(2) - (2)]); // Dummy +;} + break; + + case 31: +#line 277 "Grammar.y" + { + unit->error("exceptions cannot be forward declared"); + (yyval) = 0; +;} + break; + + case 32: +#line 287 "Grammar.y" + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (3)])); + ExceptionPtr base = ExceptionPtr::dynamicCast((yyvsp[(3) - (3)])); + ContainerPtr cont = unit->currentContainer(); + ExceptionPtr ex = cont->createException(ident->v, base, local->v); + if(ex) + { + cont->checkIntroduced(ident->v, ex); + unit->pushContainer(ex); + } + (yyval) = ex; +;} + break; + + case 33: +#line 301 "Grammar.y" + { + if((yyvsp[(4) - (7)])) + { + unit->popContainer(); + } + (yyval) = (yyvsp[(4) - (7)]); +;} + break; + + case 34: +#line 314 "Grammar.y" + { + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + ContainerPtr cont = unit->currentContainer(); + ContainedPtr contained = cont->lookupException(scoped->v); + cont->checkIntroduced(scoped->v); + (yyval) = contained; +;} + break; + + case 35: +#line 322 "Grammar.y" + { + (yyval) = 0; +;} + break; + + case 36: +#line 331 "Grammar.y" + { + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); + ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); + if(contained && !metaData->v.empty()) + { + contained->setMetaData(metaData->v); + } +;} + break; + + case 37: +#line 340 "Grammar.y" + { +;} + break; + + case 38: +#line 343 "Grammar.y" + { + unit->error("`;' missing after definition"); +;} + break; + + case 39: +#line 347 "Grammar.y" + { +;} + break; + + case 40: +#line 355 "Grammar.y" + { + TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + TypeStringTokPtr typestring = new TypeStringTok; + typestring->v = make_pair(type, ident->v); + (yyval) = typestring; +;} + break; + + case 42: +#line 374 "Grammar.y" + { + (yyval) = (yyvsp[(2) - (2)]); +;} + break; + + case 43: +#line 378 "Grammar.y" + { + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + unit->error("keyword `" + ident->v + "' cannot be used as struct name"); + (yyval) = (yyvsp[(2) - (2)]); // Dummy +;} + break; + + case 44: +#line 389 "Grammar.y" + { + unit->error("structs cannot be forward declared"); + (yyval) = 0; // Dummy +;} + break; + + case 45: +#line 399 "Grammar.y" + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + ContainerPtr cont = unit->currentContainer(); + StructPtr st = cont->createStruct(ident->v, local->v); + if(st) + { + cont->checkIntroduced(ident->v, st); + unit->pushContainer(st); + } + (yyval) = st; +;} + break; + + case 46: +#line 412 "Grammar.y" + { + if((yyvsp[(3) - (6)])) + { + unit->popContainer(); + } + (yyval) = (yyvsp[(3) - (6)]); + + // + // Empty structures are not allowed + // + StructPtr st = StructPtr::dynamicCast((yyval)); + assert(st); + if(st->dataMembers().empty()) + { + unit->error("struct `" + st->name() + "' must have at least one member"); // $$ is a dummy + } +;} + break; + + case 47: +#line 435 "Grammar.y" + { + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); + ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); + if(contained && !metaData->v.empty()) + { + contained->setMetaData(metaData->v); + } +;} + break; + + case 48: +#line 444 "Grammar.y" + { +;} + break; + + case 49: +#line 447 "Grammar.y" + { + unit->error("`;' missing after definition"); +;} + break; + + case 50: +#line 451 "Grammar.y" + { +;} + break; + + case 52: +#line 465 "Grammar.y" + { + (yyval) = (yyvsp[(2) - (2)]); +;} + break; + + case 53: +#line 469 "Grammar.y" + { + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + unit->error("keyword `" + ident->v + "' cannot be used as class name"); + (yyval) = (yyvsp[(2) - (2)]); // Dummy +;} + break; + + case 54: +#line 480 "Grammar.y" + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + ContainerPtr cont = unit->currentContainer(); + ClassDeclPtr cl = cont->createClassDecl(ident->v, false, local->v); + (yyval) = cl; +;} + break; + + case 55: +#line 493 "Grammar.y" + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (4)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (4)])); + ContainerPtr cont = unit->currentContainer(); + ClassDefPtr base = ClassDefPtr::dynamicCast((yyvsp[(3) - (4)])); + ClassListTokPtr bases = ClassListTokPtr::dynamicCast((yyvsp[(4) - (4)])); + if(base) + { + bases->v.push_front(base); + } + ClassDefPtr cl = cont->createClassDef(ident->v, false, bases->v, local->v); + if(cl) + { + cont->checkIntroduced(ident->v, cl); + unit->pushContainer(cl); + (yyval) = cl; + } + else + { + (yyval) = 0; + } +;} + break; + + case 56: +#line 516 "Grammar.y" + { + if((yyvsp[(5) - (8)])) + { + unit->popContainer(); + (yyval) = (yyvsp[(5) - (8)]); + } + else + { + (yyval) = 0; + } +;} + break; + + case 57: +#line 533 "Grammar.y" + { + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + ContainerPtr cont = unit->currentContainer(); + TypeList types = cont->lookupType(scoped->v); + (yyval) = 0; + if(!types.empty()) + { + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); + if(!cl || cl->isInterface()) + { + string msg = "`"; + msg += scoped->v; + msg += "' is not a class"; + unit->error(msg); + } + else + { + ClassDefPtr def = cl->definition(); + if(!def) + { + string msg = "`"; + msg += scoped->v; + msg += "' has been declared but not defined"; + unit->error(msg); + } + else + { + cont->checkIntroduced(scoped->v); + (yyval) = def; + } + } + } +;} + break; + + case 58: +#line 567 "Grammar.y" + { + (yyval) = 0; +;} + break; + + case 59: +#line 576 "Grammar.y" + { + (yyval) = (yyvsp[(2) - (2)]); +;} + break; + + case 60: +#line 580 "Grammar.y" + { + (yyval) = new ClassListTok; +;} + break; + + case 61: +#line 589 "Grammar.y" + { + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); + ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); + if(contained && !metaData->v.empty()) + { + contained->setMetaData(metaData->v); + } +;} + break; + + case 62: +#line 598 "Grammar.y" + { +;} + break; + + case 63: +#line 601 "Grammar.y" + { + unit->error("`;' missing after definition"); +;} + break; + + case 64: +#line 605 "Grammar.y" + { +;} + break; + + case 65: +#line 613 "Grammar.y" + { + TypePtr type = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (1)]))->v.first; + string name = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (1)]))->v.second; + ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); + DataMemberPtr dm; + if(cl) + { + dm = cl->createDataMember(name, type, 0, "", ""); + } + StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); + if(st) + { + dm = st->createDataMember(name, type, 0, "", ""); + } + ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); + if(ex) + { + dm = ex->createDataMember(name, type, 0, "", ""); + } + unit->currentContainer()->checkIntroduced(name, dm); + (yyval) = dm; +;} + break; + + case 66: +#line 636 "Grammar.y" + { + TypePtr type = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (3)]))->v.first; + string name = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (3)]))->v.second; + ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(3) - (3)])); + + ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); + DataMemberPtr dm; + if(cl) + { + dm = cl->createDataMember(name, type, value->v.value, value->v.valueAsString, value->v.valueAsLiteral); + } + StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); + if(st) + { + dm = st->createDataMember(name, type, value->v.value, value->v.valueAsString, value->v.valueAsLiteral); + } + ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); + if(ex) + { + dm = ex->createDataMember(name, type, value->v.value, value->v.valueAsString, value->v.valueAsLiteral); + } + unit->currentContainer()->checkIntroduced(name, dm); + (yyval) = dm; +;} + break; + + case 67: +#line 661 "Grammar.y" + { + TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); + string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; + ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); + if(cl) + { + (yyval) = cl->createDataMember(name, type, 0, "", ""); // Dummy + } + StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); + if(st) + { + (yyval) = st->createDataMember(name, type, 0, "", ""); // Dummy + } + ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); + if(ex) + { + (yyval) = ex->createDataMember(name, type, 0, "", ""); // Dummy + } + assert((yyval)); + unit->error("keyword `" + name + "' cannot be used as data member name"); +;} + break; + + case 68: +#line 683 "Grammar.y" + { + TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (1)])); + ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); + if(cl) + { + (yyval) = cl->createDataMember(IceUtil::generateUUID(), type, 0, "", ""); // Dummy + } + StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); + if(st) + { + (yyval) = st->createDataMember(IceUtil::generateUUID(), type, 0, "", ""); // Dummy + } + ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); + if(ex) + { + (yyval) = ex->createDataMember(IceUtil::generateUUID(), type, 0, "", ""); // Dummy + } + assert((yyval)); + unit->error("missing data member name"); +;} + break; + + case 70: +#line 710 "Grammar.y" + { + (yyval) = 0; +;} + break; + + case 71: +#line 719 "Grammar.y" + { + TypePtr returnType = TypePtr::dynamicCast((yyvsp[(1) - (2)])); + string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; + ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); + if(cl) + { + OperationPtr op = cl->createOperation(name, returnType); + if(op) + { + cl->checkIntroduced(name, op); + unit->pushContainer(op); + (yyval) = op; + } + else + { + (yyval) = 0; + } + } + else + { + (yyval) = 0; + } +;} + break; + + case 72: +#line 743 "Grammar.y" + { + TypePtr returnType = TypePtr::dynamicCast((yyvsp[(2) - (3)])); + string name = StringTokPtr::dynamicCast((yyvsp[(3) - (3)]))->v; + ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); + if(cl) + { + OperationPtr op = cl->createOperation(name, returnType, Operation::Idempotent); + if(op) + { + cl->checkIntroduced(name, op); + unit->pushContainer(op); + (yyval) = op; + } + else + { + (yyval) = 0; + } + } + else + { + (yyval) = 0; + } +;} + break; + + case 73: +#line 767 "Grammar.y" + { + TypePtr returnType = TypePtr::dynamicCast((yyvsp[(1) - (2)])); + string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; + ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); + if(cl) + { + OperationPtr op = cl->createOperation(name, returnType); + if(op) + { + unit->pushContainer(op); + unit->error("keyword `" + name + "' cannot be used as operation name"); + (yyval) = op; // Dummy + } + else + { + (yyval) = 0; + } + } + else + { + (yyval) = 0; + } +;} + break; + + case 74: +#line 791 "Grammar.y" + { + TypePtr returnType = TypePtr::dynamicCast((yyvsp[(2) - (3)])); + string name = StringTokPtr::dynamicCast((yyvsp[(3) - (3)]))->v; + ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); + if(cl) + { + OperationPtr op = cl->createOperation(name, returnType, Operation::Idempotent); + if(op) + { + unit->pushContainer(op); + unit->error("keyword `" + name + "' cannot be used as operation name"); + (yyval) = op; // Dummy + } + else + { + return 0; + } + } + else + { + (yyval) = 0; + } +;} + break; + + case 75: +#line 820 "Grammar.y" + { + if((yyvsp[(1) - (3)])) + { + unit->popContainer(); + (yyval) = (yyvsp[(1) - (3)]); + } + else + { + (yyval) = 0; + } +;} + break; + + case 76: +#line 832 "Grammar.y" + { + OperationPtr op = OperationPtr::dynamicCast((yyvsp[(4) - (5)])); + ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast((yyvsp[(5) - (5)])); + assert(el); + if(op) + { + op->setExceptionList(el->v); + } +;} + break; + + case 77: +#line 842 "Grammar.y" + { + if((yyvsp[(1) - (3)])) + { + unit->popContainer(); + } + yyerrok; +;} + break; + + case 78: +#line 850 "Grammar.y" + { + OperationPtr op = OperationPtr::dynamicCast((yyvsp[(4) - (5)])); + ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast((yyvsp[(5) - (5)])); + assert(el); + if(op) + { + op->setExceptionList(el->v); // Dummy + } +;} + break; + + case 81: +#line 872 "Grammar.y" + { + (yyval) = (yyvsp[(2) - (2)]); +;} + break; + + case 82: +#line 876 "Grammar.y" + { + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + unit->error("keyword `" + ident->v + "' cannot be used as interface name"); + (yyval) = (yyvsp[(2) - (2)]); // Dummy +;} + break; + + case 83: +#line 887 "Grammar.y" + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + ContainerPtr cont = unit->currentContainer(); + ClassDeclPtr cl = cont->createClassDecl(ident->v, true, local->v); + cont->checkIntroduced(ident->v, cl); + (yyval) = cl; +;} + break; + + case 84: +#line 901 "Grammar.y" + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (3)])); + ContainerPtr cont = unit->currentContainer(); + ClassListTokPtr bases = ClassListTokPtr::dynamicCast((yyvsp[(3) - (3)])); + ClassDefPtr cl = cont->createClassDef(ident->v, true, bases->v, local->v); + if(cl) + { + cont->checkIntroduced(ident->v, cl); + unit->pushContainer(cl); + (yyval) = cl; + } + else + { + (yyval) = 0; + } +;} + break; + + case 85: +#line 919 "Grammar.y" + { + if((yyvsp[(4) - (7)])) + { + unit->popContainer(); + (yyval) = (yyvsp[(4) - (7)]); + } + else + { + (yyval) = 0; + } +;} + break; + + case 86: +#line 936 "Grammar.y" + { + ClassListTokPtr intfs = ClassListTokPtr::dynamicCast((yyvsp[(3) - (3)])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (3)])); + ContainerPtr cont = unit->currentContainer(); + TypeList types = cont->lookupType(scoped->v); + if(!types.empty()) + { + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); + if(!cl || !cl->isInterface()) + { + string msg = "`"; + msg += scoped->v; + msg += "' is not an interface"; + unit->error(msg); + } + else + { + ClassDefPtr def = cl->definition(); + if(!def) + { + string msg = "`"; + msg += scoped->v; + msg += "' has been declared but not defined"; + unit->error(msg); + } + else + { + cont->checkIntroduced(scoped->v); + intfs->v.push_front(def); + } + } + } + (yyval) = intfs; +;} + break; + + case 87: +#line 971 "Grammar.y" + { + ClassListTokPtr intfs = new ClassListTok; + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + ContainerPtr cont = unit->currentContainer(); + TypeList types = cont->lookupType(scoped->v); + if(!types.empty()) + { + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); + if(!cl || !cl->isInterface()) + { + string msg = "`"; + msg += scoped->v; + msg += "' is not an interface"; + unit->error(msg); // $$ is a dummy + } + else + { + ClassDefPtr def = cl->definition(); + if(!def) + { + string msg = "`"; + msg += scoped->v; + msg += "' has been declared but not defined"; + unit->error(msg); // $$ is a dummy + } + else + { + cont->checkIntroduced(scoped->v); + intfs->v.push_front(def); + } + } + } + (yyval) = intfs; +;} + break; + + case 88: +#line 1006 "Grammar.y" + { + unit->error("illegal inheritance from type Object"); + (yyval) = new ClassListTok; // Dummy +;} + break; + + case 89: +#line 1016 "Grammar.y" + { + (yyval) = (yyvsp[(2) - (2)]); +;} + break; + + case 90: +#line 1020 "Grammar.y" + { + (yyval) = new ClassListTok; +;} + break; + + case 91: +#line 1029 "Grammar.y" + { + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); + ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); + if(contained && !metaData->v.empty()) + { + contained->setMetaData(metaData->v); + } +;} + break; + + case 92: +#line 1038 "Grammar.y" + { +;} + break; + + case 93: +#line 1041 "Grammar.y" + { + unit->error("`;' missing after definition"); +;} + break; + + case 94: +#line 1045 "Grammar.y" + { +;} + break; + + case 96: +#line 1059 "Grammar.y" + { + ExceptionPtr exception = ExceptionPtr::dynamicCast((yyvsp[(1) - (3)])); + ExceptionListTokPtr exceptionList = ExceptionListTokPtr::dynamicCast((yyvsp[(3) - (3)])); + exceptionList->v.push_front(exception); + (yyval) = exceptionList; +;} + break; + + case 97: +#line 1066 "Grammar.y" + { + ExceptionPtr exception = ExceptionPtr::dynamicCast((yyvsp[(1) - (1)])); + ExceptionListTokPtr exceptionList = new ExceptionListTok; + exceptionList->v.push_front(exception); + (yyval) = exceptionList; +;} + break; + + case 98: +#line 1078 "Grammar.y" + { + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + ContainerPtr cont = unit->currentContainer(); + ExceptionPtr exception = cont->lookupException(scoped->v); + if(!exception) + { + exception = cont->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy + } + cont->checkIntroduced(scoped->v, exception); + (yyval) = exception; +;} + break; + + case 99: +#line 1090 "Grammar.y" + { + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + unit->error("keyword `" + ident->v + "' cannot be used as exception name"); + (yyval) = unit->currentContainer()->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy +;} + break; + + case 100: +#line 1101 "Grammar.y" + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (7)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(7) - (7)])); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (7)])); + TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (7)])); + ContainerPtr cont = unit->currentContainer(); + (yyval) = cont->createSequence(ident->v, type, metaData->v, local->v); +;} + break; + + case 101: +#line 1110 "Grammar.y" + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (7)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(7) - (7)])); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (7)])); + TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (7)])); + ContainerPtr cont = unit->currentContainer(); + (yyval) = cont->createSequence(ident->v, type, metaData->v, local->v); // Dummy + unit->error("keyword `" + ident->v + "' cannot be used as sequence name"); +;} + break; + + case 102: +#line 1125 "Grammar.y" + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (10)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(10) - (10)])); + StringListTokPtr keyMetaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (10)])); + TypePtr keyType = TypePtr::dynamicCast((yyvsp[(5) - (10)])); + StringListTokPtr valueMetaData = StringListTokPtr::dynamicCast((yyvsp[(7) - (10)])); + TypePtr valueType = TypePtr::dynamicCast((yyvsp[(8) - (10)])); + ContainerPtr cont = unit->currentContainer(); + (yyval) = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v, local->v); +;} + break; + + case 103: +#line 1136 "Grammar.y" + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (10)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(10) - (10)])); + StringListTokPtr keyMetaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (10)])); + TypePtr keyType = TypePtr::dynamicCast((yyvsp[(5) - (10)])); + StringListTokPtr valueMetaData = StringListTokPtr::dynamicCast((yyvsp[(7) - (10)])); + TypePtr valueType = TypePtr::dynamicCast((yyvsp[(8) - (10)])); + ContainerPtr cont = unit->currentContainer(); + (yyval) = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v, local->v); // Dummy + unit->error("keyword `" + ident->v + "' cannot be used as dictionary name"); +;} + break; + + case 104: +#line 1153 "Grammar.y" + { + (yyval) = (yyvsp[(2) - (2)]); +;} + break; + + case 105: +#line 1157 "Grammar.y" + { + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + unit->error("keyword `" + ident->v + "' cannot be used as enumeration name"); + (yyval) = (yyvsp[(2) - (2)]); // Dummy +;} + break; + + case 106: +#line 1168 "Grammar.y" + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + ContainerPtr cont = unit->currentContainer(); + EnumPtr en = cont->createEnum(ident->v, local->v); + cont->checkIntroduced(ident->v, en); + (yyval) = en; +;} + break; + + case 107: +#line 1177 "Grammar.y" + { + EnumPtr en = EnumPtr::dynamicCast((yyvsp[(3) - (6)])); + if(en) + { + EnumeratorListTokPtr enumerators = EnumeratorListTokPtr::dynamicCast((yyvsp[(5) - (6)])); + if(enumerators->v.empty()) + { + unit->error("enum `" + en->name() + "' must have at least one enumerator"); + } + en->setEnumerators(enumerators->v); // Dummy + } + (yyval) = (yyvsp[(3) - (6)]); +;} + break; + + case 108: +#line 1192 "Grammar.y" + { + unit->error("missing enumeration name"); + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (5)])); + ContainerPtr cont = unit->currentContainer(); + EnumPtr en = cont->createEnum(IceUtil::generateUUID(), local->v, Dummy); // Dummy + EnumeratorListTokPtr enumerators = EnumeratorListTokPtr::dynamicCast((yyvsp[(4) - (5)])); + en->setEnumerators(enumerators->v); // Dummy + (yyval) = en; +;} + break; + + case 109: +#line 1207 "Grammar.y" + { + EnumeratorListTokPtr ens = EnumeratorListTokPtr::dynamicCast((yyvsp[(1) - (3)])); + ens->v.splice(ens->v.end(), EnumeratorListTokPtr::dynamicCast((yyvsp[(3) - (3)]))->v); + (yyval) = ens; +;} + break; + + case 110: +#line 1213 "Grammar.y" + { +;} + break; + + case 111: +#line 1221 "Grammar.y" + { + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + EnumeratorListTokPtr ens = new EnumeratorListTok; + ContainerPtr cont = unit->currentContainer(); + EnumeratorPtr en = cont->createEnumerator(ident->v); + if(en) + { + ens->v.push_front(en); + } + (yyval) = ens; +;} + break; + + case 112: +#line 1233 "Grammar.y" + { + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + unit->error("keyword `" + ident->v + "' cannot be used as enumerator"); + EnumeratorListTokPtr ens = new EnumeratorListTok; // Dummy + (yyval) = ens; +;} + break; + + case 113: +#line 1240 "Grammar.y" + { + EnumeratorListTokPtr ens = new EnumeratorListTok; + (yyval) = ens; // Dummy +;} + break; + + case 114: +#line 1250 "Grammar.y" + { + BoolTokPtr out = new BoolTok; + out->v = true; + (yyval) = out; +;} + break; + + case 115: +#line 1256 "Grammar.y" + { + BoolTokPtr out = new BoolTok; + out->v = false; + (yyval) = out; +;} + break; + + case 116: +#line 1267 "Grammar.y" + { +;} + break; + + case 117: +#line 1270 "Grammar.y" + { + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); + TypeStringTokPtr tsp = TypeStringTokPtr::dynamicCast((yyvsp[(3) - (3)])); + TypePtr type = tsp->v.first; + string ident = tsp->v.second; + OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); + if(op) + { + ParamDeclPtr pd = op->createParamDecl(ident, type, isOutParam->v); + unit->currentContainer()->checkIntroduced(ident, pd); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(2) - (3)])); + if(!metaData->v.empty()) + { + pd->setMetaData(metaData->v); + } + } +;} + break; + + case 118: +#line 1288 "Grammar.y" + { + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(3) - (5)])); + TypeStringTokPtr tsp = TypeStringTokPtr::dynamicCast((yyvsp[(5) - (5)])); + TypePtr type = tsp->v.first; + string ident = tsp->v.second; + OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); + if(op) + { + ParamDeclPtr pd = op->createParamDecl(ident, type, isOutParam->v); + unit->currentContainer()->checkIntroduced(ident, pd); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (5)])); + if(!metaData->v.empty()) + { + pd->setMetaData(metaData->v); + } + } +;} + break; + + case 119: +#line 1306 "Grammar.y" + { + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(1) - (4)])); + TypePtr type = TypePtr::dynamicCast((yyvsp[(3) - (4)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(4) - (4)])); + OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); + if(op) + { + op->createParamDecl(ident->v, type, isOutParam->v); // Dummy + unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); + } +;} + break; + + case 120: +#line 1318 "Grammar.y" + { + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(3) - (6)])); + TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (6)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(6) - (6)])); + OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); + if(op) + { + op->createParamDecl(ident->v, type, isOutParam->v); // Dummy + unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); + } +;} + break; + + case 121: +#line 1330 "Grammar.y" + { + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); + TypePtr type = TypePtr::dynamicCast((yyvsp[(3) - (3)])); + OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); + if(op) + { + op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v); // Dummy + unit->error("missing parameter name"); + } +;} + break; + + case 122: +#line 1341 "Grammar.y" + { + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(3) - (5)])); + TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (5)])); + OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); + if(op) + { + op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v); // Dummy + unit->error("missing parameter name"); + } +;} + break; + + case 123: +#line 1357 "Grammar.y" + { + (yyval) = (yyvsp[(2) - (2)]); +;} + break; + + case 124: +#line 1361 "Grammar.y" + { + (yyval) = new ExceptionListTok; +;} + break; + + case 125: +#line 1370 "Grammar.y" + { +;} + break; + + case 126: +#line 1373 "Grammar.y" + { + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + ident->v = "::" + ident->v; + (yyval) = ident; +;} + break; + + case 127: +#line 1379 "Grammar.y" + { + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (3)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(3) - (3)])); + scoped->v += "::"; + scoped->v += ident->v; + (yyval) = scoped; +;} + break; + + case 128: +#line 1392 "Grammar.y" + { + (yyval) = unit->builtin(Builtin::KindByte); +;} + break; + + case 129: +#line 1396 "Grammar.y" + { + (yyval) = unit->builtin(Builtin::KindBool); +;} + break; + + case 130: +#line 1400 "Grammar.y" + { + (yyval) = unit->builtin(Builtin::KindShort); +;} + break; + + case 131: +#line 1404 "Grammar.y" + { + (yyval) = unit->builtin(Builtin::KindInt); +;} + break; + + case 132: +#line 1408 "Grammar.y" + { + (yyval) = unit->builtin(Builtin::KindLong); +;} + break; + + case 133: +#line 1412 "Grammar.y" + { + (yyval) = unit->builtin(Builtin::KindFloat); +;} + break; + + case 134: +#line 1416 "Grammar.y" + { + (yyval) = unit->builtin(Builtin::KindDouble); +;} + break; + + case 135: +#line 1420 "Grammar.y" + { + (yyval) = unit->builtin(Builtin::KindString); +;} + break; + + case 136: +#line 1424 "Grammar.y" + { + (yyval) = unit->builtin(Builtin::KindObject); +;} + break; + + case 137: +#line 1428 "Grammar.y" + { + (yyval) = unit->builtin(Builtin::KindObjectProxy); +;} + break; + + case 138: +#line 1432 "Grammar.y" + { + (yyval) = unit->builtin(Builtin::KindLocalObject); +;} + break; + + case 139: +#line 1436 "Grammar.y" + { + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + ContainerPtr cont = unit->currentContainer(); + if(cont) + { + TypeList types = cont->lookupType(scoped->v); + if(types.empty()) + { + YYERROR; // Can't continue, jump to next yyerrok + } + cont->checkIntroduced(scoped->v); + (yyval) = types.front(); + } + else + { + (yyval) = 0; + } +;} + break; + + case 140: +#line 1455 "Grammar.y" + { + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (2)])); + ContainerPtr cont = unit->currentContainer(); + if(cont) + { + TypeList types = cont->lookupType(scoped->v); + if(types.empty()) + { + YYERROR; // Can't continue, jump to next yyerrok + } + for(TypeList::iterator p = types.begin(); p != types.end(); ++p) + { + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*p); + if(!cl) + { + string msg = "`"; + msg += scoped->v; + msg += "' must be class or interface"; + unit->error(msg); + YYERROR; // Can't continue, jump to next yyerrok + } + cont->checkIntroduced(scoped->v); + if(cl->isLocal()) + { + unit->error("cannot create proxy for " + cl->kindOf() + " `" + cl->name() + "'"); // $$ is dummy + } + *p = new Proxy(cl); + } + (yyval) = types.front(); + } + else + { + (yyval) = 0; + } +;} + break; + + case 141: +#line 1496 "Grammar.y" + { + StringTokPtr str1 = StringTokPtr::dynamicCast((yyvsp[(1) - (2)])); + StringTokPtr str2 = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + str1->v += str2->v; +;} + break; + + case 142: +#line 1502 "Grammar.y" + { +;} + break; + + case 143: +#line 1510 "Grammar.y" + { + StringTokPtr str = StringTokPtr::dynamicCast((yyvsp[(3) - (3)])); + StringListTokPtr stringList = StringListTokPtr::dynamicCast((yyvsp[(1) - (3)])); + stringList->v.push_back(str->v); + (yyval) = stringList; +;} + break; + + case 144: +#line 1517 "Grammar.y" + { + StringTokPtr str = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringListTokPtr stringList = new StringListTok; + stringList->v.push_back(str->v); + (yyval) = stringList; +;} + break; + + case 145: +#line 1529 "Grammar.y" + { + BoolTokPtr local = new BoolTok; + local->v = true; + (yyval) = local; +;} + break; + + case 146: +#line 1535 "Grammar.y" + { + BoolTokPtr local = new BoolTok; + local->v = false; + (yyval) = local; +;} + break; + + case 147: +#line 1546 "Grammar.y" + { + BuiltinPtr type = unit->builtin(Builtin::KindLong); + IntegerTokPtr intVal = IntegerTokPtr::dynamicCast((yyvsp[(1) - (1)])); + ostringstream sstr; + sstr << intVal->v; + ConstDefTokPtr def = new ConstDefTok; + def->v.type = type; + def->v.value = type; + def->v.valueAsString = sstr.str(); + def->v.valueAsLiteral = intVal->literal; + (yyval) = def; +;} + break; + + case 148: +#line 1559 "Grammar.y" + { + BuiltinPtr type = unit->builtin(Builtin::KindDouble); + FloatingTokPtr floatVal = FloatingTokPtr::dynamicCast((yyvsp[(1) - (1)])); + ostringstream sstr; + sstr << floatVal->v; + ConstDefTokPtr def = new ConstDefTok; + def->v.type = type; + def->v.value = type; + def->v.valueAsString = sstr.str(); + def->v.valueAsLiteral = floatVal->literal; + (yyval) = def; +;} + break; + + case 149: +#line 1572 "Grammar.y" + { + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + ConstDefTokPtr def = new ConstDefTok; + ContainedList cl = unit->currentContainer()->lookupContained(scoped->v); + if(cl.empty()) + { + def->v.type = TypePtr(0); + def->v.value = SyntaxTreeBasePtr(0); + def->v.valueAsString = scoped->v; + def->v.valueAsLiteral = scoped->v; + } + else + { + EnumeratorPtr enumerator = EnumeratorPtr::dynamicCast(cl.front()); + ConstPtr constant = ConstPtr::dynamicCast(cl.front()); + if(enumerator) + { + unit->currentContainer()->checkIntroduced(scoped->v, enumerator); + def->v.type = enumerator->type(); + def->v.value = enumerator; + def->v.valueAsString = scoped->v; + def->v.valueAsLiteral = scoped->v; + } + else if(constant) + { + unit->currentContainer()->checkIntroduced(scoped->v, constant); + def->v.value = constant; + def->v.valueAsString = constant->value(); + def->v.valueAsLiteral = constant->value(); + } + else + { + string msg = "illegal initializer: `" + scoped->v + "' is a"; + static const string vowels = "aeiou"; + string kindOf = cl.front()->kindOf(); + if(vowels.find_first_of(kindOf[0]) != string::npos) + { + msg += "n"; + } + msg += " " + kindOf; + unit->error(msg); // $$ is dummy + } + } + (yyval) = def; +;} + break; + + case 150: +#line 1618 "Grammar.y" + { + BuiltinPtr type = unit->builtin(Builtin::KindString); + StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + ConstDefTokPtr def = new ConstDefTok; + def->v.type = type; + def->v.value = type; + def->v.valueAsString = literal->v; + def->v.valueAsLiteral = literal->literal; + (yyval) = def; +;} + break; + + case 151: +#line 1629 "Grammar.y" + { + BuiltinPtr type = unit->builtin(Builtin::KindBool); + StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + ConstDefTokPtr def = new ConstDefTok; + def->v.type = type; + def->v.value = type; + def->v.valueAsString = "false"; + def->v.valueAsLiteral = "false"; + (yyval) = def; +;} + break; + + case 152: +#line 1640 "Grammar.y" + { + BuiltinPtr type = unit->builtin(Builtin::KindBool); + StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + ConstDefTokPtr def = new ConstDefTok; + def->v.type = type; + def->v.value = type; + def->v.valueAsString = "true"; + def->v.valueAsLiteral = "true"; + (yyval) = def; +;} + break; + + case 153: +#line 1656 "Grammar.y" + { + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(2) - (6)])); + TypePtr const_type = TypePtr::dynamicCast((yyvsp[(3) - (6)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(4) - (6)])); + ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(6) - (6)])); + (yyval) = unit->currentContainer()->createConst(ident->v, const_type, metaData->v, value->v.value, + value->v.valueAsString, value->v.valueAsLiteral); +;} + break; + + case 154: +#line 1665 "Grammar.y" + { + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(2) - (5)])); + TypePtr const_type = TypePtr::dynamicCast((yyvsp[(3) - (5)])); + ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(5) - (5)])); + unit->error("missing constant name"); + (yyval) = unit->currentContainer()->createConst(IceUtil::generateUUID(), const_type, metaData->v, value->v.value, + value->v.valueAsString, value->v.valueAsLiteral, Dummy); // Dummy +;} + break; + + case 155: +#line 1679 "Grammar.y" + { +;} + break; + + case 156: +#line 1682 "Grammar.y" + { +;} + break; + + case 157: +#line 1685 "Grammar.y" + { +;} + break; + + case 158: +#line 1688 "Grammar.y" + { +;} + break; + + case 159: +#line 1691 "Grammar.y" + { +;} + break; + + case 160: +#line 1694 "Grammar.y" + { +;} + break; + + case 161: +#line 1697 "Grammar.y" + { +;} + break; + + case 162: +#line 1700 "Grammar.y" + { +;} + break; + + case 163: +#line 1703 "Grammar.y" + { +;} + break; + + case 164: +#line 1706 "Grammar.y" + { +;} + break; + + case 165: +#line 1709 "Grammar.y" + { +;} + break; + + case 166: +#line 1712 "Grammar.y" + { +;} + break; + + case 167: +#line 1715 "Grammar.y" + { +;} + break; + + case 168: +#line 1718 "Grammar.y" + { +;} + break; + + case 169: +#line 1721 "Grammar.y" + { +;} + break; + + case 170: +#line 1724 "Grammar.y" + { +;} + break; + + case 171: +#line 1727 "Grammar.y" + { +;} + break; + + case 172: +#line 1730 "Grammar.y" + { +;} + break; + + case 173: +#line 1733 "Grammar.y" + { +;} + break; + + case 174: +#line 1736 "Grammar.y" + { +;} + break; + + case 175: +#line 1739 "Grammar.y" + { +;} + break; + + case 176: +#line 1742 "Grammar.y" + { +;} + break; + + case 177: +#line 1745 "Grammar.y" + { +;} + break; + + case 178: +#line 1748 "Grammar.y" + { +;} + break; + + case 179: +#line 1751 "Grammar.y" + { +;} + break; + + case 180: +#line 1754 "Grammar.y" + { +;} + break; + + case 181: +#line 1757 "Grammar.y" + { +;} + break; + + case 182: +#line 1760 "Grammar.y" + { +;} + break; + + +/* Line 1267 of yacc.c. */ +#line 3720 "Grammar.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + +#line 1764 "Grammar.y" + + |