From af9a837223ec5deae47dd9ef64790137f0dcf1a3 Mon Sep 17 00:00:00 2001 From: Austin Henriksen Date: Thu, 11 Jan 2024 12:15:13 -0500 Subject: [PATCH] Slice Parser Cleanup (#1658) --- cpp/src/Slice/Grammar.cpp | 1926 +++++++++++++++-------------------- cpp/src/Slice/Grammar.y | 256 ++--- cpp/src/Slice/Parser.cpp | 30 +- cpp/src/Slice/SliceUtil.cpp | 12 + cpp/src/Slice/Util.h | 4 + cpp/src/slice2cpp/Gen.cpp | 8 - 6 files changed, 929 insertions(+), 1307 deletions(-) diff --git a/cpp/src/Slice/Grammar.cpp b/cpp/src/Slice/Grammar.cpp index 4a05307b389..36761b58c3a 100644 --- a/cpp/src/Slice/Grammar.cpp +++ b/cpp/src/Slice/Grammar.cpp @@ -280,64 +280,57 @@ enum yysymbol_kind_t YYSYMBOL_exception_def = 80, /* exception_def */ YYSYMBOL_81_15 = 81, /* @15 */ YYSYMBOL_exception_extends = 82, /* exception_extends */ - YYSYMBOL_exception_exports = 83, /* exception_exports */ - YYSYMBOL_type_id = 84, /* type_id */ - YYSYMBOL_tag = 85, /* tag */ - YYSYMBOL_optional = 86, /* optional */ - YYSYMBOL_tagged_type_id = 87, /* tagged_type_id */ - YYSYMBOL_exception_export = 88, /* exception_export */ - YYSYMBOL_struct_id = 89, /* struct_id */ - YYSYMBOL_struct_decl = 90, /* struct_decl */ - YYSYMBOL_struct_def = 91, /* struct_def */ - YYSYMBOL_92_16 = 92, /* @16 */ - YYSYMBOL_struct_exports = 93, /* struct_exports */ - YYSYMBOL_struct_export = 94, /* struct_export */ - YYSYMBOL_class_name = 95, /* class_name */ - YYSYMBOL_class_id = 96, /* class_id */ - YYSYMBOL_class_decl = 97, /* class_decl */ - YYSYMBOL_class_def = 98, /* class_def */ - YYSYMBOL_99_17 = 99, /* @17 */ - YYSYMBOL_class_extends = 100, /* class_extends */ - YYSYMBOL_extends = 101, /* extends */ - YYSYMBOL_class_exports = 102, /* class_exports */ - YYSYMBOL_data_member = 103, /* data_member */ - YYSYMBOL_struct_data_member = 104, /* struct_data_member */ - YYSYMBOL_return_type = 105, /* return_type */ - YYSYMBOL_operation_preamble = 106, /* operation_preamble */ - YYSYMBOL_operation = 107, /* operation */ - YYSYMBOL_108_18 = 108, /* @18 */ - YYSYMBOL_109_19 = 109, /* @19 */ - YYSYMBOL_class_export = 110, /* class_export */ - YYSYMBOL_interface_id = 111, /* interface_id */ - YYSYMBOL_interface_decl = 112, /* interface_decl */ - YYSYMBOL_interface_def = 113, /* interface_def */ - YYSYMBOL_114_20 = 114, /* @20 */ - YYSYMBOL_interface_list = 115, /* interface_list */ - YYSYMBOL_interface_extends = 116, /* interface_extends */ - YYSYMBOL_interface_exports = 117, /* interface_exports */ - YYSYMBOL_interface_export = 118, /* interface_export */ - YYSYMBOL_exception_list = 119, /* exception_list */ - YYSYMBOL_exception = 120, /* exception */ - YYSYMBOL_sequence_def = 121, /* sequence_def */ - YYSYMBOL_dictionary_def = 122, /* dictionary_def */ - YYSYMBOL_enum_id = 123, /* enum_id */ - YYSYMBOL_enum_def = 124, /* enum_def */ - YYSYMBOL_125_21 = 125, /* @21 */ - YYSYMBOL_126_22 = 126, /* @22 */ - YYSYMBOL_enumerator_list = 127, /* enumerator_list */ - YYSYMBOL_enumerator = 128, /* enumerator */ - YYSYMBOL_enumerator_initializer = 129, /* enumerator_initializer */ - YYSYMBOL_out_qualifier = 130, /* out_qualifier */ - YYSYMBOL_parameters = 131, /* parameters */ - YYSYMBOL_throws = 132, /* throws */ - YYSYMBOL_scoped_name = 133, /* scoped_name */ - YYSYMBOL_builtin = 134, /* builtin */ - YYSYMBOL_type = 135, /* type */ - YYSYMBOL_string_literal = 136, /* string_literal */ - YYSYMBOL_string_list = 137, /* string_list */ - YYSYMBOL_const_initializer = 138, /* const_initializer */ - YYSYMBOL_const_def = 139, /* const_def */ - YYSYMBOL_keyword = 140 /* keyword */ + YYSYMBOL_type_id = 83, /* type_id */ + YYSYMBOL_tag = 84, /* tag */ + YYSYMBOL_optional = 85, /* optional */ + YYSYMBOL_tagged_type_id = 86, /* tagged_type_id */ + YYSYMBOL_struct_id = 87, /* struct_id */ + YYSYMBOL_struct_decl = 88, /* struct_decl */ + YYSYMBOL_struct_def = 89, /* struct_def */ + YYSYMBOL_90_16 = 90, /* @16 */ + YYSYMBOL_class_name = 91, /* class_name */ + YYSYMBOL_class_id = 92, /* class_id */ + YYSYMBOL_class_decl = 93, /* class_decl */ + YYSYMBOL_class_def = 94, /* class_def */ + YYSYMBOL_95_17 = 95, /* @17 */ + YYSYMBOL_class_extends = 96, /* class_extends */ + YYSYMBOL_extends = 97, /* extends */ + YYSYMBOL_data_members = 98, /* data_members */ + YYSYMBOL_data_member = 99, /* data_member */ + YYSYMBOL_return_type = 100, /* return_type */ + YYSYMBOL_operation_preamble = 101, /* operation_preamble */ + YYSYMBOL_operation = 102, /* operation */ + YYSYMBOL_103_18 = 103, /* @18 */ + YYSYMBOL_104_19 = 104, /* @19 */ + YYSYMBOL_interface_id = 105, /* interface_id */ + YYSYMBOL_interface_decl = 106, /* interface_decl */ + YYSYMBOL_interface_def = 107, /* interface_def */ + YYSYMBOL_108_20 = 108, /* @20 */ + YYSYMBOL_interface_list = 109, /* interface_list */ + YYSYMBOL_interface_extends = 110, /* interface_extends */ + YYSYMBOL_operations = 111, /* operations */ + YYSYMBOL_exception_list = 112, /* exception_list */ + YYSYMBOL_exception = 113, /* exception */ + YYSYMBOL_sequence_def = 114, /* sequence_def */ + YYSYMBOL_dictionary_def = 115, /* dictionary_def */ + YYSYMBOL_enum_id = 116, /* enum_id */ + YYSYMBOL_enum_def = 117, /* enum_def */ + YYSYMBOL_118_21 = 118, /* @21 */ + YYSYMBOL_119_22 = 119, /* @22 */ + YYSYMBOL_enumerator_list = 120, /* enumerator_list */ + YYSYMBOL_enumerator = 121, /* enumerator */ + YYSYMBOL_enumerator_initializer = 122, /* enumerator_initializer */ + YYSYMBOL_out_qualifier = 123, /* out_qualifier */ + YYSYMBOL_parameters = 124, /* parameters */ + YYSYMBOL_throws = 125, /* throws */ + YYSYMBOL_scoped_name = 126, /* scoped_name */ + YYSYMBOL_builtin = 127, /* builtin */ + YYSYMBOL_type = 128, /* type */ + YYSYMBOL_string_literal = 129, /* string_literal */ + YYSYMBOL_string_list = 130, /* string_list */ + YYSYMBOL_const_initializer = 131, /* const_initializer */ + YYSYMBOL_const_def = 132, /* const_def */ + YYSYMBOL_keyword = 133 /* keyword */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -352,7 +345,7 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; int slice_lex(YYSTYPE* lvalp, YYLTYPE* llocp); -#line 356 "src/Slice/Grammar.cpp" +#line 349 "src/Slice/Grammar.cpp" #ifdef short # undef short @@ -678,16 +671,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 848 +#define YYLAST 674 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 56 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 85 +#define YYNNTS 78 /* YYNRULES -- Number of rules. */ -#define YYNRULES 227 +#define YYNRULES 207 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 331 +#define YYNSTATES 300 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 300 @@ -746,24 +739,22 @@ static const yytype_int16 yyrline[] = 274, 279, 284, 283, 289, 288, 293, 298, 297, 303, 302, 307, 312, 311, 317, 316, 321, 326, 325, 330, 335, 334, 340, 339, 344, 348, 358, 357, 390, 394, - 405, 416, 415, 441, 449, 458, 467, 470, 474, 482, - 496, 514, 593, 599, 610, 628, 706, 712, 723, 732, - 741, 754, 760, 764, 775, 786, 785, 826, 835, 838, - 842, 850, 856, 860, 871, 896, 986, 998, 1011, 1010, - 1044, 1078, 1087, 1090, 1098, 1107, 1110, 1114, 1122, 1144, - 1171, 1193, 1219, 1228, 1239, 1248, 1257, 1266, 1275, 1285, - 1299, 1305, 1311, 1317, 1327, 1351, 1376, 1400, 1431, 1430, - 1453, 1452, 1475, 1481, 1485, 1496, 1510, 1509, 1543, 1578, - 1613, 1618, 1628, 1632, 1641, 1650, 1653, 1657, 1665, 1671, - 1678, 1690, 1702, 1713, 1721, 1735, 1745, 1761, 1765, 1777, - 1776, 1808, 1807, 1825, 1831, 1839, 1851, 1871, 1878, 1888, - 1892, 1930, 1936, 1947, 1950, 1966, 1982, 1994, 2006, 2017, - 2033, 2037, 2046, 2049, 2057, 2058, 2059, 2060, 2061, 2062, - 2063, 2064, 2065, 2066, 2071, 2075, 2080, 2111, 2147, 2153, - 2161, 2168, 2180, 2189, 2198, 2238, 2245, 2252, 2264, 2273, - 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, - 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2305, 2306, - 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2314 + 405, 416, 415, 441, 449, 458, 471, 489, 568, 574, + 585, 603, 681, 687, 698, 707, 716, 729, 733, 744, + 755, 754, 795, 799, 810, 835, 925, 937, 950, 949, + 983, 1017, 1026, 1029, 1037, 1046, 1049, 1053, 1061, 1091, + 1126, 1148, 1174, 1180, 1186, 1192, 1202, 1226, 1251, 1275, + 1306, 1305, 1328, 1327, 1350, 1354, 1365, 1379, 1378, 1412, + 1447, 1482, 1487, 1497, 1501, 1510, 1519, 1522, 1526, 1534, + 1541, 1553, 1565, 1576, 1584, 1598, 1608, 1624, 1628, 1640, + 1639, 1671, 1670, 1688, 1694, 1702, 1714, 1734, 1741, 1751, + 1755, 1793, 1799, 1810, 1813, 1829, 1845, 1857, 1869, 1880, + 1896, 1900, 1909, 1912, 1920, 1921, 1922, 1923, 1924, 1925, + 1926, 1927, 1928, 1929, 1934, 1938, 1943, 1974, 2010, 2016, + 2024, 2031, 2043, 2052, 2061, 2096, 2103, 2110, 2122, 2131, + 2145, 2146, 2147, 2148, 2149, 2150, 2151, 2152, 2153, 2154, + 2155, 2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, + 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172 }; #endif @@ -795,15 +786,13 @@ static const char *const yytname[] = "global_meta_data", "meta_data", "definitions", "definition", "$@1", "$@2", "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", "$@9", "$@10", "$@11", "$@12", "$@13", "module_def", "@14", "exception_id", "exception_decl", - "exception_def", "@15", "exception_extends", "exception_exports", - "type_id", "tag", "optional", "tagged_type_id", "exception_export", - "struct_id", "struct_decl", "struct_def", "@16", "struct_exports", - "struct_export", "class_name", "class_id", "class_decl", "class_def", - "@17", "class_extends", "extends", "class_exports", "data_member", - "struct_data_member", "return_type", "operation_preamble", "operation", - "@18", "@19", "class_export", "interface_id", "interface_decl", - "interface_def", "@20", "interface_list", "interface_extends", - "interface_exports", "interface_export", "exception_list", "exception", + "exception_def", "@15", "exception_extends", "type_id", "tag", + "optional", "tagged_type_id", "struct_id", "struct_decl", "struct_def", + "@16", "class_name", "class_id", "class_decl", "class_def", "@17", + "class_extends", "extends", "data_members", "data_member", "return_type", + "operation_preamble", "operation", "@18", "@19", "interface_id", + "interface_decl", "interface_def", "@20", "interface_list", + "interface_extends", "operations", "exception_list", "exception", "sequence_def", "dictionary_def", "enum_id", "enum_def", "@21", "@22", "enumerator_list", "enumerator", "enumerator_initializer", "out_qualifier", "parameters", "throws", "scoped_name", "builtin", @@ -818,12 +807,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-287) +#define YYPACT_NINF (-256) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-164) +#define YYTABLE_NINF (-144) #define yytable_value_is_error(Yyn) \ 0 @@ -832,40 +821,36 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - -287, 22, 18, -287, 12, 12, 12, -287, 74, 12, - -287, -11, 6, 33, 1, -5, 457, 529, 561, 593, - 7, 23, 625, 36, -287, -287, 19, 44, -287, 48, - 54, -287, 20, 2, 89, -287, 24, 94, -287, 109, - 111, -287, -287, 118, -287, -287, 12, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - 77, -287, -287, -287, -287, -287, -287, -287, 36, 36, - -287, 68, -287, 102, 121, -287, -287, -287, 69, 122, - 121, 86, 123, 121, -287, 69, 124, 121, 104, -287, - 128, 121, 130, 132, 103, 121, 134, -287, 107, 133, - -287, -287, 135, 102, 102, 657, -287, -287, -287, -287, - -287, -287, -287, -287, 136, -287, 137, -287, -17, -287, - -287, 126, -287, -287, -287, 245, -287, -287, 142, -287, - -287, -287, -287, -287, -287, 125, 146, -287, -287, -287, - -287, 657, -287, -287, -287, -287, -287, 140, 138, 144, - 148, 147, -287, -287, -287, 149, 127, 375, 155, 804, - 154, 411, 104, 339, 156, 108, 689, 36, 131, -287, - 657, 127, -287, -287, -287, -287, -287, -287, -287, 157, - 804, 160, 245, -287, -287, -7, 59, 158, 102, 102, - 159, -287, 721, -287, 174, 804, 173, -287, 176, 774, - 179, -287, -287, -287, -287, 102, -287, -287, -287, -287, - -287, 375, -287, 102, 102, 177, 187, -287, 721, -287, - -287, 185, -287, 186, 188, -287, 189, 127, 190, 202, - 192, 245, -287, -287, 411, -287, 198, -287, 339, -287, - 196, 102, 102, 87, 300, -287, 199, -287, -287, 194, - -287, -287, -287, 127, 375, -287, -287, -287, -287, -287, - -287, 127, 127, -287, -287, 411, -287, 101, -287, -287, - -287, -287, 200, -287, 36, -12, 339, 753, -287, -287, - -287, -287, -287, -287, -287, -287, 804, -287, 239, -287, - -287, -287, 238, -287, 721, 238, 36, 496, -287, -287, - -287, 804, -287, 203, -287, -287, -287, 721, 496, -287, - -287 + -256, 16, 28, -256, -6, -6, -6, -256, 643, -6, + -256, 22, -29, -28, 37, 2, 283, 355, 387, 419, + 36, 49, 451, 87, -256, -256, 18, 92, -256, 94, + 100, -256, 41, -10, 102, -256, 45, 122, -256, 125, + 126, -256, -256, 131, -256, -256, -6, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + 105, -256, -256, -256, -256, -256, -256, -256, 87, 87, + -256, 133, -256, 639, 136, -256, -256, -256, 42, 142, + 136, 150, 153, 136, -256, 42, 156, 136, 50, -256, + 160, 136, 162, 173, 174, 136, 179, -256, 180, 171, + -256, -256, 177, 639, 639, 483, -256, -256, -256, -256, + -256, -256, -256, -256, 176, -256, 178, -256, -17, -256, + -256, 185, -256, -256, -256, 194, -256, -256, 187, -256, + -256, -256, -256, -256, -256, 183, 189, -256, -256, -256, + -256, 483, -256, -256, -256, -256, -256, 186, 191, 188, + 196, 193, -256, -256, -256, 195, 73, 194, 201, 599, + 200, 194, 50, 99, 212, 155, 515, 87, 141, -256, + 483, 73, -256, -256, -256, -256, -256, -256, -256, 213, + 194, -256, -256, 47, 152, -256, 639, 639, 216, 226, + 547, -256, 225, -256, 229, 235, 228, -256, -256, -256, + -256, 639, -256, -256, -256, -256, -256, -256, -256, 231, + -256, 232, 233, -256, 265, -256, 243, -256, 73, 194, + -256, -256, -256, 99, -256, 135, 639, 639, 69, 26, + 269, -256, -256, 262, -256, -256, -256, -256, -256, -256, + -256, 90, -256, -256, -256, -256, 270, -256, 87, -34, + 99, 579, -256, -256, -256, 599, -256, 307, -256, -256, + -256, 308, -256, 547, 308, 87, 322, -256, -256, -256, + 599, -256, 268, -256, -256, -256, 547, 322, -256, -256 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -873,54 +858,49 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 11, 0, 8, 1, 0, 0, 0, 9, 0, 189, - 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 151, 8, 10, 12, 50, 26, 27, 74, - 31, 32, 87, 91, 16, 17, 125, 21, 22, 36, - 39, 149, 40, 44, 188, 7, 0, 5, 6, 45, - 46, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 82, - 0, 83, 123, 124, 48, 49, 72, 73, 8, 8, - 147, 0, 148, 0, 4, 92, 93, 51, 0, 0, - 4, 0, 0, 4, 88, 0, 0, 4, 0, 126, - 0, 4, 0, 0, 0, 4, 0, 190, 0, 0, - 172, 173, 0, 0, 0, 158, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 186, 185, 0, 3, - 13, 0, 53, 25, 28, 0, 30, 33, 0, 90, - 15, 18, 130, 131, 132, 129, 0, 20, 23, 35, - 38, 158, 41, 43, 11, 84, 85, 0, 0, 155, - 0, 154, 157, 184, 187, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 8, 0, 8, 0, 152, - 158, 0, 196, 197, 195, 192, 193, 194, 199, 0, - 0, 0, 0, 63, 67, 0, 0, 102, 0, 0, - 79, 81, 109, 76, 0, 0, 0, 128, 0, 0, - 0, 150, 47, 143, 144, 0, 159, 156, 160, 153, - 198, 0, 70, 0, 0, 98, 57, 71, 101, 52, - 78, 0, 62, 0, 0, 66, 0, 0, 104, 0, - 106, 0, 59, 108, 0, 122, 96, 89, 0, 113, - 0, 0, 0, 0, 0, 138, 136, 112, 127, 0, - 56, 68, 69, 0, 0, 100, 60, 61, 64, 65, - 103, 0, 0, 77, 95, 0, 135, 0, 110, 111, - 114, 116, 0, 161, 8, 0, 0, 0, 99, 55, - 105, 107, 94, 115, 117, 120, 0, 118, 162, 134, - 145, 146, 171, 164, 168, 171, 8, 0, 121, 166, - 119, 0, 170, 140, 141, 142, 165, 169, 0, 167, - 139 + 11, 0, 8, 1, 0, 0, 0, 9, 0, 169, + 171, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 131, 8, 10, 12, 50, 26, 27, 69, + 31, 32, 77, 81, 16, 17, 106, 21, 22, 36, + 39, 129, 40, 44, 168, 7, 0, 5, 6, 45, + 46, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 72, + 0, 73, 104, 105, 48, 49, 67, 68, 8, 8, + 127, 0, 128, 0, 4, 82, 83, 51, 0, 0, + 4, 0, 0, 4, 78, 0, 0, 4, 0, 107, + 0, 4, 0, 0, 0, 4, 0, 170, 0, 0, + 152, 153, 0, 0, 0, 138, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 166, 165, 0, 3, + 13, 0, 53, 25, 28, 0, 30, 33, 0, 80, + 15, 18, 111, 112, 113, 110, 0, 20, 23, 35, + 38, 138, 41, 43, 11, 74, 75, 0, 0, 135, + 0, 134, 137, 164, 167, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 8, 0, 8, 0, 132, + 138, 0, 176, 177, 175, 172, 173, 174, 179, 0, + 0, 59, 63, 0, 0, 66, 0, 0, 88, 86, + 91, 71, 0, 109, 0, 0, 0, 130, 47, 123, + 124, 0, 139, 136, 140, 133, 178, 52, 85, 0, + 58, 0, 0, 62, 0, 64, 0, 65, 0, 0, + 55, 90, 79, 0, 95, 0, 0, 0, 0, 0, + 117, 94, 108, 0, 56, 57, 60, 61, 89, 84, + 116, 0, 92, 93, 96, 98, 0, 141, 8, 0, + 0, 0, 97, 99, 102, 0, 100, 142, 115, 125, + 126, 151, 144, 148, 151, 8, 0, 103, 146, 101, + 0, 150, 120, 121, 122, 145, 149, 0, 147, 119 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -287, -287, -1, -287, -2, 90, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -287, -287, -287, - -287, -287, -287, -287, -287, -287, -287, -219, -170, -171, - -168, -286, -287, -287, -287, -287, -287, -192, -287, -287, - -287, -287, -287, -287, -287, 32, -241, 42, -287, 9, - -287, -287, -287, -287, -287, -287, -287, -287, -287, 76, - -287, -243, -287, -69, -287, -287, -287, -287, -287, -287, - -287, -145, -287, -287, -38, -287, -44, -75, -287, -74, - 15, 143, -185, -287, -15 + -256, -256, 89, -256, -2, 158, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, -256, -256, -256, -256, -256, -256, -62, -193, -182, + -255, -256, -256, -256, -256, -256, -256, -256, -256, -256, + -256, 57, -168, -256, 78, -256, -256, -256, -256, -256, + -256, -256, -256, 172, -256, -212, 56, -256, -256, -256, + -256, -256, -256, -256, -89, -256, -256, 109, -256, 71, + -79, -256, -85, 5, 161, -188, -256, -12 }; /* YYDEFGOTO[NTERM-NUM]. */ @@ -928,13 +908,12 @@ static const yytype_int16 yydefgoto[] = { 0, 1, 140, 7, 179, 2, 24, 94, 106, 107, 110, 111, 99, 100, 102, 103, 112, 113, 115, 116, - 25, 118, 26, 27, 28, 141, 97, 201, 232, 233, - 234, 235, 236, 29, 30, 31, 101, 180, 210, 32, - 33, 34, 35, 148, 104, 98, 216, 237, 211, 263, - 264, 265, 315, 312, 256, 36, 37, 38, 156, 154, - 109, 220, 266, 322, 323, 39, 40, 41, 42, 114, - 91, 170, 171, 227, 294, 295, 318, 136, 137, 249, - 10, 11, 198, 43, 172 + 25, 118, 26, 27, 28, 141, 97, 205, 206, 207, + 208, 29, 30, 31, 101, 32, 33, 34, 35, 148, + 104, 98, 180, 209, 248, 249, 250, 284, 281, 36, + 37, 38, 156, 154, 109, 216, 291, 292, 39, 40, + 41, 42, 114, 91, 170, 171, 223, 268, 269, 287, + 136, 137, 236, 10, 11, 198, 43, 172 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -942,149 +921,121 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 8, 81, 83, 85, 87, 122, 230, 92, 208, 207, - 240, 209, 270, 284, 95, 286, 184, 175, -2, 138, - 313, 93, 3, 142, 44, 241, 45, 120, 121, 50, - 149, 95, -86, 155, 176, 326, 95, 307, 248, 250, - 308, 46, 242, 9, 302, 229, 47, 49, 261, 167, - 168, 262, 96, 309, 4, 299, 5, 6, 46, 283, - 88, 117, 280, 271, 272, 105, -54, -86, 108, 96, - -86, -133, 4, 48, 96, 14, 89, 15, 16, 17, - 18, 19, 20, 21, 22, 46, 123, 124, 298, 261, - -24, 244, 262, 120, 121, -75, 300, 301, 23, 144, - -29, 197, 147, 120, 121, 212, 151, 155, 245, 119, - 158, 120, 121, 228, 162, 125, 197, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 238, 152, 290, 291, - 243, 246, 135, 145, 153, -14, 120, 121, 120, 121, - -19, 238, 303, 304, 4, 267, 5, 6, 12, 13, - 161, 269, 192, 193, 164, -34, 222, -37, 194, 195, - 196, 120, 121, 226, -42, 120, 121, 139, 143, 146, - 150, 224, 197, 177, 157, 200, 159, 182, 160, 215, - 163, 219, 165, 8, 166, 225, 267, 288, 289, 181, - 187, 173, 174, 183, 186, 188, 189, 253, 197, 190, - 191, 202, 213, 231, 221, 251, 197, 197, 239, 247, - 259, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 254, 257, 258, 275, 203, 204, 135, 268, 273, 200, - 120, 121, 314, 274, 276, 277, 252, 278, 279, 205, - 206, 281, 324, 282, 285, 296, 178, 327, 297, 305, - 293, 317, 215, 324, 185, 328, 219, 255, 217, 330, - -8, -8, -8, -8, -8, -8, -8, -8, -8, 287, - 316, 320, 200, -8, -8, -8, 0, 0, 0, -8, - -8, 4, 311, 215, 0, 0, 0, 0, -8, -8, - 0, 0, 306, -80, 219, 0, 0, 0, 0, 319, - 0, 292, 325, 0, 0, 0, 0, 0, 0, 0, - 0, 293, 329, 325, 321, -162, -162, -162, -162, -162, - -162, -162, -162, -162, 0, 0, 0, 0, -162, -162, - -162, 0, 0, 0, -162, -162, -162, 0, 0, 0, - 218, 0, 0, -162, -162, 0, 0, 0, 0, -163, - 0, 0, -163, -8, -8, -8, -8, -8, -8, -8, - -8, -8, -8, 0, 0, 0, -8, -8, -8, -8, - 0, 0, 0, -8, -8, 4, 199, 0, 0, 0, - 0, 0, -8, -8, 0, 0, 0, -137, 0, 0, - -8, -8, -8, -8, -8, -8, -8, -8, -8, 0, - 0, 0, 0, -8, -8, -8, 0, 0, 0, -8, - -8, 4, 214, 0, 0, 0, 0, 0, -8, -8, - 0, 0, 0, -58, 0, 0, -8, -8, -8, -8, - -8, -8, -8, -8, -8, 0, 0, 0, 0, -8, - -8, -8, 0, 0, 0, -8, -8, 4, 0, 0, - 0, 0, 0, 0, -8, -8, 0, 0, 0, -97, + 8, 122, 95, 226, 81, 83, 85, 87, 138, 199, + 92, 47, 48, 212, 44, 276, 3, 175, 277, 142, + 282, 93, 246, 46, 46, 9, 149, 266, -2, 155, + 95, 260, 228, 247, 176, 295, 50, 267, 167, 168, + 96, -142, -142, -142, -142, -142, -142, -142, -142, -142, + 258, 117, 246, -76, -142, -142, -142, 95, 278, 45, + -142, -142, -142, 247, 4, -54, 5, 6, 96, -142, + -142, 259, 184, 152, 46, -143, 120, 121, -143, 229, + 153, 120, 121, 49, 120, 121, 123, 124, -76, 88, + 105, -76, -114, 108, 210, 96, 230, 197, 192, 193, + 214, 225, 89, 155, 194, 195, 196, 120, 121, 224, + 264, 265, 197, -8, -8, -8, -8, -8, -8, -8, + -8, -8, -8, 4, 231, 234, -8, -8, -8, -8, + 251, 272, 273, -8, -8, 4, 253, 119, -24, 120, + 121, -70, -8, -8, 235, 237, -29, -118, -14, 244, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 197, + 251, 262, 263, 201, 202, 135, 12, 13, -19, 120, + 121, -34, -37, 222, 220, 120, 121, -42, 203, 204, + 125, 215, 139, 8, 232, 221, 120, 121, 143, 144, + 283, 4, 147, 5, 6, 178, 151, 145, 241, 146, + 158, 233, 150, 218, 162, 296, 157, 293, 159, -8, + -8, -8, -8, -8, -8, -8, -8, -8, 293, 160, + 165, 161, -8, -8, -8, 163, 166, 164, -8, -8, + 4, 173, 177, 174, 181, 182, 183, -8, -8, 188, + 186, 215, -87, 187, 189, 190, 191, 200, 211, 244, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 280, + 217, 227, 245, 201, 202, 135, 275, 238, 215, 120, + 121, 288, 239, 242, 294, 243, 252, 240, 203, 204, + 254, 255, 256, 290, 298, 294, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 257, 270, 271, 79, 267, 274, + 297, 286, 185, 261, 80, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 299, 213, 289, 120, 121, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 285, 0, 0, 82, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, 0, - 0, 79, 0, 0, 0, 0, 0, 0, 80, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 0, 0, 0, - 120, 121, 51, 52, 53, 54, 55, 56, 57, 58, + 0, 84, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 0, 0, 0, 82, 51, 52, 53, 54, 55, 56, + 0, 0, 0, 86, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 0, 0, 0, 84, 51, 52, 53, 54, + 77, 78, 0, 0, 0, 90, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 0, 0, 0, 86, 51, 52, + 75, 76, 77, 78, 0, 0, 0, 169, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 0, 0, 0, 90, + 73, 74, 75, 76, 77, 78, 0, 0, 0, 219, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 0, 0, - 0, 169, 51, 52, 53, 54, 55, 56, 57, 58, + 0, 240, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 0, 0, 0, 223, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 0, 0, 0, 252, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 0, 0, 0, 310, 259, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 0, 0, - 0, 260, 203, 204, 135, 0, 0, 0, 120, 121, - 0, 0, 0, 0, 0, 0, 0, 205, 206, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 0, 0, - 0, 0, 203, 204, 135, 0, 0, 0, 120, 121, - 0, 0, 0, 0, 0, 0, 0, 205, 206 + 0, 0, 0, 279, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 0, 0, 0, 0, 201, 202, 135, + 0, 0, 0, 120, 121, 0, 0, 0, 0, 0, + 0, 0, 203, 204, 14, 0, 15, 16, 17, 18, + 19, 20, 21, 22, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 0, 0, 0, 0, 23, 0, 135, + 0, 0, 0, 120, 121 }; static const yytype_int16 yycheck[] = { - 2, 16, 17, 18, 19, 80, 191, 22, 179, 179, - 202, 179, 231, 254, 12, 258, 161, 34, 0, 93, - 306, 23, 0, 98, 9, 32, 37, 34, 35, 34, - 105, 12, 12, 108, 51, 321, 12, 49, 208, 209, - 52, 52, 49, 31, 285, 190, 40, 46, 219, 123, - 124, 219, 50, 296, 36, 274, 38, 39, 52, 251, - 53, 46, 247, 233, 234, 33, 47, 47, 36, 50, - 50, 47, 36, 40, 50, 1, 53, 3, 4, 5, - 6, 7, 8, 9, 10, 52, 88, 89, 273, 260, - 46, 32, 260, 34, 35, 47, 281, 282, 24, 100, - 46, 176, 103, 34, 35, 179, 107, 182, 49, 32, - 111, 34, 35, 188, 115, 47, 191, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 200, 23, 41, 42, - 205, 206, 30, 47, 30, 46, 34, 35, 34, 35, - 46, 215, 41, 42, 36, 219, 38, 39, 5, 6, - 47, 225, 25, 26, 47, 46, 48, 46, 31, 32, - 33, 34, 35, 32, 46, 34, 35, 46, 46, 46, - 46, 186, 247, 47, 46, 177, 46, 52, 46, 181, - 46, 183, 49, 185, 49, 187, 260, 261, 262, 47, - 52, 55, 55, 47, 54, 51, 48, 212, 273, 52, - 51, 46, 48, 46, 48, 46, 281, 282, 48, 51, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 46, 48, 46, 238, 28, 29, 30, 48, 51, 231, - 34, 35, 306, 46, 49, 49, 34, 49, 49, 43, - 44, 51, 317, 51, 46, 46, 1, 321, 54, 49, - 11, 13, 254, 328, 164, 52, 258, 215, 182, 328, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 260, - 308, 315, 274, 28, 29, 30, -1, -1, -1, 34, - 35, 36, 297, 285, -1, -1, -1, -1, 43, 44, - -1, -1, 294, 48, 296, -1, -1, -1, -1, 314, - -1, 1, 317, -1, -1, -1, -1, -1, -1, -1, - -1, 11, 327, 328, 316, 15, 16, 17, 18, 19, - 20, 21, 22, 23, -1, -1, -1, -1, 28, 29, - 30, -1, -1, -1, 34, 35, 36, -1, -1, -1, - 1, -1, -1, 43, 44, -1, -1, -1, -1, 49, - -1, -1, 52, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, -1, -1, -1, 27, 28, 29, 30, - -1, -1, -1, 34, 35, 36, 1, -1, -1, -1, - -1, -1, 43, 44, -1, -1, -1, 48, -1, -1, - 15, 16, 17, 18, 19, 20, 21, 22, 23, -1, - -1, -1, -1, 28, 29, 30, -1, -1, -1, 34, - 35, 36, 1, -1, -1, -1, -1, -1, 43, 44, - -1, -1, -1, 48, -1, -1, 15, 16, 17, 18, - 19, 20, 21, 22, 23, -1, -1, -1, -1, 28, - 29, 30, -1, -1, -1, 34, 35, 36, -1, -1, - -1, -1, -1, -1, 43, 44, -1, -1, -1, 48, + 2, 80, 12, 191, 16, 17, 18, 19, 93, 177, + 22, 40, 40, 181, 9, 49, 0, 34, 52, 98, + 275, 23, 215, 52, 52, 31, 105, 1, 0, 108, + 12, 243, 200, 215, 51, 290, 34, 11, 123, 124, + 50, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 238, 46, 245, 12, 28, 29, 30, 12, 270, 37, + 34, 35, 36, 245, 36, 47, 38, 39, 50, 43, + 44, 239, 161, 23, 52, 49, 34, 35, 52, 32, + 30, 34, 35, 46, 34, 35, 88, 89, 47, 53, + 33, 50, 47, 36, 179, 50, 49, 176, 25, 26, + 1, 190, 53, 182, 31, 32, 33, 34, 35, 188, + 41, 42, 191, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 36, 203, 204, 27, 28, 29, 30, + 215, 41, 42, 34, 35, 36, 221, 32, 46, 34, + 35, 47, 43, 44, 206, 207, 46, 48, 46, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 238, + 245, 246, 247, 28, 29, 30, 5, 6, 46, 34, + 35, 46, 46, 32, 186, 34, 35, 46, 43, 44, + 47, 183, 46, 185, 32, 187, 34, 35, 46, 100, + 275, 36, 103, 38, 39, 1, 107, 47, 210, 46, + 111, 49, 46, 48, 115, 290, 46, 286, 46, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 297, 46, + 49, 47, 28, 29, 30, 46, 49, 47, 34, 35, + 36, 55, 47, 55, 47, 52, 47, 43, 44, 51, + 54, 243, 48, 52, 48, 52, 51, 46, 48, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 271, + 48, 48, 27, 28, 29, 30, 268, 51, 270, 34, + 35, 283, 46, 48, 286, 46, 48, 34, 43, 44, + 49, 49, 49, 285, 296, 297, 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, 49, 46, 54, 34, 11, 49, + 52, 13, 164, 245, 41, 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, 297, 182, 284, 34, 35, 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, 277, -1, -1, 34, 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, -1, - -1, 34, -1, -1, -1, -1, -1, -1, 41, 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, -1, -1, - 34, 35, 3, 4, 5, 6, 7, 8, 9, 10, + -1, 34, 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, -1, -1, 34, 3, 4, 5, 6, 7, 8, @@ -1103,19 +1054,13 @@ static const yytype_int16 yycheck[] = -1, 34, 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, -1, -1, 34, 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, -1, -1, 34, 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, -1, -1, 34, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, -1, -1, - -1, 27, 28, 29, 30, -1, -1, -1, 34, 35, - -1, -1, -1, -1, -1, -1, -1, 43, 44, 15, - 16, 17, 18, 19, 20, 21, 22, 23, -1, -1, - -1, -1, 28, 29, 30, -1, -1, -1, 34, 35, - -1, -1, -1, -1, -1, -1, -1, 43, 44 + -1, -1, -1, 34, 15, 16, 17, 18, 19, 20, + 21, 22, 23, -1, -1, -1, -1, 28, 29, 30, + -1, -1, -1, 34, 35, -1, -1, -1, -1, -1, + -1, -1, 43, 44, 1, -1, 3, 4, 5, 6, + 7, 8, 9, 10, 15, 16, 17, 18, 19, 20, + 21, 22, 23, -1, -1, -1, -1, 24, -1, 30, + -1, -1, -1, 34, 35 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -1123,39 +1068,35 @@ static const yytype_int16 yycheck[] = static const yytype_uint8 yystos[] = { 0, 57, 61, 0, 36, 38, 39, 59, 60, 31, - 136, 137, 137, 137, 1, 3, 4, 5, 6, 7, - 8, 9, 10, 24, 62, 76, 78, 79, 80, 89, - 90, 91, 95, 96, 97, 98, 111, 112, 113, 121, - 122, 123, 124, 139, 136, 37, 52, 40, 40, 46, + 129, 130, 130, 130, 1, 3, 4, 5, 6, 7, + 8, 9, 10, 24, 62, 76, 78, 79, 80, 87, + 88, 89, 91, 92, 93, 94, 105, 106, 107, 114, + 115, 116, 117, 132, 129, 37, 52, 40, 40, 46, 34, 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, 34, - 41, 140, 34, 140, 34, 140, 34, 140, 53, 53, - 34, 126, 140, 60, 63, 12, 50, 82, 101, 68, - 69, 92, 70, 71, 100, 101, 64, 65, 101, 116, - 66, 67, 72, 73, 125, 74, 75, 136, 77, 32, - 34, 35, 133, 60, 60, 47, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 30, 133, 134, 135, 46, - 58, 81, 133, 46, 58, 47, 46, 58, 99, 133, - 46, 58, 23, 30, 115, 133, 114, 46, 58, 46, - 46, 47, 58, 46, 47, 49, 49, 135, 135, 34, - 127, 128, 140, 55, 55, 34, 51, 47, 1, 60, - 93, 47, 52, 47, 127, 61, 54, 52, 51, 48, - 52, 51, 25, 26, 31, 32, 33, 133, 138, 1, - 60, 83, 46, 28, 29, 43, 44, 84, 85, 86, - 94, 104, 135, 48, 1, 60, 102, 115, 1, 60, - 117, 48, 48, 34, 140, 60, 32, 129, 133, 127, - 138, 46, 84, 85, 86, 87, 88, 103, 135, 48, - 93, 32, 49, 133, 32, 49, 133, 51, 84, 135, - 84, 46, 34, 140, 46, 103, 110, 48, 46, 14, - 27, 85, 86, 105, 106, 107, 118, 135, 48, 135, - 83, 84, 84, 51, 46, 140, 49, 49, 49, 49, - 138, 51, 51, 93, 102, 46, 117, 105, 135, 135, - 41, 42, 1, 11, 130, 131, 46, 54, 138, 83, - 138, 138, 102, 41, 42, 49, 60, 49, 52, 117, - 34, 140, 109, 87, 135, 108, 130, 13, 132, 140, - 132, 60, 119, 120, 133, 140, 87, 135, 52, 140, - 119 + 41, 133, 34, 133, 34, 133, 34, 133, 53, 53, + 34, 119, 133, 60, 63, 12, 50, 82, 97, 68, + 69, 90, 70, 71, 96, 97, 64, 65, 97, 110, + 66, 67, 72, 73, 118, 74, 75, 129, 77, 32, + 34, 35, 126, 60, 60, 47, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 30, 126, 127, 128, 46, + 58, 81, 126, 46, 58, 47, 46, 58, 95, 126, + 46, 58, 23, 30, 109, 126, 108, 46, 58, 46, + 46, 47, 58, 46, 47, 49, 49, 128, 128, 34, + 120, 121, 133, 55, 55, 34, 51, 47, 1, 60, + 98, 47, 52, 47, 120, 61, 54, 52, 51, 48, + 52, 51, 25, 26, 31, 32, 33, 126, 131, 98, + 46, 28, 29, 43, 44, 83, 84, 85, 86, 99, + 128, 48, 98, 109, 1, 60, 111, 48, 48, 34, + 133, 60, 32, 122, 126, 120, 131, 48, 98, 32, + 49, 126, 32, 49, 126, 83, 128, 83, 51, 46, + 34, 133, 48, 46, 14, 27, 84, 85, 100, 101, + 102, 128, 48, 128, 49, 49, 49, 49, 131, 98, + 111, 100, 128, 128, 41, 42, 1, 11, 123, 124, + 46, 54, 41, 42, 49, 60, 49, 52, 111, 34, + 133, 104, 86, 128, 103, 123, 13, 125, 133, 125, + 60, 112, 113, 126, 133, 86, 128, 52, 133, 112 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ @@ -1166,24 +1107,22 @@ static const yytype_uint8 yyr1[] = 62, 62, 67, 62, 68, 62, 62, 69, 62, 70, 62, 62, 71, 62, 72, 62, 62, 73, 62, 62, 74, 62, 75, 62, 62, 62, 77, 76, 78, 78, - 79, 81, 80, 82, 82, 83, 83, 83, 83, 84, - 85, 85, 85, 85, 86, 86, 86, 86, 87, 87, - 87, 88, 89, 89, 90, 92, 91, 93, 93, 93, - 93, 94, 95, 95, 96, 96, 96, 97, 99, 98, - 100, 100, 101, 101, 102, 102, 102, 102, 103, 103, - 103, 103, 104, 104, 104, 104, 104, 104, 104, 104, - 105, 105, 105, 105, 106, 106, 106, 106, 108, 107, - 109, 107, 110, 111, 111, 112, 114, 113, 115, 115, - 115, 115, 116, 116, 117, 117, 117, 117, 118, 119, - 119, 120, 120, 121, 121, 122, 122, 123, 123, 125, - 124, 126, 124, 127, 127, 128, 128, 128, 128, 129, - 129, 130, 130, 131, 131, 131, 131, 131, 131, 131, - 132, 132, 133, 133, 134, 134, 134, 134, 134, 134, - 134, 134, 134, 134, 135, 135, 135, 135, 136, 136, - 137, 137, 138, 138, 138, 138, 138, 138, 139, 139, - 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, - 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, - 140, 140, 140, 140, 140, 140, 140, 140 + 79, 81, 80, 82, 82, 83, 84, 84, 84, 84, + 85, 85, 85, 85, 86, 86, 86, 87, 87, 88, + 90, 89, 91, 91, 92, 92, 92, 93, 95, 94, + 96, 96, 97, 97, 98, 98, 98, 98, 99, 99, + 99, 99, 100, 100, 100, 100, 101, 101, 101, 101, + 103, 102, 104, 102, 105, 105, 106, 108, 107, 109, + 109, 109, 109, 110, 110, 111, 111, 111, 111, 112, + 112, 113, 113, 114, 114, 115, 115, 116, 116, 118, + 117, 119, 117, 120, 120, 121, 121, 121, 121, 122, + 122, 123, 123, 124, 124, 124, 124, 124, 124, 124, + 125, 125, 126, 126, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 128, 128, 128, 128, 129, 129, + 130, 130, 131, 131, 131, 131, 131, 131, 132, 132, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 133, 133, 133 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -1194,15 +1133,13 @@ static const yytype_int8 yyr2[] = 3, 1, 0, 3, 0, 3, 1, 0, 3, 0, 3, 1, 0, 3, 0, 3, 1, 0, 3, 1, 0, 3, 0, 3, 1, 2, 0, 6, 2, 2, - 1, 0, 6, 2, 0, 4, 3, 2, 0, 2, - 3, 3, 2, 1, 3, 3, 2, 1, 2, 2, - 1, 1, 2, 2, 1, 0, 5, 4, 3, 2, - 0, 1, 2, 2, 4, 4, 1, 1, 0, 6, + 1, 0, 6, 2, 0, 2, 3, 3, 2, 1, + 3, 3, 2, 1, 2, 2, 1, 2, 2, 1, + 0, 5, 2, 2, 4, 4, 1, 1, 0, 6, 2, 0, 1, 1, 4, 3, 2, 0, 1, 3, - 2, 1, 1, 3, 2, 4, 2, 4, 2, 1, - 2, 2, 1, 1, 2, 3, 2, 3, 0, 5, - 0, 5, 1, 2, 2, 1, 0, 6, 3, 1, - 1, 1, 2, 0, 4, 3, 2, 0, 1, 3, + 2, 1, 2, 2, 1, 1, 2, 3, 2, 3, + 0, 5, 0, 5, 2, 2, 1, 0, 6, 3, + 1, 1, 1, 2, 0, 4, 3, 2, 0, 3, 1, 1, 1, 6, 6, 9, 9, 2, 2, 0, 5, 0, 5, 3, 1, 1, 3, 1, 0, 1, 1, 1, 0, 0, 3, 5, 4, 6, 3, 5, @@ -1799,21 +1736,21 @@ YYLTYPE yylloc = yyloc_default; #line 185 "src/Slice/Grammar.y" { } -#line 1803 "src/Slice/Grammar.cpp" +#line 1740 "src/Slice/Grammar.cpp" break; case 3: /* opt_semicolon: ';' */ #line 193 "src/Slice/Grammar.y" { } -#line 1810 "src/Slice/Grammar.cpp" +#line 1747 "src/Slice/Grammar.cpp" break; case 4: /* opt_semicolon: %empty */ #line 196 "src/Slice/Grammar.y" { } -#line 1817 "src/Slice/Grammar.cpp" +#line 1754 "src/Slice/Grammar.cpp" break; case 5: /* global_meta_data: ICE_GLOBAL_METADATA_OPEN string_list ICE_GLOBAL_METADATA_CLOSE */ @@ -1821,7 +1758,7 @@ YYLTYPE yylloc = yyloc_default; { yyval = yyvsp[-1]; } -#line 1825 "src/Slice/Grammar.cpp" +#line 1762 "src/Slice/Grammar.cpp" break; case 6: /* global_meta_data: ICE_GLOBAL_METADATA_IGNORE string_list ICE_GLOBAL_METADATA_CLOSE */ @@ -1830,7 +1767,7 @@ YYLTYPE yylloc = yyloc_default; unit->error("global metadata must appear before any definitions"); yyval = yyvsp[-1]; // Dummy } -#line 1834 "src/Slice/Grammar.cpp" +#line 1771 "src/Slice/Grammar.cpp" break; case 7: /* meta_data: ICE_METADATA_OPEN string_list ICE_METADATA_CLOSE */ @@ -1838,7 +1775,7 @@ YYLTYPE yylloc = yyloc_default; { yyval = yyvsp[-1]; } -#line 1842 "src/Slice/Grammar.cpp" +#line 1779 "src/Slice/Grammar.cpp" break; case 8: /* meta_data: %empty */ @@ -1846,7 +1783,7 @@ YYLTYPE yylloc = yyloc_default; { yyval = new StringListTok; } -#line 1850 "src/Slice/Grammar.cpp" +#line 1787 "src/Slice/Grammar.cpp" break; case 9: /* definitions: definitions global_meta_data */ @@ -1858,7 +1795,7 @@ YYLTYPE yylloc = yyloc_default; unit->addGlobalMetaData(metaData->v); } } -#line 1862 "src/Slice/Grammar.cpp" +#line 1799 "src/Slice/Grammar.cpp" break; case 10: /* definitions: definitions meta_data definition */ @@ -1871,14 +1808,14 @@ YYLTYPE yylloc = yyloc_default; contained->setMetaData(metaData->v); } } -#line 1875 "src/Slice/Grammar.cpp" +#line 1812 "src/Slice/Grammar.cpp" break; case 11: /* definitions: %empty */ #line 248 "src/Slice/Grammar.y" { } -#line 1882 "src/Slice/Grammar.cpp" +#line 1819 "src/Slice/Grammar.cpp" break; case 12: /* $@1: %empty */ @@ -1886,7 +1823,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0 || ModulePtr::dynamicCast(yyvsp[0])); } -#line 1890 "src/Slice/Grammar.cpp" +#line 1827 "src/Slice/Grammar.cpp" break; case 14: /* $@2: %empty */ @@ -1894,7 +1831,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0 || ClassDeclPtr::dynamicCast(yyvsp[0])); } -#line 1898 "src/Slice/Grammar.cpp" +#line 1835 "src/Slice/Grammar.cpp" break; case 16: /* definition: class_decl */ @@ -1902,7 +1839,7 @@ YYLTYPE yylloc = yyloc_default; { unit->error("`;' missing after class forward declaration"); } -#line 1906 "src/Slice/Grammar.cpp" +#line 1843 "src/Slice/Grammar.cpp" break; case 17: /* $@3: %empty */ @@ -1910,7 +1847,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0 || ClassDefPtr::dynamicCast(yyvsp[0])); } -#line 1914 "src/Slice/Grammar.cpp" +#line 1851 "src/Slice/Grammar.cpp" break; case 19: /* $@4: %empty */ @@ -1918,7 +1855,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0 || InterfaceDeclPtr::dynamicCast(yyvsp[0])); } -#line 1922 "src/Slice/Grammar.cpp" +#line 1859 "src/Slice/Grammar.cpp" break; case 21: /* definition: interface_decl */ @@ -1926,7 +1863,7 @@ YYLTYPE yylloc = yyloc_default; { unit->error("`;' missing after interface forward declaration"); } -#line 1930 "src/Slice/Grammar.cpp" +#line 1867 "src/Slice/Grammar.cpp" break; case 22: /* $@5: %empty */ @@ -1934,7 +1871,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0 || InterfaceDefPtr::dynamicCast(yyvsp[0])); } -#line 1938 "src/Slice/Grammar.cpp" +#line 1875 "src/Slice/Grammar.cpp" break; case 24: /* $@6: %empty */ @@ -1942,7 +1879,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0); } -#line 1946 "src/Slice/Grammar.cpp" +#line 1883 "src/Slice/Grammar.cpp" break; case 26: /* definition: exception_decl */ @@ -1950,7 +1887,7 @@ YYLTYPE yylloc = yyloc_default; { unit->error("`;' missing after exception forward declaration"); } -#line 1954 "src/Slice/Grammar.cpp" +#line 1891 "src/Slice/Grammar.cpp" break; case 27: /* $@7: %empty */ @@ -1958,7 +1895,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0 || ExceptionPtr::dynamicCast(yyvsp[0])); } -#line 1962 "src/Slice/Grammar.cpp" +#line 1899 "src/Slice/Grammar.cpp" break; case 29: /* $@8: %empty */ @@ -1966,7 +1903,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0); } -#line 1970 "src/Slice/Grammar.cpp" +#line 1907 "src/Slice/Grammar.cpp" break; case 31: /* definition: struct_decl */ @@ -1974,7 +1911,7 @@ YYLTYPE yylloc = yyloc_default; { unit->error("`;' missing after struct forward declaration"); } -#line 1978 "src/Slice/Grammar.cpp" +#line 1915 "src/Slice/Grammar.cpp" break; case 32: /* $@9: %empty */ @@ -1982,7 +1919,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0 || StructPtr::dynamicCast(yyvsp[0])); } -#line 1986 "src/Slice/Grammar.cpp" +#line 1923 "src/Slice/Grammar.cpp" break; case 34: /* $@10: %empty */ @@ -1990,7 +1927,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0 || SequencePtr::dynamicCast(yyvsp[0])); } -#line 1994 "src/Slice/Grammar.cpp" +#line 1931 "src/Slice/Grammar.cpp" break; case 36: /* definition: sequence_def */ @@ -1998,7 +1935,7 @@ YYLTYPE yylloc = yyloc_default; { unit->error("`;' missing after sequence definition"); } -#line 2002 "src/Slice/Grammar.cpp" +#line 1939 "src/Slice/Grammar.cpp" break; case 37: /* $@11: %empty */ @@ -2006,7 +1943,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0 || DictionaryPtr::dynamicCast(yyvsp[0])); } -#line 2010 "src/Slice/Grammar.cpp" +#line 1947 "src/Slice/Grammar.cpp" break; case 39: /* definition: dictionary_def */ @@ -2014,7 +1951,7 @@ YYLTYPE yylloc = yyloc_default; { unit->error("`;' missing after dictionary definition"); } -#line 2018 "src/Slice/Grammar.cpp" +#line 1955 "src/Slice/Grammar.cpp" break; case 40: /* $@12: %empty */ @@ -2022,7 +1959,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0 || EnumPtr::dynamicCast(yyvsp[0])); } -#line 2026 "src/Slice/Grammar.cpp" +#line 1963 "src/Slice/Grammar.cpp" break; case 42: /* $@13: %empty */ @@ -2030,7 +1967,7 @@ YYLTYPE yylloc = yyloc_default; { assert(yyvsp[0] == 0 || ConstPtr::dynamicCast(yyvsp[0])); } -#line 2034 "src/Slice/Grammar.cpp" +#line 1971 "src/Slice/Grammar.cpp" break; case 44: /* definition: const_def */ @@ -2038,7 +1975,7 @@ YYLTYPE yylloc = yyloc_default; { unit->error("`;' missing after const definition"); } -#line 2042 "src/Slice/Grammar.cpp" +#line 1979 "src/Slice/Grammar.cpp" break; case 45: /* definition: error ';' */ @@ -2046,7 +1983,7 @@ YYLTYPE yylloc = yyloc_default; { yyerrok; } -#line 2050 "src/Slice/Grammar.cpp" +#line 1987 "src/Slice/Grammar.cpp" break; case 46: /* @14: %empty */ @@ -2066,7 +2003,7 @@ YYLTYPE yylloc = yyloc_default; yyval = 0; } } -#line 2070 "src/Slice/Grammar.cpp" +#line 2007 "src/Slice/Grammar.cpp" break; case 47: /* module_def: ICE_MODULE ICE_IDENTIFIER @14 '{' definitions '}' */ @@ -2082,7 +2019,7 @@ YYLTYPE yylloc = yyloc_default; yyval = 0; } } -#line 2086 "src/Slice/Grammar.cpp" +#line 2023 "src/Slice/Grammar.cpp" break; case 48: /* exception_id: ICE_EXCEPTION ICE_IDENTIFIER */ @@ -2090,7 +2027,7 @@ YYLTYPE yylloc = yyloc_default; { yyval = yyvsp[0]; } -#line 2094 "src/Slice/Grammar.cpp" +#line 2031 "src/Slice/Grammar.cpp" break; case 49: /* exception_id: ICE_EXCEPTION keyword */ @@ -2100,7 +2037,7 @@ YYLTYPE yylloc = yyloc_default; unit->error("keyword `" + ident->v + "' cannot be used as exception name"); yyval = yyvsp[0]; // Dummy } -#line 2104 "src/Slice/Grammar.cpp" +#line 2041 "src/Slice/Grammar.cpp" break; case 50: /* exception_decl: exception_id */ @@ -2109,7 +2046,7 @@ YYLTYPE yylloc = yyloc_default; unit->error("exceptions cannot be forward declared"); yyval = 0; } -#line 2113 "src/Slice/Grammar.cpp" +#line 2050 "src/Slice/Grammar.cpp" break; case 51: /* @15: %empty */ @@ -2126,10 +2063,10 @@ YYLTYPE yylloc = yyloc_default; } yyval = ex; } -#line 2130 "src/Slice/Grammar.cpp" +#line 2067 "src/Slice/Grammar.cpp" break; - case 52: /* exception_def: exception_id exception_extends @15 '{' exception_exports '}' */ + case 52: /* exception_def: exception_id exception_extends @15 '{' data_members '}' */ #line 429 "src/Slice/Grammar.y" { if(yyvsp[-3]) @@ -2138,7 +2075,7 @@ YYLTYPE yylloc = yyloc_default; } yyval = yyvsp[-3]; } -#line 2142 "src/Slice/Grammar.cpp" +#line 2079 "src/Slice/Grammar.cpp" break; case 53: /* exception_extends: extends scoped_name */ @@ -2150,7 +2087,7 @@ YYLTYPE yylloc = yyloc_default; cont->checkIntroduced(scoped->v); yyval = contained; } -#line 2154 "src/Slice/Grammar.cpp" +#line 2091 "src/Slice/Grammar.cpp" break; case 54: /* exception_extends: %empty */ @@ -2158,59 +2095,23 @@ YYLTYPE yylloc = yyloc_default; { yyval = 0; } -#line 2162 "src/Slice/Grammar.cpp" +#line 2099 "src/Slice/Grammar.cpp" break; - case 55: /* exception_exports: meta_data exception_export ';' exception_exports */ + case 55: /* type_id: type ICE_IDENTIFIER */ #line 459 "src/Slice/Grammar.y" -{ - StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); - ContainedPtr contained = ContainedPtr::dynamicCast(yyvsp[-2]); - if(contained && !metaData->v.empty()) - { - contained->setMetaData(metaData->v); - } -} -#line 2175 "src/Slice/Grammar.cpp" - break; - - case 56: /* exception_exports: error ';' exception_exports */ -#line 468 "src/Slice/Grammar.y" -{ -} -#line 2182 "src/Slice/Grammar.cpp" - break; - - case 57: /* exception_exports: meta_data exception_export */ -#line 471 "src/Slice/Grammar.y" -{ - unit->error("`;' missing after definition"); -} -#line 2190 "src/Slice/Grammar.cpp" - break; - - case 58: /* exception_exports: %empty */ -#line 475 "src/Slice/Grammar.y" -{ -} -#line 2197 "src/Slice/Grammar.cpp" - break; - - case 59: /* type_id: type ICE_IDENTIFIER */ -#line 483 "src/Slice/Grammar.y" { TypePtr type = TypePtr::dynamicCast(yyvsp[-1]); StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); - checkIdentifier(ident->v); TypeStringTokPtr typestring = new TypeStringTok; typestring->v = make_pair(type, ident->v); yyval = typestring; } -#line 2210 "src/Slice/Grammar.cpp" +#line 2111 "src/Slice/Grammar.cpp" break; - case 60: /* tag: ICE_TAG_OPEN ICE_INTEGER_LITERAL ')' */ -#line 497 "src/Slice/Grammar.y" + case 56: /* tag: ICE_TAG_OPEN ICE_INTEGER_LITERAL ')' */ +#line 472 "src/Slice/Grammar.y" { IntegerTokPtr i = IntegerTokPtr::dynamicCast(yyvsp[-1]); @@ -2228,11 +2129,11 @@ YYLTYPE yylloc = yyloc_default; TaggedDefTokPtr m = new TaggedDefTok(tag); yyval = m; } -#line 2232 "src/Slice/Grammar.cpp" +#line 2133 "src/Slice/Grammar.cpp" break; - case 61: /* tag: ICE_TAG_OPEN scoped_name ')' */ -#line 515 "src/Slice/Grammar.y" + case 57: /* tag: ICE_TAG_OPEN scoped_name ')' */ +#line 490 "src/Slice/Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[-1]); @@ -2311,31 +2212,31 @@ YYLTYPE yylloc = yyloc_default; TaggedDefTokPtr m = new TaggedDefTok(tag); yyval = m; } -#line 2315 "src/Slice/Grammar.cpp" +#line 2216 "src/Slice/Grammar.cpp" break; - case 62: /* tag: ICE_TAG_OPEN ')' */ -#line 594 "src/Slice/Grammar.y" + case 58: /* tag: ICE_TAG_OPEN ')' */ +#line 569 "src/Slice/Grammar.y" { unit->error("missing tag"); TaggedDefTokPtr m = new TaggedDefTok(-1); // Dummy yyval = m; } -#line 2325 "src/Slice/Grammar.cpp" +#line 2226 "src/Slice/Grammar.cpp" break; - case 63: /* tag: ICE_TAG */ -#line 600 "src/Slice/Grammar.y" + case 59: /* tag: ICE_TAG */ +#line 575 "src/Slice/Grammar.y" { unit->error("missing tag"); TaggedDefTokPtr m = new TaggedDefTok(-1); // Dummy yyval = m; } -#line 2335 "src/Slice/Grammar.cpp" +#line 2236 "src/Slice/Grammar.cpp" break; - case 64: /* optional: ICE_OPTIONAL_OPEN ICE_INTEGER_LITERAL ')' */ -#line 611 "src/Slice/Grammar.y" + case 60: /* optional: ICE_OPTIONAL_OPEN ICE_INTEGER_LITERAL ')' */ +#line 586 "src/Slice/Grammar.y" { IntegerTokPtr i = IntegerTokPtr::dynamicCast(yyvsp[-1]); @@ -2353,11 +2254,11 @@ YYLTYPE yylloc = yyloc_default; TaggedDefTokPtr m = new TaggedDefTok(tag); yyval = m; } -#line 2357 "src/Slice/Grammar.cpp" +#line 2258 "src/Slice/Grammar.cpp" break; - case 65: /* optional: ICE_OPTIONAL_OPEN scoped_name ')' */ -#line 629 "src/Slice/Grammar.y" + case 61: /* optional: ICE_OPTIONAL_OPEN scoped_name ')' */ +#line 604 "src/Slice/Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[-1]); ContainerPtr cont = unit->currentContainer(); @@ -2435,31 +2336,31 @@ YYLTYPE yylloc = yyloc_default; TaggedDefTokPtr m = new TaggedDefTok(tag); yyval = m; } -#line 2439 "src/Slice/Grammar.cpp" +#line 2340 "src/Slice/Grammar.cpp" break; - case 66: /* optional: ICE_OPTIONAL_OPEN ')' */ -#line 707 "src/Slice/Grammar.y" + case 62: /* optional: ICE_OPTIONAL_OPEN ')' */ +#line 682 "src/Slice/Grammar.y" { unit->error("missing tag"); TaggedDefTokPtr m = new TaggedDefTok(-1); // Dummy yyval = m; } -#line 2449 "src/Slice/Grammar.cpp" +#line 2350 "src/Slice/Grammar.cpp" break; - case 67: /* optional: ICE_OPTIONAL */ -#line 713 "src/Slice/Grammar.y" + case 63: /* optional: ICE_OPTIONAL */ +#line 688 "src/Slice/Grammar.y" { unit->error("missing tag"); TaggedDefTokPtr m = new TaggedDefTok(-1); // Dummy yyval = m; } -#line 2459 "src/Slice/Grammar.cpp" +#line 2360 "src/Slice/Grammar.cpp" break; - case 68: /* tagged_type_id: tag type_id */ -#line 724 "src/Slice/Grammar.y" + case 64: /* tagged_type_id: tag type_id */ +#line 699 "src/Slice/Grammar.y" { TaggedDefTokPtr m = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[0]); @@ -2468,11 +2369,11 @@ YYLTYPE yylloc = yyloc_default; m->name = ts->v.second; yyval = m; } -#line 2472 "src/Slice/Grammar.cpp" +#line 2373 "src/Slice/Grammar.cpp" break; - case 69: /* tagged_type_id: optional type_id */ -#line 733 "src/Slice/Grammar.y" + case 65: /* tagged_type_id: optional type_id */ +#line 708 "src/Slice/Grammar.y" { TaggedDefTokPtr m = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[0]); @@ -2481,11 +2382,11 @@ YYLTYPE yylloc = yyloc_default; m->name = ts->v.second; yyval = m; } -#line 2485 "src/Slice/Grammar.cpp" +#line 2386 "src/Slice/Grammar.cpp" break; - case 70: /* tagged_type_id: type_id */ -#line 742 "src/Slice/Grammar.y" + case 66: /* tagged_type_id: type_id */ +#line 717 "src/Slice/Grammar.y" { TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[0]); TaggedDefTokPtr m = new TaggedDefTok(-1); @@ -2493,38 +2394,38 @@ YYLTYPE yylloc = yyloc_default; m->name = ts->v.second; yyval = m; } -#line 2497 "src/Slice/Grammar.cpp" +#line 2398 "src/Slice/Grammar.cpp" break; - case 72: /* struct_id: ICE_STRUCT ICE_IDENTIFIER */ -#line 761 "src/Slice/Grammar.y" + case 67: /* struct_id: ICE_STRUCT ICE_IDENTIFIER */ +#line 730 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 2505 "src/Slice/Grammar.cpp" +#line 2406 "src/Slice/Grammar.cpp" break; - case 73: /* struct_id: ICE_STRUCT keyword */ -#line 765 "src/Slice/Grammar.y" + case 68: /* struct_id: ICE_STRUCT keyword */ +#line 734 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); unit->error("keyword `" + ident->v + "' cannot be used as struct name"); yyval = yyvsp[0]; // Dummy } -#line 2515 "src/Slice/Grammar.cpp" +#line 2416 "src/Slice/Grammar.cpp" break; - case 74: /* struct_decl: struct_id */ -#line 776 "src/Slice/Grammar.y" + case 69: /* struct_decl: struct_id */ +#line 745 "src/Slice/Grammar.y" { unit->error("structs cannot be forward declared"); yyval = 0; // Dummy } -#line 2524 "src/Slice/Grammar.cpp" +#line 2425 "src/Slice/Grammar.cpp" break; - case 75: /* @16: %empty */ -#line 786 "src/Slice/Grammar.y" + case 70: /* @16: %empty */ +#line 755 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); @@ -2542,11 +2443,11 @@ YYLTYPE yylloc = yyloc_default; } yyval = st; } -#line 2546 "src/Slice/Grammar.cpp" +#line 2447 "src/Slice/Grammar.cpp" break; - case 76: /* struct_def: struct_id @16 '{' struct_exports '}' */ -#line 804 "src/Slice/Grammar.y" + case 71: /* struct_def: struct_id @16 '{' data_members '}' */ +#line 773 "src/Slice/Grammar.y" { if(yyvsp[-3]) { @@ -2564,64 +2465,29 @@ YYLTYPE yylloc = yyloc_default; unit->error("struct `" + st->name() + "' must have at least one member"); // $$ is a dummy } } -#line 2568 "src/Slice/Grammar.cpp" +#line 2469 "src/Slice/Grammar.cpp" break; - case 77: /* struct_exports: meta_data struct_export ';' struct_exports */ -#line 827 "src/Slice/Grammar.y" -{ - StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); - ContainedPtr contained = ContainedPtr::dynamicCast(yyvsp[-2]); - if(contained && !metaData->v.empty()) - { - contained->setMetaData(metaData->v); - } -} -#line 2581 "src/Slice/Grammar.cpp" - break; - - case 78: /* struct_exports: error ';' struct_exports */ -#line 836 "src/Slice/Grammar.y" -{ -} -#line 2588 "src/Slice/Grammar.cpp" - break; - - case 79: /* struct_exports: meta_data struct_export */ -#line 839 "src/Slice/Grammar.y" -{ - unit->error("`;' missing after definition"); -} -#line 2596 "src/Slice/Grammar.cpp" - break; - - case 80: /* struct_exports: %empty */ -#line 843 "src/Slice/Grammar.y" -{ -} -#line 2603 "src/Slice/Grammar.cpp" - break; - - case 82: /* class_name: ICE_CLASS ICE_IDENTIFIER */ -#line 857 "src/Slice/Grammar.y" + case 72: /* class_name: ICE_CLASS ICE_IDENTIFIER */ +#line 796 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 2611 "src/Slice/Grammar.cpp" +#line 2477 "src/Slice/Grammar.cpp" break; - case 83: /* class_name: ICE_CLASS keyword */ -#line 861 "src/Slice/Grammar.y" + case 73: /* class_name: ICE_CLASS keyword */ +#line 800 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); unit->error("keyword `" + ident->v + "' cannot be used as class name"); yyval = yyvsp[0]; // Dummy } -#line 2621 "src/Slice/Grammar.cpp" +#line 2487 "src/Slice/Grammar.cpp" break; - case 84: /* class_id: ICE_CLASS ICE_IDENT_OPEN ICE_INTEGER_LITERAL ')' */ -#line 872 "src/Slice/Grammar.y" + case 74: /* class_id: ICE_CLASS ICE_IDENT_OPEN ICE_INTEGER_LITERAL ')' */ +#line 811 "src/Slice/Grammar.y" { IceUtil::Int64 id = IntegerTokPtr::dynamicCast(yyvsp[-1])->v; if(id < 0) @@ -2646,11 +2512,11 @@ YYLTYPE yylloc = yyloc_default; classId->t = static_cast(id); yyval = classId; } -#line 2650 "src/Slice/Grammar.cpp" +#line 2516 "src/Slice/Grammar.cpp" break; - case 85: /* class_id: ICE_CLASS ICE_IDENT_OPEN scoped_name ')' */ -#line 897 "src/Slice/Grammar.y" + case 75: /* class_id: ICE_CLASS ICE_IDENT_OPEN scoped_name ')' */ +#line 836 "src/Slice/Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[-1]); @@ -2740,33 +2606,33 @@ YYLTYPE yylloc = yyloc_default; yyval = classId; } -#line 2744 "src/Slice/Grammar.cpp" +#line 2610 "src/Slice/Grammar.cpp" break; - case 86: /* class_id: class_name */ -#line 987 "src/Slice/Grammar.y" + case 76: /* class_id: class_name */ +#line 926 "src/Slice/Grammar.y" { ClassIdTokPtr classId = new ClassIdTok(); classId->v = StringTokPtr::dynamicCast(yyvsp[0])->v; classId->t = -1; yyval = classId; } -#line 2755 "src/Slice/Grammar.cpp" +#line 2621 "src/Slice/Grammar.cpp" break; - case 87: /* class_decl: class_name */ -#line 999 "src/Slice/Grammar.y" + case 77: /* class_decl: class_name */ +#line 938 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); ClassDeclPtr cl = cont->createClassDecl(ident->v); yyval = cl; } -#line 2766 "src/Slice/Grammar.cpp" +#line 2632 "src/Slice/Grammar.cpp" break; - case 88: /* @17: %empty */ -#line 1011 "src/Slice/Grammar.y" + case 78: /* @17: %empty */ +#line 950 "src/Slice/Grammar.y" { ClassIdTokPtr ident = ClassIdTokPtr::dynamicCast(yyvsp[-1]); ContainerPtr cont = unit->currentContainer(); @@ -2783,11 +2649,11 @@ YYLTYPE yylloc = yyloc_default; yyval = 0; } } -#line 2787 "src/Slice/Grammar.cpp" +#line 2653 "src/Slice/Grammar.cpp" break; - case 89: /* class_def: class_id class_extends @17 '{' class_exports '}' */ -#line 1028 "src/Slice/Grammar.y" + case 79: /* class_def: class_id class_extends @17 '{' data_members '}' */ +#line 967 "src/Slice/Grammar.y" { if(yyvsp[-3]) { @@ -2799,11 +2665,11 @@ YYLTYPE yylloc = yyloc_default; yyval = 0; } } -#line 2803 "src/Slice/Grammar.cpp" +#line 2669 "src/Slice/Grammar.cpp" break; - case 90: /* class_extends: extends scoped_name */ -#line 1045 "src/Slice/Grammar.y" + case 80: /* class_extends: extends scoped_name */ +#line 984 "src/Slice/Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); @@ -2837,33 +2703,33 @@ YYLTYPE yylloc = yyloc_default; } } } -#line 2841 "src/Slice/Grammar.cpp" +#line 2707 "src/Slice/Grammar.cpp" break; - case 91: /* class_extends: %empty */ -#line 1079 "src/Slice/Grammar.y" + case 81: /* class_extends: %empty */ +#line 1018 "src/Slice/Grammar.y" { yyval = 0; } -#line 2849 "src/Slice/Grammar.cpp" +#line 2715 "src/Slice/Grammar.cpp" break; - case 92: /* extends: ICE_EXTENDS */ -#line 1088 "src/Slice/Grammar.y" + case 82: /* extends: ICE_EXTENDS */ +#line 1027 "src/Slice/Grammar.y" { } -#line 2856 "src/Slice/Grammar.cpp" +#line 2722 "src/Slice/Grammar.cpp" break; - case 93: /* extends: ':' */ -#line 1091 "src/Slice/Grammar.y" + case 83: /* extends: ':' */ +#line 1030 "src/Slice/Grammar.y" { } -#line 2863 "src/Slice/Grammar.cpp" +#line 2729 "src/Slice/Grammar.cpp" break; - case 94: /* class_exports: meta_data class_export ';' class_exports */ -#line 1099 "src/Slice/Grammar.y" + case 84: /* data_members: meta_data data_member ';' data_members */ +#line 1038 "src/Slice/Grammar.y" { StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); ContainedPtr contained = ContainedPtr::dynamicCast(yyvsp[-2]); @@ -2872,33 +2738,33 @@ YYLTYPE yylloc = yyloc_default; contained->setMetaData(metaData->v); } } -#line 2876 "src/Slice/Grammar.cpp" +#line 2742 "src/Slice/Grammar.cpp" break; - case 95: /* class_exports: error ';' class_exports */ -#line 1108 "src/Slice/Grammar.y" + case 85: /* data_members: error ';' data_members */ +#line 1047 "src/Slice/Grammar.y" { } -#line 2883 "src/Slice/Grammar.cpp" +#line 2749 "src/Slice/Grammar.cpp" break; - case 96: /* class_exports: meta_data class_export */ -#line 1111 "src/Slice/Grammar.y" + case 86: /* data_members: meta_data data_member */ +#line 1050 "src/Slice/Grammar.y" { unit->error("`;' missing after definition"); } -#line 2891 "src/Slice/Grammar.cpp" +#line 2757 "src/Slice/Grammar.cpp" break; - case 97: /* class_exports: %empty */ -#line 1115 "src/Slice/Grammar.y" + case 87: /* data_members: %empty */ +#line 1054 "src/Slice/Grammar.y" { } -#line 2898 "src/Slice/Grammar.cpp" +#line 2764 "src/Slice/Grammar.cpp" break; - case 98: /* data_member: tagged_type_id */ -#line 1123 "src/Slice/Grammar.y" + case 88: /* data_member: tagged_type_id */ +#line 1062 "src/Slice/Grammar.y" { TaggedDefTokPtr def = TaggedDefTokPtr::dynamicCast(yyvsp[0]); ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); @@ -2910,7 +2776,15 @@ YYLTYPE yylloc = yyloc_default; StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); if(st) { - dm = st->createDataMember(def->name, def->type, def->isTagged, def->tag, 0, "", ""); + if (def->isTagged) + { + unit->error("tagged data members are not supported in structs"); + dm = st->createDataMember(def->name, def->type, false, 0, 0, "", ""); // Dummy + } + else + { + dm = st->createDataMember(def->name, def->type, false, -1, 0, "", ""); + } } ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); if(ex) @@ -2920,11 +2794,11 @@ YYLTYPE yylloc = yyloc_default; unit->currentContainer()->checkIntroduced(def->name, dm); yyval = dm; } -#line 2924 "src/Slice/Grammar.cpp" +#line 2798 "src/Slice/Grammar.cpp" break; - case 99: /* data_member: tagged_type_id '=' const_initializer */ -#line 1145 "src/Slice/Grammar.y" + case 89: /* data_member: tagged_type_id '=' const_initializer */ +#line 1092 "src/Slice/Grammar.y" { TaggedDefTokPtr def = TaggedDefTokPtr::dynamicCast(yyvsp[-2]); ConstDefTokPtr value = ConstDefTokPtr::dynamicCast(yyvsp[0]); @@ -2939,8 +2813,16 @@ YYLTYPE yylloc = yyloc_default; StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); if(st) { - dm = st->createDataMember(def->name, def->type, def->isTagged, def->tag, value->v, - value->valueAsString, value->valueAsLiteral); + if (def->isTagged) + { + unit->error("tagged data members are not supported in structs"); + dm = st->createDataMember(def->name, def->type, false, 0, 0, "", ""); // Dummy + } + else + { + dm = st->createDataMember(def->name, def->type, false, -1, value->v, + value->valueAsString, value->valueAsLiteral); + } } ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); if(ex) @@ -2951,11 +2833,11 @@ YYLTYPE yylloc = yyloc_default; unit->currentContainer()->checkIntroduced(def->name, dm); yyval = dm; } -#line 2955 "src/Slice/Grammar.cpp" +#line 2837 "src/Slice/Grammar.cpp" break; - case 100: /* data_member: type keyword */ -#line 1172 "src/Slice/Grammar.y" + case 90: /* data_member: type keyword */ +#line 1127 "src/Slice/Grammar.y" { TypePtr type = TypePtr::dynamicCast(yyvsp[-1]); string name = StringTokPtr::dynamicCast(yyvsp[0])->v; @@ -2977,11 +2859,11 @@ YYLTYPE yylloc = yyloc_default; assert(yyval); unit->error("keyword `" + name + "' cannot be used as data member name"); } -#line 2981 "src/Slice/Grammar.cpp" +#line 2863 "src/Slice/Grammar.cpp" break; - case 101: /* data_member: type */ -#line 1194 "src/Slice/Grammar.y" + case 91: /* data_member: type */ +#line 1149 "src/Slice/Grammar.y" { TypePtr type = TypePtr::dynamicCast(yyvsp[0]); ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); @@ -3002,157 +2884,50 @@ YYLTYPE yylloc = yyloc_default; assert(yyval); unit->error("missing data member name"); } -#line 3006 "src/Slice/Grammar.cpp" - break; - - case 102: /* struct_data_member: type_id */ -#line 1220 "src/Slice/Grammar.y" -{ - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[0]); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - DataMemberPtr dm = st->createDataMember(ts->v.second, ts->v.first, false, -1, 0, "", ""); - unit->currentContainer()->checkIntroduced(ts->v.second, dm); - yyval = dm; -} -#line 3019 "src/Slice/Grammar.cpp" - break; - - case 103: /* struct_data_member: type_id '=' const_initializer */ -#line 1229 "src/Slice/Grammar.y" -{ - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[-2]); - ConstDefTokPtr value = ConstDefTokPtr::dynamicCast(yyvsp[0]); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - DataMemberPtr dm = st->createDataMember(ts->v.second, ts->v.first, false, -1, value->v, - value->valueAsString, value->valueAsLiteral); - unit->currentContainer()->checkIntroduced(ts->v.second, dm); - yyval = dm; -} -#line 3034 "src/Slice/Grammar.cpp" - break; - - case 104: /* struct_data_member: tag type_id */ -#line 1240 "src/Slice/Grammar.y" -{ - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[0]); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - yyval = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy - assert(yyval); - unit->error("tagged data members are not supported in structs"); -} -#line 3047 "src/Slice/Grammar.cpp" - break; - - case 105: /* struct_data_member: tag type_id '=' const_initializer */ -#line 1249 "src/Slice/Grammar.y" -{ - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[-2]); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - yyval = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy - assert(yyval); - unit->error("tagged data members are not supported in structs"); -} -#line 3060 "src/Slice/Grammar.cpp" - break; - - case 106: /* struct_data_member: optional type_id */ -#line 1258 "src/Slice/Grammar.y" -{ - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[0]); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - yyval = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy - assert(yyval); - unit->error("tagged data members are not supported in structs"); -} -#line 3073 "src/Slice/Grammar.cpp" - break; - - case 107: /* struct_data_member: optional type_id '=' const_initializer */ -#line 1267 "src/Slice/Grammar.y" -{ - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast(yyvsp[-2]); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - yyval = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy - assert(yyval); - unit->error("tagged data members are not supported in structs"); -} -#line 3086 "src/Slice/Grammar.cpp" - break; - - case 108: /* struct_data_member: type keyword */ -#line 1276 "src/Slice/Grammar.y" -{ - TypePtr type = TypePtr::dynamicCast(yyvsp[-1]); - string name = StringTokPtr::dynamicCast(yyvsp[0])->v; - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - yyval = st->createDataMember(name, type, false, 0, 0, "", ""); // Dummy - assert(yyval); - unit->error("keyword `" + name + "' cannot be used as data member name"); -} -#line 3100 "src/Slice/Grammar.cpp" - break; - - case 109: /* struct_data_member: type */ -#line 1286 "src/Slice/Grammar.y" -{ - TypePtr type = TypePtr::dynamicCast(yyvsp[0]); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - yyval = st->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy - assert(yyval); - unit->error("missing data member name"); -} -#line 3113 "src/Slice/Grammar.cpp" +#line 2888 "src/Slice/Grammar.cpp" break; - case 110: /* return_type: tag type */ -#line 1300 "src/Slice/Grammar.y" + case 92: /* return_type: tag type */ +#line 1175 "src/Slice/Grammar.y" { TaggedDefTokPtr m = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); m->type = TypePtr::dynamicCast(yyvsp[0]); yyval = m; } -#line 3123 "src/Slice/Grammar.cpp" +#line 2898 "src/Slice/Grammar.cpp" break; - case 111: /* return_type: optional type */ -#line 1306 "src/Slice/Grammar.y" + case 93: /* return_type: optional type */ +#line 1181 "src/Slice/Grammar.y" { TaggedDefTokPtr m = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); m->type = TypePtr::dynamicCast(yyvsp[0]); yyval = m; } -#line 3133 "src/Slice/Grammar.cpp" +#line 2908 "src/Slice/Grammar.cpp" break; - case 112: /* return_type: type */ -#line 1312 "src/Slice/Grammar.y" + case 94: /* return_type: type */ +#line 1187 "src/Slice/Grammar.y" { TaggedDefTokPtr m = new TaggedDefTok(-1); m->type = TypePtr::dynamicCast(yyvsp[0]); yyval = m; } -#line 3143 "src/Slice/Grammar.cpp" +#line 2918 "src/Slice/Grammar.cpp" break; - case 113: /* return_type: ICE_VOID */ -#line 1318 "src/Slice/Grammar.y" + case 95: /* return_type: ICE_VOID */ +#line 1193 "src/Slice/Grammar.y" { TaggedDefTokPtr m = new TaggedDefTok(-1); yyval = m; } -#line 3152 "src/Slice/Grammar.cpp" +#line 2927 "src/Slice/Grammar.cpp" break; - case 114: /* operation_preamble: return_type ICE_IDENT_OPEN */ -#line 1328 "src/Slice/Grammar.y" + case 96: /* operation_preamble: return_type ICE_IDENT_OPEN */ +#line 1203 "src/Slice/Grammar.y" { TaggedDefTokPtr returnType = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); string name = StringTokPtr::dynamicCast(yyvsp[0])->v; @@ -3176,11 +2951,11 @@ YYLTYPE yylloc = yyloc_default; yyval = 0; } } -#line 3180 "src/Slice/Grammar.cpp" +#line 2955 "src/Slice/Grammar.cpp" break; - case 115: /* operation_preamble: ICE_IDEMPOTENT return_type ICE_IDENT_OPEN */ -#line 1352 "src/Slice/Grammar.y" + case 97: /* operation_preamble: ICE_IDEMPOTENT return_type ICE_IDENT_OPEN */ +#line 1227 "src/Slice/Grammar.y" { TaggedDefTokPtr returnType = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); string name = StringTokPtr::dynamicCast(yyvsp[0])->v; @@ -3205,11 +2980,11 @@ YYLTYPE yylloc = yyloc_default; yyval = 0; } } -#line 3209 "src/Slice/Grammar.cpp" +#line 2984 "src/Slice/Grammar.cpp" break; - case 116: /* operation_preamble: return_type ICE_KEYWORD_OPEN */ -#line 1377 "src/Slice/Grammar.y" + case 98: /* operation_preamble: return_type ICE_KEYWORD_OPEN */ +#line 1252 "src/Slice/Grammar.y" { TaggedDefTokPtr returnType = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); string name = StringTokPtr::dynamicCast(yyvsp[0])->v; @@ -3233,11 +3008,11 @@ YYLTYPE yylloc = yyloc_default; yyval = 0; } } -#line 3237 "src/Slice/Grammar.cpp" +#line 3012 "src/Slice/Grammar.cpp" break; - case 117: /* operation_preamble: ICE_IDEMPOTENT return_type ICE_KEYWORD_OPEN */ -#line 1401 "src/Slice/Grammar.y" + case 99: /* operation_preamble: ICE_IDEMPOTENT return_type ICE_KEYWORD_OPEN */ +#line 1276 "src/Slice/Grammar.y" { TaggedDefTokPtr returnType = TaggedDefTokPtr::dynamicCast(yyvsp[-1]); string name = StringTokPtr::dynamicCast(yyvsp[0])->v; @@ -3262,11 +3037,11 @@ YYLTYPE yylloc = yyloc_default; yyval = 0; } } -#line 3266 "src/Slice/Grammar.cpp" +#line 3041 "src/Slice/Grammar.cpp" break; - case 118: /* @18: %empty */ -#line 1431 "src/Slice/Grammar.y" + case 100: /* @18: %empty */ +#line 1306 "src/Slice/Grammar.y" { if(yyvsp[-2]) { @@ -3278,11 +3053,11 @@ YYLTYPE yylloc = yyloc_default; yyval = 0; } } -#line 3282 "src/Slice/Grammar.cpp" +#line 3057 "src/Slice/Grammar.cpp" break; - case 119: /* operation: operation_preamble parameters ')' @18 throws */ -#line 1443 "src/Slice/Grammar.y" + case 101: /* operation: operation_preamble parameters ')' @18 throws */ +#line 1318 "src/Slice/Grammar.y" { OperationPtr op = OperationPtr::dynamicCast(yyvsp[-1]); ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast(yyvsp[0]); @@ -3292,11 +3067,11 @@ YYLTYPE yylloc = yyloc_default; op->setExceptionList(el->v); } } -#line 3296 "src/Slice/Grammar.cpp" +#line 3071 "src/Slice/Grammar.cpp" break; - case 120: /* @19: %empty */ -#line 1453 "src/Slice/Grammar.y" + case 102: /* @19: %empty */ +#line 1328 "src/Slice/Grammar.y" { if(yyvsp[-2]) { @@ -3304,11 +3079,11 @@ YYLTYPE yylloc = yyloc_default; } yyerrok; } -#line 3308 "src/Slice/Grammar.cpp" +#line 3083 "src/Slice/Grammar.cpp" break; - case 121: /* operation: operation_preamble error ')' @19 throws */ -#line 1461 "src/Slice/Grammar.y" + case 103: /* operation: operation_preamble error ')' @19 throws */ +#line 1336 "src/Slice/Grammar.y" { OperationPtr op = OperationPtr::dynamicCast(yyvsp[-1]); ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast(yyvsp[0]); @@ -3318,29 +3093,29 @@ YYLTYPE yylloc = yyloc_default; op->setExceptionList(el->v); // Dummy } } -#line 3322 "src/Slice/Grammar.cpp" +#line 3097 "src/Slice/Grammar.cpp" break; - case 123: /* interface_id: ICE_INTERFACE ICE_IDENTIFIER */ -#line 1482 "src/Slice/Grammar.y" + case 104: /* interface_id: ICE_INTERFACE ICE_IDENTIFIER */ +#line 1351 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 3330 "src/Slice/Grammar.cpp" +#line 3105 "src/Slice/Grammar.cpp" break; - case 124: /* interface_id: ICE_INTERFACE keyword */ -#line 1486 "src/Slice/Grammar.y" + case 105: /* interface_id: ICE_INTERFACE keyword */ +#line 1355 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); unit->error("keyword `" + ident->v + "' cannot be used as interface name"); yyval = yyvsp[0]; // Dummy } -#line 3340 "src/Slice/Grammar.cpp" +#line 3115 "src/Slice/Grammar.cpp" break; - case 125: /* interface_decl: interface_id */ -#line 1497 "src/Slice/Grammar.y" + case 106: /* interface_decl: interface_id */ +#line 1366 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); @@ -3348,11 +3123,11 @@ YYLTYPE yylloc = yyloc_default; cont->checkIntroduced(ident->v, cl); yyval = cl; } -#line 3352 "src/Slice/Grammar.cpp" +#line 3127 "src/Slice/Grammar.cpp" break; - case 126: /* @20: %empty */ -#line 1510 "src/Slice/Grammar.y" + case 107: /* @20: %empty */ +#line 1379 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[-1]); ContainerPtr cont = unit->currentContainer(); @@ -3369,11 +3144,11 @@ YYLTYPE yylloc = yyloc_default; yyval = 0; } } -#line 3373 "src/Slice/Grammar.cpp" +#line 3148 "src/Slice/Grammar.cpp" break; - case 127: /* interface_def: interface_id interface_extends @20 '{' interface_exports '}' */ -#line 1527 "src/Slice/Grammar.y" + case 108: /* interface_def: interface_id interface_extends @20 '{' operations '}' */ +#line 1396 "src/Slice/Grammar.y" { if(yyvsp[-3]) { @@ -3385,11 +3160,11 @@ YYLTYPE yylloc = yyloc_default; yyval = 0; } } -#line 3389 "src/Slice/Grammar.cpp" +#line 3164 "src/Slice/Grammar.cpp" break; - case 128: /* interface_list: scoped_name ',' interface_list */ -#line 1544 "src/Slice/Grammar.y" + case 109: /* interface_list: scoped_name ',' interface_list */ +#line 1413 "src/Slice/Grammar.y" { InterfaceListTokPtr intfs = InterfaceListTokPtr::dynamicCast(yyvsp[0]); StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[-2]); @@ -3424,11 +3199,11 @@ YYLTYPE yylloc = yyloc_default; } yyval = intfs; } -#line 3428 "src/Slice/Grammar.cpp" +#line 3203 "src/Slice/Grammar.cpp" break; - case 129: /* interface_list: scoped_name */ -#line 1579 "src/Slice/Grammar.y" + case 110: /* interface_list: scoped_name */ +#line 1448 "src/Slice/Grammar.y" { InterfaceListTokPtr intfs = new InterfaceListTok; StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); @@ -3463,45 +3238,45 @@ YYLTYPE yylloc = yyloc_default; } yyval = intfs; } -#line 3467 "src/Slice/Grammar.cpp" +#line 3242 "src/Slice/Grammar.cpp" break; - case 130: /* interface_list: ICE_OBJECT */ -#line 1614 "src/Slice/Grammar.y" + case 111: /* interface_list: ICE_OBJECT */ +#line 1483 "src/Slice/Grammar.y" { unit->error("illegal inheritance from type Object"); yyval = new InterfaceListTok; // Dummy } -#line 3476 "src/Slice/Grammar.cpp" +#line 3251 "src/Slice/Grammar.cpp" break; - case 131: /* interface_list: ICE_VALUE */ -#line 1619 "src/Slice/Grammar.y" + case 112: /* interface_list: ICE_VALUE */ +#line 1488 "src/Slice/Grammar.y" { unit->error("illegal inheritance from type Value"); yyval = new ClassListTok; // Dummy } -#line 3485 "src/Slice/Grammar.cpp" +#line 3260 "src/Slice/Grammar.cpp" break; - case 132: /* interface_extends: extends interface_list */ -#line 1629 "src/Slice/Grammar.y" + case 113: /* interface_extends: extends interface_list */ +#line 1498 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 3493 "src/Slice/Grammar.cpp" +#line 3268 "src/Slice/Grammar.cpp" break; - case 133: /* interface_extends: %empty */ -#line 1633 "src/Slice/Grammar.y" + case 114: /* interface_extends: %empty */ +#line 1502 "src/Slice/Grammar.y" { yyval = new InterfaceListTok; } -#line 3501 "src/Slice/Grammar.cpp" +#line 3276 "src/Slice/Grammar.cpp" break; - case 134: /* interface_exports: meta_data interface_export ';' interface_exports */ -#line 1642 "src/Slice/Grammar.y" + case 115: /* operations: meta_data operation ';' operations */ +#line 1511 "src/Slice/Grammar.y" { StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); ContainedPtr contained = ContainedPtr::dynamicCast(yyvsp[-2]); @@ -3510,55 +3285,55 @@ YYLTYPE yylloc = yyloc_default; contained->setMetaData(metaData->v); } } -#line 3514 "src/Slice/Grammar.cpp" +#line 3289 "src/Slice/Grammar.cpp" break; - case 135: /* interface_exports: error ';' interface_exports */ -#line 1651 "src/Slice/Grammar.y" + case 116: /* operations: error ';' operations */ +#line 1520 "src/Slice/Grammar.y" { } -#line 3521 "src/Slice/Grammar.cpp" +#line 3296 "src/Slice/Grammar.cpp" break; - case 136: /* interface_exports: meta_data interface_export */ -#line 1654 "src/Slice/Grammar.y" + case 117: /* operations: meta_data operation */ +#line 1523 "src/Slice/Grammar.y" { unit->error("`;' missing after definition"); } -#line 3529 "src/Slice/Grammar.cpp" +#line 3304 "src/Slice/Grammar.cpp" break; - case 137: /* interface_exports: %empty */ -#line 1658 "src/Slice/Grammar.y" + case 118: /* operations: %empty */ +#line 1527 "src/Slice/Grammar.y" { } -#line 3536 "src/Slice/Grammar.cpp" +#line 3311 "src/Slice/Grammar.cpp" break; - case 139: /* exception_list: exception ',' exception_list */ -#line 1672 "src/Slice/Grammar.y" + case 119: /* exception_list: exception ',' exception_list */ +#line 1535 "src/Slice/Grammar.y" { ExceptionPtr exception = ExceptionPtr::dynamicCast(yyvsp[-2]); ExceptionListTokPtr exceptionList = ExceptionListTokPtr::dynamicCast(yyvsp[0]); exceptionList->v.push_front(exception); yyval = exceptionList; } -#line 3547 "src/Slice/Grammar.cpp" +#line 3322 "src/Slice/Grammar.cpp" break; - case 140: /* exception_list: exception */ -#line 1679 "src/Slice/Grammar.y" + case 120: /* exception_list: exception */ +#line 1542 "src/Slice/Grammar.y" { ExceptionPtr exception = ExceptionPtr::dynamicCast(yyvsp[0]); ExceptionListTokPtr exceptionList = new ExceptionListTok; exceptionList->v.push_front(exception); yyval = exceptionList; } -#line 3558 "src/Slice/Grammar.cpp" +#line 3333 "src/Slice/Grammar.cpp" break; - case 141: /* exception: scoped_name */ -#line 1691 "src/Slice/Grammar.y" + case 121: /* exception: scoped_name */ +#line 1554 "src/Slice/Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); @@ -3570,21 +3345,21 @@ YYLTYPE yylloc = yyloc_default; cont->checkIntroduced(scoped->v, exception); yyval = exception; } -#line 3574 "src/Slice/Grammar.cpp" +#line 3349 "src/Slice/Grammar.cpp" break; - case 142: /* exception: keyword */ -#line 1703 "src/Slice/Grammar.y" + case 122: /* exception: keyword */ +#line 1566 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); unit->error("keyword `" + ident->v + "' cannot be used as exception name"); yyval = unit->currentContainer()->createException(IceUtil::generateUUID(), 0, Dummy); // Dummy } -#line 3584 "src/Slice/Grammar.cpp" +#line 3359 "src/Slice/Grammar.cpp" break; - case 143: /* sequence_def: ICE_SEQUENCE '<' meta_data type '>' ICE_IDENTIFIER */ -#line 1714 "src/Slice/Grammar.y" + case 123: /* sequence_def: ICE_SEQUENCE '<' meta_data type '>' ICE_IDENTIFIER */ +#line 1577 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); @@ -3592,11 +3367,11 @@ YYLTYPE yylloc = yyloc_default; ContainerPtr cont = unit->currentContainer(); yyval = cont->createSequence(ident->v, type, metaData->v); } -#line 3596 "src/Slice/Grammar.cpp" +#line 3371 "src/Slice/Grammar.cpp" break; - case 144: /* sequence_def: ICE_SEQUENCE '<' meta_data type '>' keyword */ -#line 1722 "src/Slice/Grammar.y" + case 124: /* sequence_def: ICE_SEQUENCE '<' meta_data type '>' keyword */ +#line 1585 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); @@ -3605,11 +3380,11 @@ YYLTYPE yylloc = yyloc_default; yyval = cont->createSequence(ident->v, type, metaData->v); // Dummy unit->error("keyword `" + ident->v + "' cannot be used as sequence name"); } -#line 3609 "src/Slice/Grammar.cpp" +#line 3384 "src/Slice/Grammar.cpp" break; - case 145: /* dictionary_def: ICE_DICTIONARY '<' meta_data type ',' meta_data type '>' ICE_IDENTIFIER */ -#line 1736 "src/Slice/Grammar.y" + case 125: /* dictionary_def: ICE_DICTIONARY '<' meta_data type ',' meta_data type '>' ICE_IDENTIFIER */ +#line 1599 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); StringListTokPtr keyMetaData = StringListTokPtr::dynamicCast(yyvsp[-6]); @@ -3619,11 +3394,11 @@ YYLTYPE yylloc = yyloc_default; ContainerPtr cont = unit->currentContainer(); yyval = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v); } -#line 3623 "src/Slice/Grammar.cpp" +#line 3398 "src/Slice/Grammar.cpp" break; - case 146: /* dictionary_def: ICE_DICTIONARY '<' meta_data type ',' meta_data type '>' keyword */ -#line 1746 "src/Slice/Grammar.y" + case 126: /* dictionary_def: ICE_DICTIONARY '<' meta_data type ',' meta_data type '>' keyword */ +#line 1609 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); StringListTokPtr keyMetaData = StringListTokPtr::dynamicCast(yyvsp[-6]); @@ -3634,29 +3409,29 @@ YYLTYPE yylloc = yyloc_default; yyval = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v); // Dummy unit->error("keyword `" + ident->v + "' cannot be used as dictionary name"); } -#line 3638 "src/Slice/Grammar.cpp" +#line 3413 "src/Slice/Grammar.cpp" break; - case 147: /* enum_id: ICE_ENUM ICE_IDENTIFIER */ -#line 1762 "src/Slice/Grammar.y" + case 127: /* enum_id: ICE_ENUM ICE_IDENTIFIER */ +#line 1625 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 3646 "src/Slice/Grammar.cpp" +#line 3421 "src/Slice/Grammar.cpp" break; - case 148: /* enum_id: ICE_ENUM keyword */ -#line 1766 "src/Slice/Grammar.y" + case 128: /* enum_id: ICE_ENUM keyword */ +#line 1629 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); unit->error("keyword `" + ident->v + "' cannot be used as enumeration name"); yyval = yyvsp[0]; // Dummy } -#line 3656 "src/Slice/Grammar.cpp" +#line 3431 "src/Slice/Grammar.cpp" break; - case 149: /* @21: %empty */ -#line 1777 "src/Slice/Grammar.y" + case 129: /* @21: %empty */ +#line 1640 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); @@ -3672,11 +3447,11 @@ YYLTYPE yylloc = yyloc_default; unit->pushContainer(en); yyval = en; } -#line 3676 "src/Slice/Grammar.cpp" +#line 3451 "src/Slice/Grammar.cpp" break; - case 150: /* enum_def: enum_id @21 '{' enumerator_list '}' */ -#line 1793 "src/Slice/Grammar.y" + case 130: /* enum_def: enum_id @21 '{' enumerator_list '}' */ +#line 1656 "src/Slice/Grammar.y" { EnumPtr en = EnumPtr::dynamicCast(yyvsp[-3]); if(en) @@ -3690,11 +3465,11 @@ YYLTYPE yylloc = yyloc_default; } yyval = yyvsp[-3]; } -#line 3694 "src/Slice/Grammar.cpp" +#line 3469 "src/Slice/Grammar.cpp" break; - case 151: /* @22: %empty */ -#line 1808 "src/Slice/Grammar.y" + case 131: /* @22: %empty */ +#line 1671 "src/Slice/Grammar.y" { unit->error("missing enumeration name"); ContainerPtr cont = unit->currentContainer(); @@ -3702,37 +3477,37 @@ YYLTYPE yylloc = yyloc_default; unit->pushContainer(en); yyval = en; } -#line 3706 "src/Slice/Grammar.cpp" +#line 3481 "src/Slice/Grammar.cpp" break; - case 152: /* enum_def: ICE_ENUM @22 '{' enumerator_list '}' */ -#line 1816 "src/Slice/Grammar.y" + case 132: /* enum_def: ICE_ENUM @22 '{' enumerator_list '}' */ +#line 1679 "src/Slice/Grammar.y" { unit->popContainer(); yyval = yyvsp[-4]; } -#line 3715 "src/Slice/Grammar.cpp" +#line 3490 "src/Slice/Grammar.cpp" break; - case 153: /* enumerator_list: enumerator ',' enumerator_list */ -#line 1826 "src/Slice/Grammar.y" + case 133: /* enumerator_list: enumerator ',' enumerator_list */ +#line 1689 "src/Slice/Grammar.y" { EnumeratorListTokPtr ens = EnumeratorListTokPtr::dynamicCast(yyvsp[-2]); ens->v.splice(ens->v.end(), EnumeratorListTokPtr::dynamicCast(yyvsp[0])->v); yyval = ens; } -#line 3725 "src/Slice/Grammar.cpp" +#line 3500 "src/Slice/Grammar.cpp" break; - case 154: /* enumerator_list: enumerator */ -#line 1832 "src/Slice/Grammar.y" + case 134: /* enumerator_list: enumerator */ +#line 1695 "src/Slice/Grammar.y" { } -#line 3732 "src/Slice/Grammar.cpp" +#line 3507 "src/Slice/Grammar.cpp" break; - case 155: /* enumerator: ICE_IDENTIFIER */ -#line 1840 "src/Slice/Grammar.y" + case 135: /* enumerator: ICE_IDENTIFIER */ +#line 1703 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); EnumeratorListTokPtr ens = new EnumeratorListTok; @@ -3744,11 +3519,11 @@ YYLTYPE yylloc = yyloc_default; } yyval = ens; } -#line 3748 "src/Slice/Grammar.cpp" +#line 3523 "src/Slice/Grammar.cpp" break; - case 156: /* enumerator: ICE_IDENTIFIER '=' enumerator_initializer */ -#line 1852 "src/Slice/Grammar.y" + case 136: /* enumerator: ICE_IDENTIFIER '=' enumerator_initializer */ +#line 1715 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[-2]); EnumeratorListTokPtr ens = new EnumeratorListTok; @@ -3768,39 +3543,39 @@ YYLTYPE yylloc = yyloc_default; } yyval = ens; } -#line 3772 "src/Slice/Grammar.cpp" +#line 3547 "src/Slice/Grammar.cpp" break; - case 157: /* enumerator: keyword */ -#line 1872 "src/Slice/Grammar.y" + case 137: /* enumerator: keyword */ +#line 1735 "src/Slice/Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast(yyvsp[0]); unit->error("keyword `" + ident->v + "' cannot be used as enumerator"); EnumeratorListTokPtr ens = new EnumeratorListTok; // Dummy yyval = ens; } -#line 3783 "src/Slice/Grammar.cpp" +#line 3558 "src/Slice/Grammar.cpp" break; - case 158: /* enumerator: %empty */ -#line 1879 "src/Slice/Grammar.y" + case 138: /* enumerator: %empty */ +#line 1742 "src/Slice/Grammar.y" { EnumeratorListTokPtr ens = new EnumeratorListTok; yyval = ens; // Dummy } -#line 3792 "src/Slice/Grammar.cpp" +#line 3567 "src/Slice/Grammar.cpp" break; - case 159: /* enumerator_initializer: ICE_INTEGER_LITERAL */ -#line 1889 "src/Slice/Grammar.y" + case 139: /* enumerator_initializer: ICE_INTEGER_LITERAL */ +#line 1752 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 3800 "src/Slice/Grammar.cpp" +#line 3575 "src/Slice/Grammar.cpp" break; - case 160: /* enumerator_initializer: scoped_name */ -#line 1893 "src/Slice/Grammar.y" + case 140: /* enumerator_initializer: scoped_name */ +#line 1756 "src/Slice/Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); ContainedList cl = unit->currentContainer()->lookupContained(scoped->v); @@ -3833,38 +3608,38 @@ YYLTYPE yylloc = yyloc_default; yyval = tok; } -#line 3837 "src/Slice/Grammar.cpp" +#line 3612 "src/Slice/Grammar.cpp" break; - case 161: /* out_qualifier: ICE_OUT */ -#line 1931 "src/Slice/Grammar.y" + case 141: /* out_qualifier: ICE_OUT */ +#line 1794 "src/Slice/Grammar.y" { BoolTokPtr out = new BoolTok; out->v = true; yyval = out; } -#line 3847 "src/Slice/Grammar.cpp" +#line 3622 "src/Slice/Grammar.cpp" break; - case 162: /* out_qualifier: %empty */ -#line 1937 "src/Slice/Grammar.y" + case 142: /* out_qualifier: %empty */ +#line 1800 "src/Slice/Grammar.y" { BoolTokPtr out = new BoolTok; out->v = false; yyval = out; } -#line 3857 "src/Slice/Grammar.cpp" +#line 3632 "src/Slice/Grammar.cpp" break; - case 163: /* parameters: %empty */ -#line 1948 "src/Slice/Grammar.y" + case 143: /* parameters: %empty */ +#line 1811 "src/Slice/Grammar.y" { } -#line 3864 "src/Slice/Grammar.cpp" +#line 3639 "src/Slice/Grammar.cpp" break; - case 164: /* parameters: out_qualifier meta_data tagged_type_id */ -#line 1951 "src/Slice/Grammar.y" + case 144: /* parameters: out_qualifier meta_data tagged_type_id */ +#line 1814 "src/Slice/Grammar.y" { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast(yyvsp[-2]); TaggedDefTokPtr tsp = TaggedDefTokPtr::dynamicCast(yyvsp[0]); @@ -3880,11 +3655,11 @@ YYLTYPE yylloc = yyloc_default; } } } -#line 3884 "src/Slice/Grammar.cpp" +#line 3659 "src/Slice/Grammar.cpp" break; - case 165: /* parameters: parameters ',' out_qualifier meta_data tagged_type_id */ -#line 1967 "src/Slice/Grammar.y" + case 145: /* parameters: parameters ',' out_qualifier meta_data tagged_type_id */ +#line 1830 "src/Slice/Grammar.y" { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast(yyvsp[-2]); TaggedDefTokPtr tsp = TaggedDefTokPtr::dynamicCast(yyvsp[0]); @@ -3900,11 +3675,11 @@ YYLTYPE yylloc = yyloc_default; } } } -#line 3904 "src/Slice/Grammar.cpp" +#line 3679 "src/Slice/Grammar.cpp" break; - case 166: /* parameters: out_qualifier meta_data type keyword */ -#line 1983 "src/Slice/Grammar.y" + case 146: /* parameters: out_qualifier meta_data type keyword */ +#line 1846 "src/Slice/Grammar.y" { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast(yyvsp[-3]); TypePtr type = TypePtr::dynamicCast(yyvsp[-1]); @@ -3916,11 +3691,11 @@ YYLTYPE yylloc = yyloc_default; unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); } } -#line 3920 "src/Slice/Grammar.cpp" +#line 3695 "src/Slice/Grammar.cpp" break; - case 167: /* parameters: parameters ',' out_qualifier meta_data type keyword */ -#line 1995 "src/Slice/Grammar.y" + case 147: /* parameters: parameters ',' out_qualifier meta_data type keyword */ +#line 1858 "src/Slice/Grammar.y" { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast(yyvsp[-3]); TypePtr type = TypePtr::dynamicCast(yyvsp[-1]); @@ -3932,11 +3707,11 @@ YYLTYPE yylloc = yyloc_default; unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); } } -#line 3936 "src/Slice/Grammar.cpp" +#line 3711 "src/Slice/Grammar.cpp" break; - case 168: /* parameters: out_qualifier meta_data type */ -#line 2007 "src/Slice/Grammar.y" + case 148: /* parameters: out_qualifier meta_data type */ +#line 1870 "src/Slice/Grammar.y" { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast(yyvsp[-2]); TypePtr type = TypePtr::dynamicCast(yyvsp[0]); @@ -3947,11 +3722,11 @@ YYLTYPE yylloc = yyloc_default; unit->error("missing parameter name"); } } -#line 3951 "src/Slice/Grammar.cpp" +#line 3726 "src/Slice/Grammar.cpp" break; - case 169: /* parameters: parameters ',' out_qualifier meta_data type */ -#line 2018 "src/Slice/Grammar.y" + case 149: /* parameters: parameters ',' out_qualifier meta_data type */ +#line 1881 "src/Slice/Grammar.y" { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast(yyvsp[-2]); TypePtr type = TypePtr::dynamicCast(yyvsp[0]); @@ -3962,118 +3737,118 @@ YYLTYPE yylloc = yyloc_default; unit->error("missing parameter name"); } } -#line 3966 "src/Slice/Grammar.cpp" +#line 3741 "src/Slice/Grammar.cpp" break; - case 170: /* throws: ICE_THROWS exception_list */ -#line 2034 "src/Slice/Grammar.y" + case 150: /* throws: ICE_THROWS exception_list */ +#line 1897 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 3974 "src/Slice/Grammar.cpp" +#line 3749 "src/Slice/Grammar.cpp" break; - case 171: /* throws: %empty */ -#line 2038 "src/Slice/Grammar.y" + case 151: /* throws: %empty */ +#line 1901 "src/Slice/Grammar.y" { yyval = new ExceptionListTok; } -#line 3982 "src/Slice/Grammar.cpp" +#line 3757 "src/Slice/Grammar.cpp" break; - case 172: /* scoped_name: ICE_IDENTIFIER */ -#line 2047 "src/Slice/Grammar.y" + case 152: /* scoped_name: ICE_IDENTIFIER */ +#line 1910 "src/Slice/Grammar.y" { } -#line 3989 "src/Slice/Grammar.cpp" +#line 3764 "src/Slice/Grammar.cpp" break; - case 173: /* scoped_name: ICE_SCOPED_IDENTIFIER */ -#line 2050 "src/Slice/Grammar.y" + case 153: /* scoped_name: ICE_SCOPED_IDENTIFIER */ +#line 1913 "src/Slice/Grammar.y" { } -#line 3996 "src/Slice/Grammar.cpp" +#line 3771 "src/Slice/Grammar.cpp" break; - case 174: /* builtin: ICE_BOOL */ -#line 2057 "src/Slice/Grammar.y" + case 154: /* builtin: ICE_BOOL */ +#line 1920 "src/Slice/Grammar.y" {} -#line 4002 "src/Slice/Grammar.cpp" +#line 3777 "src/Slice/Grammar.cpp" break; - case 175: /* builtin: ICE_BYTE */ -#line 2058 "src/Slice/Grammar.y" + case 155: /* builtin: ICE_BYTE */ +#line 1921 "src/Slice/Grammar.y" {} -#line 4008 "src/Slice/Grammar.cpp" +#line 3783 "src/Slice/Grammar.cpp" break; - case 176: /* builtin: ICE_SHORT */ -#line 2059 "src/Slice/Grammar.y" + case 156: /* builtin: ICE_SHORT */ +#line 1922 "src/Slice/Grammar.y" {} -#line 4014 "src/Slice/Grammar.cpp" +#line 3789 "src/Slice/Grammar.cpp" break; - case 177: /* builtin: ICE_INT */ -#line 2060 "src/Slice/Grammar.y" + case 157: /* builtin: ICE_INT */ +#line 1923 "src/Slice/Grammar.y" {} -#line 4020 "src/Slice/Grammar.cpp" +#line 3795 "src/Slice/Grammar.cpp" break; - case 178: /* builtin: ICE_LONG */ -#line 2061 "src/Slice/Grammar.y" + case 158: /* builtin: ICE_LONG */ +#line 1924 "src/Slice/Grammar.y" {} -#line 4026 "src/Slice/Grammar.cpp" +#line 3801 "src/Slice/Grammar.cpp" break; - case 179: /* builtin: ICE_FLOAT */ -#line 2062 "src/Slice/Grammar.y" + case 159: /* builtin: ICE_FLOAT */ +#line 1925 "src/Slice/Grammar.y" {} -#line 4032 "src/Slice/Grammar.cpp" +#line 3807 "src/Slice/Grammar.cpp" break; - case 180: /* builtin: ICE_DOUBLE */ -#line 2063 "src/Slice/Grammar.y" + case 160: /* builtin: ICE_DOUBLE */ +#line 1926 "src/Slice/Grammar.y" {} -#line 4038 "src/Slice/Grammar.cpp" +#line 3813 "src/Slice/Grammar.cpp" break; - case 181: /* builtin: ICE_STRING */ -#line 2064 "src/Slice/Grammar.y" + case 161: /* builtin: ICE_STRING */ +#line 1927 "src/Slice/Grammar.y" {} -#line 4044 "src/Slice/Grammar.cpp" +#line 3819 "src/Slice/Grammar.cpp" break; - case 182: /* builtin: ICE_OBJECT */ -#line 2065 "src/Slice/Grammar.y" + case 162: /* builtin: ICE_OBJECT */ +#line 1928 "src/Slice/Grammar.y" {} -#line 4050 "src/Slice/Grammar.cpp" +#line 3825 "src/Slice/Grammar.cpp" break; - case 183: /* builtin: ICE_VALUE */ -#line 2066 "src/Slice/Grammar.y" + case 163: /* builtin: ICE_VALUE */ +#line 1929 "src/Slice/Grammar.y" {} -#line 4056 "src/Slice/Grammar.cpp" +#line 3831 "src/Slice/Grammar.cpp" break; - case 184: /* type: ICE_OBJECT '*' */ -#line 2072 "src/Slice/Grammar.y" + case 164: /* type: ICE_OBJECT '*' */ +#line 1935 "src/Slice/Grammar.y" { yyval = unit->builtin(Builtin::KindObjectProxy); } -#line 4064 "src/Slice/Grammar.cpp" +#line 3839 "src/Slice/Grammar.cpp" break; - case 185: /* type: builtin */ -#line 2076 "src/Slice/Grammar.y" + case 165: /* type: builtin */ +#line 1939 "src/Slice/Grammar.y" { StringTokPtr typeName = StringTokPtr::dynamicCast(yyvsp[0]); yyval = unit->builtin(Builtin::kindFromString(typeName->v).value()); } -#line 4073 "src/Slice/Grammar.cpp" +#line 3848 "src/Slice/Grammar.cpp" break; - case 186: /* type: scoped_name */ -#line 2081 "src/Slice/Grammar.y" + case 166: /* type: scoped_name */ +#line 1944 "src/Slice/Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); ContainerPtr cont = unit->currentContainer(); @@ -4084,31 +3859,31 @@ YYLTYPE yylloc = yyloc_default; { YYERROR; // Can't continue, jump to next yyerrok } - for(TypeList::iterator p = types.begin(); p != types.end(); ++p) + TypePtr firstType = types.front(); + + InterfaceDeclPtr interface = InterfaceDeclPtr::dynamicCast(firstType); + if(interface) { - InterfaceDeclPtr interface = InterfaceDeclPtr::dynamicCast(*p); - if(interface) - { - string msg = "add a '*' after the interface name to specify its proxy type: '"; - msg += scoped->v; - msg += "*'"; - unit->error(msg); - YYERROR; // Can't continue, jump to next yyerrok - } - cont->checkIntroduced(scoped->v); + string msg = "add a '*' after the interface name to specify its proxy type: '"; + msg += scoped->v; + msg += "*'"; + unit->error(msg); + YYERROR; // Can't continue, jump to next yyerrok } - yyval = types.front(); + cont->checkIntroduced(scoped->v); + + yyval = firstType; } else { yyval = 0; } } -#line 4108 "src/Slice/Grammar.cpp" +#line 3883 "src/Slice/Grammar.cpp" break; - case 187: /* type: scoped_name '*' */ -#line 2112 "src/Slice/Grammar.y" + case 167: /* type: scoped_name '*' */ +#line 1975 "src/Slice/Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[-1]); ContainerPtr cont = unit->currentContainer(); @@ -4119,70 +3894,70 @@ YYLTYPE yylloc = yyloc_default; { YYERROR; // Can't continue, jump to next yyerrok } - for(TypeList::iterator p = types.begin(); p != types.end(); ++p) + TypePtr firstType = types.front(); + + InterfaceDeclPtr interface = InterfaceDeclPtr::dynamicCast(firstType); + if(!interface) { - InterfaceDeclPtr interface = InterfaceDeclPtr::dynamicCast(*p); - if(!interface) - { - string msg = "`"; - msg += scoped->v; - msg += "' must be an interface"; - unit->error(msg); - YYERROR; // Can't continue, jump to next yyerrok - } - cont->checkIntroduced(scoped->v); + string msg = "`"; + msg += scoped->v; + msg += "' must be an interface"; + unit->error(msg); + YYERROR; // Can't continue, jump to next yyerrok } - yyval = types.front(); + cont->checkIntroduced(scoped->v); + + yyval = firstType; } else { yyval = 0; } } -#line 4143 "src/Slice/Grammar.cpp" +#line 3918 "src/Slice/Grammar.cpp" break; - case 188: /* string_literal: ICE_STRING_LITERAL string_literal */ -#line 2148 "src/Slice/Grammar.y" + case 168: /* string_literal: ICE_STRING_LITERAL string_literal */ +#line 2011 "src/Slice/Grammar.y" { StringTokPtr str1 = StringTokPtr::dynamicCast(yyvsp[-1]); StringTokPtr str2 = StringTokPtr::dynamicCast(yyvsp[0]); str1->v += str2->v; } -#line 4153 "src/Slice/Grammar.cpp" +#line 3928 "src/Slice/Grammar.cpp" break; - case 189: /* string_literal: ICE_STRING_LITERAL */ -#line 2154 "src/Slice/Grammar.y" + case 169: /* string_literal: ICE_STRING_LITERAL */ +#line 2017 "src/Slice/Grammar.y" { } -#line 4160 "src/Slice/Grammar.cpp" +#line 3935 "src/Slice/Grammar.cpp" break; - case 190: /* string_list: string_list ',' string_literal */ -#line 2162 "src/Slice/Grammar.y" + case 170: /* string_list: string_list ',' string_literal */ +#line 2025 "src/Slice/Grammar.y" { StringTokPtr str = StringTokPtr::dynamicCast(yyvsp[0]); StringListTokPtr stringList = StringListTokPtr::dynamicCast(yyvsp[-2]); stringList->v.push_back(str->v); yyval = stringList; } -#line 4171 "src/Slice/Grammar.cpp" +#line 3946 "src/Slice/Grammar.cpp" break; - case 191: /* string_list: string_literal */ -#line 2169 "src/Slice/Grammar.y" + case 171: /* string_list: string_literal */ +#line 2032 "src/Slice/Grammar.y" { StringTokPtr str = StringTokPtr::dynamicCast(yyvsp[0]); StringListTokPtr stringList = new StringListTok; stringList->v.push_back(str->v); yyval = stringList; } -#line 4182 "src/Slice/Grammar.cpp" +#line 3957 "src/Slice/Grammar.cpp" break; - case 192: /* const_initializer: ICE_INTEGER_LITERAL */ -#line 2181 "src/Slice/Grammar.y" + case 172: /* const_initializer: ICE_INTEGER_LITERAL */ +#line 2044 "src/Slice/Grammar.y" { BuiltinPtr type = unit->builtin(Builtin::KindLong); IntegerTokPtr intVal = IntegerTokPtr::dynamicCast(yyvsp[0]); @@ -4191,11 +3966,11 @@ YYLTYPE yylloc = yyloc_default; ConstDefTokPtr def = new ConstDefTok(type, sstr.str(), intVal->literal); yyval = def; } -#line 4195 "src/Slice/Grammar.cpp" +#line 3970 "src/Slice/Grammar.cpp" break; - case 193: /* const_initializer: ICE_FLOATING_POINT_LITERAL */ -#line 2190 "src/Slice/Grammar.y" + case 173: /* const_initializer: ICE_FLOATING_POINT_LITERAL */ +#line 2053 "src/Slice/Grammar.y" { BuiltinPtr type = unit->builtin(Builtin::KindDouble); FloatingTokPtr floatVal = FloatingTokPtr::dynamicCast(yyvsp[0]); @@ -4204,11 +3979,11 @@ YYLTYPE yylloc = yyloc_default; ConstDefTokPtr def = new ConstDefTok(type, sstr.str(), floatVal->literal); yyval = def; } -#line 4208 "src/Slice/Grammar.cpp" +#line 3983 "src/Slice/Grammar.cpp" break; - case 194: /* const_initializer: scoped_name */ -#line 2199 "src/Slice/Grammar.y" + case 174: /* const_initializer: scoped_name */ +#line 2062 "src/Slice/Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast(yyvsp[0]); ConstDefTokPtr def; @@ -4235,57 +4010,52 @@ YYLTYPE yylloc = yyloc_default; else { def = new ConstDefTok; - string msg = "illegal initializer: `" + scoped->v + "' is a"; - static const string vowels = "aeiou"; + string msg = "illegal initializer: `" + scoped->v + "' is "; string kindOf = cl.front()->kindOf(); - if(vowels.find_first_of(kindOf[0]) != string::npos) - { - msg += "n"; - } - msg += " " + kindOf; + msg += prependA(kindOf); unit->error(msg); // $$ is dummy } } yyval = def; } -#line 4252 "src/Slice/Grammar.cpp" +#line 4022 "src/Slice/Grammar.cpp" break; - case 195: /* const_initializer: ICE_STRING_LITERAL */ -#line 2239 "src/Slice/Grammar.y" + case 175: /* const_initializer: ICE_STRING_LITERAL */ +#line 2097 "src/Slice/Grammar.y" { BuiltinPtr type = unit->builtin(Builtin::KindString); StringTokPtr literal = StringTokPtr::dynamicCast(yyvsp[0]); ConstDefTokPtr def = new ConstDefTok(type, literal->v, literal->literal); yyval = def; } -#line 4263 "src/Slice/Grammar.cpp" +#line 4033 "src/Slice/Grammar.cpp" break; - case 196: /* const_initializer: ICE_FALSE */ -#line 2246 "src/Slice/Grammar.y" + case 176: /* const_initializer: ICE_FALSE */ +#line 2104 "src/Slice/Grammar.y" { BuiltinPtr type = unit->builtin(Builtin::KindBool); StringTokPtr literal = StringTokPtr::dynamicCast(yyvsp[0]); ConstDefTokPtr def = new ConstDefTok(type, "false", "false"); yyval = def; } -#line 4274 "src/Slice/Grammar.cpp" +#line 4044 "src/Slice/Grammar.cpp" break; - case 197: /* const_initializer: ICE_TRUE */ -#line 2253 "src/Slice/Grammar.y" + case 177: /* const_initializer: ICE_TRUE */ +#line 2111 "src/Slice/Grammar.y" { BuiltinPtr type = unit->builtin(Builtin::KindBool); StringTokPtr literal = StringTokPtr::dynamicCast(yyvsp[0]); ConstDefTokPtr def = new ConstDefTok(type, "true", "true"); yyval = def; } -#line 4285 "src/Slice/Grammar.cpp" +#line 4055 "src/Slice/Grammar.cpp" break; - case 198: /* const_def: ICE_CONST meta_data type ICE_IDENTIFIER '=' const_initializer */ -#line 2265 "src/Slice/Grammar.y" + case 178: /* const_def: ICE_CONST meta_data type ICE_IDENTIFIER '=' const_initializer */ +#line 2123 "src/Slice/Grammar.y" { StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-4]); TypePtr const_type = TypePtr::dynamicCast(yyvsp[-3]); @@ -4294,11 +4064,11 @@ YYLTYPE yylloc = yyloc_default; yyval = unit->currentContainer()->createConst(ident->v, const_type, metaData->v, value->v, value->valueAsString, value->valueAsLiteral); } -#line 4298 "src/Slice/Grammar.cpp" +#line 4068 "src/Slice/Grammar.cpp" break; - case 199: /* const_def: ICE_CONST meta_data type '=' const_initializer */ -#line 2274 "src/Slice/Grammar.y" + case 179: /* const_def: ICE_CONST meta_data type '=' const_initializer */ +#line 2132 "src/Slice/Grammar.y" { StringListTokPtr metaData = StringListTokPtr::dynamicCast(yyvsp[-3]); TypePtr const_type = TypePtr::dynamicCast(yyvsp[-2]); @@ -4307,179 +4077,179 @@ YYLTYPE yylloc = yyloc_default; yyval = unit->currentContainer()->createConst(IceUtil::generateUUID(), const_type, metaData->v, value->v, value->valueAsString, value->valueAsLiteral, Dummy); // Dummy } -#line 4311 "src/Slice/Grammar.cpp" +#line 4081 "src/Slice/Grammar.cpp" break; - case 200: /* keyword: ICE_MODULE */ -#line 2287 "src/Slice/Grammar.y" + case 180: /* keyword: ICE_MODULE */ +#line 2145 "src/Slice/Grammar.y" {} -#line 4317 "src/Slice/Grammar.cpp" +#line 4087 "src/Slice/Grammar.cpp" break; - case 201: /* keyword: ICE_CLASS */ -#line 2288 "src/Slice/Grammar.y" + case 181: /* keyword: ICE_CLASS */ +#line 2146 "src/Slice/Grammar.y" {} -#line 4323 "src/Slice/Grammar.cpp" +#line 4093 "src/Slice/Grammar.cpp" break; - case 202: /* keyword: ICE_INTERFACE */ -#line 2289 "src/Slice/Grammar.y" + case 182: /* keyword: ICE_INTERFACE */ +#line 2147 "src/Slice/Grammar.y" {} -#line 4329 "src/Slice/Grammar.cpp" +#line 4099 "src/Slice/Grammar.cpp" break; - case 203: /* keyword: ICE_EXCEPTION */ -#line 2290 "src/Slice/Grammar.y" + case 183: /* keyword: ICE_EXCEPTION */ +#line 2148 "src/Slice/Grammar.y" {} -#line 4335 "src/Slice/Grammar.cpp" +#line 4105 "src/Slice/Grammar.cpp" break; - case 204: /* keyword: ICE_STRUCT */ -#line 2291 "src/Slice/Grammar.y" + case 184: /* keyword: ICE_STRUCT */ +#line 2149 "src/Slice/Grammar.y" {} -#line 4341 "src/Slice/Grammar.cpp" +#line 4111 "src/Slice/Grammar.cpp" break; - case 205: /* keyword: ICE_SEQUENCE */ -#line 2292 "src/Slice/Grammar.y" + case 185: /* keyword: ICE_SEQUENCE */ +#line 2150 "src/Slice/Grammar.y" {} -#line 4347 "src/Slice/Grammar.cpp" +#line 4117 "src/Slice/Grammar.cpp" break; - case 206: /* keyword: ICE_DICTIONARY */ -#line 2293 "src/Slice/Grammar.y" + case 186: /* keyword: ICE_DICTIONARY */ +#line 2151 "src/Slice/Grammar.y" {} -#line 4353 "src/Slice/Grammar.cpp" +#line 4123 "src/Slice/Grammar.cpp" break; - case 207: /* keyword: ICE_ENUM */ -#line 2294 "src/Slice/Grammar.y" + case 187: /* keyword: ICE_ENUM */ +#line 2152 "src/Slice/Grammar.y" {} -#line 4359 "src/Slice/Grammar.cpp" +#line 4129 "src/Slice/Grammar.cpp" break; - case 208: /* keyword: ICE_OUT */ -#line 2295 "src/Slice/Grammar.y" + case 188: /* keyword: ICE_OUT */ +#line 2153 "src/Slice/Grammar.y" {} -#line 4365 "src/Slice/Grammar.cpp" +#line 4135 "src/Slice/Grammar.cpp" break; - case 209: /* keyword: ICE_EXTENDS */ -#line 2296 "src/Slice/Grammar.y" + case 189: /* keyword: ICE_EXTENDS */ +#line 2154 "src/Slice/Grammar.y" {} -#line 4371 "src/Slice/Grammar.cpp" +#line 4141 "src/Slice/Grammar.cpp" break; - case 210: /* keyword: ICE_THROWS */ -#line 2297 "src/Slice/Grammar.y" + case 190: /* keyword: ICE_THROWS */ +#line 2155 "src/Slice/Grammar.y" {} -#line 4377 "src/Slice/Grammar.cpp" +#line 4147 "src/Slice/Grammar.cpp" break; - case 211: /* keyword: ICE_VOID */ -#line 2298 "src/Slice/Grammar.y" + case 191: /* keyword: ICE_VOID */ +#line 2156 "src/Slice/Grammar.y" {} -#line 4383 "src/Slice/Grammar.cpp" +#line 4153 "src/Slice/Grammar.cpp" break; - case 212: /* keyword: ICE_BOOL */ -#line 2299 "src/Slice/Grammar.y" + case 192: /* keyword: ICE_BOOL */ +#line 2157 "src/Slice/Grammar.y" {} -#line 4389 "src/Slice/Grammar.cpp" +#line 4159 "src/Slice/Grammar.cpp" break; - case 213: /* keyword: ICE_BYTE */ -#line 2300 "src/Slice/Grammar.y" + case 193: /* keyword: ICE_BYTE */ +#line 2158 "src/Slice/Grammar.y" {} -#line 4395 "src/Slice/Grammar.cpp" +#line 4165 "src/Slice/Grammar.cpp" break; - case 214: /* keyword: ICE_SHORT */ -#line 2301 "src/Slice/Grammar.y" + case 194: /* keyword: ICE_SHORT */ +#line 2159 "src/Slice/Grammar.y" {} -#line 4401 "src/Slice/Grammar.cpp" +#line 4171 "src/Slice/Grammar.cpp" break; - case 215: /* keyword: ICE_INT */ -#line 2302 "src/Slice/Grammar.y" + case 195: /* keyword: ICE_INT */ +#line 2160 "src/Slice/Grammar.y" {} -#line 4407 "src/Slice/Grammar.cpp" +#line 4177 "src/Slice/Grammar.cpp" break; - case 216: /* keyword: ICE_LONG */ -#line 2303 "src/Slice/Grammar.y" + case 196: /* keyword: ICE_LONG */ +#line 2161 "src/Slice/Grammar.y" {} -#line 4413 "src/Slice/Grammar.cpp" +#line 4183 "src/Slice/Grammar.cpp" break; - case 217: /* keyword: ICE_FLOAT */ -#line 2304 "src/Slice/Grammar.y" + case 197: /* keyword: ICE_FLOAT */ +#line 2162 "src/Slice/Grammar.y" {} -#line 4419 "src/Slice/Grammar.cpp" +#line 4189 "src/Slice/Grammar.cpp" break; - case 218: /* keyword: ICE_DOUBLE */ -#line 2305 "src/Slice/Grammar.y" + case 198: /* keyword: ICE_DOUBLE */ +#line 2163 "src/Slice/Grammar.y" {} -#line 4425 "src/Slice/Grammar.cpp" +#line 4195 "src/Slice/Grammar.cpp" break; - case 219: /* keyword: ICE_STRING */ -#line 2306 "src/Slice/Grammar.y" + case 199: /* keyword: ICE_STRING */ +#line 2164 "src/Slice/Grammar.y" {} -#line 4431 "src/Slice/Grammar.cpp" +#line 4201 "src/Slice/Grammar.cpp" break; - case 220: /* keyword: ICE_OBJECT */ -#line 2307 "src/Slice/Grammar.y" + case 200: /* keyword: ICE_OBJECT */ +#line 2165 "src/Slice/Grammar.y" {} -#line 4437 "src/Slice/Grammar.cpp" +#line 4207 "src/Slice/Grammar.cpp" break; - case 221: /* keyword: ICE_CONST */ -#line 2308 "src/Slice/Grammar.y" + case 201: /* keyword: ICE_CONST */ +#line 2166 "src/Slice/Grammar.y" {} -#line 4443 "src/Slice/Grammar.cpp" +#line 4213 "src/Slice/Grammar.cpp" break; - case 222: /* keyword: ICE_FALSE */ -#line 2309 "src/Slice/Grammar.y" + case 202: /* keyword: ICE_FALSE */ +#line 2167 "src/Slice/Grammar.y" {} -#line 4449 "src/Slice/Grammar.cpp" +#line 4219 "src/Slice/Grammar.cpp" break; - case 223: /* keyword: ICE_TRUE */ -#line 2310 "src/Slice/Grammar.y" + case 203: /* keyword: ICE_TRUE */ +#line 2168 "src/Slice/Grammar.y" {} -#line 4455 "src/Slice/Grammar.cpp" +#line 4225 "src/Slice/Grammar.cpp" break; - case 224: /* keyword: ICE_IDEMPOTENT */ -#line 2311 "src/Slice/Grammar.y" + case 204: /* keyword: ICE_IDEMPOTENT */ +#line 2169 "src/Slice/Grammar.y" {} -#line 4461 "src/Slice/Grammar.cpp" +#line 4231 "src/Slice/Grammar.cpp" break; - case 225: /* keyword: ICE_TAG */ -#line 2312 "src/Slice/Grammar.y" + case 205: /* keyword: ICE_TAG */ +#line 2170 "src/Slice/Grammar.y" {} -#line 4467 "src/Slice/Grammar.cpp" +#line 4237 "src/Slice/Grammar.cpp" break; - case 226: /* keyword: ICE_OPTIONAL */ -#line 2313 "src/Slice/Grammar.y" + case 206: /* keyword: ICE_OPTIONAL */ +#line 2171 "src/Slice/Grammar.y" {} -#line 4473 "src/Slice/Grammar.cpp" +#line 4243 "src/Slice/Grammar.cpp" break; - case 227: /* keyword: ICE_VALUE */ -#line 2314 "src/Slice/Grammar.y" + case 207: /* keyword: ICE_VALUE */ +#line 2172 "src/Slice/Grammar.y" {} -#line 4479 "src/Slice/Grammar.cpp" +#line 4249 "src/Slice/Grammar.cpp" break; -#line 4483 "src/Slice/Grammar.cpp" +#line 4253 "src/Slice/Grammar.cpp" default: break; } @@ -4677,5 +4447,5 @@ YYLTYPE yylloc = yyloc_default; return yyresult; } -#line 2317 "src/Slice/Grammar.y" +#line 2175 "src/Slice/Grammar.y" diff --git a/cpp/src/Slice/Grammar.y b/cpp/src/Slice/Grammar.y index da424e62244..48a8e68465a 100644 --- a/cpp/src/Slice/Grammar.y +++ b/cpp/src/Slice/Grammar.y @@ -425,7 +425,7 @@ exception_def } $$ = ex; } -'{' exception_exports '}' +'{' data_members '}' { if($3) { @@ -452,30 +452,6 @@ exception_extends } ; -// ---------------------------------------------------------------------- -exception_exports -// ---------------------------------------------------------------------- -: meta_data exception_export ';' exception_exports -{ - StringListTokPtr metaData = StringListTokPtr::dynamicCast($1); - ContainedPtr contained = ContainedPtr::dynamicCast($2); - if(contained && !metaData->v.empty()) - { - contained->setMetaData(metaData->v); - } -} -| error ';' exception_exports -{ -} -| meta_data exception_export -{ - unit->error("`;' missing after definition"); -} -| %empty -{ -} -; - // ---------------------------------------------------------------------- type_id // ---------------------------------------------------------------------- @@ -483,7 +459,6 @@ type_id { TypePtr type = TypePtr::dynamicCast($1); StringTokPtr ident = StringTokPtr::dynamicCast($2); - checkIdentifier(ident->v); TypeStringTokPtr typestring = new TypeStringTok; typestring->v = make_pair(type, ident->v); $$ = typestring; @@ -748,12 +723,6 @@ tagged_type_id } ; -// ---------------------------------------------------------------------- -exception_export -// ---------------------------------------------------------------------- -: data_member -; - // ---------------------------------------------------------------------- struct_id // ---------------------------------------------------------------------- @@ -800,7 +769,7 @@ struct_def } $$ = st; } -'{' struct_exports '}' +'{' data_members '}' { if($2) { @@ -820,36 +789,6 @@ struct_def } ; -// ---------------------------------------------------------------------- -struct_exports -// ---------------------------------------------------------------------- -: meta_data struct_export ';' struct_exports -{ - StringListTokPtr metaData = StringListTokPtr::dynamicCast($1); - ContainedPtr contained = ContainedPtr::dynamicCast($2); - if(contained && !metaData->v.empty()) - { - contained->setMetaData(metaData->v); - } -} -| error ';' struct_exports -{ -} -| meta_data struct_export -{ - unit->error("`;' missing after definition"); -} -| %empty -{ -} -; - -// ---------------------------------------------------------------------- -struct_export -// ---------------------------------------------------------------------- -: struct_data_member -; - // ---------------------------------------------------------------------- class_name // ---------------------------------------------------------------------- @@ -1024,7 +963,7 @@ class_def $$ = 0; } } -'{' class_exports '}' +'{' data_members '}' { if($3) { @@ -1093,9 +1032,9 @@ extends ; // ---------------------------------------------------------------------- -class_exports +data_members // ---------------------------------------------------------------------- -: meta_data class_export ';' class_exports +: meta_data data_member ';' data_members { StringListTokPtr metaData = StringListTokPtr::dynamicCast($1); ContainedPtr contained = ContainedPtr::dynamicCast($2); @@ -1104,10 +1043,10 @@ class_exports contained->setMetaData(metaData->v); } } -| error ';' class_exports +| error ';' data_members { } -| meta_data class_export +| meta_data data_member { unit->error("`;' missing after definition"); } @@ -1131,7 +1070,15 @@ data_member StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); if(st) { - dm = st->createDataMember(def->name, def->type, def->isTagged, def->tag, 0, "", ""); + if (def->isTagged) + { + unit->error("tagged data members are not supported in structs"); + dm = st->createDataMember(def->name, def->type, false, 0, 0, "", ""); // Dummy + } + else + { + dm = st->createDataMember(def->name, def->type, false, -1, 0, "", ""); + } } ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); if(ex) @@ -1156,8 +1103,16 @@ data_member StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); if(st) { - dm = st->createDataMember(def->name, def->type, def->isTagged, def->tag, value->v, - value->valueAsString, value->valueAsLiteral); + if (def->isTagged) + { + unit->error("tagged data members are not supported in structs"); + dm = st->createDataMember(def->name, def->type, false, 0, 0, "", ""); // Dummy + } + else + { + dm = st->createDataMember(def->name, def->type, false, -1, value->v, + value->valueAsString, value->valueAsLiteral); + } } ExceptionPtr ex = ExceptionPtr::dynamicCast(unit->currentContainer()); if(ex) @@ -1213,86 +1168,6 @@ data_member } ; -// ---------------------------------------------------------------------- -struct_data_member -// ---------------------------------------------------------------------- -: type_id -{ - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast($1); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - DataMemberPtr dm = st->createDataMember(ts->v.second, ts->v.first, false, -1, 0, "", ""); - unit->currentContainer()->checkIntroduced(ts->v.second, dm); - $$ = dm; -} -| type_id '=' const_initializer -{ - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast($1); - ConstDefTokPtr value = ConstDefTokPtr::dynamicCast($3); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - DataMemberPtr dm = st->createDataMember(ts->v.second, ts->v.first, false, -1, value->v, - value->valueAsString, value->valueAsLiteral); - unit->currentContainer()->checkIntroduced(ts->v.second, dm); - $$ = dm; -} -| tag type_id -{ - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast($2); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - $$ = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy - assert($$); - unit->error("tagged data members are not supported in structs"); -} -| tag type_id '=' const_initializer -{ - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast($2); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - $$ = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy - assert($$); - unit->error("tagged data members are not supported in structs"); -} -| optional type_id -{ - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast($2); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - $$ = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy - assert($$); - unit->error("tagged data members are not supported in structs"); -} -| optional type_id '=' const_initializer -{ - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast($2); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - $$ = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy - assert($$); - unit->error("tagged data members are not supported in structs"); -} -| type keyword -{ - TypePtr type = TypePtr::dynamicCast($1); - string name = StringTokPtr::dynamicCast($2)->v; - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - $$ = st->createDataMember(name, type, false, 0, 0, "", ""); // Dummy - assert($$); - unit->error("keyword `" + name + "' cannot be used as data member name"); -} -| type -{ - TypePtr type = TypePtr::dynamicCast($1); - StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); - assert(st); - $$ = st->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy - assert($$); - unit->error("missing data member name"); -} -; - // ---------------------------------------------------------------------- return_type // ---------------------------------------------------------------------- @@ -1469,12 +1344,6 @@ throws } ; -// ---------------------------------------------------------------------- -class_export -// ---------------------------------------------------------------------- -: data_member -; - // ---------------------------------------------------------------------- interface_id // ---------------------------------------------------------------------- @@ -1523,7 +1392,7 @@ interface_def $$ = 0; } } -'{' interface_exports '}' +'{' operations '}' { if($3) { @@ -1636,9 +1505,9 @@ interface_extends ; // ---------------------------------------------------------------------- -interface_exports +operations // ---------------------------------------------------------------------- -: meta_data interface_export ';' interface_exports +: meta_data operation ';' operations { StringListTokPtr metaData = StringListTokPtr::dynamicCast($1); ContainedPtr contained = ContainedPtr::dynamicCast($2); @@ -1647,10 +1516,10 @@ interface_exports contained->setMetaData(metaData->v); } } -| error ';' interface_exports +| error ';' operations { } -| meta_data interface_export +| meta_data operation { unit->error("`;' missing after definition"); } @@ -1659,12 +1528,6 @@ interface_exports } ; -// ---------------------------------------------------------------------- -interface_export -// ---------------------------------------------------------------------- -: operation -; - // ---------------------------------------------------------------------- exception_list // ---------------------------------------------------------------------- @@ -2088,20 +1951,20 @@ type { YYERROR; // Can't continue, jump to next yyerrok } - for(TypeList::iterator p = types.begin(); p != types.end(); ++p) + TypePtr firstType = types.front(); + + InterfaceDeclPtr interface = InterfaceDeclPtr::dynamicCast(firstType); + if(interface) { - InterfaceDeclPtr interface = InterfaceDeclPtr::dynamicCast(*p); - if(interface) - { - string msg = "add a '*' after the interface name to specify its proxy type: '"; - msg += scoped->v; - msg += "*'"; - unit->error(msg); - YYERROR; // Can't continue, jump to next yyerrok - } - cont->checkIntroduced(scoped->v); + string msg = "add a '*' after the interface name to specify its proxy type: '"; + msg += scoped->v; + msg += "*'"; + unit->error(msg); + YYERROR; // Can't continue, jump to next yyerrok } - $$ = types.front(); + cont->checkIntroduced(scoped->v); + + $$ = firstType; } else { @@ -2119,20 +1982,20 @@ type { YYERROR; // Can't continue, jump to next yyerrok } - for(TypeList::iterator p = types.begin(); p != types.end(); ++p) + TypePtr firstType = types.front(); + + InterfaceDeclPtr interface = InterfaceDeclPtr::dynamicCast(firstType); + if(!interface) { - InterfaceDeclPtr interface = InterfaceDeclPtr::dynamicCast(*p); - if(!interface) - { - string msg = "`"; - msg += scoped->v; - msg += "' must be an interface"; - unit->error(msg); - YYERROR; // Can't continue, jump to next yyerrok - } - cont->checkIntroduced(scoped->v); + string msg = "`"; + msg += scoped->v; + msg += "' must be an interface"; + unit->error(msg); + YYERROR; // Can't continue, jump to next yyerrok } - $$ = types.front(); + cont->checkIntroduced(scoped->v); + + $$ = firstType; } else { @@ -2222,14 +2085,9 @@ const_initializer else { def = new ConstDefTok; - string msg = "illegal initializer: `" + scoped->v + "' is a"; - static const string vowels = "aeiou"; + string msg = "illegal initializer: `" + scoped->v + "' is "; string kindOf = cl.front()->kindOf(); - if(vowels.find_first_of(kindOf[0]) != string::npos) - { - msg += "n"; - } - msg += " " + kindOf; + msg += prependA(kindOf); unit->error(msg); // $$ is dummy } } diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index e3dca36a66d..44e1b1379e8 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -77,18 +77,6 @@ string readWriteAttribute[] = { "read", "write" }; string txAttribute[] = { "supports", "mandatory", "required", "never" }; enum { Supports, Mandatory, Required, Never }; -string -prependA(const string& s) // return a or an -{ - static const string vowels = "aeiou"; - string prefix = "a"; - if (vowels.find_first_of(s[0]) != string::npos) - { - prefix += "n"; - } - return prefix + " " + s; -} - DataMemberList filterOrderedOptionalDataMembers(const DataMemberList& members) { @@ -2822,14 +2810,7 @@ Slice::Container::checkForGlobalDef(const string& name, const char* newConstruct { if(dynamic_cast(this) && strcmp(newConstruct, "module")) { - static const string vowels = "aeiou"; - string glottalStop; - if(vowels.find_first_of(newConstruct[0]) != string::npos) - { - glottalStop = "n"; - } - _unit->error("`" + name + "': a" + glottalStop + " " + newConstruct + - " can be defined only at module scope"); + _unit->error("`" + name + "': " + prependA(newConstruct) + " can be defined only at module scope"); return false; } return true; @@ -3328,6 +3309,8 @@ Slice::ClassDef::createDataMember(const string& name, const TypePtr& type, bool } } + checkIdentifier(name); // Don't return here -- we create the data member anyway. + // // Check whether any bases have defined something with the same name already. // @@ -4157,6 +4140,8 @@ Slice::Exception::createDataMember(const string& name, const TypePtr& type, bool } } + checkIdentifier(name); // Don't return here -- we create the data member anyway. + string newName = IceUtilInternal::toLower(name); // // Check whether any bases have defined a member with the same name already. @@ -4479,6 +4464,8 @@ Slice::Struct::createDataMember(const string& name, const TypePtr& type, bool op } } + checkIdentifier(name); // Don't return here -- we create the data member anyway. + // // Structures cannot contain themselves. // @@ -5358,8 +5345,7 @@ Slice::Operation::createParamDecl(const string& name, const TypePtr& type, bool } } - string newName = IceUtilInternal::toLower(name); - string thisName = IceUtilInternal::toLower(this->name()); + checkIdentifier(name); // Don't return here -- we create the parameter anyway. // // Check that in parameters don't follow out parameters. diff --git a/cpp/src/Slice/SliceUtil.cpp b/cpp/src/Slice/SliceUtil.cpp index 31261b38542..d13ff4db8b3 100644 --- a/cpp/src/Slice/SliceUtil.cpp +++ b/cpp/src/Slice/SliceUtil.cpp @@ -458,6 +458,18 @@ Slice::argvToArgs(int argc, char* argv[]) return ids; } +string +Slice::prependA(const string& s) +{ + static const string vowels = "aeiou"; + string prefix = "a"; + if (vowels.find_first_of(s[0]) != string::npos) + { + prefix += "n"; + } + return prefix + " " + s; +} + bool Slice::checkIdentifier(const string& id) { diff --git a/cpp/src/Slice/Util.h b/cpp/src/Slice/Util.h index 19f34ac428e..f5212d1fe99 100644 --- a/cpp/src/Slice/Util.h +++ b/cpp/src/Slice/Util.h @@ -48,6 +48,10 @@ writeDependencies(const std::string&, const std::string&); std::vector splitScopedName(const std::string&, bool = true); +// return a or an +std::string +prependA(const std::string&); + // Checks an identifier for illegal syntax and reports any that is present. bool checkIdentifier(const std::string&); diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 9bf7f943e72..9d73af0060b 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -592,7 +592,6 @@ emitOpNameResult(IceUtilInternal::Output& H, const OperationPtr& p, int useWstri { string name = p->name(); - ContainerPtr container = p->container(); InterfaceDefPtr interface = p->interface(); string interfaceScope = fixKwd(interface->scope()); @@ -1712,7 +1711,6 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) void Slice::Gen::TypesVisitor::visitDataMember(const DataMemberPtr& p) { - ContainerPtr container = p->container(); string name = fixKwd(p->name()); writeDocSummary(H, p); @@ -2154,7 +2152,6 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) returnTypeToString(ret, retIsOpt, "", p->getMetaData(), _useWstring | TypeContextAMIPrivateEnd); string retInS = retS != "void" ? inputTypeToString(ret, retIsOpt, "", p->getMetaData(), _useWstring) : ""; - ContainerPtr container = p->container(); InterfaceDefPtr interface = p->interface(); string interfaceName = interface->name(); string interfaceScope = fixKwd(interface->scope()); @@ -2897,7 +2894,6 @@ Slice::Gen::InterfaceVisitor::visitOperation(const OperationPtr& p) string scoped = fixKwd(p->scoped()); string scope = fixKwd(p->scope()); - ContainerPtr container = p->container(); InterfaceDefPtr interface = p->interface(); string classNameAMD = "AMD_" + interface->name(); string classScope = fixKwd(interface->scope()); @@ -4356,7 +4352,6 @@ Slice::Gen::AsyncVisitor::visitInterfaceDefEnd(const InterfaceDefPtr&) void Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) { - ContainerPtr container = p->container(); InterfaceDefPtr interface = p->interface(); if((!interface->hasMetaData("amd") && !p->hasMetaData("amd"))) @@ -6095,8 +6090,6 @@ Slice::Gen::Cpp11ProxyVisitor::visitOperation(const OperationPtr& p) string name = p->name(); string flatName = "iceC" + p->flattenedScope() + p->name() + "_name"; - ContainerPtr container = p->container(); - InterfaceDefPtr interface = p->interface(); string interfaceScope = fixKwd(interface->scope()); @@ -6939,7 +6932,6 @@ Slice::Gen::Cpp11InterfaceVisitor::visitOperation(const OperationPtr& p) vector responseParamsDecl; vector responseParamsImplDecl; - ContainerPtr container = p->container(); InterfaceDefPtr interface = p->interface(); string interfaceScope = fixKwd(interface->scope());