diff --git a/cpp/include/IceUtil/ScannerConfig.h b/cpp/include/IceUtil/ScannerConfig.h index 5a2f8a3c8fc..aded7688d7f 100644 --- a/cpp/include/IceUtil/ScannerConfig.h +++ b/cpp/include/IceUtil/ScannerConfig.h @@ -9,6 +9,8 @@ #ifdef _MSC_VER # define YY_NO_UNISTD_H +// Warning C4018: signed/unsigned mismatch +# pragma warning(disable : 4018) // Warning C4244: conversion from `int` to `_Elem`, possible loss of data # pragma warning(disable : 4244) // warning C4267: conversion from 'size_t' to 'int', possible loss of data diff --git a/cpp/src/Slice/Grammar.cpp b/cpp/src/Slice/Grammar.cpp index 301d80dc16b..befc734acdd 100644 --- a/cpp/src/Slice/Grammar.cpp +++ b/cpp/src/Slice/Grammar.cpp @@ -268,62 +268,63 @@ enum yysymbol_kind_t YYSYMBOL_75_13 = 75, /* $@13 */ YYSYMBOL_module_def = 76, /* module_def */ YYSYMBOL_77_14 = 77, /* @14 */ - YYSYMBOL_exception_id = 78, /* exception_id */ - YYSYMBOL_exception_decl = 79, /* exception_decl */ - YYSYMBOL_exception_def = 80, /* exception_def */ - YYSYMBOL_81_15 = 81, /* @15 */ - YYSYMBOL_exception_extends = 82, /* exception_extends */ - 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_78_15 = 78, /* @15 */ + YYSYMBOL_exception_id = 79, /* exception_id */ + YYSYMBOL_exception_decl = 80, /* exception_decl */ + YYSYMBOL_exception_def = 81, /* exception_def */ + YYSYMBOL_82_16 = 82, /* @16 */ + YYSYMBOL_exception_extends = 83, /* exception_extends */ + YYSYMBOL_type_id = 84, /* type_id */ + YYSYMBOL_tag = 85, /* tag */ + YYSYMBOL_optional = 86, /* optional */ + YYSYMBOL_tagged_type_id = 87, /* tagged_type_id */ + YYSYMBOL_struct_id = 88, /* struct_id */ + YYSYMBOL_struct_decl = 89, /* struct_decl */ + YYSYMBOL_struct_def = 90, /* struct_def */ + YYSYMBOL_91_17 = 91, /* @17 */ + YYSYMBOL_class_name = 92, /* class_name */ + YYSYMBOL_class_id = 93, /* class_id */ + YYSYMBOL_class_decl = 94, /* class_decl */ + YYSYMBOL_class_def = 95, /* class_def */ + YYSYMBOL_96_18 = 96, /* @18 */ + YYSYMBOL_class_extends = 97, /* class_extends */ + YYSYMBOL_extends = 98, /* extends */ + YYSYMBOL_data_members = 99, /* data_members */ + YYSYMBOL_data_member = 100, /* data_member */ + YYSYMBOL_return_type = 101, /* return_type */ + YYSYMBOL_operation_preamble = 102, /* operation_preamble */ + YYSYMBOL_operation = 103, /* operation */ 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_105_20 = 105, /* @20 */ + YYSYMBOL_interface_id = 106, /* interface_id */ + YYSYMBOL_interface_decl = 107, /* interface_decl */ + YYSYMBOL_interface_def = 108, /* interface_def */ + YYSYMBOL_109_21 = 109, /* @21 */ + YYSYMBOL_interface_list = 110, /* interface_list */ + YYSYMBOL_interface_extends = 111, /* interface_extends */ + YYSYMBOL_operations = 112, /* operations */ + YYSYMBOL_exception_list = 113, /* exception_list */ + YYSYMBOL_exception = 114, /* exception */ + YYSYMBOL_sequence_def = 115, /* sequence_def */ + YYSYMBOL_dictionary_def = 116, /* dictionary_def */ + YYSYMBOL_enum_id = 117, /* enum_id */ + YYSYMBOL_enum_def = 118, /* enum_def */ 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 */ + YYSYMBOL_120_23 = 120, /* @23 */ + YYSYMBOL_enumerator_list = 121, /* enumerator_list */ + YYSYMBOL_enumerator = 122, /* enumerator */ + YYSYMBOL_enumerator_initializer = 123, /* enumerator_initializer */ + YYSYMBOL_out_qualifier = 124, /* out_qualifier */ + YYSYMBOL_parameters = 125, /* parameters */ + YYSYMBOL_throws = 126, /* throws */ + YYSYMBOL_scoped_name = 127, /* scoped_name */ + YYSYMBOL_builtin = 128, /* builtin */ + YYSYMBOL_type = 129, /* type */ + YYSYMBOL_string_literal = 130, /* string_literal */ + YYSYMBOL_string_list = 131, /* string_list */ + YYSYMBOL_const_initializer = 132, /* const_initializer */ + YYSYMBOL_const_def = 133, /* const_def */ + YYSYMBOL_keyword = 134 /* keyword */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -334,7 +335,7 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; // This must match the definition of 'yylex' (or 'slice_lex') in the generated scanner. int slice_lex(YYSTYPE* lvalp, YYLTYPE* llocp); -#line 347 "src/Slice/Grammar.cpp" +#line 348 "src/Slice/Grammar.cpp" #ifdef short # undef short @@ -645,16 +646,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 674 +#define YYLAST 679 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 56 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 78 +#define YYNNTS 79 /* YYNRULES -- Number of rules. */ -#define YYNRULES 207 +#define YYNRULES 209 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 300 +#define YYNSTATES 305 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 300 @@ -682,17 +683,18 @@ static const yytype_int8 yytranslate[] = { #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 187, 187, 195, 198, 206, 210, 220, 224, 233, 241, 250, 259, 258, 264, 263, 268, 273, 272, - 278, 277, 282, 287, 286, 292, 291, 296, 301, 300, 306, 305, 310, 315, 314, 320, 319, 324, 329, - 328, 333, 338, 337, 343, 342, 347, 351, 361, 360, 393, 397, 408, 419, 418, 444, 452, 461, 474, - 492, 571, 577, 588, 606, 684, 690, 701, 710, 719, 732, 736, 747, 758, 757, 796, 800, 811, 836, - 926, 938, 951, 950, 984, 1018, 1027, 1030, 1038, 1047, 1050, 1054, 1062, 1092, 1126, 1148, 1174, 1180, 1186, - 1192, 1202, 1226, 1256, 1280, 1315, 1314, 1337, 1336, 1359, 1363, 1374, 1388, 1387, 1421, 1456, 1491, 1496, 1506, - 1510, 1519, 1528, 1531, 1535, 1543, 1550, 1562, 1574, 1585, 1593, 1607, 1617, 1633, 1637, 1649, 1648, 1680, 1679, - 1697, 1703, 1711, 1723, 1743, 1750, 1760, 1764, 1805, 1811, 1822, 1825, 1841, 1857, 1869, 1881, 1892, 1908, 1912, - 1921, 1924, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1946, 1950, 1955, 1986, 2022, 2028, 2036, - 2043, 2055, 2064, 2073, 2108, 2115, 2122, 2134, 2143, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, - 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184}; + 0, 187, 187, 195, 198, 206, 210, 220, 224, 233, 241, 250, 259, 258, 264, 263, 268, 273, + 272, 278, 277, 282, 287, 286, 292, 291, 296, 301, 300, 306, 305, 310, 315, 314, 320, 319, + 324, 329, 328, 333, 338, 337, 343, 342, 347, 351, 361, 360, 389, 388, 470, 474, 485, 496, + 495, 521, 529, 538, 551, 569, 648, 654, 665, 683, 761, 767, 778, 787, 796, 809, 813, 824, + 835, 834, 873, 877, 888, 913, 1003, 1015, 1028, 1027, 1061, 1095, 1104, 1107, 1115, 1124, 1127, 1131, + 1139, 1169, 1203, 1225, 1251, 1257, 1263, 1269, 1279, 1303, 1333, 1357, 1392, 1391, 1414, 1413, 1436, 1440, + 1451, 1465, 1464, 1498, 1533, 1568, 1573, 1583, 1587, 1596, 1605, 1608, 1612, 1620, 1627, 1639, 1651, 1662, + 1670, 1684, 1694, 1710, 1714, 1726, 1725, 1757, 1756, 1774, 1780, 1788, 1800, 1820, 1827, 1837, 1841, 1882, + 1888, 1899, 1902, 1918, 1934, 1946, 1958, 1969, 1985, 1989, 1998, 2001, 2009, 2010, 2011, 2012, 2013, 2014, + 2015, 2016, 2017, 2018, 2023, 2027, 2032, 2063, 2099, 2105, 2113, 2120, 2132, 2141, 2150, 2185, 2192, 2199, + 2211, 2220, 2234, 2235, 2236, 2237, 2238, 2239, 2240, 2241, 2242, 2243, 2244, 2245, 2246, 2247, 2248, 2249, + 2250, 2251, 2252, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261}; #endif /** Accessing symbol of state STATE. */ @@ -784,10 +786,11 @@ static const char* const yytname[] = { "$@13", "module_def", "@14", + "@15", "exception_id", "exception_decl", "exception_def", - "@15", + "@16", "exception_extends", "type_id", "tag", @@ -796,12 +799,12 @@ static const char* const yytname[] = { "struct_id", "struct_decl", "struct_def", - "@16", + "@17", "class_name", "class_id", "class_decl", "class_def", - "@17", + "@18", "class_extends", "extends", "data_members", @@ -809,12 +812,12 @@ static const char* const yytname[] = { "return_type", "operation_preamble", "operation", - "@18", "@19", + "@20", "interface_id", "interface_decl", "interface_def", - "@20", + "@21", "interface_list", "interface_extends", "operations", @@ -824,8 +827,8 @@ static const char* const yytname[] = { "dictionary_def", "enum_id", "enum_def", - "@21", "@22", + "@23", "enumerator_list", "enumerator", "enumerator_initializer", @@ -849,178 +852,179 @@ yysymbol_name(yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-256) +#define YYPACT_NINF (-238) #define yypact_value_is_default(Yyn) ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-144) +#define YYTABLE_NINF (-146) #define yytable_value_is_error(Yyn) 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { - -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}; + -238, 15, 28, -238, -8, -8, -8, -238, 648, -8, -238, 20, -28, 52, -15, 66, 288, 360, + 392, 424, 5, 29, 456, 57, -238, -238, 18, 51, -238, 38, 63, -238, 24, 2, 80, -238, + 39, 126, -238, 135, 144, -238, -238, 147, -238, -238, -8, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, 76, -238, -238, -238, -238, -238, -238, -238, 57, + 57, -238, 105, -238, 644, 149, -238, -238, -238, 79, 151, 149, 152, 155, 149, -238, 79, 157, + 149, 72, -238, 158, 149, 159, 160, 161, 149, 164, -238, 174, 176, 100, -238, -238, 142, 644, + 644, 488, -238, -238, -238, -238, -238, -238, -238, -238, 169, -238, 173, -238, -16, -238, -238, 182, + -238, -238, -238, 197, -238, -238, 183, -238, -238, -238, -238, -238, -238, 184, 187, -238, -238, -238, + -238, 488, -238, -238, -238, -238, -238, -238, 153, 192, 188, 205, 213, -238, -238, -238, 215, 217, + 197, 226, 604, 229, 197, 72, 102, 230, 103, 199, 520, 57, 145, -238, 488, 217, -238, -238, + -238, -238, -238, -238, -238, 232, 197, -238, -238, 45, 49, -238, 644, 644, 231, 235, 552, -238, + 237, -238, 241, 240, 238, -238, -238, -238, -238, -238, 644, -238, -238, -238, -238, -238, -238, -238, + 270, -238, 271, 272, -238, 274, -238, 290, -238, 217, 197, -238, -238, -238, 102, -238, 139, 644, + 644, 93, 26, 279, -238, -238, 273, -238, -238, -238, -238, -238, -238, -238, 106, -238, -238, -238, + -238, 277, -238, 57, -32, 102, 584, -238, -238, -238, 604, -238, 317, -238, -238, -238, 345, -238, + 552, 345, 57, 327, -238, -238, -238, 604, -238, 307, -238, -238, -238, 552, 327, -238, -238}; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { - 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}; + 11, 0, 8, 1, 0, 0, 0, 9, 0, 171, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 133, 8, 10, 12, 52, 26, 27, 71, 31, 32, 79, 83, 16, 17, 108, 21, 22, 36, 39, 131, 40, 44, + 170, 7, 0, 5, 6, 45, 46, 48, 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, 208, 209, 74, 0, 75, 106, 107, 50, 51, 69, + 70, 8, 8, 129, 0, 130, 0, 4, 84, 85, 53, 0, 0, 4, 0, 0, 4, 80, 0, 0, 4, 0, + 109, 0, 4, 0, 0, 0, 4, 0, 172, 0, 0, 0, 154, 155, 0, 0, 0, 140, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 168, 167, 0, 3, 13, 0, 55, 25, 28, 0, 30, 33, 0, 82, 15, 18, + 113, 114, 115, 112, 0, 20, 23, 35, 38, 140, 41, 43, 11, 11, 76, 77, 0, 0, 137, 0, 136, 139, + 166, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 0, 8, 0, 134, 140, 0, 178, 179, + 177, 174, 175, 176, 181, 0, 0, 61, 65, 0, 0, 68, 0, 0, 90, 88, 93, 73, 0, 111, 0, 0, + 0, 132, 47, 49, 125, 126, 0, 141, 138, 142, 135, 180, 54, 87, 0, 60, 0, 0, 64, 0, 66, 0, + 67, 0, 0, 57, 92, 81, 0, 97, 0, 0, 0, 0, 0, 119, 96, 110, 0, 58, 59, 62, 63, 91, + 86, 118, 0, 94, 95, 98, 100, 0, 143, 8, 0, 0, 0, 99, 101, 104, 0, 102, 144, 117, 127, 128, + 153, 146, 150, 153, 8, 0, 105, 148, 103, 0, 152, 122, 123, 124, 147, 151, 0, 149, 121}; /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = {-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}; +static const yytype_int16 yypgoto[] = { + -238, -238, 84, -238, -2, -23, -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, -40, -216, -187, -204, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, -11, -171, -238, 110, -238, -238, + -238, -238, -238, -238, -238, -238, 206, -238, -237, 90, -238, -238, -238, -238, -238, -238, + -238, -104, -238, -238, 111, -238, 134, -80, -238, -86, 7, 170, -193, -238, -12}; /* YYDEFGOTO[NTERM-NUM]. */ -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, 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}; +static const yytype_int16 yydefgoto[] = {0, 1, 142, 7, 182, 2, 24, 95, 107, 108, 111, 112, 100, 101, 103, 104, + 113, 114, 116, 117, 25, 119, 120, 26, 27, 28, 143, 98, 209, 210, 211, 212, + 29, 30, 31, 102, 32, 33, 34, 35, 150, 105, 99, 183, 213, 253, 254, 255, + 289, 286, 36, 37, 38, 158, 156, 110, 220, 296, 297, 39, 40, 41, 42, 115, + 92, 173, 174, 228, 273, 274, 292, 138, 139, 241, 10, 11, 202, 43, 175}; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 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, 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, 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, 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, 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, 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, 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, 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}; + 8, 124, 231, 251, 82, 84, 86, 88, 140, 203, 93, 265, 47, 216, 96, 3, 44, 281, 178, 144, + 282, 94, 106, 9, 46, 109, 151, 271, -2, 157, 96, 49, 252, 233, 251, 179, -78, 272, 283, 170, + 171, -144, -144, -144, -144, -144, -144, -144, -144, -144, 263, 96, 97, 118, -144, -144, -144, 45, 89, 187, + -144, -144, -144, 252, 4, -56, 5, 6, 97, -144, -144, -78, 46, 264, -78, -145, 287, 234, -145, 122, + 123, 237, 90, 122, 123, -72, -116, 125, 126, 97, 230, 300, 48, 4, 235, 154, 214, -24, 238, 201, + 50, 51, 155, 218, 46, 157, 122, 123, 121, -29, 122, 123, 229, 122, 123, 201, -8, -8, -8, -8, + -8, -8, -8, -8, -8, -8, -14, 236, 239, -8, -8, -8, -8, 256, 269, 270, -8, -8, 4, 4, + 258, 5, 6, 188, 189, -8, -8, 277, 278, 168, -120, 222, 127, 249, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 201, 256, 267, 268, 205, 206, 137, 240, 242, -19, 122, 123, 12, 13, 227, 225, 122, + 123, -34, 207, 208, 219, 146, 8, 8, 149, 226, -37, 169, 153, -42, 288, 141, 160, 145, 181, 147, + 164, 148, 246, 152, 159, 161, 162, 190, 163, 301, 165, 298, -8, -8, -8, -8, -8, -8, -8, -8, + -8, 166, 298, 167, 176, -8, -8, -8, 177, 180, 184, -8, -8, 4, 186, 4, 185, 5, 6, 192, + -8, -8, 196, 197, 191, -89, 219, 223, 198, 199, 200, 122, 123, 193, 249, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 285, 194, 195, 250, 205, 206, 137, 280, 204, 219, 122, 123, 293, 215, 221, 299, + 232, 244, 243, 207, 208, 247, 257, 248, 295, 303, 299, 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, 79, 259, + 260, 261, 80, 262, 245, 275, 279, 276, 272, 81, 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, 79, 291, 302, + 266, 122, 123, 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, 79, 217, 304, 290, 83, 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, 79, 294, 0, 0, 85, 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, 79, 0, 0, 0, 87, 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, 79, 0, 0, 0, 91, 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, 79, 0, + 0, 0, 172, 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, 79, 0, 0, 0, 224, 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, 79, 0, 0, 0, 245, 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, 79, 0, 0, 0, 284, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 0, 0, 0, 0, 205, 206, 137, 0, 0, 0, 122, 123, + 0, 0, 0, 0, 0, 0, 0, 207, 208, 14, 0, 15, 16, 17, 18, 19, 20, 21, 22, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 0, 0, 0, 0, 23, 0, 137, 0, 0, 0, 122, 123}; static const yytype_int16 yycheck[] = { - 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, + 2, 81, 195, 219, 16, 17, 18, 19, 94, 180, 22, 248, 40, 184, 12, 0, 9, 49, 34, 99, 52, 23, 33, + 31, 52, 36, 106, 1, 0, 109, 12, 46, 219, 204, 250, 51, 12, 11, 275, 125, 126, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 243, 12, 50, 46, 28, 29, 30, 37, 53, 163, 34, 35, 36, 250, 36, 47, 38, 39, 50, + 43, 44, 47, 52, 244, 50, 49, 280, 32, 52, 34, 35, 32, 53, 34, 35, 47, 47, 89, 90, 50, 194, 295, + 40, 36, 49, 23, 182, 46, 49, 179, 34, 35, 30, 1, 52, 185, 34, 35, 32, 46, 34, 35, 192, 34, 35, + 195, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 46, 207, 208, 27, 28, 29, 30, 219, 41, 42, 34, 35, + 36, 36, 226, 38, 39, 166, 167, 43, 44, 41, 42, 49, 48, 48, 47, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 243, 250, 251, 252, 28, 29, 30, 210, 211, 46, 34, 35, 5, 6, 32, 190, 34, 35, 46, 43, 44, + 186, 101, 188, 189, 104, 191, 46, 49, 108, 46, 280, 46, 112, 46, 1, 47, 116, 46, 214, 46, 46, 46, 46, + 54, 47, 295, 46, 291, 15, 16, 17, 18, 19, 20, 21, 22, 23, 47, 302, 47, 55, 28, 29, 30, 55, 47, + 47, 34, 35, 36, 47, 36, 52, 38, 39, 51, 43, 44, 25, 26, 52, 48, 248, 48, 31, 32, 33, 34, 35, + 48, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 276, 52, 51, 27, 28, 29, 30, 273, 46, 275, 34, 35, + 288, 48, 48, 291, 48, 46, 51, 43, 44, 48, 48, 46, 290, 301, 302, 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, 49, 49, + 34, 49, 34, 46, 49, 54, 11, 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, 13, 52, 250, 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, + 185, 302, 282, 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, 289, -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, 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, 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, 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}; + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, -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 state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 57, 61, 0, 36, 38, 39, 59, 60, 31, 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, 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}; + 0, 57, 61, 0, 36, 38, 39, 59, 60, 31, 130, 131, 131, 131, 1, 3, 4, 5, 6, 7, 8, 9, + 10, 24, 62, 76, 79, 80, 81, 88, 89, 90, 92, 93, 94, 95, 106, 107, 108, 115, 116, 117, 118, 133, + 130, 37, 52, 40, 40, 46, 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, 34, 41, 134, 34, 134, 34, 134, 34, + 134, 53, 53, 34, 120, 134, 60, 63, 12, 50, 83, 98, 68, 69, 91, 70, 71, 97, 98, 64, 65, 98, + 111, 66, 67, 72, 73, 119, 74, 75, 130, 77, 78, 32, 34, 35, 127, 60, 60, 47, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 30, 127, 128, 129, 46, 58, 82, 127, 46, 58, 47, 46, 58, 96, 127, 46, 58, + 23, 30, 110, 127, 109, 46, 58, 46, 46, 47, 58, 46, 47, 47, 49, 49, 129, 129, 34, 121, 122, 134, + 55, 55, 34, 51, 47, 1, 60, 99, 47, 52, 47, 121, 61, 61, 54, 52, 51, 48, 52, 51, 25, 26, + 31, 32, 33, 127, 132, 99, 46, 28, 29, 43, 44, 84, 85, 86, 87, 100, 129, 48, 99, 110, 1, 60, + 112, 48, 48, 48, 34, 134, 60, 32, 123, 127, 121, 132, 48, 99, 32, 49, 127, 32, 49, 127, 84, 129, + 84, 51, 46, 34, 134, 48, 46, 14, 27, 85, 86, 101, 102, 103, 129, 48, 129, 49, 49, 49, 49, 132, + 99, 112, 101, 129, 129, 41, 42, 1, 11, 124, 125, 46, 54, 41, 42, 49, 60, 49, 52, 112, 34, 134, + 105, 87, 129, 104, 124, 13, 126, 134, 126, 60, 113, 114, 127, 134, 87, 129, 52, 134, 113}; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_uint8 yyr1[] = { 0, 56, 57, 58, 58, 59, 59, 60, 60, 61, 61, 61, 63, 62, 64, 62, 62, 65, 62, 66, 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, 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}; + 75, 62, 62, 62, 77, 76, 78, 76, 79, 79, 80, 82, 81, 83, 83, 84, 85, 85, 85, 85, 86, + 86, 86, 86, 87, 87, 87, 88, 88, 89, 91, 90, 92, 92, 93, 93, 93, 94, 96, 95, 97, 97, + 98, 98, 99, 99, 99, 99, 100, 100, 100, 100, 101, 101, 101, 101, 102, 102, 102, 102, 104, 103, 105, + 103, 106, 106, 107, 109, 108, 110, 110, 110, 110, 111, 111, 112, 112, 112, 112, 113, 113, 114, 114, 115, + 115, 116, 116, 117, 117, 119, 118, 120, 118, 121, 121, 122, 122, 122, 122, 123, 123, 124, 124, 125, 125, + 125, 125, 125, 125, 125, 126, 126, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, + 129, 129, 130, 130, 131, 131, 132, 132, 132, 132, 132, 132, 133, 133, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134}; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 1, 1, 0, 3, 3, 3, 0, 2, 3, 0, 0, 3, 0, 3, 1, 0, 3, 0, 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, 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, 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, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 3, 1, 1, 1, 1, - 1, 1, 1, 6, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; + 3, 1, 0, 3, 1, 0, 3, 0, 3, 1, 2, 0, 6, 0, 6, 2, 2, 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, 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, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 6, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; enum { @@ -1584,21 +1588,21 @@ yyparse(void) #line 188 "src/Slice/Grammar.y" { } -#line 1738 "src/Slice/Grammar.cpp" +#line 1742 "src/Slice/Grammar.cpp" break; case 3: /* opt_semicolon: ';' */ #line 196 "src/Slice/Grammar.y" { } -#line 1745 "src/Slice/Grammar.cpp" +#line 1749 "src/Slice/Grammar.cpp" break; case 4: /* opt_semicolon: %empty */ #line 199 "src/Slice/Grammar.y" { } -#line 1752 "src/Slice/Grammar.cpp" +#line 1756 "src/Slice/Grammar.cpp" break; case 5: /* global_meta_data: ICE_GLOBAL_METADATA_OPEN string_list ICE_GLOBAL_METADATA_CLOSE */ @@ -1606,7 +1610,7 @@ yyparse(void) { yyval = yyvsp[-1]; } -#line 1760 "src/Slice/Grammar.cpp" +#line 1764 "src/Slice/Grammar.cpp" break; case 6: /* global_meta_data: ICE_GLOBAL_METADATA_IGNORE string_list ICE_GLOBAL_METADATA_CLOSE */ @@ -1615,7 +1619,7 @@ yyparse(void) currentUnit->error("global metadata must appear before any definitions"); yyval = yyvsp[-1]; // Dummy } -#line 1769 "src/Slice/Grammar.cpp" +#line 1773 "src/Slice/Grammar.cpp" break; case 7: /* meta_data: ICE_METADATA_OPEN string_list ICE_METADATA_CLOSE */ @@ -1623,7 +1627,7 @@ yyparse(void) { yyval = yyvsp[-1]; } -#line 1777 "src/Slice/Grammar.cpp" +#line 1781 "src/Slice/Grammar.cpp" break; case 8: /* meta_data: %empty */ @@ -1631,7 +1635,7 @@ yyparse(void) { yyval = make_shared(); } -#line 1785 "src/Slice/Grammar.cpp" +#line 1789 "src/Slice/Grammar.cpp" break; case 9: /* definitions: definitions global_meta_data */ @@ -1643,7 +1647,7 @@ yyparse(void) currentUnit->addGlobalMetaData(metaData->v); } } -#line 1797 "src/Slice/Grammar.cpp" +#line 1801 "src/Slice/Grammar.cpp" break; case 10: /* definitions: definitions meta_data definition */ @@ -1656,14 +1660,14 @@ yyparse(void) contained->setMetaData(metaData->v); } } -#line 1810 "src/Slice/Grammar.cpp" +#line 1814 "src/Slice/Grammar.cpp" break; case 11: /* definitions: %empty */ #line 251 "src/Slice/Grammar.y" { } -#line 1817 "src/Slice/Grammar.cpp" +#line 1821 "src/Slice/Grammar.cpp" break; case 12: /* $@1: %empty */ @@ -1671,7 +1675,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr || dynamic_pointer_cast(yyvsp[0])); } -#line 1825 "src/Slice/Grammar.cpp" +#line 1829 "src/Slice/Grammar.cpp" break; case 14: /* $@2: %empty */ @@ -1679,7 +1683,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr || dynamic_pointer_cast(yyvsp[0])); } -#line 1833 "src/Slice/Grammar.cpp" +#line 1837 "src/Slice/Grammar.cpp" break; case 16: /* definition: class_decl */ @@ -1687,7 +1691,7 @@ yyparse(void) { currentUnit->error("`;' missing after class forward declaration"); } -#line 1841 "src/Slice/Grammar.cpp" +#line 1845 "src/Slice/Grammar.cpp" break; case 17: /* $@3: %empty */ @@ -1695,7 +1699,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr || dynamic_pointer_cast(yyvsp[0])); } -#line 1849 "src/Slice/Grammar.cpp" +#line 1853 "src/Slice/Grammar.cpp" break; case 19: /* $@4: %empty */ @@ -1703,7 +1707,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr || dynamic_pointer_cast(yyvsp[0])); } -#line 1857 "src/Slice/Grammar.cpp" +#line 1861 "src/Slice/Grammar.cpp" break; case 21: /* definition: interface_decl */ @@ -1711,7 +1715,7 @@ yyparse(void) { currentUnit->error("`;' missing after interface forward declaration"); } -#line 1865 "src/Slice/Grammar.cpp" +#line 1869 "src/Slice/Grammar.cpp" break; case 22: /* $@5: %empty */ @@ -1719,7 +1723,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr || dynamic_pointer_cast(yyvsp[0])); } -#line 1873 "src/Slice/Grammar.cpp" +#line 1877 "src/Slice/Grammar.cpp" break; case 24: /* $@6: %empty */ @@ -1727,7 +1731,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr); } -#line 1881 "src/Slice/Grammar.cpp" +#line 1885 "src/Slice/Grammar.cpp" break; case 26: /* definition: exception_decl */ @@ -1735,7 +1739,7 @@ yyparse(void) { currentUnit->error("`;' missing after exception forward declaration"); } -#line 1889 "src/Slice/Grammar.cpp" +#line 1893 "src/Slice/Grammar.cpp" break; case 27: /* $@7: %empty */ @@ -1743,7 +1747,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr || dynamic_pointer_cast(yyvsp[0])); } -#line 1897 "src/Slice/Grammar.cpp" +#line 1901 "src/Slice/Grammar.cpp" break; case 29: /* $@8: %empty */ @@ -1751,7 +1755,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr); } -#line 1905 "src/Slice/Grammar.cpp" +#line 1909 "src/Slice/Grammar.cpp" break; case 31: /* definition: struct_decl */ @@ -1759,7 +1763,7 @@ yyparse(void) { currentUnit->error("`;' missing after struct forward declaration"); } -#line 1913 "src/Slice/Grammar.cpp" +#line 1917 "src/Slice/Grammar.cpp" break; case 32: /* $@9: %empty */ @@ -1767,7 +1771,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr || dynamic_pointer_cast(yyvsp[0])); } -#line 1921 "src/Slice/Grammar.cpp" +#line 1925 "src/Slice/Grammar.cpp" break; case 34: /* $@10: %empty */ @@ -1775,7 +1779,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr || dynamic_pointer_cast(yyvsp[0])); } -#line 1929 "src/Slice/Grammar.cpp" +#line 1933 "src/Slice/Grammar.cpp" break; case 36: /* definition: sequence_def */ @@ -1783,7 +1787,7 @@ yyparse(void) { currentUnit->error("`;' missing after sequence definition"); } -#line 1937 "src/Slice/Grammar.cpp" +#line 1941 "src/Slice/Grammar.cpp" break; case 37: /* $@11: %empty */ @@ -1791,7 +1795,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr || dynamic_pointer_cast(yyvsp[0])); } -#line 1945 "src/Slice/Grammar.cpp" +#line 1949 "src/Slice/Grammar.cpp" break; case 39: /* definition: dictionary_def */ @@ -1799,7 +1803,7 @@ yyparse(void) { currentUnit->error("`;' missing after dictionary definition"); } -#line 1953 "src/Slice/Grammar.cpp" +#line 1957 "src/Slice/Grammar.cpp" break; case 40: /* $@12: %empty */ @@ -1807,7 +1811,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr || dynamic_pointer_cast(yyvsp[0])); } -#line 1961 "src/Slice/Grammar.cpp" +#line 1965 "src/Slice/Grammar.cpp" break; case 42: /* $@13: %empty */ @@ -1815,7 +1819,7 @@ yyparse(void) { assert(yyvsp[0] == nullptr || dynamic_pointer_cast(yyvsp[0])); } -#line 1969 "src/Slice/Grammar.cpp" +#line 1973 "src/Slice/Grammar.cpp" break; case 44: /* definition: const_def */ @@ -1823,7 +1827,7 @@ yyparse(void) { currentUnit->error("`;' missing after const definition"); } -#line 1977 "src/Slice/Grammar.cpp" +#line 1981 "src/Slice/Grammar.cpp" break; case 45: /* definition: error ';' */ @@ -1831,7 +1835,7 @@ yyparse(void) { yyerrok; } -#line 1985 "src/Slice/Grammar.cpp" +#line 1989 "src/Slice/Grammar.cpp" break; case 46: /* @14: %empty */ @@ -1851,7 +1855,7 @@ yyparse(void) yyval = nullptr; } } -#line 2005 "src/Slice/Grammar.cpp" +#line 2009 "src/Slice/Grammar.cpp" break; case 47: /* module_def: ICE_MODULE ICE_IDENTIFIER @14 '{' definitions '}' */ @@ -1867,38 +1871,125 @@ yyparse(void) yyval = nullptr; } } -#line 2021 "src/Slice/Grammar.cpp" +#line 2025 "src/Slice/Grammar.cpp" + break; + + case 48: /* @15: %empty */ +#line 389 "src/Slice/Grammar.y" + { + auto ident = dynamic_pointer_cast(yyvsp[0]); + + // Reject scoped identifiers starting with "::". This is generally indicates global scope, but is invalid + // here. + size_t startPos = 0; + if (ident->v.find("::") == 0) + { + currentUnit->error("illegal identifier: module identifiers cannot start with '::' prefix"); + startPos += 2; // Skip the leading "::". + } + + // Split the scoped-identifier token into separate module names. + size_t endPos; + vector modules; + while ((endPos = ident->v.find("::", startPos)) != string::npos) + { + modules.push_back(ident->v.substr(startPos, (endPos - startPos))); + startPos = endPos + 2; // Skip the "::" separator. + } + modules.push_back(ident->v.substr(startPos)); + + // Create the nested modules. + ContainerPtr cont = currentUnit->currentContainer(); + for (size_t i = 0; i < modules.size(); i++) + { + const auto currentModuleName = modules[i]; + ModulePtr module = cont->createModule(currentModuleName); + if (module) + { + cont->checkIntroduced(currentModuleName, module); + currentUnit->pushContainer(module); + yyval = cont = module; + } + else + { + // If an error occurs while creating one of the modules, we have to stop. But, to eagerly report as + // many errors as possible, we still 'create' any remaining modules, which will run _some_ + // validation on them. + for (size_t j = (i + 1); j < modules.size(); j++) + { + cont->createModule(modules[j]); // Dummy + } + + // Then we roll back the chain, ie. pop the successfully-created-modules off the container stack. + for (; i > 0; i--) + { + currentUnit->popContainer(); + } + yyval = nullptr; + break; + } + } + } +#line 2082 "src/Slice/Grammar.cpp" + break; + + case 49: /* module_def: ICE_MODULE ICE_SCOPED_IDENTIFIER @15 '{' definitions '}' */ +#line 442 "src/Slice/Grammar.y" + { + if (yyvsp[-3]) + { + // We need to pop '(N+1)' modules off the container stack, to navigate out of the nested module. + // Where `N` is the number of scope separators ("::"). + size_t startPos = 0; + auto ident = dynamic_pointer_cast(yyvsp[-4]); + while ((startPos = ident->v.find("::", startPos)) != string::npos) + { + currentUnit->popContainer(); + startPos += 2; // Skip the "::" separator. + } + + // Set the 'return value' to the outer-most module, before we pop it off the stack. + // Whichever module we return, is the one that metadata will be applied to. + yyval = currentUnit->currentContainer(); + currentUnit->popContainer(); + } + else + { + yyval = nullptr; + } + } +#line 2110 "src/Slice/Grammar.cpp" break; - case 48: /* exception_id: ICE_EXCEPTION ICE_IDENTIFIER */ -#line 394 "src/Slice/Grammar.y" + case 50: /* exception_id: ICE_EXCEPTION ICE_IDENTIFIER */ +#line 471 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 2029 "src/Slice/Grammar.cpp" +#line 2118 "src/Slice/Grammar.cpp" break; - case 49: /* exception_id: ICE_EXCEPTION keyword */ -#line 398 "src/Slice/Grammar.y" + case 51: /* exception_id: ICE_EXCEPTION keyword */ +#line 475 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); currentUnit->error("keyword `" + ident->v + "' cannot be used as exception name"); yyval = yyvsp[0]; // Dummy } -#line 2039 "src/Slice/Grammar.cpp" +#line 2128 "src/Slice/Grammar.cpp" break; - case 50: /* exception_decl: exception_id */ -#line 409 "src/Slice/Grammar.y" + case 52: /* exception_decl: exception_id */ +#line 486 "src/Slice/Grammar.y" { currentUnit->error("exceptions cannot be forward declared"); yyval = nullptr; } -#line 2048 "src/Slice/Grammar.cpp" +#line 2137 "src/Slice/Grammar.cpp" break; - case 51: /* @15: %empty */ -#line 419 "src/Slice/Grammar.y" + case 53: /* @16: %empty */ +#line 496 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[-1]); auto base = dynamic_pointer_cast(yyvsp[0]); @@ -1911,11 +2002,11 @@ yyparse(void) } yyval = ex; } -#line 2065 "src/Slice/Grammar.cpp" +#line 2154 "src/Slice/Grammar.cpp" break; - case 52: /* exception_def: exception_id exception_extends @15 '{' data_members '}' */ -#line 432 "src/Slice/Grammar.y" + case 54: /* exception_def: exception_id exception_extends @16 '{' data_members '}' */ +#line 509 "src/Slice/Grammar.y" { if (yyvsp[-3]) { @@ -1923,11 +2014,11 @@ yyparse(void) } yyval = yyvsp[-3]; } -#line 2077 "src/Slice/Grammar.cpp" +#line 2166 "src/Slice/Grammar.cpp" break; - case 53: /* exception_extends: extends scoped_name */ -#line 445 "src/Slice/Grammar.y" + case 55: /* exception_extends: extends scoped_name */ +#line 522 "src/Slice/Grammar.y" { auto scoped = dynamic_pointer_cast(yyvsp[0]); ContainerPtr cont = currentUnit->currentContainer(); @@ -1935,19 +2026,19 @@ yyparse(void) cont->checkIntroduced(scoped->v); yyval = contained; } -#line 2089 "src/Slice/Grammar.cpp" +#line 2178 "src/Slice/Grammar.cpp" break; - case 54: /* exception_extends: %empty */ -#line 453 "src/Slice/Grammar.y" + case 56: /* exception_extends: %empty */ +#line 530 "src/Slice/Grammar.y" { yyval = nullptr; } -#line 2097 "src/Slice/Grammar.cpp" +#line 2186 "src/Slice/Grammar.cpp" break; - case 55: /* type_id: type ICE_IDENTIFIER */ -#line 462 "src/Slice/Grammar.y" + case 57: /* type_id: type ICE_IDENTIFIER */ +#line 539 "src/Slice/Grammar.y" { auto type = dynamic_pointer_cast(yyvsp[-1]); auto ident = dynamic_pointer_cast(yyvsp[0]); @@ -1955,11 +2046,11 @@ yyparse(void) typestring->v = make_pair(type, ident->v); yyval = typestring; } -#line 2109 "src/Slice/Grammar.cpp" +#line 2198 "src/Slice/Grammar.cpp" break; - case 56: /* tag: ICE_TAG_OPEN ICE_INTEGER_LITERAL ')' */ -#line 475 "src/Slice/Grammar.y" + case 58: /* tag: ICE_TAG_OPEN ICE_INTEGER_LITERAL ')' */ +#line 552 "src/Slice/Grammar.y" { auto i = dynamic_pointer_cast(yyvsp[-1]); @@ -1977,11 +2068,11 @@ yyparse(void) auto m = make_shared(tag); yyval = m; } -#line 2131 "src/Slice/Grammar.cpp" +#line 2220 "src/Slice/Grammar.cpp" break; - case 57: /* tag: ICE_TAG_OPEN scoped_name ')' */ -#line 493 "src/Slice/Grammar.y" + case 59: /* tag: ICE_TAG_OPEN scoped_name ')' */ +#line 570 "src/Slice/Grammar.y" { auto scoped = dynamic_pointer_cast(yyvsp[-1]); @@ -2062,31 +2153,31 @@ yyparse(void) auto m = make_shared(tag); yyval = m; } -#line 2214 "src/Slice/Grammar.cpp" +#line 2303 "src/Slice/Grammar.cpp" break; - case 58: /* tag: ICE_TAG_OPEN ')' */ -#line 572 "src/Slice/Grammar.y" + case 60: /* tag: ICE_TAG_OPEN ')' */ +#line 649 "src/Slice/Grammar.y" { currentUnit->error("missing tag"); auto m = make_shared(-1); // Dummy yyval = m; } -#line 2224 "src/Slice/Grammar.cpp" +#line 2313 "src/Slice/Grammar.cpp" break; - case 59: /* tag: ICE_TAG */ -#line 578 "src/Slice/Grammar.y" + case 61: /* tag: ICE_TAG */ +#line 655 "src/Slice/Grammar.y" { currentUnit->error("missing tag"); auto m = make_shared(-1); // Dummy yyval = m; } -#line 2234 "src/Slice/Grammar.cpp" +#line 2323 "src/Slice/Grammar.cpp" break; - case 60: /* optional: ICE_OPTIONAL_OPEN ICE_INTEGER_LITERAL ')' */ -#line 589 "src/Slice/Grammar.y" + case 62: /* optional: ICE_OPTIONAL_OPEN ICE_INTEGER_LITERAL ')' */ +#line 666 "src/Slice/Grammar.y" { auto i = dynamic_pointer_cast(yyvsp[-1]); @@ -2104,11 +2195,11 @@ yyparse(void) auto m = make_shared(tag); yyval = m; } -#line 2256 "src/Slice/Grammar.cpp" +#line 2345 "src/Slice/Grammar.cpp" break; - case 61: /* optional: ICE_OPTIONAL_OPEN scoped_name ')' */ -#line 607 "src/Slice/Grammar.y" + case 63: /* optional: ICE_OPTIONAL_OPEN scoped_name ')' */ +#line 684 "src/Slice/Grammar.y" { auto scoped = dynamic_pointer_cast(yyvsp[-1]); ContainerPtr cont = currentUnit->currentContainer(); @@ -2188,31 +2279,31 @@ yyparse(void) auto m = make_shared(tag); yyval = m; } -#line 2338 "src/Slice/Grammar.cpp" +#line 2427 "src/Slice/Grammar.cpp" break; - case 62: /* optional: ICE_OPTIONAL_OPEN ')' */ -#line 685 "src/Slice/Grammar.y" + case 64: /* optional: ICE_OPTIONAL_OPEN ')' */ +#line 762 "src/Slice/Grammar.y" { currentUnit->error("missing tag"); auto m = make_shared(-1); // Dummy yyval = m; } -#line 2348 "src/Slice/Grammar.cpp" +#line 2437 "src/Slice/Grammar.cpp" break; - case 63: /* optional: ICE_OPTIONAL */ -#line 691 "src/Slice/Grammar.y" + case 65: /* optional: ICE_OPTIONAL */ +#line 768 "src/Slice/Grammar.y" { currentUnit->error("missing tag"); auto m = make_shared(-1); // Dummy yyval = m; } -#line 2358 "src/Slice/Grammar.cpp" +#line 2447 "src/Slice/Grammar.cpp" break; - case 64: /* tagged_type_id: tag type_id */ -#line 702 "src/Slice/Grammar.y" + case 66: /* tagged_type_id: tag type_id */ +#line 779 "src/Slice/Grammar.y" { auto m = dynamic_pointer_cast(yyvsp[-1]); auto ts = dynamic_pointer_cast(yyvsp[0]); @@ -2221,11 +2312,11 @@ yyparse(void) m->name = ts->v.second; yyval = m; } -#line 2371 "src/Slice/Grammar.cpp" +#line 2460 "src/Slice/Grammar.cpp" break; - case 65: /* tagged_type_id: optional type_id */ -#line 711 "src/Slice/Grammar.y" + case 67: /* tagged_type_id: optional type_id */ +#line 788 "src/Slice/Grammar.y" { auto m = dynamic_pointer_cast(yyvsp[-1]); auto ts = dynamic_pointer_cast(yyvsp[0]); @@ -2234,11 +2325,11 @@ yyparse(void) m->name = ts->v.second; yyval = m; } -#line 2384 "src/Slice/Grammar.cpp" +#line 2473 "src/Slice/Grammar.cpp" break; - case 66: /* tagged_type_id: type_id */ -#line 720 "src/Slice/Grammar.y" + case 68: /* tagged_type_id: type_id */ +#line 797 "src/Slice/Grammar.y" { auto ts = dynamic_pointer_cast(yyvsp[0]); auto m = make_shared(-1); @@ -2246,38 +2337,38 @@ yyparse(void) m->name = ts->v.second; yyval = m; } -#line 2396 "src/Slice/Grammar.cpp" +#line 2485 "src/Slice/Grammar.cpp" break; - case 67: /* struct_id: ICE_STRUCT ICE_IDENTIFIER */ -#line 733 "src/Slice/Grammar.y" + case 69: /* struct_id: ICE_STRUCT ICE_IDENTIFIER */ +#line 810 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 2404 "src/Slice/Grammar.cpp" +#line 2493 "src/Slice/Grammar.cpp" break; - case 68: /* struct_id: ICE_STRUCT keyword */ -#line 737 "src/Slice/Grammar.y" + case 70: /* struct_id: ICE_STRUCT keyword */ +#line 814 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); currentUnit->error("keyword `" + ident->v + "' cannot be used as struct name"); yyval = yyvsp[0]; // Dummy } -#line 2414 "src/Slice/Grammar.cpp" +#line 2503 "src/Slice/Grammar.cpp" break; - case 69: /* struct_decl: struct_id */ -#line 748 "src/Slice/Grammar.y" + case 71: /* struct_decl: struct_id */ +#line 825 "src/Slice/Grammar.y" { currentUnit->error("structs cannot be forward declared"); yyval = nullptr; // Dummy } -#line 2423 "src/Slice/Grammar.cpp" +#line 2512 "src/Slice/Grammar.cpp" break; - case 70: /* @16: %empty */ -#line 758 "src/Slice/Grammar.y" + case 72: /* @17: %empty */ +#line 835 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); ContainerPtr cont = currentUnit->currentContainer(); @@ -2295,11 +2386,11 @@ yyparse(void) } yyval = st; } -#line 2445 "src/Slice/Grammar.cpp" +#line 2534 "src/Slice/Grammar.cpp" break; - case 71: /* struct_def: struct_id @16 '{' data_members '}' */ -#line 776 "src/Slice/Grammar.y" + case 73: /* struct_def: struct_id @17 '{' data_members '}' */ +#line 853 "src/Slice/Grammar.y" { if (yyvsp[-3]) { @@ -2315,29 +2406,29 @@ yyparse(void) currentUnit->error("struct `" + st->name() + "' must have at least one member"); // $$ is a dummy } } -#line 2465 "src/Slice/Grammar.cpp" +#line 2554 "src/Slice/Grammar.cpp" break; - case 72: /* class_name: ICE_CLASS ICE_IDENTIFIER */ -#line 797 "src/Slice/Grammar.y" + case 74: /* class_name: ICE_CLASS ICE_IDENTIFIER */ +#line 874 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 2473 "src/Slice/Grammar.cpp" +#line 2562 "src/Slice/Grammar.cpp" break; - case 73: /* class_name: ICE_CLASS keyword */ -#line 801 "src/Slice/Grammar.y" + case 75: /* class_name: ICE_CLASS keyword */ +#line 878 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); currentUnit->error("keyword `" + ident->v + "' cannot be used as class name"); yyval = yyvsp[0]; // Dummy } -#line 2483 "src/Slice/Grammar.cpp" +#line 2572 "src/Slice/Grammar.cpp" break; - case 74: /* class_id: ICE_CLASS ICE_IDENT_OPEN ICE_INTEGER_LITERAL ')' */ -#line 812 "src/Slice/Grammar.y" + case 76: /* class_id: ICE_CLASS ICE_IDENT_OPEN ICE_INTEGER_LITERAL ')' */ +#line 889 "src/Slice/Grammar.y" { int64_t id = dynamic_pointer_cast(yyvsp[-1])->v; if (id < 0) @@ -2362,11 +2453,11 @@ yyparse(void) classId->t = static_cast(id); yyval = classId; } -#line 2512 "src/Slice/Grammar.cpp" +#line 2601 "src/Slice/Grammar.cpp" break; - case 75: /* class_id: ICE_CLASS ICE_IDENT_OPEN scoped_name ')' */ -#line 837 "src/Slice/Grammar.y" + case 77: /* class_id: ICE_CLASS ICE_IDENT_OPEN scoped_name ')' */ +#line 914 "src/Slice/Grammar.y" { auto scoped = dynamic_pointer_cast(yyvsp[-1]); @@ -2457,33 +2548,33 @@ yyparse(void) classId->t = id; yyval = classId; } -#line 2606 "src/Slice/Grammar.cpp" +#line 2695 "src/Slice/Grammar.cpp" break; - case 76: /* class_id: class_name */ -#line 927 "src/Slice/Grammar.y" + case 78: /* class_id: class_name */ +#line 1004 "src/Slice/Grammar.y" { auto classId = make_shared(); classId->v = dynamic_pointer_cast(yyvsp[0])->v; classId->t = -1; yyval = classId; } -#line 2617 "src/Slice/Grammar.cpp" +#line 2706 "src/Slice/Grammar.cpp" break; - case 77: /* class_decl: class_name */ -#line 939 "src/Slice/Grammar.y" + case 79: /* class_decl: class_name */ +#line 1016 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); ContainerPtr cont = currentUnit->currentContainer(); ClassDeclPtr cl = cont->createClassDecl(ident->v); yyval = cl; } -#line 2628 "src/Slice/Grammar.cpp" +#line 2717 "src/Slice/Grammar.cpp" break; - case 78: /* @17: %empty */ -#line 951 "src/Slice/Grammar.y" + case 80: /* @18: %empty */ +#line 1028 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[-1]); ContainerPtr cont = currentUnit->currentContainer(); @@ -2500,11 +2591,11 @@ yyparse(void) yyval = nullptr; } } -#line 2649 "src/Slice/Grammar.cpp" +#line 2738 "src/Slice/Grammar.cpp" break; - case 79: /* class_def: class_id class_extends @17 '{' data_members '}' */ -#line 968 "src/Slice/Grammar.y" + case 81: /* class_def: class_id class_extends @18 '{' data_members '}' */ +#line 1045 "src/Slice/Grammar.y" { if (yyvsp[-3]) { @@ -2516,11 +2607,11 @@ yyparse(void) yyval = nullptr; } } -#line 2665 "src/Slice/Grammar.cpp" +#line 2754 "src/Slice/Grammar.cpp" break; - case 80: /* class_extends: extends scoped_name */ -#line 985 "src/Slice/Grammar.y" + case 82: /* class_extends: extends scoped_name */ +#line 1062 "src/Slice/Grammar.y" { auto scoped = dynamic_pointer_cast(yyvsp[0]); ContainerPtr cont = currentUnit->currentContainer(); @@ -2554,33 +2645,33 @@ yyparse(void) } } } -#line 2703 "src/Slice/Grammar.cpp" +#line 2792 "src/Slice/Grammar.cpp" break; - case 81: /* class_extends: %empty */ -#line 1019 "src/Slice/Grammar.y" + case 83: /* class_extends: %empty */ +#line 1096 "src/Slice/Grammar.y" { yyval = nullptr; } -#line 2711 "src/Slice/Grammar.cpp" +#line 2800 "src/Slice/Grammar.cpp" break; - case 82: /* extends: ICE_EXTENDS */ -#line 1028 "src/Slice/Grammar.y" + case 84: /* extends: ICE_EXTENDS */ +#line 1105 "src/Slice/Grammar.y" { } -#line 2718 "src/Slice/Grammar.cpp" +#line 2807 "src/Slice/Grammar.cpp" break; - case 83: /* extends: ':' */ -#line 1031 "src/Slice/Grammar.y" + case 85: /* extends: ':' */ +#line 1108 "src/Slice/Grammar.y" { } -#line 2725 "src/Slice/Grammar.cpp" +#line 2814 "src/Slice/Grammar.cpp" break; - case 84: /* data_members: meta_data data_member ';' data_members */ -#line 1039 "src/Slice/Grammar.y" + case 86: /* data_members: meta_data data_member ';' data_members */ +#line 1116 "src/Slice/Grammar.y" { auto metaData = dynamic_pointer_cast(yyvsp[-3]); auto contained = dynamic_pointer_cast(yyvsp[-2]); @@ -2589,33 +2680,33 @@ yyparse(void) contained->setMetaData(metaData->v); } } -#line 2738 "src/Slice/Grammar.cpp" +#line 2827 "src/Slice/Grammar.cpp" break; - case 85: /* data_members: error ';' data_members */ -#line 1048 "src/Slice/Grammar.y" + case 87: /* data_members: error ';' data_members */ +#line 1125 "src/Slice/Grammar.y" { } -#line 2745 "src/Slice/Grammar.cpp" +#line 2834 "src/Slice/Grammar.cpp" break; - case 86: /* data_members: meta_data data_member */ -#line 1051 "src/Slice/Grammar.y" + case 88: /* data_members: meta_data data_member */ +#line 1128 "src/Slice/Grammar.y" { currentUnit->error("`;' missing after definition"); } -#line 2753 "src/Slice/Grammar.cpp" +#line 2842 "src/Slice/Grammar.cpp" break; - case 87: /* data_members: %empty */ -#line 1055 "src/Slice/Grammar.y" + case 89: /* data_members: %empty */ +#line 1132 "src/Slice/Grammar.y" { } -#line 2760 "src/Slice/Grammar.cpp" +#line 2849 "src/Slice/Grammar.cpp" break; - case 88: /* data_member: tagged_type_id */ -#line 1063 "src/Slice/Grammar.y" + case 90: /* data_member: tagged_type_id */ +#line 1140 "src/Slice/Grammar.y" { auto def = dynamic_pointer_cast(yyvsp[0]); auto cl = dynamic_pointer_cast(currentUnit->currentContainer()); @@ -2645,11 +2736,11 @@ yyparse(void) currentUnit->currentContainer()->checkIntroduced(def->name, dm); yyval = dm; } -#line 2794 "src/Slice/Grammar.cpp" +#line 2883 "src/Slice/Grammar.cpp" break; - case 89: /* data_member: tagged_type_id '=' const_initializer */ -#line 1093 "src/Slice/Grammar.y" + case 91: /* data_member: tagged_type_id '=' const_initializer */ +#line 1170 "src/Slice/Grammar.y" { auto def = dynamic_pointer_cast(yyvsp[-2]); auto value = dynamic_pointer_cast(yyvsp[0]); @@ -2701,11 +2792,11 @@ yyparse(void) currentUnit->currentContainer()->checkIntroduced(def->name, dm); yyval = dm; } -#line 2832 "src/Slice/Grammar.cpp" +#line 2921 "src/Slice/Grammar.cpp" break; - case 90: /* data_member: type keyword */ -#line 1127 "src/Slice/Grammar.y" + case 92: /* data_member: type keyword */ +#line 1204 "src/Slice/Grammar.y" { auto type = dynamic_pointer_cast(yyvsp[-1]); string name = dynamic_pointer_cast(yyvsp[0])->v; @@ -2727,11 +2818,11 @@ yyparse(void) assert(yyval); currentUnit->error("keyword `" + name + "' cannot be used as data member name"); } -#line 2858 "src/Slice/Grammar.cpp" +#line 2947 "src/Slice/Grammar.cpp" break; - case 91: /* data_member: type */ -#line 1149 "src/Slice/Grammar.y" + case 93: /* data_member: type */ +#line 1226 "src/Slice/Grammar.y" { auto type = dynamic_pointer_cast(yyvsp[0]); auto cl = dynamic_pointer_cast(currentUnit->currentContainer()); @@ -2752,50 +2843,50 @@ yyparse(void) assert(yyval); currentUnit->error("missing data member name"); } -#line 2883 "src/Slice/Grammar.cpp" +#line 2972 "src/Slice/Grammar.cpp" break; - case 92: /* return_type: tag type */ -#line 1175 "src/Slice/Grammar.y" + case 94: /* return_type: tag type */ +#line 1252 "src/Slice/Grammar.y" { auto m = dynamic_pointer_cast(yyvsp[-1]); m->type = dynamic_pointer_cast(yyvsp[0]); yyval = m; } -#line 2893 "src/Slice/Grammar.cpp" +#line 2982 "src/Slice/Grammar.cpp" break; - case 93: /* return_type: optional type */ -#line 1181 "src/Slice/Grammar.y" + case 95: /* return_type: optional type */ +#line 1258 "src/Slice/Grammar.y" { auto m = dynamic_pointer_cast(yyvsp[-1]); m->type = dynamic_pointer_cast(yyvsp[0]); yyval = m; } -#line 2903 "src/Slice/Grammar.cpp" +#line 2992 "src/Slice/Grammar.cpp" break; - case 94: /* return_type: type */ -#line 1187 "src/Slice/Grammar.y" + case 96: /* return_type: type */ +#line 1264 "src/Slice/Grammar.y" { auto m = make_shared(-1); m->type = dynamic_pointer_cast(yyvsp[0]); yyval = m; } -#line 2913 "src/Slice/Grammar.cpp" +#line 3002 "src/Slice/Grammar.cpp" break; - case 95: /* return_type: ICE_VOID */ -#line 1193 "src/Slice/Grammar.y" + case 97: /* return_type: ICE_VOID */ +#line 1270 "src/Slice/Grammar.y" { auto m = make_shared(-1); yyval = m; } -#line 2922 "src/Slice/Grammar.cpp" +#line 3011 "src/Slice/Grammar.cpp" break; - case 96: /* operation_preamble: return_type ICE_IDENT_OPEN */ -#line 1203 "src/Slice/Grammar.y" + case 98: /* operation_preamble: return_type ICE_IDENT_OPEN */ +#line 1280 "src/Slice/Grammar.y" { auto returnType = dynamic_pointer_cast(yyvsp[-1]); string name = dynamic_pointer_cast(yyvsp[0])->v; @@ -2820,11 +2911,11 @@ yyparse(void) yyval = nullptr; } } -#line 2950 "src/Slice/Grammar.cpp" +#line 3039 "src/Slice/Grammar.cpp" break; - case 97: /* operation_preamble: ICE_IDEMPOTENT return_type ICE_IDENT_OPEN */ -#line 1227 "src/Slice/Grammar.y" + case 99: /* operation_preamble: ICE_IDEMPOTENT return_type ICE_IDENT_OPEN */ +#line 1304 "src/Slice/Grammar.y" { auto returnType = dynamic_pointer_cast(yyvsp[-1]); string name = dynamic_pointer_cast(yyvsp[0])->v; @@ -2854,11 +2945,11 @@ yyparse(void) yyval = nullptr; } } -#line 2984 "src/Slice/Grammar.cpp" +#line 3073 "src/Slice/Grammar.cpp" break; - case 98: /* operation_preamble: return_type ICE_KEYWORD_OPEN */ -#line 1257 "src/Slice/Grammar.y" + case 100: /* operation_preamble: return_type ICE_KEYWORD_OPEN */ +#line 1334 "src/Slice/Grammar.y" { auto returnType = dynamic_pointer_cast(yyvsp[-1]); string name = dynamic_pointer_cast(yyvsp[0])->v; @@ -2883,11 +2974,11 @@ yyparse(void) yyval = nullptr; } } -#line 3012 "src/Slice/Grammar.cpp" +#line 3101 "src/Slice/Grammar.cpp" break; - case 99: /* operation_preamble: ICE_IDEMPOTENT return_type ICE_KEYWORD_OPEN */ -#line 1281 "src/Slice/Grammar.y" + case 101: /* operation_preamble: ICE_IDEMPOTENT return_type ICE_KEYWORD_OPEN */ +#line 1358 "src/Slice/Grammar.y" { auto returnType = dynamic_pointer_cast(yyvsp[-1]); string name = dynamic_pointer_cast(yyvsp[0])->v; @@ -2916,11 +3007,11 @@ yyparse(void) yyval = nullptr; } } -#line 3045 "src/Slice/Grammar.cpp" +#line 3134 "src/Slice/Grammar.cpp" break; - case 100: /* @18: %empty */ -#line 1315 "src/Slice/Grammar.y" + case 102: /* @19: %empty */ +#line 1392 "src/Slice/Grammar.y" { if (yyvsp[-2]) { @@ -2932,11 +3023,11 @@ yyparse(void) yyval = nullptr; } } -#line 3061 "src/Slice/Grammar.cpp" +#line 3150 "src/Slice/Grammar.cpp" break; - case 101: /* operation: operation_preamble parameters ')' @18 throws */ -#line 1327 "src/Slice/Grammar.y" + case 103: /* operation: operation_preamble parameters ')' @19 throws */ +#line 1404 "src/Slice/Grammar.y" { auto op = dynamic_pointer_cast(yyvsp[-1]); auto el = dynamic_pointer_cast(yyvsp[0]); @@ -2946,11 +3037,11 @@ yyparse(void) op->setExceptionList(el->v); } } -#line 3075 "src/Slice/Grammar.cpp" +#line 3164 "src/Slice/Grammar.cpp" break; - case 102: /* @19: %empty */ -#line 1337 "src/Slice/Grammar.y" + case 104: /* @20: %empty */ +#line 1414 "src/Slice/Grammar.y" { if (yyvsp[-2]) { @@ -2958,11 +3049,11 @@ yyparse(void) } yyerrok; } -#line 3087 "src/Slice/Grammar.cpp" +#line 3176 "src/Slice/Grammar.cpp" break; - case 103: /* operation: operation_preamble error ')' @19 throws */ -#line 1345 "src/Slice/Grammar.y" + case 105: /* operation: operation_preamble error ')' @20 throws */ +#line 1422 "src/Slice/Grammar.y" { auto op = dynamic_pointer_cast(yyvsp[-1]); auto el = dynamic_pointer_cast(yyvsp[0]); @@ -2972,29 +3063,29 @@ yyparse(void) op->setExceptionList(el->v); // Dummy } } -#line 3101 "src/Slice/Grammar.cpp" +#line 3190 "src/Slice/Grammar.cpp" break; - case 104: /* interface_id: ICE_INTERFACE ICE_IDENTIFIER */ -#line 1360 "src/Slice/Grammar.y" + case 106: /* interface_id: ICE_INTERFACE ICE_IDENTIFIER */ +#line 1437 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 3109 "src/Slice/Grammar.cpp" +#line 3198 "src/Slice/Grammar.cpp" break; - case 105: /* interface_id: ICE_INTERFACE keyword */ -#line 1364 "src/Slice/Grammar.y" + case 107: /* interface_id: ICE_INTERFACE keyword */ +#line 1441 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); currentUnit->error("keyword `" + ident->v + "' cannot be used as interface name"); yyval = yyvsp[0]; // Dummy } -#line 3119 "src/Slice/Grammar.cpp" +#line 3208 "src/Slice/Grammar.cpp" break; - case 106: /* interface_decl: interface_id */ -#line 1375 "src/Slice/Grammar.y" + case 108: /* interface_decl: interface_id */ +#line 1452 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); auto cont = currentUnit->currentContainer(); @@ -3002,11 +3093,11 @@ yyparse(void) cont->checkIntroduced(ident->v, cl); yyval = cl; } -#line 3131 "src/Slice/Grammar.cpp" +#line 3220 "src/Slice/Grammar.cpp" break; - case 107: /* @20: %empty */ -#line 1388 "src/Slice/Grammar.y" + case 109: /* @21: %empty */ +#line 1465 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[-1]); ContainerPtr cont = currentUnit->currentContainer(); @@ -3023,11 +3114,11 @@ yyparse(void) yyval = nullptr; } } -#line 3152 "src/Slice/Grammar.cpp" +#line 3241 "src/Slice/Grammar.cpp" break; - case 108: /* interface_def: interface_id interface_extends @20 '{' operations '}' */ -#line 1405 "src/Slice/Grammar.y" + case 110: /* interface_def: interface_id interface_extends @21 '{' operations '}' */ +#line 1482 "src/Slice/Grammar.y" { if (yyvsp[-3]) { @@ -3039,11 +3130,11 @@ yyparse(void) yyval = nullptr; } } -#line 3168 "src/Slice/Grammar.cpp" +#line 3257 "src/Slice/Grammar.cpp" break; - case 109: /* interface_list: scoped_name ',' interface_list */ -#line 1422 "src/Slice/Grammar.y" + case 111: /* interface_list: scoped_name ',' interface_list */ +#line 1499 "src/Slice/Grammar.y" { auto intfs = dynamic_pointer_cast(yyvsp[0]); auto scoped = dynamic_pointer_cast(yyvsp[-2]); @@ -3078,11 +3169,11 @@ yyparse(void) } yyval = intfs; } -#line 3207 "src/Slice/Grammar.cpp" +#line 3296 "src/Slice/Grammar.cpp" break; - case 110: /* interface_list: scoped_name */ -#line 1457 "src/Slice/Grammar.y" + case 112: /* interface_list: scoped_name */ +#line 1534 "src/Slice/Grammar.y" { auto intfs = make_shared(); auto scoped = dynamic_pointer_cast(yyvsp[0]); @@ -3117,45 +3208,45 @@ yyparse(void) } yyval = intfs; } -#line 3246 "src/Slice/Grammar.cpp" +#line 3335 "src/Slice/Grammar.cpp" break; - case 111: /* interface_list: ICE_OBJECT */ -#line 1492 "src/Slice/Grammar.y" + case 113: /* interface_list: ICE_OBJECT */ +#line 1569 "src/Slice/Grammar.y" { currentUnit->error("illegal inheritance from type Object"); yyval = make_shared(); // Dummy } -#line 3255 "src/Slice/Grammar.cpp" +#line 3344 "src/Slice/Grammar.cpp" break; - case 112: /* interface_list: ICE_VALUE */ -#line 1497 "src/Slice/Grammar.y" + case 114: /* interface_list: ICE_VALUE */ +#line 1574 "src/Slice/Grammar.y" { currentUnit->error("illegal inheritance from type Value"); yyval = make_shared(); // Dummy } -#line 3264 "src/Slice/Grammar.cpp" +#line 3353 "src/Slice/Grammar.cpp" break; - case 113: /* interface_extends: extends interface_list */ -#line 1507 "src/Slice/Grammar.y" + case 115: /* interface_extends: extends interface_list */ +#line 1584 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 3272 "src/Slice/Grammar.cpp" +#line 3361 "src/Slice/Grammar.cpp" break; - case 114: /* interface_extends: %empty */ -#line 1511 "src/Slice/Grammar.y" + case 116: /* interface_extends: %empty */ +#line 1588 "src/Slice/Grammar.y" { yyval = make_shared(); } -#line 3280 "src/Slice/Grammar.cpp" +#line 3369 "src/Slice/Grammar.cpp" break; - case 115: /* operations: meta_data operation ';' operations */ -#line 1520 "src/Slice/Grammar.y" + case 117: /* operations: meta_data operation ';' operations */ +#line 1597 "src/Slice/Grammar.y" { auto metaData = dynamic_pointer_cast(yyvsp[-3]); auto contained = dynamic_pointer_cast(yyvsp[-2]); @@ -3164,55 +3255,55 @@ yyparse(void) contained->setMetaData(metaData->v); } } -#line 3293 "src/Slice/Grammar.cpp" +#line 3382 "src/Slice/Grammar.cpp" break; - case 116: /* operations: error ';' operations */ -#line 1529 "src/Slice/Grammar.y" + case 118: /* operations: error ';' operations */ +#line 1606 "src/Slice/Grammar.y" { } -#line 3300 "src/Slice/Grammar.cpp" +#line 3389 "src/Slice/Grammar.cpp" break; - case 117: /* operations: meta_data operation */ -#line 1532 "src/Slice/Grammar.y" + case 119: /* operations: meta_data operation */ +#line 1609 "src/Slice/Grammar.y" { currentUnit->error("`;' missing after definition"); } -#line 3308 "src/Slice/Grammar.cpp" +#line 3397 "src/Slice/Grammar.cpp" break; - case 118: /* operations: %empty */ -#line 1536 "src/Slice/Grammar.y" + case 120: /* operations: %empty */ +#line 1613 "src/Slice/Grammar.y" { } -#line 3315 "src/Slice/Grammar.cpp" +#line 3404 "src/Slice/Grammar.cpp" break; - case 119: /* exception_list: exception ',' exception_list */ -#line 1544 "src/Slice/Grammar.y" + case 121: /* exception_list: exception ',' exception_list */ +#line 1621 "src/Slice/Grammar.y" { auto exception = dynamic_pointer_cast(yyvsp[-2]); auto exceptionList = dynamic_pointer_cast(yyvsp[0]); exceptionList->v.push_front(exception); yyval = exceptionList; } -#line 3326 "src/Slice/Grammar.cpp" +#line 3415 "src/Slice/Grammar.cpp" break; - case 120: /* exception_list: exception */ -#line 1551 "src/Slice/Grammar.y" + case 122: /* exception_list: exception */ +#line 1628 "src/Slice/Grammar.y" { auto exception = dynamic_pointer_cast(yyvsp[0]); auto exceptionList = make_shared(); exceptionList->v.push_front(exception); yyval = exceptionList; } -#line 3337 "src/Slice/Grammar.cpp" +#line 3426 "src/Slice/Grammar.cpp" break; - case 121: /* exception: scoped_name */ -#line 1563 "src/Slice/Grammar.y" + case 123: /* exception: scoped_name */ +#line 1640 "src/Slice/Grammar.y" { auto scoped = dynamic_pointer_cast(yyvsp[0]); ContainerPtr cont = currentUnit->currentContainer(); @@ -3224,21 +3315,21 @@ yyparse(void) cont->checkIntroduced(scoped->v, exception); yyval = exception; } -#line 3353 "src/Slice/Grammar.cpp" +#line 3442 "src/Slice/Grammar.cpp" break; - case 122: /* exception: keyword */ -#line 1575 "src/Slice/Grammar.y" + case 124: /* exception: keyword */ +#line 1652 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); currentUnit->error("keyword `" + ident->v + "' cannot be used as exception name"); yyval = currentUnit->currentContainer()->createException(IceUtil::generateUUID(), 0, Dummy); // Dummy } -#line 3363 "src/Slice/Grammar.cpp" +#line 3452 "src/Slice/Grammar.cpp" break; - case 123: /* sequence_def: ICE_SEQUENCE '<' meta_data type '>' ICE_IDENTIFIER */ -#line 1586 "src/Slice/Grammar.y" + case 125: /* sequence_def: ICE_SEQUENCE '<' meta_data type '>' ICE_IDENTIFIER */ +#line 1663 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); auto metaData = dynamic_pointer_cast(yyvsp[-3]); @@ -3246,11 +3337,11 @@ yyparse(void) ContainerPtr cont = currentUnit->currentContainer(); yyval = cont->createSequence(ident->v, type, metaData->v); } -#line 3375 "src/Slice/Grammar.cpp" +#line 3464 "src/Slice/Grammar.cpp" break; - case 124: /* sequence_def: ICE_SEQUENCE '<' meta_data type '>' keyword */ -#line 1594 "src/Slice/Grammar.y" + case 126: /* sequence_def: ICE_SEQUENCE '<' meta_data type '>' keyword */ +#line 1671 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); auto metaData = dynamic_pointer_cast(yyvsp[-3]); @@ -3259,11 +3350,11 @@ yyparse(void) yyval = cont->createSequence(ident->v, type, metaData->v); // Dummy currentUnit->error("keyword `" + ident->v + "' cannot be used as sequence name"); } -#line 3388 "src/Slice/Grammar.cpp" +#line 3477 "src/Slice/Grammar.cpp" break; - case 125: /* dictionary_def: ICE_DICTIONARY '<' meta_data type ',' meta_data type '>' ICE_IDENTIFIER */ -#line 1608 "src/Slice/Grammar.y" + case 127: /* dictionary_def: ICE_DICTIONARY '<' meta_data type ',' meta_data type '>' ICE_IDENTIFIER */ +#line 1685 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); auto keyMetaData = dynamic_pointer_cast(yyvsp[-6]); @@ -3273,11 +3364,11 @@ yyparse(void) ContainerPtr cont = currentUnit->currentContainer(); yyval = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v); } -#line 3402 "src/Slice/Grammar.cpp" +#line 3491 "src/Slice/Grammar.cpp" break; - case 126: /* dictionary_def: ICE_DICTIONARY '<' meta_data type ',' meta_data type '>' keyword */ -#line 1618 "src/Slice/Grammar.y" + case 128: /* dictionary_def: ICE_DICTIONARY '<' meta_data type ',' meta_data type '>' keyword */ +#line 1695 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); auto keyMetaData = dynamic_pointer_cast(yyvsp[-6]); @@ -3288,29 +3379,29 @@ yyparse(void) yyval = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v); // Dummy currentUnit->error("keyword `" + ident->v + "' cannot be used as dictionary name"); } -#line 3417 "src/Slice/Grammar.cpp" +#line 3506 "src/Slice/Grammar.cpp" break; - case 127: /* enum_id: ICE_ENUM ICE_IDENTIFIER */ -#line 1634 "src/Slice/Grammar.y" + case 129: /* enum_id: ICE_ENUM ICE_IDENTIFIER */ +#line 1711 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 3425 "src/Slice/Grammar.cpp" +#line 3514 "src/Slice/Grammar.cpp" break; - case 128: /* enum_id: ICE_ENUM keyword */ -#line 1638 "src/Slice/Grammar.y" + case 130: /* enum_id: ICE_ENUM keyword */ +#line 1715 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); currentUnit->error("keyword `" + ident->v + "' cannot be used as enumeration name"); yyval = yyvsp[0]; // Dummy } -#line 3435 "src/Slice/Grammar.cpp" +#line 3524 "src/Slice/Grammar.cpp" break; - case 129: /* @21: %empty */ -#line 1649 "src/Slice/Grammar.y" + case 131: /* @22: %empty */ +#line 1726 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); ContainerPtr cont = currentUnit->currentContainer(); @@ -3326,11 +3417,11 @@ yyparse(void) currentUnit->pushContainer(en); yyval = en; } -#line 3455 "src/Slice/Grammar.cpp" +#line 3544 "src/Slice/Grammar.cpp" break; - case 130: /* enum_def: enum_id @21 '{' enumerator_list '}' */ -#line 1665 "src/Slice/Grammar.y" + case 132: /* enum_def: enum_id @22 '{' enumerator_list '}' */ +#line 1742 "src/Slice/Grammar.y" { auto en = dynamic_pointer_cast(yyvsp[-3]); if (en) @@ -3344,11 +3435,11 @@ yyparse(void) } yyval = yyvsp[-3]; } -#line 3473 "src/Slice/Grammar.cpp" +#line 3562 "src/Slice/Grammar.cpp" break; - case 131: /* @22: %empty */ -#line 1680 "src/Slice/Grammar.y" + case 133: /* @23: %empty */ +#line 1757 "src/Slice/Grammar.y" { currentUnit->error("missing enumeration name"); ContainerPtr cont = currentUnit->currentContainer(); @@ -3356,37 +3447,37 @@ yyparse(void) currentUnit->pushContainer(en); yyval = en; } -#line 3485 "src/Slice/Grammar.cpp" +#line 3574 "src/Slice/Grammar.cpp" break; - case 132: /* enum_def: ICE_ENUM @22 '{' enumerator_list '}' */ -#line 1688 "src/Slice/Grammar.y" + case 134: /* enum_def: ICE_ENUM @23 '{' enumerator_list '}' */ +#line 1765 "src/Slice/Grammar.y" { currentUnit->popContainer(); yyval = yyvsp[-4]; } -#line 3494 "src/Slice/Grammar.cpp" +#line 3583 "src/Slice/Grammar.cpp" break; - case 133: /* enumerator_list: enumerator ',' enumerator_list */ -#line 1698 "src/Slice/Grammar.y" + case 135: /* enumerator_list: enumerator ',' enumerator_list */ +#line 1775 "src/Slice/Grammar.y" { auto ens = dynamic_pointer_cast(yyvsp[-2]); ens->v.splice(ens->v.end(), dynamic_pointer_cast(yyvsp[0])->v); yyval = ens; } -#line 3504 "src/Slice/Grammar.cpp" +#line 3593 "src/Slice/Grammar.cpp" break; - case 134: /* enumerator_list: enumerator */ -#line 1704 "src/Slice/Grammar.y" + case 136: /* enumerator_list: enumerator */ +#line 1781 "src/Slice/Grammar.y" { } -#line 3511 "src/Slice/Grammar.cpp" +#line 3600 "src/Slice/Grammar.cpp" break; - case 135: /* enumerator: ICE_IDENTIFIER */ -#line 1712 "src/Slice/Grammar.y" + case 137: /* enumerator: ICE_IDENTIFIER */ +#line 1789 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); auto ens = make_shared(); @@ -3398,11 +3489,11 @@ yyparse(void) } yyval = ens; } -#line 3527 "src/Slice/Grammar.cpp" +#line 3616 "src/Slice/Grammar.cpp" break; - case 136: /* enumerator: ICE_IDENTIFIER '=' enumerator_initializer */ -#line 1724 "src/Slice/Grammar.y" + case 138: /* enumerator: ICE_IDENTIFIER '=' enumerator_initializer */ +#line 1801 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[-2]); auto ens = make_shared(); @@ -3422,39 +3513,39 @@ yyparse(void) } yyval = ens; } -#line 3551 "src/Slice/Grammar.cpp" +#line 3640 "src/Slice/Grammar.cpp" break; - case 137: /* enumerator: keyword */ -#line 1744 "src/Slice/Grammar.y" + case 139: /* enumerator: keyword */ +#line 1821 "src/Slice/Grammar.y" { auto ident = dynamic_pointer_cast(yyvsp[0]); currentUnit->error("keyword `" + ident->v + "' cannot be used as enumerator"); auto ens = make_shared(); // Dummy yyval = ens; } -#line 3562 "src/Slice/Grammar.cpp" +#line 3651 "src/Slice/Grammar.cpp" break; - case 138: /* enumerator: %empty */ -#line 1751 "src/Slice/Grammar.y" + case 140: /* enumerator: %empty */ +#line 1828 "src/Slice/Grammar.y" { auto ens = make_shared(); yyval = ens; // Dummy } -#line 3571 "src/Slice/Grammar.cpp" +#line 3660 "src/Slice/Grammar.cpp" break; - case 139: /* enumerator_initializer: ICE_INTEGER_LITERAL */ -#line 1761 "src/Slice/Grammar.y" + case 141: /* enumerator_initializer: ICE_INTEGER_LITERAL */ +#line 1838 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 3579 "src/Slice/Grammar.cpp" +#line 3668 "src/Slice/Grammar.cpp" break; - case 140: /* enumerator_initializer: scoped_name */ -#line 1765 "src/Slice/Grammar.y" + case 142: /* enumerator_initializer: scoped_name */ +#line 1842 "src/Slice/Grammar.y" { auto scoped = dynamic_pointer_cast(yyvsp[0]); ContainedList cl = currentUnit->currentContainer()->lookupContained(scoped->v); @@ -3490,38 +3581,38 @@ yyparse(void) yyval = tok; } -#line 3619 "src/Slice/Grammar.cpp" +#line 3708 "src/Slice/Grammar.cpp" break; - case 141: /* out_qualifier: ICE_OUT */ -#line 1806 "src/Slice/Grammar.y" + case 143: /* out_qualifier: ICE_OUT */ +#line 1883 "src/Slice/Grammar.y" { auto out = make_shared(); out->v = true; yyval = out; } -#line 3629 "src/Slice/Grammar.cpp" +#line 3718 "src/Slice/Grammar.cpp" break; - case 142: /* out_qualifier: %empty */ -#line 1812 "src/Slice/Grammar.y" + case 144: /* out_qualifier: %empty */ +#line 1889 "src/Slice/Grammar.y" { auto out = make_shared(); out->v = false; yyval = out; } -#line 3639 "src/Slice/Grammar.cpp" +#line 3728 "src/Slice/Grammar.cpp" break; - case 143: /* parameters: %empty */ -#line 1823 "src/Slice/Grammar.y" + case 145: /* parameters: %empty */ +#line 1900 "src/Slice/Grammar.y" { } -#line 3646 "src/Slice/Grammar.cpp" +#line 3735 "src/Slice/Grammar.cpp" break; - case 144: /* parameters: out_qualifier meta_data tagged_type_id */ -#line 1826 "src/Slice/Grammar.y" + case 146: /* parameters: out_qualifier meta_data tagged_type_id */ +#line 1903 "src/Slice/Grammar.y" { auto isOutParam = dynamic_pointer_cast(yyvsp[-2]); auto tsp = dynamic_pointer_cast(yyvsp[0]); @@ -3537,11 +3628,11 @@ yyparse(void) } } } -#line 3666 "src/Slice/Grammar.cpp" +#line 3755 "src/Slice/Grammar.cpp" break; - case 145: /* parameters: parameters ',' out_qualifier meta_data tagged_type_id */ -#line 1842 "src/Slice/Grammar.y" + case 147: /* parameters: parameters ',' out_qualifier meta_data tagged_type_id */ +#line 1919 "src/Slice/Grammar.y" { auto isOutParam = dynamic_pointer_cast(yyvsp[-2]); auto tsp = dynamic_pointer_cast(yyvsp[0]); @@ -3557,11 +3648,11 @@ yyparse(void) } } } -#line 3686 "src/Slice/Grammar.cpp" +#line 3775 "src/Slice/Grammar.cpp" break; - case 146: /* parameters: out_qualifier meta_data type keyword */ -#line 1858 "src/Slice/Grammar.y" + case 148: /* parameters: out_qualifier meta_data type keyword */ +#line 1935 "src/Slice/Grammar.y" { auto isOutParam = dynamic_pointer_cast(yyvsp[-3]); auto type = dynamic_pointer_cast(yyvsp[-1]); @@ -3573,11 +3664,11 @@ yyparse(void) currentUnit->error("keyword `" + ident->v + "' cannot be used as parameter name"); } } -#line 3702 "src/Slice/Grammar.cpp" +#line 3791 "src/Slice/Grammar.cpp" break; - case 147: /* parameters: parameters ',' out_qualifier meta_data type keyword */ -#line 1870 "src/Slice/Grammar.y" + case 149: /* parameters: parameters ',' out_qualifier meta_data type keyword */ +#line 1947 "src/Slice/Grammar.y" { auto isOutParam = dynamic_pointer_cast(yyvsp[-3]); auto type = dynamic_pointer_cast(yyvsp[-1]); @@ -3589,11 +3680,11 @@ yyparse(void) currentUnit->error("keyword `" + ident->v + "' cannot be used as parameter name"); } } -#line 3718 "src/Slice/Grammar.cpp" +#line 3807 "src/Slice/Grammar.cpp" break; - case 148: /* parameters: out_qualifier meta_data type */ -#line 1882 "src/Slice/Grammar.y" + case 150: /* parameters: out_qualifier meta_data type */ +#line 1959 "src/Slice/Grammar.y" { auto isOutParam = dynamic_pointer_cast(yyvsp[-2]); auto type = dynamic_pointer_cast(yyvsp[0]); @@ -3604,11 +3695,11 @@ yyparse(void) currentUnit->error("missing parameter name"); } } -#line 3733 "src/Slice/Grammar.cpp" +#line 3822 "src/Slice/Grammar.cpp" break; - case 149: /* parameters: parameters ',' out_qualifier meta_data type */ -#line 1893 "src/Slice/Grammar.y" + case 151: /* parameters: parameters ',' out_qualifier meta_data type */ +#line 1970 "src/Slice/Grammar.y" { auto isOutParam = dynamic_pointer_cast(yyvsp[-2]); auto type = dynamic_pointer_cast(yyvsp[0]); @@ -3619,128 +3710,128 @@ yyparse(void) currentUnit->error("missing parameter name"); } } -#line 3748 "src/Slice/Grammar.cpp" +#line 3837 "src/Slice/Grammar.cpp" break; - case 150: /* throws: ICE_THROWS exception_list */ -#line 1909 "src/Slice/Grammar.y" + case 152: /* throws: ICE_THROWS exception_list */ +#line 1986 "src/Slice/Grammar.y" { yyval = yyvsp[0]; } -#line 3756 "src/Slice/Grammar.cpp" +#line 3845 "src/Slice/Grammar.cpp" break; - case 151: /* throws: %empty */ -#line 1913 "src/Slice/Grammar.y" + case 153: /* throws: %empty */ +#line 1990 "src/Slice/Grammar.y" { yyval = make_shared(); } -#line 3764 "src/Slice/Grammar.cpp" +#line 3853 "src/Slice/Grammar.cpp" break; - case 152: /* scoped_name: ICE_IDENTIFIER */ -#line 1922 "src/Slice/Grammar.y" + case 154: /* scoped_name: ICE_IDENTIFIER */ +#line 1999 "src/Slice/Grammar.y" { } -#line 3771 "src/Slice/Grammar.cpp" +#line 3860 "src/Slice/Grammar.cpp" break; - case 153: /* scoped_name: ICE_SCOPED_IDENTIFIER */ -#line 1925 "src/Slice/Grammar.y" + case 155: /* scoped_name: ICE_SCOPED_IDENTIFIER */ +#line 2002 "src/Slice/Grammar.y" { } -#line 3778 "src/Slice/Grammar.cpp" +#line 3867 "src/Slice/Grammar.cpp" break; - case 154: /* builtin: ICE_BOOL */ -#line 1932 "src/Slice/Grammar.y" + case 156: /* builtin: ICE_BOOL */ +#line 2009 "src/Slice/Grammar.y" { } -#line 3784 "src/Slice/Grammar.cpp" +#line 3873 "src/Slice/Grammar.cpp" break; - case 155: /* builtin: ICE_BYTE */ -#line 1933 "src/Slice/Grammar.y" + case 157: /* builtin: ICE_BYTE */ +#line 2010 "src/Slice/Grammar.y" { } -#line 3790 "src/Slice/Grammar.cpp" +#line 3879 "src/Slice/Grammar.cpp" break; - case 156: /* builtin: ICE_SHORT */ -#line 1934 "src/Slice/Grammar.y" + case 158: /* builtin: ICE_SHORT */ +#line 2011 "src/Slice/Grammar.y" { } -#line 3796 "src/Slice/Grammar.cpp" +#line 3885 "src/Slice/Grammar.cpp" break; - case 157: /* builtin: ICE_INT */ -#line 1935 "src/Slice/Grammar.y" + case 159: /* builtin: ICE_INT */ +#line 2012 "src/Slice/Grammar.y" { } -#line 3802 "src/Slice/Grammar.cpp" +#line 3891 "src/Slice/Grammar.cpp" break; - case 158: /* builtin: ICE_LONG */ -#line 1936 "src/Slice/Grammar.y" + case 160: /* builtin: ICE_LONG */ +#line 2013 "src/Slice/Grammar.y" { } -#line 3808 "src/Slice/Grammar.cpp" +#line 3897 "src/Slice/Grammar.cpp" break; - case 159: /* builtin: ICE_FLOAT */ -#line 1937 "src/Slice/Grammar.y" + case 161: /* builtin: ICE_FLOAT */ +#line 2014 "src/Slice/Grammar.y" { } -#line 3814 "src/Slice/Grammar.cpp" +#line 3903 "src/Slice/Grammar.cpp" break; - case 160: /* builtin: ICE_DOUBLE */ -#line 1938 "src/Slice/Grammar.y" + case 162: /* builtin: ICE_DOUBLE */ +#line 2015 "src/Slice/Grammar.y" { } -#line 3820 "src/Slice/Grammar.cpp" +#line 3909 "src/Slice/Grammar.cpp" break; - case 161: /* builtin: ICE_STRING */ -#line 1939 "src/Slice/Grammar.y" + case 163: /* builtin: ICE_STRING */ +#line 2016 "src/Slice/Grammar.y" { } -#line 3826 "src/Slice/Grammar.cpp" +#line 3915 "src/Slice/Grammar.cpp" break; - case 162: /* builtin: ICE_OBJECT */ -#line 1940 "src/Slice/Grammar.y" + case 164: /* builtin: ICE_OBJECT */ +#line 2017 "src/Slice/Grammar.y" { } -#line 3832 "src/Slice/Grammar.cpp" +#line 3921 "src/Slice/Grammar.cpp" break; - case 163: /* builtin: ICE_VALUE */ -#line 1941 "src/Slice/Grammar.y" + case 165: /* builtin: ICE_VALUE */ +#line 2018 "src/Slice/Grammar.y" { } -#line 3838 "src/Slice/Grammar.cpp" +#line 3927 "src/Slice/Grammar.cpp" break; - case 164: /* type: ICE_OBJECT '*' */ -#line 1947 "src/Slice/Grammar.y" + case 166: /* type: ICE_OBJECT '*' */ +#line 2024 "src/Slice/Grammar.y" { yyval = currentUnit->builtin(Builtin::KindObjectProxy); } -#line 3846 "src/Slice/Grammar.cpp" +#line 3935 "src/Slice/Grammar.cpp" break; - case 165: /* type: builtin */ -#line 1951 "src/Slice/Grammar.y" + case 167: /* type: builtin */ +#line 2028 "src/Slice/Grammar.y" { auto typeName = dynamic_pointer_cast(yyvsp[0]); yyval = currentUnit->builtin(Builtin::kindFromString(typeName->v).value()); } -#line 3855 "src/Slice/Grammar.cpp" +#line 3944 "src/Slice/Grammar.cpp" break; - case 166: /* type: scoped_name */ -#line 1956 "src/Slice/Grammar.y" + case 168: /* type: scoped_name */ +#line 2033 "src/Slice/Grammar.y" { auto scoped = dynamic_pointer_cast(yyvsp[0]); ContainerPtr cont = currentUnit->currentContainer(); @@ -3771,11 +3862,11 @@ yyparse(void) yyval = nullptr; } } -#line 3890 "src/Slice/Grammar.cpp" +#line 3979 "src/Slice/Grammar.cpp" break; - case 167: /* type: scoped_name '*' */ -#line 1987 "src/Slice/Grammar.y" + case 169: /* type: scoped_name '*' */ +#line 2064 "src/Slice/Grammar.y" { auto scoped = dynamic_pointer_cast(yyvsp[-1]); ContainerPtr cont = currentUnit->currentContainer(); @@ -3806,50 +3897,50 @@ yyparse(void) yyval = nullptr; } } -#line 3925 "src/Slice/Grammar.cpp" +#line 4014 "src/Slice/Grammar.cpp" break; - case 168: /* string_literal: ICE_STRING_LITERAL string_literal */ -#line 2023 "src/Slice/Grammar.y" + case 170: /* string_literal: ICE_STRING_LITERAL string_literal */ +#line 2100 "src/Slice/Grammar.y" { auto str1 = dynamic_pointer_cast(yyvsp[-1]); auto str2 = dynamic_pointer_cast(yyvsp[0]); str1->v += str2->v; } -#line 3935 "src/Slice/Grammar.cpp" +#line 4024 "src/Slice/Grammar.cpp" break; - case 169: /* string_literal: ICE_STRING_LITERAL */ -#line 2029 "src/Slice/Grammar.y" + case 171: /* string_literal: ICE_STRING_LITERAL */ +#line 2106 "src/Slice/Grammar.y" { } -#line 3942 "src/Slice/Grammar.cpp" +#line 4031 "src/Slice/Grammar.cpp" break; - case 170: /* string_list: string_list ',' string_literal */ -#line 2037 "src/Slice/Grammar.y" + case 172: /* string_list: string_list ',' string_literal */ +#line 2114 "src/Slice/Grammar.y" { auto str = dynamic_pointer_cast(yyvsp[0]); auto stringList = dynamic_pointer_cast(yyvsp[-2]); stringList->v.push_back(str->v); yyval = stringList; } -#line 3953 "src/Slice/Grammar.cpp" +#line 4042 "src/Slice/Grammar.cpp" break; - case 171: /* string_list: string_literal */ -#line 2044 "src/Slice/Grammar.y" + case 173: /* string_list: string_literal */ +#line 2121 "src/Slice/Grammar.y" { auto str = dynamic_pointer_cast(yyvsp[0]); auto stringList = make_shared(); stringList->v.push_back(str->v); yyval = stringList; } -#line 3964 "src/Slice/Grammar.cpp" +#line 4053 "src/Slice/Grammar.cpp" break; - case 172: /* const_initializer: ICE_INTEGER_LITERAL */ -#line 2056 "src/Slice/Grammar.y" + case 174: /* const_initializer: ICE_INTEGER_LITERAL */ +#line 2133 "src/Slice/Grammar.y" { BuiltinPtr type = currentUnit->builtin(Builtin::KindLong); auto intVal = dynamic_pointer_cast(yyvsp[0]); @@ -3858,11 +3949,11 @@ yyparse(void) auto def = make_shared(type, sstr.str(), intVal->literal); yyval = def; } -#line 3977 "src/Slice/Grammar.cpp" +#line 4066 "src/Slice/Grammar.cpp" break; - case 173: /* const_initializer: ICE_FLOATING_POINT_LITERAL */ -#line 2065 "src/Slice/Grammar.y" + case 175: /* const_initializer: ICE_FLOATING_POINT_LITERAL */ +#line 2142 "src/Slice/Grammar.y" { BuiltinPtr type = currentUnit->builtin(Builtin::KindDouble); auto floatVal = dynamic_pointer_cast(yyvsp[0]); @@ -3871,11 +3962,11 @@ yyparse(void) auto def = make_shared(type, sstr.str(), floatVal->literal); yyval = def; } -#line 3990 "src/Slice/Grammar.cpp" +#line 4079 "src/Slice/Grammar.cpp" break; - case 174: /* const_initializer: scoped_name */ -#line 2074 "src/Slice/Grammar.y" + case 176: /* const_initializer: scoped_name */ +#line 2151 "src/Slice/Grammar.y" { auto scoped = dynamic_pointer_cast(yyvsp[0]); ConstDefTokPtr def; @@ -3910,44 +4001,44 @@ yyparse(void) } yyval = def; } -#line 4029 "src/Slice/Grammar.cpp" +#line 4118 "src/Slice/Grammar.cpp" break; - case 175: /* const_initializer: ICE_STRING_LITERAL */ -#line 2109 "src/Slice/Grammar.y" + case 177: /* const_initializer: ICE_STRING_LITERAL */ +#line 2186 "src/Slice/Grammar.y" { BuiltinPtr type = currentUnit->builtin(Builtin::KindString); auto literal = dynamic_pointer_cast(yyvsp[0]); auto def = make_shared(type, literal->v, literal->literal); yyval = def; } -#line 4040 "src/Slice/Grammar.cpp" +#line 4129 "src/Slice/Grammar.cpp" break; - case 176: /* const_initializer: ICE_FALSE */ -#line 2116 "src/Slice/Grammar.y" + case 178: /* const_initializer: ICE_FALSE */ +#line 2193 "src/Slice/Grammar.y" { BuiltinPtr type = currentUnit->builtin(Builtin::KindBool); auto literal = dynamic_pointer_cast(yyvsp[0]); auto def = make_shared(type, "false", "false"); yyval = def; } -#line 4051 "src/Slice/Grammar.cpp" +#line 4140 "src/Slice/Grammar.cpp" break; - case 177: /* const_initializer: ICE_TRUE */ -#line 2123 "src/Slice/Grammar.y" + case 179: /* const_initializer: ICE_TRUE */ +#line 2200 "src/Slice/Grammar.y" { BuiltinPtr type = currentUnit->builtin(Builtin::KindBool); auto literal = dynamic_pointer_cast(yyvsp[0]); auto def = make_shared(type, "true", "true"); yyval = def; } -#line 4062 "src/Slice/Grammar.cpp" +#line 4151 "src/Slice/Grammar.cpp" break; - case 178: /* const_def: ICE_CONST meta_data type ICE_IDENTIFIER '=' const_initializer */ -#line 2135 "src/Slice/Grammar.y" + case 180: /* const_def: ICE_CONST meta_data type ICE_IDENTIFIER '=' const_initializer */ +#line 2212 "src/Slice/Grammar.y" { auto metaData = dynamic_pointer_cast(yyvsp[-4]); auto const_type = dynamic_pointer_cast(yyvsp[-3]); @@ -3961,11 +4052,11 @@ yyparse(void) value->valueAsString, value->valueAsLiteral); } -#line 4075 "src/Slice/Grammar.cpp" +#line 4164 "src/Slice/Grammar.cpp" break; - case 179: /* const_def: ICE_CONST meta_data type '=' const_initializer */ -#line 2144 "src/Slice/Grammar.y" + case 181: /* const_def: ICE_CONST meta_data type '=' const_initializer */ +#line 2221 "src/Slice/Grammar.y" { auto metaData = dynamic_pointer_cast(yyvsp[-3]); auto const_type = dynamic_pointer_cast(yyvsp[-2]); @@ -3980,206 +4071,206 @@ yyparse(void) value->valueAsLiteral, Dummy); // Dummy } -#line 4088 "src/Slice/Grammar.cpp" +#line 4177 "src/Slice/Grammar.cpp" break; - case 180: /* keyword: ICE_MODULE */ -#line 2157 "src/Slice/Grammar.y" + case 182: /* keyword: ICE_MODULE */ +#line 2234 "src/Slice/Grammar.y" { } -#line 4094 "src/Slice/Grammar.cpp" +#line 4183 "src/Slice/Grammar.cpp" break; - case 181: /* keyword: ICE_CLASS */ -#line 2158 "src/Slice/Grammar.y" + case 183: /* keyword: ICE_CLASS */ +#line 2235 "src/Slice/Grammar.y" { } -#line 4100 "src/Slice/Grammar.cpp" +#line 4189 "src/Slice/Grammar.cpp" break; - case 182: /* keyword: ICE_INTERFACE */ -#line 2159 "src/Slice/Grammar.y" + case 184: /* keyword: ICE_INTERFACE */ +#line 2236 "src/Slice/Grammar.y" { } -#line 4106 "src/Slice/Grammar.cpp" +#line 4195 "src/Slice/Grammar.cpp" break; - case 183: /* keyword: ICE_EXCEPTION */ -#line 2160 "src/Slice/Grammar.y" + case 185: /* keyword: ICE_EXCEPTION */ +#line 2237 "src/Slice/Grammar.y" { } -#line 4112 "src/Slice/Grammar.cpp" +#line 4201 "src/Slice/Grammar.cpp" break; - case 184: /* keyword: ICE_STRUCT */ -#line 2161 "src/Slice/Grammar.y" + case 186: /* keyword: ICE_STRUCT */ +#line 2238 "src/Slice/Grammar.y" { } -#line 4118 "src/Slice/Grammar.cpp" +#line 4207 "src/Slice/Grammar.cpp" break; - case 185: /* keyword: ICE_SEQUENCE */ -#line 2162 "src/Slice/Grammar.y" + case 187: /* keyword: ICE_SEQUENCE */ +#line 2239 "src/Slice/Grammar.y" { } -#line 4124 "src/Slice/Grammar.cpp" +#line 4213 "src/Slice/Grammar.cpp" break; - case 186: /* keyword: ICE_DICTIONARY */ -#line 2163 "src/Slice/Grammar.y" + case 188: /* keyword: ICE_DICTIONARY */ +#line 2240 "src/Slice/Grammar.y" { } -#line 4130 "src/Slice/Grammar.cpp" +#line 4219 "src/Slice/Grammar.cpp" break; - case 187: /* keyword: ICE_ENUM */ -#line 2164 "src/Slice/Grammar.y" + case 189: /* keyword: ICE_ENUM */ +#line 2241 "src/Slice/Grammar.y" { } -#line 4136 "src/Slice/Grammar.cpp" +#line 4225 "src/Slice/Grammar.cpp" break; - case 188: /* keyword: ICE_OUT */ -#line 2165 "src/Slice/Grammar.y" + case 190: /* keyword: ICE_OUT */ +#line 2242 "src/Slice/Grammar.y" { } -#line 4142 "src/Slice/Grammar.cpp" +#line 4231 "src/Slice/Grammar.cpp" break; - case 189: /* keyword: ICE_EXTENDS */ -#line 2166 "src/Slice/Grammar.y" + case 191: /* keyword: ICE_EXTENDS */ +#line 2243 "src/Slice/Grammar.y" { } -#line 4148 "src/Slice/Grammar.cpp" +#line 4237 "src/Slice/Grammar.cpp" break; - case 190: /* keyword: ICE_THROWS */ -#line 2167 "src/Slice/Grammar.y" + case 192: /* keyword: ICE_THROWS */ +#line 2244 "src/Slice/Grammar.y" { } -#line 4154 "src/Slice/Grammar.cpp" +#line 4243 "src/Slice/Grammar.cpp" break; - case 191: /* keyword: ICE_VOID */ -#line 2168 "src/Slice/Grammar.y" + case 193: /* keyword: ICE_VOID */ +#line 2245 "src/Slice/Grammar.y" { } -#line 4160 "src/Slice/Grammar.cpp" +#line 4249 "src/Slice/Grammar.cpp" break; - case 192: /* keyword: ICE_BOOL */ -#line 2169 "src/Slice/Grammar.y" + case 194: /* keyword: ICE_BOOL */ +#line 2246 "src/Slice/Grammar.y" { } -#line 4166 "src/Slice/Grammar.cpp" +#line 4255 "src/Slice/Grammar.cpp" break; - case 193: /* keyword: ICE_BYTE */ -#line 2170 "src/Slice/Grammar.y" + case 195: /* keyword: ICE_BYTE */ +#line 2247 "src/Slice/Grammar.y" { } -#line 4172 "src/Slice/Grammar.cpp" +#line 4261 "src/Slice/Grammar.cpp" break; - case 194: /* keyword: ICE_SHORT */ -#line 2171 "src/Slice/Grammar.y" + case 196: /* keyword: ICE_SHORT */ +#line 2248 "src/Slice/Grammar.y" { } -#line 4178 "src/Slice/Grammar.cpp" +#line 4267 "src/Slice/Grammar.cpp" break; - case 195: /* keyword: ICE_INT */ -#line 2172 "src/Slice/Grammar.y" + case 197: /* keyword: ICE_INT */ +#line 2249 "src/Slice/Grammar.y" { } -#line 4184 "src/Slice/Grammar.cpp" +#line 4273 "src/Slice/Grammar.cpp" break; - case 196: /* keyword: ICE_LONG */ -#line 2173 "src/Slice/Grammar.y" + case 198: /* keyword: ICE_LONG */ +#line 2250 "src/Slice/Grammar.y" { } -#line 4190 "src/Slice/Grammar.cpp" +#line 4279 "src/Slice/Grammar.cpp" break; - case 197: /* keyword: ICE_FLOAT */ -#line 2174 "src/Slice/Grammar.y" + case 199: /* keyword: ICE_FLOAT */ +#line 2251 "src/Slice/Grammar.y" { } -#line 4196 "src/Slice/Grammar.cpp" +#line 4285 "src/Slice/Grammar.cpp" break; - case 198: /* keyword: ICE_DOUBLE */ -#line 2175 "src/Slice/Grammar.y" + case 200: /* keyword: ICE_DOUBLE */ +#line 2252 "src/Slice/Grammar.y" { } -#line 4202 "src/Slice/Grammar.cpp" +#line 4291 "src/Slice/Grammar.cpp" break; - case 199: /* keyword: ICE_STRING */ -#line 2176 "src/Slice/Grammar.y" + case 201: /* keyword: ICE_STRING */ +#line 2253 "src/Slice/Grammar.y" { } -#line 4208 "src/Slice/Grammar.cpp" +#line 4297 "src/Slice/Grammar.cpp" break; - case 200: /* keyword: ICE_OBJECT */ -#line 2177 "src/Slice/Grammar.y" + case 202: /* keyword: ICE_OBJECT */ +#line 2254 "src/Slice/Grammar.y" { } -#line 4214 "src/Slice/Grammar.cpp" +#line 4303 "src/Slice/Grammar.cpp" break; - case 201: /* keyword: ICE_CONST */ -#line 2178 "src/Slice/Grammar.y" + case 203: /* keyword: ICE_CONST */ +#line 2255 "src/Slice/Grammar.y" { } -#line 4220 "src/Slice/Grammar.cpp" +#line 4309 "src/Slice/Grammar.cpp" break; - case 202: /* keyword: ICE_FALSE */ -#line 2179 "src/Slice/Grammar.y" + case 204: /* keyword: ICE_FALSE */ +#line 2256 "src/Slice/Grammar.y" { } -#line 4226 "src/Slice/Grammar.cpp" +#line 4315 "src/Slice/Grammar.cpp" break; - case 203: /* keyword: ICE_TRUE */ -#line 2180 "src/Slice/Grammar.y" + case 205: /* keyword: ICE_TRUE */ +#line 2257 "src/Slice/Grammar.y" { } -#line 4232 "src/Slice/Grammar.cpp" +#line 4321 "src/Slice/Grammar.cpp" break; - case 204: /* keyword: ICE_IDEMPOTENT */ -#line 2181 "src/Slice/Grammar.y" + case 206: /* keyword: ICE_IDEMPOTENT */ +#line 2258 "src/Slice/Grammar.y" { } -#line 4238 "src/Slice/Grammar.cpp" +#line 4327 "src/Slice/Grammar.cpp" break; - case 205: /* keyword: ICE_TAG */ -#line 2182 "src/Slice/Grammar.y" + case 207: /* keyword: ICE_TAG */ +#line 2259 "src/Slice/Grammar.y" { } -#line 4244 "src/Slice/Grammar.cpp" +#line 4333 "src/Slice/Grammar.cpp" break; - case 206: /* keyword: ICE_OPTIONAL */ -#line 2183 "src/Slice/Grammar.y" + case 208: /* keyword: ICE_OPTIONAL */ +#line 2260 "src/Slice/Grammar.y" { } -#line 4250 "src/Slice/Grammar.cpp" +#line 4339 "src/Slice/Grammar.cpp" break; - case 207: /* keyword: ICE_VALUE */ -#line 2184 "src/Slice/Grammar.y" + case 209: /* keyword: ICE_VALUE */ +#line 2261 "src/Slice/Grammar.y" { } -#line 4256 "src/Slice/Grammar.cpp" +#line 4345 "src/Slice/Grammar.cpp" break; -#line 4260 "src/Slice/Grammar.cpp" +#line 4349 "src/Slice/Grammar.cpp" default: break; @@ -4365,4 +4456,4 @@ yyparse(void) return yyresult; } -#line 2187 "src/Slice/Grammar.y" +#line 2264 "src/Slice/Grammar.y" diff --git a/cpp/src/Slice/Grammar.y b/cpp/src/Slice/Grammar.y index 03562b977cd..0cd83144d59 100644 --- a/cpp/src/Slice/Grammar.y +++ b/cpp/src/Slice/Grammar.y @@ -385,6 +385,83 @@ module_def $$ = nullptr; } } +| ICE_MODULE ICE_SCOPED_IDENTIFIER +{ + auto ident = dynamic_pointer_cast($2); + + // Reject scoped identifiers starting with "::". This is generally indicates global scope, but is invalid here. + size_t startPos = 0; + if (ident->v.find("::") == 0) + { + currentUnit->error("illegal identifier: module identifiers cannot start with '::' prefix"); + startPos += 2; // Skip the leading "::". + } + + // Split the scoped-identifier token into separate module names. + size_t endPos; + vector modules; + while ((endPos = ident->v.find("::", startPos)) != string::npos) + { + modules.push_back(ident->v.substr(startPos, (endPos - startPos))); + startPos = endPos + 2; // Skip the "::" separator. + } + modules.push_back(ident->v.substr(startPos)); + + // Create the nested modules. + ContainerPtr cont = currentUnit->currentContainer(); + for (size_t i = 0; i < modules.size(); i++) + { + const auto currentModuleName = modules[i]; + ModulePtr module = cont->createModule(currentModuleName); + if (module) + { + cont->checkIntroduced(currentModuleName, module); + currentUnit->pushContainer(module); + $$ = cont = module; + } + else + { + // If an error occurs while creating one of the modules, we have to stop. But, to eagerly report as many + // errors as possible, we still 'create' any remaining modules, which will run _some_ validation on them. + for (size_t j = (i + 1); j < modules.size(); j++) + { + cont->createModule(modules[j]); // Dummy + } + + // Then we roll back the chain, ie. pop the successfully-created-modules off the container stack. + for (; i > 0; i--) + { + currentUnit->popContainer(); + } + $$ = nullptr; + break; + } + } +} +'{' definitions '}' +{ + if ($3) + { + // We need to pop '(N+1)' modules off the container stack, to navigate out of the nested module. + // Where `N` is the number of scope separators ("::"). + size_t startPos = 0; + auto ident = dynamic_pointer_cast($2); + while ((startPos = ident->v.find("::", startPos)) != string::npos) + { + currentUnit->popContainer(); + startPos += 2; // Skip the "::" separator. + } + + // Set the 'return value' to the outer-most module, before we pop it off the stack. + // Whichever module we return, is the one that metadata will be applied to. + $$ = currentUnit->currentContainer(); + currentUnit->popContainer(); + } + else + { + $$ = nullptr; + } +} ; // ---------------------------------------------------------------------- diff --git a/cpp/src/Slice/SliceUtil.cpp b/cpp/src/Slice/SliceUtil.cpp index 293735499b1..3ca6efa3a97 100644 --- a/cpp/src/Slice/SliceUtil.cpp +++ b/cpp/src/Slice/SliceUtil.cpp @@ -483,7 +483,9 @@ Slice::checkIdentifier(const string& id) name = id; } + assert(!name.empty()); bool isValid = true; + // check the identifier for reserved suffixes static const string suffixBlacklist[] = {"Helper", "Holder", "Prx", "Ptr"}; for (size_t i = 0; i < sizeof(suffixBlacklist) / sizeof(*suffixBlacklist); ++i) diff --git a/cpp/test/Ice/ami/Test.ice b/cpp/test/Ice/ami/Test.ice index 89348dfbf3d..a61714780df 100644 --- a/cpp/test/Ice/ami/Test.ice +++ b/cpp/test/Ice/ami/Test.ice @@ -59,10 +59,7 @@ interface TestIntfController void resumeAdapter(); } -module Outer -{ - -module Inner +module Outer::Inner { interface TestIntf @@ -73,5 +70,3 @@ interface TestIntf } } - -} diff --git a/cpp/test/Ice/scope/Test.ice b/cpp/test/Ice/scope/Test.ice index 011badcf15b..879c565f423 100644 --- a/cpp/test/Ice/scope/Test.ice +++ b/cpp/test/Ice/scope/Test.ice @@ -144,13 +144,7 @@ module Test } } -module Inner -{ - -module Test -{ - -module Inner2 +module Inner::Test::Inner2 { interface I { @@ -165,7 +159,3 @@ module Inner2 void shutdown(); } } - -} - -} diff --git a/cpp/test/Ice/stream/Test.ice b/cpp/test/Ice/stream/Test.ice index fa49475f087..ed073e4d6ca 100644 --- a/cpp/test/Ice/stream/Test.ice +++ b/cpp/test/Ice/stream/Test.ice @@ -124,9 +124,7 @@ module Sub } } -module Test2 -{ -module Sub2 +module Test2::Sub2 { enum NestedEnum2 { @@ -153,4 +151,3 @@ module Sub2 string str; } } -} diff --git a/cpp/test/Slice/errorDetection/CaseInsensitive.err b/cpp/test/Slice/errorDetection/CaseInsensitive.err index bb62bed8ca6..e4d8fa077e0 100644 --- a/cpp/test/Slice/errorDetection/CaseInsensitive.err +++ b/cpp/test/Slice/errorDetection/CaseInsensitive.err @@ -30,22 +30,22 @@ CaseInsensitive.ice:149: enumeration `eN1' differs only in capitalization from e CaseInsensitive.ice:150: redefinition of module `m1' as enumeration CaseInsensitive.ice:151: enumeration `M1' differs only in capitalization from module `m1' CaseInsensitive.ice:152: enumerator `EN1' differs only in capitalization from `en1' -CaseInsensitive.ice:170: interface name `base' is capitalized inconsistently with its previous name: `::Test::xxx::xx::Base' -CaseInsensitive.ice:170: redefinition of interface `Derived' -CaseInsensitive.ice:177: exception name `E1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' -CaseInsensitive.ice:184: sequence name `S1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::s1' -CaseInsensitive.ice:185: sequence name `xxx::xx::S1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::s1' -CaseInsensitive.ice:186: sequence name `xxx::XX::s1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::s1' -CaseInsensitive.ice:187: sequence name `xxx::XX::s1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::s1' -CaseInsensitive.ice:193: interface name `derived' is capitalized inconsistently with its previous name: `::Test::xxx::xx::Derived' -CaseInsensitive.ice:202: parameter `Param' differs only in capitalization from parameter `param' -CaseInsensitive.ice:202: `Param' has changed meaning -CaseInsensitive.ice:204: exception name `E1' is capitalized inconsistently with its previous name: `::Test::e1' -CaseInsensitive.ice:206: exception name `Test::xxx::xx::E1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' -CaseInsensitive.ice:207: exception name `Test::xxx::XX::e1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' -CaseInsensitive.ice:208: exception name `Test::XXX::xx::e1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' -CaseInsensitive.ice:210: exception name `Test::xxx::xx::E1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' -CaseInsensitive.ice:211: exception name `Test::xxx::XX::e1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' -CaseInsensitive.ice:212: exception name `Test::XXX::xx::e1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' -CaseInsensitive.ice:230: ambiguous multiple inheritance: `derived' inherits operations `op' and `OP', which differ only in capitalization, from unrelated base interfaces -CaseInsensitive.ice:274: data member `x' differs only in capitalization from data member `X', which is defined in a base class +CaseInsensitive.ice:167: interface name `base' is capitalized inconsistently with its previous name: `::Test::xxx::xx::Base' +CaseInsensitive.ice:167: redefinition of interface `Derived' +CaseInsensitive.ice:174: exception name `E1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' +CaseInsensitive.ice:181: sequence name `S1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::s1' +CaseInsensitive.ice:182: sequence name `xxx::xx::S1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::s1' +CaseInsensitive.ice:183: sequence name `xxx::XX::s1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::s1' +CaseInsensitive.ice:184: sequence name `xxx::XX::s1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::s1' +CaseInsensitive.ice:190: interface name `derived' is capitalized inconsistently with its previous name: `::Test::xxx::xx::Derived' +CaseInsensitive.ice:197: parameter `Param' differs only in capitalization from parameter `param' +CaseInsensitive.ice:197: `Param' has changed meaning +CaseInsensitive.ice:199: exception name `E1' is capitalized inconsistently with its previous name: `::Test::e1' +CaseInsensitive.ice:201: exception name `Test::xxx::xx::E1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' +CaseInsensitive.ice:202: exception name `Test::xxx::XX::e1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' +CaseInsensitive.ice:203: exception name `Test::XXX::xx::e1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' +CaseInsensitive.ice:205: exception name `Test::xxx::xx::E1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' +CaseInsensitive.ice:206: exception name `Test::xxx::XX::e1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' +CaseInsensitive.ice:207: exception name `Test::XXX::xx::e1' is capitalized inconsistently with its previous name: `::Test::xxx::xx::e1' +CaseInsensitive.ice:225: ambiguous multiple inheritance: `derived' inherits operations `op' and `OP', which differ only in capitalization, from unrelated base interfaces +CaseInsensitive.ice:269: data member `x' differs only in capitalization from data member `X', which is defined in a base class diff --git a/cpp/test/Slice/errorDetection/CaseInsensitive.ice b/cpp/test/Slice/errorDetection/CaseInsensitive.ice index 4eaa0c1e585..015f9594c04 100644 --- a/cpp/test/Slice/errorDetection/CaseInsensitive.ice +++ b/cpp/test/Slice/errorDetection/CaseInsensitive.ice @@ -151,10 +151,7 @@ enum m1 { green } enum M1 { blue } enum en2 { yellow, en1, EN1} -module xxx -{ - -module xx +module xxx::xx { interface Base @@ -195,8 +192,6 @@ struct s2 } -} - interface Foo { void op(long param, string Param); diff --git a/cpp/test/Slice/errorDetection/NestedModule.err b/cpp/test/Slice/errorDetection/NestedModule.err new file mode 100644 index 00000000000..c512ae124a0 --- /dev/null +++ b/cpp/test/Slice/errorDetection/NestedModule.err @@ -0,0 +1,10 @@ +NestedModule.ice:9: illegal identifier `Holder': `Holder' suffix is reserved +NestedModule.ice:11: illegal identifier `Holder': `Holder' suffix is reserved +NestedModule.ice:15: illegal leading underscore in identifier `__Iceberg' +NestedModule.ice:18: illegal identifier `Holder': `Holder' suffix is reserved +NestedModule.ice:20: illegal identifier `Holder': `Holder' suffix is reserved +NestedModule.ice:24: illegal identifier `APtr': `Ptr' suffix is reserved +NestedModule.ice:24: illegal identifier `BPrx': `Prx' suffix is reserved +NestedModule.ice:24: illegal identifier `CHelper': `Helper' suffix is reserved +NestedModule.ice:27: illegal identifier: module identifiers cannot start with '::' prefix +NestedModule.ice:27: illegal identifier `Helper': `Helper' suffix is reserved diff --git a/cpp/test/Slice/errorDetection/NestedModule.ice b/cpp/test/Slice/errorDetection/NestedModule.ice new file mode 100644 index 00000000000..777b07e2d18 --- /dev/null +++ b/cpp/test/Slice/errorDetection/NestedModule.ice @@ -0,0 +1,27 @@ +// +// Copyright (c) ZeroC, Inc. All rights reserved. +// + +// Case where the module chain is all good. +module All::Good::Here +{ + module Okay {} + module Holder {} // Error: 'Holder' suffix is reserved + + module Okay::Holder {} // Error: 'Holder' suffix is reserved +} + +// Case where the module chain is broken. +module An::__Iceberg::Ahead // Error: illegal leading underscore +{ + module Okay {} + module Holder {} // Error: 'Holder' suffix is reserved + + module Okay::Holder {} // Error: 'Holder' suffix is reserved +} + +// Ensure that each module segment is individually checked for errors. +module APtr::Okay::BPrx::Fine::CHelper {} + +// Ensure that modules cannot start with a '::' character. +module ::No::Leading::Helper {} diff --git a/csharp/test/Ice/ami/Test.ice b/csharp/test/Ice/ami/Test.ice index 7b59fdc42fc..9038377d0bf 100644 --- a/csharp/test/Ice/ami/Test.ice +++ b/csharp/test/Ice/ami/Test.ice @@ -60,10 +60,7 @@ interface TestIntfController void resumeAdapter(); } -module Outer -{ - -module Inner +module Outer::Inner { interface TestIntf @@ -74,5 +71,3 @@ interface TestIntf } } - -} diff --git a/csharp/test/Ice/scope/Test.ice b/csharp/test/Ice/scope/Test.ice index a492517e65c..6c69d6a3a58 100644 --- a/csharp/test/Ice/scope/Test.ice +++ b/csharp/test/Ice/scope/Test.ice @@ -146,13 +146,7 @@ module Test } } -module Inner -{ - -module Test -{ - -module Inner2 +module Inner::Test::Inner2 { interface I { @@ -167,7 +161,3 @@ module Inner2 void shutdown(); } } - -} - -} diff --git a/java/test/src/main/java/test/Ice/ami/Test.ice b/java/test/src/main/java/test/Ice/ami/Test.ice index 7eab6a6867d..dbed7725945 100644 --- a/java/test/src/main/java/test/Ice/ami/Test.ice +++ b/java/test/src/main/java/test/Ice/ami/Test.ice @@ -62,10 +62,7 @@ interface TestIntfController void resumeAdapter(); } -module Outer -{ - -module Inner +module Outer::Inner { interface TestIntf @@ -76,5 +73,3 @@ interface TestIntf } } - -} diff --git a/java/test/src/main/java/test/Ice/scope/Test.ice b/java/test/src/main/java/test/Ice/scope/Test.ice index 8eb753f9977..3cd70f877e2 100644 --- a/java/test/src/main/java/test/Ice/scope/Test.ice +++ b/java/test/src/main/java/test/Ice/scope/Test.ice @@ -145,13 +145,7 @@ module Test } } -module Inner -{ - -module Test -{ - -module Inner2 +module Inner::Test::Inner2 { interface I { @@ -166,7 +160,3 @@ module Inner2 void shutdown(); } } - -} - -} diff --git a/js/test/Ice/import/Demo/Canvas.ice b/js/test/Ice/import/Demo/Canvas.ice index 17af5f8e250..e2b3406fd39 100644 --- a/js/test/Ice/import/Demo/Canvas.ice +++ b/js/test/Ice/import/Demo/Canvas.ice @@ -10,10 +10,7 @@ #include "Demo/Circle.ice" #include "Glacier2/Session.ice" -module Demo -{ - -module gx +module Demo::gx { interface Canvas @@ -29,5 +26,3 @@ interface Session extends Glacier2::Session } } - -} diff --git a/js/test/Ice/import/Demo/Circle.ice b/js/test/Ice/import/Demo/Circle.ice index ea2f3b27f89..e2b1d28467a 100644 --- a/js/test/Ice/import/Demo/Circle.ice +++ b/js/test/Ice/import/Demo/Circle.ice @@ -8,10 +8,7 @@ #include "Demo/Point.ice" -module Demo -{ - -module gx +module Demo::gx { struct Circle @@ -21,5 +18,3 @@ struct Circle } } - -} diff --git a/js/test/Ice/import/Demo/Point.ice b/js/test/Ice/import/Demo/Point.ice index d59f802d8ab..1ba36a82601 100644 --- a/js/test/Ice/import/Demo/Point.ice +++ b/js/test/Ice/import/Demo/Point.ice @@ -6,10 +6,7 @@ #pragma once -module Demo -{ - -module gx +module Demo::gx { struct Point @@ -19,5 +16,3 @@ struct Point } } - -} diff --git a/js/test/Ice/import/Demo/Square.ice b/js/test/Ice/import/Demo/Square.ice index 54683302a66..bb6893d854a 100644 --- a/js/test/Ice/import/Demo/Square.ice +++ b/js/test/Ice/import/Demo/Square.ice @@ -8,10 +8,7 @@ #include "Demo/Point.ice" -module Demo -{ - -module gx +module Demo::gx { struct Square @@ -23,5 +20,3 @@ struct Square } } - -} diff --git a/js/test/Ice/scope/Test.ice b/js/test/Ice/scope/Test.ice index 011badcf15b..879c565f423 100644 --- a/js/test/Ice/scope/Test.ice +++ b/js/test/Ice/scope/Test.ice @@ -144,13 +144,7 @@ module Test } } -module Inner -{ - -module Test -{ - -module Inner2 +module Inner::Test::Inner2 { interface I { @@ -165,7 +159,3 @@ module Inner2 void shutdown(); } } - -} - -} diff --git a/js/test/typescript/Ice/scope/Test.ice b/js/test/typescript/Ice/scope/Test.ice index 6dbe43bfdaa..edcb5fc07f6 100644 --- a/js/test/typescript/Ice/scope/Test.ice +++ b/js/test/typescript/Ice/scope/Test.ice @@ -146,13 +146,7 @@ module Test } } -module Inner -{ - -module Test -{ - -module Inner2 +module Inner::Test::Inner2 { interface I { @@ -167,7 +161,3 @@ module Inner2 void shutdown(); } } - -} - -} diff --git a/matlab/test/Ice/ami/Test.ice b/matlab/test/Ice/ami/Test.ice index 94a2df77703..9536192bd22 100644 --- a/matlab/test/Ice/ami/Test.ice +++ b/matlab/test/Ice/ami/Test.ice @@ -61,10 +61,7 @@ interface TestIntfController void resumeAdapter(); } -module Outer -{ - -module Inner +module Outer::Inner { interface TestIntf @@ -75,5 +72,3 @@ interface TestIntf } } - -} diff --git a/php/test/Ice/scope/Test.ice b/php/test/Ice/scope/Test.ice index 011badcf15b..879c565f423 100644 --- a/php/test/Ice/scope/Test.ice +++ b/php/test/Ice/scope/Test.ice @@ -144,13 +144,7 @@ module Test } } -module Inner -{ - -module Test -{ - -module Inner2 +module Inner::Test::Inner2 { interface I { @@ -165,7 +159,3 @@ module Inner2 void shutdown(); } } - -} - -} diff --git a/python/test/Ice/ami/Test.ice b/python/test/Ice/ami/Test.ice index 9d6b6ed3bd8..8f6745a2b72 100644 --- a/python/test/Ice/ami/Test.ice +++ b/python/test/Ice/ami/Test.ice @@ -54,10 +54,7 @@ interface TestIntfController void resumeAdapter(); } -module Outer -{ - -module Inner +module Outer::Inner { interface TestIntf @@ -68,5 +65,3 @@ interface TestIntf } } - -} diff --git a/python/test/Ice/custom/TestNumPy.ice b/python/test/Ice/custom/TestNumPy.ice index 128f5c1d07d..c2464a91ecf 100644 --- a/python/test/Ice/custom/TestNumPy.ice +++ b/python/test/Ice/custom/TestNumPy.ice @@ -4,68 +4,65 @@ #pragma once -module Test +module Test::NumPy { - module NumPy - { - ["python:numpy.ndarray"] sequence BoolSeq1; - ["python:memoryview:Custom.myNumPyBoolSeq"] sequence BoolSeq2; + ["python:numpy.ndarray"] sequence BoolSeq1; + ["python:memoryview:Custom.myNumPyBoolSeq"] sequence BoolSeq2; - ["python:numpy.ndarray"] sequence ByteSeq1; - ["python:memoryview:Custom.myNumPyByteSeq"] sequence ByteSeq2; + ["python:numpy.ndarray"] sequence ByteSeq1; + ["python:memoryview:Custom.myNumPyByteSeq"] sequence ByteSeq2; - ["python:numpy.ndarray"] sequence ShortSeq1; - ["python:memoryview:Custom.myNumPyShortSeq"] sequence ShortSeq2; + ["python:numpy.ndarray"] sequence ShortSeq1; + ["python:memoryview:Custom.myNumPyShortSeq"] sequence ShortSeq2; - ["python:numpy.ndarray"] sequence IntSeq1; - ["python:memoryview:Custom.myNumPyIntSeq"] sequence IntSeq2; + ["python:numpy.ndarray"] sequence IntSeq1; + ["python:memoryview:Custom.myNumPyIntSeq"] sequence IntSeq2; - ["python:numpy.ndarray"] sequence LongSeq1; - ["python:memoryview:Custom.myNumPyLongSeq"] sequence LongSeq2; + ["python:numpy.ndarray"] sequence LongSeq1; + ["python:memoryview:Custom.myNumPyLongSeq"] sequence LongSeq2; - ["python:numpy.ndarray"] sequence FloatSeq1; - ["python:memoryview:Custom.myNumPyFloatSeq"] sequence FloatSeq2; + ["python:numpy.ndarray"] sequence FloatSeq1; + ["python:memoryview:Custom.myNumPyFloatSeq"] sequence FloatSeq2; - ["python:numpy.ndarray"] sequence DoubleSeq1; - ["python:memoryview:Custom.myNumPyDoubleSeq"] sequence DoubleSeq2; + ["python:numpy.ndarray"] sequence DoubleSeq1; + ["python:memoryview:Custom.myNumPyDoubleSeq"] sequence DoubleSeq2; - ["python:memoryview:Custom.myNumPyComplex128Seq"] sequence Complex128Seq; + ["python:memoryview:Custom.myNumPyComplex128Seq"] sequence Complex128Seq; - class D - { - optional(1) BoolSeq1 boolSeq; - optional(2) ByteSeq1 byteSeq; - optional(3) ShortSeq1 shortSeq; - optional(4) IntSeq1 intSeq; - optional(5) LongSeq1 longSeq; - optional(6) FloatSeq1 floatSeq; - optional(7) DoubleSeq1 doubleSeq; - } + class D + { + optional(1) BoolSeq1 boolSeq; + optional(2) ByteSeq1 byteSeq; + optional(3) ShortSeq1 shortSeq; + optional(4) IntSeq1 intSeq; + optional(5) LongSeq1 longSeq; + optional(6) FloatSeq1 floatSeq; + optional(7) DoubleSeq1 doubleSeq; + } - interface Custom - { - BoolSeq1 opBoolSeq(BoolSeq1 v1, out BoolSeq2 v2); - ByteSeq1 opByteSeq(ByteSeq1 v1, out ByteSeq2 v2); - ShortSeq1 opShortSeq(ShortSeq1 v1, out ShortSeq2 v2); - IntSeq1 opIntSeq(IntSeq1 v1, out IntSeq2 v2); - LongSeq1 opLongSeq(LongSeq1 v1, out LongSeq2 v2); - FloatSeq1 opFloatSeq(FloatSeq1 v1, out FloatSeq2 v2); - DoubleSeq1 opDoubleSeq(DoubleSeq1 v1, out DoubleSeq2 v2); - Complex128Seq opComplex128Seq(Complex128Seq v1); + interface Custom + { + BoolSeq1 opBoolSeq(BoolSeq1 v1, out BoolSeq2 v2); + ByteSeq1 opByteSeq(ByteSeq1 v1, out ByteSeq2 v2); + ShortSeq1 opShortSeq(ShortSeq1 v1, out ShortSeq2 v2); + IntSeq1 opIntSeq(IntSeq1 v1, out IntSeq2 v2); + LongSeq1 opLongSeq(LongSeq1 v1, out LongSeq2 v2); + FloatSeq1 opFloatSeq(FloatSeq1 v1, out FloatSeq2 v2); + DoubleSeq1 opDoubleSeq(DoubleSeq1 v1, out DoubleSeq2 v2); + Complex128Seq opComplex128Seq(Complex128Seq v1); - ["python:memoryview:Custom.myNumPyMatrix3x3"] BoolSeq1 opBoolMatrix(); - ["python:memoryview:Custom.myNumPyMatrix3x3"] ByteSeq1 opByteMatrix(); - ["python:memoryview:Custom.myNumPyMatrix3x3"] ShortSeq1 opShortMatrix(); - ["python:memoryview:Custom.myNumPyMatrix3x3"] IntSeq1 opIntMatrix(); - ["python:memoryview:Custom.myNumPyMatrix3x3"] LongSeq1 opLongMatrix(); - ["python:memoryview:Custom.myNumPyMatrix3x3"] FloatSeq1 opFloatMatrix(); - ["python:memoryview:Custom.myNumPyMatrix3x3"] DoubleSeq1 opDoubleMatrix(); + ["python:memoryview:Custom.myNumPyMatrix3x3"] BoolSeq1 opBoolMatrix(); + ["python:memoryview:Custom.myNumPyMatrix3x3"] ByteSeq1 opByteMatrix(); + ["python:memoryview:Custom.myNumPyMatrix3x3"] ShortSeq1 opShortMatrix(); + ["python:memoryview:Custom.myNumPyMatrix3x3"] IntSeq1 opIntMatrix(); + ["python:memoryview:Custom.myNumPyMatrix3x3"] LongSeq1 opLongMatrix(); + ["python:memoryview:Custom.myNumPyMatrix3x3"] FloatSeq1 opFloatMatrix(); + ["python:memoryview:Custom.myNumPyMatrix3x3"] DoubleSeq1 opDoubleMatrix(); - ["python:memoryview:Custom.myBogusNumpyArrayType"]BoolSeq1 opBogusNumpyArrayType(); + ["python:memoryview:Custom.myBogusNumpyArrayType"]BoolSeq1 opBogusNumpyArrayType(); - D opD(D d); + D opD(D d); - void shutdown(); - } + void shutdown(); } } diff --git a/python/test/Ice/scope/Test.ice b/python/test/Ice/scope/Test.ice index 011badcf15b..879c565f423 100644 --- a/python/test/Ice/scope/Test.ice +++ b/python/test/Ice/scope/Test.ice @@ -144,13 +144,7 @@ module Test } } -module Inner -{ - -module Test -{ - -module Inner2 +module Inner::Test::Inner2 { interface I { @@ -165,7 +159,3 @@ module Inner2 void shutdown(); } } - -} - -} diff --git a/python/test/Slice/import/Test1.ice b/python/test/Slice/import/Test1.ice index ec5eb3b9c2c..50e20494045 100644 --- a/python/test/Slice/import/Test1.ice +++ b/python/test/Slice/import/Test1.ice @@ -4,19 +4,13 @@ module Test { - module SubA + module SubA::SubSubA1 { - module SubSubA1 - { - const int Value1 = 10; - } + const int Value1 = 10; } - module SubB + module SubB::SubSubB1 { - module SubSubB1 - { - const int Value1 = 20; - } + const int Value1 = 20; } } diff --git a/ruby/test/Ice/scope/Test.ice b/ruby/test/Ice/scope/Test.ice index 011badcf15b..879c565f423 100644 --- a/ruby/test/Ice/scope/Test.ice +++ b/ruby/test/Ice/scope/Test.ice @@ -144,13 +144,7 @@ module Test } } -module Inner -{ - -module Test -{ - -module Inner2 +module Inner::Test::Inner2 { interface I { @@ -165,7 +159,3 @@ module Inner2 void shutdown(); } } - -} - -} diff --git a/scripts/Controller.ice b/scripts/Controller.ice index a4b8d6b4ae0..453fb27fd24 100644 --- a/scripts/Controller.ice +++ b/scripts/Controller.ice @@ -2,10 +2,7 @@ // Copyright (c) ZeroC, Inc. All rights reserved. // -module Test -{ - -module Common +module Test::Common { sequence BoolSeq; @@ -102,5 +99,3 @@ interface ProcessControllerRegistry } } - -} diff --git a/swift/test/Ice/ami/Test.ice b/swift/test/Ice/ami/Test.ice index 89348dfbf3d..a61714780df 100644 --- a/swift/test/Ice/ami/Test.ice +++ b/swift/test/Ice/ami/Test.ice @@ -59,10 +59,7 @@ interface TestIntfController void resumeAdapter(); } -module Outer -{ - -module Inner +module Outer::Inner { interface TestIntf @@ -73,5 +70,3 @@ interface TestIntf } } - -}