diff --git a/direct/src/dcparser/dcArrayParameter.cxx b/direct/src/dcparser/dcArrayParameter.cxx index 08b897a9bf..df6b880775 100644 --- a/direct/src/dcparser/dcArrayParameter.cxx +++ b/direct/src/dcparser/dcArrayParameter.cxx @@ -251,7 +251,11 @@ generate_hash(HashGenerator &hashgen) const { //////////////////////////////////////////////////////////////////// bool DCArrayParameter:: pack_default_value(DCPackData &pack_data, bool &pack_error) const { - if (has_default_value()) { + // We only want to call up if the DCField can pack the value + // immediately--we don't trust the DCField to generate the default + // value (since it doesn't know how large the minimum length array + // is). + if (_has_default_value && !_default_value_stale) { return DCField::pack_default_value(pack_data, pack_error); } diff --git a/direct/src/dcparser/dcPacker.I b/direct/src/dcparser/dcPacker.I index c74c72bc78..2ca83294c5 100755 --- a/direct/src/dcparser/dcPacker.I +++ b/direct/src/dcparser/dcPacker.I @@ -85,7 +85,7 @@ get_num_nested_fields() const { //////////////////////////////////////////////////////////////////// INLINE bool DCPacker:: more_nested_fields() const { - return (_current_field != (DCPackerInterface *)NULL); + return (_current_field != (DCPackerInterface *)NULL && !_pack_error); } //////////////////////////////////////////////////////////////////// diff --git a/direct/src/dcparser/dcParser.cxx.prebuilt b/direct/src/dcparser/dcParser.cxx.prebuilt index d0aa676c45..2dd086de44 100644 --- a/direct/src/dcparser/dcParser.cxx.prebuilt +++ b/direct/src/dcparser/dcParser.cxx.prebuilt @@ -137,12 +137,12 @@ dc_cleanup_parser() { -#define YYFINAL 268 +#define YYFINAL 271 #define YYFLAG -32768 #define YYNTBASE 62 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ -#define YYTRANSLATE(x) ((unsigned)(x) <= 301 ? yytranslate[x] : 134) +#define YYTRANSLATE(x) ((unsigned)(x) <= 301 ? yytranslate[x] : 135) /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ static const char yytranslate[] = @@ -192,68 +192,70 @@ static const short yyprhs[] = 171, 175, 177, 179, 180, 185, 187, 188, 193, 195, 197, 199, 201, 204, 207, 210, 212, 217, 221, 228, 235, 237, 239, 241, 243, 245, 249, 252, 256, 262, - 267, 269, 271, 275, 279, 285, 287, 292, 294, 298, - 303, 305, 307, 309, 311, 313, 315, 317, 319, 321, - 323, 325, 327, 329, 331, 333, 334, 339, 340, 345, - 346, 351, 355, 359, 363, 367, 369, 372, 374, 376, - 378, 382, 384, 386, 388, 390, 392, 394, 396, 398, - 400, 402, 404, 406, 408, 410, 412, 414, 416, 418, - 420, 422, 424, 427, 430, 433, 436, 439, 442, 445, - 448, 451, 453, 454, 459, 461, 463, 467, 469, 471, - 472, 482, 484, 487, 490, 493, 494, 499, 502, 504 + 267, 269, 271, 275, 278, 282, 288, 293, 295, 300, + 302, 306, 311, 313, 315, 317, 319, 321, 323, 325, + 327, 329, 331, 333, 335, 337, 339, 341, 343, 344, + 349, 350, 355, 356, 361, 365, 369, 373, 377, 379, + 382, 384, 386, 388, 392, 394, 396, 398, 400, 402, + 404, 406, 408, 410, 412, 414, 416, 418, 420, 422, + 424, 426, 428, 430, 432, 434, 437, 440, 443, 446, + 449, 452, 455, 458, 461, 463, 464, 469, 471, 473, + 477, 479, 481, 482, 492, 494, 497, 500, 503, 504, + 509, 512, 514 }; static const short yyrhs[] = { - 45, 63, 0, 46, 112, 0, 47, 100, 0, 133, - 0, 63, 48, 0, 63, 71, 0, 63, 127, 0, + 45, 63, 0, 46, 113, 0, 47, 100, 0, 134, + 0, 63, 48, 0, 63, 71, 0, 63, 128, 0, 63, 66, 0, 63, 70, 0, 8, 0, 64, 49, 8, 0, 64, 0, 65, 50, 64, 0, 12, 65, 0, 0, 11, 65, 12, 67, 68, 0, 69, 0, 51, 0, 64, 0, 69, 52, 64, 0, 13, 99, - 0, 72, 0, 79, 0, 0, 9, 126, 73, 75, - 53, 77, 54, 0, 8, 0, 133, 0, 55, 76, - 0, 74, 0, 76, 52, 74, 0, 133, 0, 77, - 48, 0, 77, 78, 0, 86, 120, 0, 122, 121, - 0, 96, 120, 48, 0, 94, 120, 0, 0, 10, - 126, 80, 82, 53, 84, 54, 0, 8, 0, 133, + 0, 72, 0, 79, 0, 0, 9, 127, 73, 75, + 53, 77, 54, 0, 8, 0, 134, 0, 55, 76, + 0, 74, 0, 76, 52, 74, 0, 134, 0, 77, + 48, 0, 77, 78, 0, 86, 121, 0, 123, 122, + 0, 96, 121, 48, 0, 94, 121, 0, 0, 10, + 127, 80, 82, 53, 84, 54, 0, 8, 0, 134, 0, 55, 83, 0, 81, 0, 83, 52, 81, 0, - 133, 0, 84, 48, 0, 84, 85, 0, 86, 121, - 0, 122, 121, 0, 96, 121, 48, 0, 94, 121, - 0, 0, 126, 56, 87, 88, 57, 0, 133, 0, + 134, 0, 84, 48, 0, 84, 85, 0, 86, 122, + 0, 123, 122, 0, 96, 122, 48, 0, 94, 122, + 0, 0, 127, 56, 87, 88, 57, 0, 134, 0, 89, 0, 90, 0, 89, 52, 90, 0, 99, 0, 0, 104, 92, 105, 0, 104, 0, 91, 0, 0, - 91, 58, 95, 112, 0, 93, 0, 0, 93, 58, - 97, 112, 0, 91, 0, 93, 0, 94, 0, 96, - 0, 86, 121, 0, 96, 121, 0, 94, 121, 0, - 119, 0, 119, 56, 102, 57, 0, 119, 49, 107, - 0, 119, 49, 107, 56, 102, 57, 0, 119, 56, - 102, 57, 49, 107, 0, 8, 0, 79, 0, 127, - 0, 133, 0, 111, 0, 111, 59, 111, 0, 111, - 110, 0, 102, 52, 111, 0, 102, 52, 111, 59, - 111, 0, 102, 52, 111, 110, 0, 133, 0, 106, - 0, 106, 59, 106, 0, 103, 52, 106, 0, 103, - 52, 106, 59, 106, 0, 101, 0, 104, 60, 103, - 61, 0, 8, 0, 105, 49, 107, 0, 105, 60, - 103, 61, 0, 6, 0, 107, 0, 3, 0, 4, - 0, 3, 0, 109, 0, 108, 0, 5, 0, 6, - 0, 110, 0, 108, 0, 109, 0, 5, 0, 6, - 0, 7, 0, 0, 53, 113, 116, 54, 0, 0, - 60, 114, 116, 61, 0, 0, 56, 115, 116, 57, - 0, 108, 51, 107, 0, 109, 51, 107, 0, 5, - 51, 107, 0, 7, 51, 107, 0, 117, 0, 118, - 117, 0, 133, 0, 52, 0, 112, 0, 118, 52, - 112, 0, 16, 0, 17, 0, 18, 0, 19, 0, + 91, 58, 95, 113, 0, 93, 0, 0, 93, 58, + 97, 113, 0, 91, 0, 93, 0, 94, 0, 96, + 0, 86, 122, 0, 96, 122, 0, 94, 122, 0, + 120, 0, 120, 56, 102, 57, 0, 120, 49, 107, + 0, 120, 49, 107, 56, 102, 57, 0, 120, 56, + 102, 57, 49, 107, 0, 8, 0, 79, 0, 128, + 0, 134, 0, 112, 0, 112, 59, 112, 0, 112, + 111, 0, 102, 52, 112, 0, 102, 52, 112, 59, + 112, 0, 102, 52, 112, 111, 0, 134, 0, 106, + 0, 106, 59, 106, 0, 106, 108, 0, 103, 52, + 106, 0, 103, 52, 106, 59, 106, 0, 103, 52, + 106, 108, 0, 101, 0, 104, 60, 103, 61, 0, + 8, 0, 105, 49, 107, 0, 105, 60, 103, 61, + 0, 6, 0, 107, 0, 3, 0, 4, 0, 4, + 0, 3, 0, 110, 0, 109, 0, 5, 0, 6, + 0, 111, 0, 109, 0, 110, 0, 5, 0, 6, + 0, 7, 0, 0, 53, 114, 117, 54, 0, 0, + 60, 115, 117, 61, 0, 0, 56, 116, 117, 57, + 0, 109, 51, 107, 0, 110, 51, 107, 0, 5, + 51, 107, 0, 7, 51, 107, 0, 118, 0, 119, + 118, 0, 134, 0, 52, 0, 113, 0, 119, 52, + 113, 0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23, 0, 24, 0, 25, 0, 26, 0, 27, 0, 28, 0, 29, 0, 30, 0, 31, 0, 32, 0, 33, 0, 34, 0, - 35, 0, 133, 0, 120, 36, 0, 120, 37, 0, - 120, 38, 0, 120, 39, 0, 120, 40, 0, 120, - 41, 0, 120, 42, 0, 120, 43, 0, 120, 44, - 0, 120, 0, 0, 8, 55, 123, 125, 0, 8, - 0, 124, 0, 125, 52, 124, 0, 133, 0, 8, - 0, 0, 14, 126, 56, 98, 57, 53, 128, 129, - 54, 0, 133, 0, 129, 48, 0, 129, 130, 0, - 129, 132, 0, 0, 15, 131, 112, 55, 0, 96, + 35, 0, 134, 0, 121, 36, 0, 121, 37, 0, + 121, 38, 0, 121, 39, 0, 121, 40, 0, 121, + 41, 0, 121, 42, 0, 121, 43, 0, 121, 44, + 0, 121, 0, 0, 8, 55, 124, 126, 0, 8, + 0, 125, 0, 126, 52, 125, 0, 134, 0, 8, + 0, 0, 14, 127, 56, 98, 57, 53, 129, 130, + 54, 0, 134, 0, 130, 48, 0, 130, 131, 0, + 130, 133, 0, 0, 15, 132, 113, 55, 0, 96, 48, 0, 94, 0, 0 }; @@ -263,24 +265,25 @@ static const short yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const short yyrline[] = { - 0, 170, 172, 173, 179, 181, 182, 193, 199, 200, - 203, 205, 211, 213, 219, 224, 224, 231, 233, 239, - 244, 250, 268, 270, 273, 273, 286, 309, 311, 314, - 321, 329, 331, 332, 344, 355, 356, 364, 373, 373, - 386, 409, 411, 414, 421, 429, 431, 432, 442, 450, - 451, 455, 461, 461, 474, 476, 479, 481, 484, 493, - 493, 504, 508, 510, 510, 538, 540, 540, 568, 570, - 573, 575, 578, 583, 587, 593, 598, 606, 617, 631, - 645, 680, 696, 714, 719, 726, 733, 742, 748, 754, - 764, 769, 776, 783, 789, 797, 799, 809, 815, 829, - 835, 845, 848, 859, 863, 867, 872, 876, 879, 889, - 893, 898, 902, 906, 910, 914, 914, 922, 922, 930, - 930, 938, 944, 950, 956, 964, 966, 969, 971, 974, - 976, 979, 984, 988, 992, 996, 1000, 1004, 1008, 1012, - 1016, 1020, 1024, 1028, 1032, 1036, 1040, 1044, 1048, 1052, - 1056, 1062, 1067, 1071, 1075, 1079, 1083, 1087, 1091, 1095, - 1099, 1105, 1115, 1115, 1126, 1142, 1149, 1162, 1167, 1170, - 1170, 1184, 1186, 1187, 1188, 1200, 1200, 1217, 1222, 1228 + 0, 171, 173, 174, 180, 182, 183, 194, 200, 201, + 204, 206, 212, 214, 220, 225, 225, 232, 234, 240, + 245, 251, 269, 271, 274, 274, 287, 310, 312, 315, + 322, 330, 332, 333, 345, 356, 357, 365, 374, 374, + 387, 410, 412, 415, 422, 430, 432, 433, 443, 451, + 452, 456, 462, 462, 475, 477, 480, 482, 485, 494, + 494, 505, 509, 511, 511, 539, 541, 541, 569, 571, + 574, 576, 579, 584, 588, 594, 599, 607, 618, 632, + 646, 681, 697, 715, 720, 727, 734, 743, 749, 755, + 765, 770, 777, 784, 791, 797, 803, 811, 813, 823, + 829, 843, 849, 859, 862, 873, 887, 891, 895, 900, + 904, 907, 917, 921, 926, 930, 934, 938, 942, 942, + 950, 950, 958, 958, 966, 972, 978, 984, 992, 994, + 997, 999, 1002, 1004, 1007, 1012, 1016, 1020, 1024, 1028, + 1032, 1036, 1040, 1044, 1048, 1052, 1056, 1060, 1064, 1068, + 1072, 1076, 1080, 1084, 1090, 1095, 1099, 1103, 1107, 1111, + 1115, 1119, 1123, 1127, 1133, 1143, 1143, 1154, 1170, 1177, + 1190, 1195, 1198, 1198, 1212, 1214, 1215, 1216, 1228, 1228, + 1245, 1250, 1256 }; #endif @@ -313,12 +316,13 @@ static const char *const yytname[] = "unnamed_parameter_with_default", "@7", "parameter", "parameter_with_default", "parameter_description", "type_name", "double_range", "uint_range", "type_definition", "parameter_definition", - "char_or_uint", "small_unsigned_integer", "signed_integer", - "unsigned_integer", "number", "char_or_number", "parameter_value", "@8", - "@9", "@10", "array", "maybe_comma", "array_def", "type_token", - "server_flags", "no_server_flags", "molecular_field", "@11", - "atomic_name", "molecular_atom_list", "optional_name", "switch", "@12", - "switch_fields", "switch_case", "@13", "switch_field", "empty", 0 + "char_or_uint", "small_unsigned_integer", "small_negative_integer", + "signed_integer", "unsigned_integer", "number", "char_or_number", + "parameter_value", "@8", "@9", "@10", "array", "maybe_comma", + "array_def", "type_token", "server_flags", "no_server_flags", + "molecular_field", "@11", "atomic_name", "molecular_atom_list", + "optional_name", "switch", "@12", "switch_fields", "switch_case", "@13", + "switch_field", "empty", 0 }; #endif @@ -334,15 +338,16 @@ static const short yyr1[] = 91, 93, 94, 95, 94, 96, 97, 96, 98, 98, 99, 99, 100, 100, 100, 101, 101, 101, 101, 101, 101, 101, 101, 102, 102, 102, 102, 102, 102, 102, - 103, 103, 103, 103, 103, 104, 104, 105, 105, 105, - 106, 106, 107, 108, 109, 110, 110, 110, 111, 111, - 112, 112, 112, 112, 112, 113, 112, 114, 112, 115, - 112, 112, 112, 112, 112, 116, 116, 117, 117, 118, - 118, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 121, 123, 122, 124, 125, 125, 126, 126, 128, - 127, 129, 129, 129, 129, 131, 130, 132, 132, 133 + 103, 103, 103, 103, 103, 103, 103, 104, 104, 105, + 105, 105, 106, 106, 107, 108, 109, 110, 111, 111, + 111, 112, 112, 113, 113, 113, 113, 113, 114, 113, + 115, 113, 116, 113, 113, 113, 113, 113, 117, 117, + 118, 118, 119, 119, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 120, 120, 121, 121, 121, 121, 121, 121, + 121, 121, 121, 121, 122, 124, 123, 125, 126, 126, + 127, 127, 129, 128, 130, 130, 130, 130, 132, 131, + 133, 133, 134 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -357,15 +362,16 @@ static const short yyr2[] = 3, 1, 1, 0, 4, 1, 0, 4, 1, 1, 1, 1, 2, 2, 2, 1, 4, 3, 6, 6, 1, 1, 1, 1, 1, 3, 2, 3, 5, 4, - 1, 1, 3, 3, 5, 1, 4, 1, 3, 4, + 1, 1, 3, 2, 3, 5, 4, 1, 4, 1, + 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 4, + 0, 4, 0, 4, 3, 3, 3, 3, 1, 2, + 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 4, 0, 4, 0, - 4, 3, 3, 3, 3, 1, 2, 1, 1, 1, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 1, 0, 4, 1, 1, 3, 1, 1, 0, - 9, 1, 2, 2, 2, 0, 4, 2, 1, 0 + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 1, 0, 4, 1, 1, 3, + 1, 1, 0, 9, 1, 2, 2, 2, 0, 4, + 2, 1, 0 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE @@ -373,186 +379,188 @@ static const short yyr2[] = error. */ static const short yydefact[] = { - 0, 179, 0, 179, 1, 4, 104, 103, 112, 113, - 114, 115, 119, 117, 110, 111, 2, 80, 179, 179, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 81, 179, 62, 65, 179, 179, 3, 95, 61, 75, - 0, 82, 167, 179, 0, 0, 0, 5, 8, 9, - 6, 22, 23, 7, 0, 0, 179, 179, 179, 0, - 0, 168, 38, 0, 161, 72, 151, 63, 66, 74, - 73, 179, 0, 0, 179, 52, 24, 10, 12, 0, - 14, 80, 70, 71, 21, 102, 123, 124, 128, 129, - 0, 125, 179, 127, 0, 0, 121, 122, 179, 0, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 0, - 0, 100, 0, 91, 101, 90, 97, 60, 77, 107, - 108, 0, 106, 105, 109, 84, 83, 179, 179, 0, - 15, 0, 116, 128, 126, 120, 118, 0, 0, 41, - 68, 69, 0, 64, 67, 0, 96, 0, 0, 179, - 179, 0, 76, 0, 86, 0, 55, 56, 58, 54, - 0, 0, 27, 11, 0, 13, 130, 40, 43, 42, - 179, 0, 93, 92, 98, 0, 0, 87, 0, 85, - 53, 0, 26, 29, 28, 179, 18, 19, 16, 17, - 0, 179, 45, 169, 0, 99, 78, 0, 89, 79, - 57, 0, 179, 31, 0, 44, 80, 46, 39, 47, - 179, 179, 179, 179, 179, 94, 88, 30, 32, 25, - 33, 179, 179, 179, 179, 20, 162, 48, 51, 0, - 49, 0, 171, 34, 37, 0, 35, 0, 50, 175, - 172, 170, 178, 0, 173, 174, 36, 164, 165, 163, - 0, 177, 0, 0, 166, 176, 0, 0, 0 + 0, 182, 0, 182, 1, 4, 107, 106, 115, 116, + 117, 118, 122, 120, 113, 114, 2, 80, 182, 182, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 81, 182, 62, 65, 182, 182, 3, 97, 61, 75, + 0, 82, 170, 182, 0, 0, 0, 5, 8, 9, + 6, 22, 23, 7, 0, 0, 182, 182, 182, 0, + 0, 171, 38, 0, 164, 72, 154, 63, 66, 74, + 73, 182, 0, 0, 182, 52, 24, 10, 12, 0, + 14, 80, 70, 71, 21, 104, 126, 127, 131, 132, + 0, 128, 182, 130, 0, 0, 124, 125, 182, 0, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 0, + 0, 102, 0, 91, 103, 90, 99, 60, 77, 110, + 111, 0, 109, 108, 112, 84, 83, 182, 182, 0, + 15, 0, 119, 131, 129, 123, 121, 0, 0, 41, + 68, 69, 0, 64, 67, 0, 98, 105, 0, 93, + 0, 182, 182, 0, 76, 0, 86, 0, 55, 56, + 58, 54, 0, 0, 27, 11, 0, 13, 133, 40, + 43, 42, 182, 0, 94, 92, 100, 0, 0, 87, + 0, 85, 53, 0, 26, 29, 28, 182, 18, 19, + 16, 17, 0, 182, 45, 172, 0, 96, 101, 78, + 0, 89, 79, 57, 0, 182, 31, 0, 44, 80, + 46, 39, 47, 182, 182, 182, 182, 182, 95, 88, + 30, 32, 25, 33, 182, 182, 182, 182, 20, 165, + 48, 51, 0, 49, 0, 174, 34, 37, 0, 35, + 0, 50, 178, 175, 173, 181, 0, 176, 177, 36, + 167, 168, 166, 0, 180, 0, 0, 169, 179, 0, + 0, 0 }; static const short yydefgoto[] = { - 266, 4, 88, 89, 58, 174, 198, 199, 59, 60, - 61, 138, 193, 171, 194, 212, 230, 40, 108, 178, - 148, 179, 201, 219, 41, 137, 165, 166, 167, 42, - 82, 43, 92, 119, 93, 120, 152, 168, 46, 47, - 131, 122, 48, 127, 123, 124, 14, 15, 134, 135, - 99, 66, 68, 67, 100, 101, 102, 49, 74, 75, - 223, 247, 258, 259, 50, 51, 224, 241, 254, 260, - 255, 76 + 269, 4, 88, 89, 58, 176, 200, 201, 59, 60, + 61, 138, 195, 173, 196, 215, 233, 40, 108, 180, + 148, 181, 203, 222, 41, 137, 167, 168, 169, 42, + 82, 43, 92, 119, 93, 120, 152, 170, 46, 47, + 131, 122, 48, 127, 123, 124, 159, 14, 15, 134, + 135, 99, 66, 68, 67, 100, 101, 102, 49, 74, + 75, 226, 250, 261, 262, 50, 51, 227, 244, 257, + 263, 258, 76 }; static const short yypact[] = { - 61,-32768, 29, 362, 137,-32768,-32768,-32768, 13,-32768, - 19,-32768,-32768,-32768, 20, 30,-32768, 11, 82, 82, + 67,-32768, 33, 365, 110,-32768,-32768,-32768, -23,-32768, + 8,-32768,-32768,-32768, 14, 20,-32768, -5, 69, 69, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768, 43, 58,-32768,-32768,-32768,-32768, 1, -25, - 44,-32768,-32768, 82, 90, 90, 390,-32768,-32768,-32768, - -32768,-32768,-32768,-32768, 119, 119, 16, 16, 16, 119, - 119,-32768,-32768, 67, 132,-32768,-32768,-32768,-32768,-32768, - -32768, 53, 117, 119, 108,-32768,-32768,-32768, 77, 3, - 78,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 73,-32768, 79,-32768, 72, 71,-32768,-32768, 81, 390, - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 29, - 29,-32768, 2, 74,-32768,-32768,-32768, -31, 83,-32768, - -32768, 35,-32768,-32768,-32768, 37,-32768, 390, 85, 126, - -32768, 90,-32768, 29,-32768,-32768,-32768, 129, 89,-32768, - -32768,-32768, 86,-32768,-32768, 53,-32768, 53, 119, 53, - 108, 108, 112, 108,-32768, 105, 111,-32768,-32768,-32768, - 130, 124,-32768,-32768, 6, 77,-32768,-32768,-32768, 113, - -32768, 125, 120,-32768,-32768, 42, 45, 40, 119,-32768, - -32768, 390,-32768,-32768, 134,-32768,-32768, 77,-32768, 136, - 129, 284,-32768,-32768, 53,-32768,-32768, 108,-32768,-32768, - -32768, 130, 323,-32768, 90,-32768, -18,-32768,-32768,-32768, + -32768,-32768, 50, 52,-32768,-32768,-32768,-32768, 6, -22, + 60,-32768,-32768, 69, 96, 96, 393,-32768,-32768,-32768, + -32768,-32768,-32768,-32768, 128, 128, 16, 16, 16, 128, + 128,-32768,-32768, 79, 134,-32768,-32768,-32768,-32768,-32768, + -32768, 29, 130, 128, 91,-32768,-32768,-32768, 87, 12, + 89,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + 86,-32768, 90,-32768, 99, 82,-32768,-32768, 102, 393, + -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 33, + 33,-32768, -3, 5,-32768,-32768,-32768, 32, 104,-32768, + -32768, 46,-32768,-32768,-32768, 40,-32768, 393, 106, 138, + -32768, 96,-32768, 33,-32768,-32768,-32768, 154, 112,-32768, + -32768,-32768, 107,-32768,-32768, 29,-32768,-32768, 29,-32768, + 128, 29, 91, 91, 114, 91,-32768, 109, 115,-32768, + -32768,-32768, 171, 127,-32768,-32768, 10, 87,-32768,-32768, + -32768, 129,-32768, 135, 11,-32768,-32768, 2, 48, 43, + 128,-32768,-32768, 393,-32768,-32768, 139,-32768,-32768, 87, + -32768, 140, 154, 287,-32768,-32768, 29,-32768,-32768,-32768, + 91,-32768,-32768,-32768, 171, 326,-32768, 96,-32768, 70, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768,-32768,-32768,-32768, 77,-32768,-32768,-32768, 141, - -32768, 245,-32768, 132, 132, 116,-32768, 176,-32768,-32768, - -32768,-32768,-32768, 142,-32768,-32768,-32768,-32768,-32768, 139, - 29,-32768, 176, 138,-32768,-32768, 192, 195,-32768 + -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 87,-32768, + -32768,-32768, 142,-32768, 248,-32768, 134, 134, 111,-32768, + 174,-32768,-32768,-32768,-32768,-32768, 145,-32768,-32768,-32768, + -32768,-32768, 143, 33,-32768, 174, 132,-32768,-32768, 194, + 196,-32768 }; static const short yypgoto[] = { - -32768,-32768, -135, 143,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768, -15,-32768,-32768,-32768,-32768, 193,-32768, 4, - -32768,-32768,-32768,-32768, -146,-32768,-32768,-32768, 8, 94, - -32768, 96, -1,-32768, 0,-32768,-32768, 150,-32768,-32768, - 47, 50,-32768,-32768, -109, -53, -83, -77, -122, -114, - -2,-32768,-32768,-32768, -17, 114,-32768,-32768, -112, -40, - 5,-32768, -52,-32768, 9, 209,-32768,-32768,-32768,-32768, - -32768, 7 + -32768,-32768, -134, 144,-32768,-32768,-32768,-32768,-32768,-32768, + -32768,-32768, -16,-32768,-32768,-32768,-32768, 197,-32768, 3, + -32768,-32768,-32768,-32768, -174,-32768,-32768,-32768, 13, 98, + -32768, 100, -1,-32768, 0,-32768,-32768, 152,-32768,-32768, + 38, 51,-32768,-32768, -105, -53, 27, -83, -78, -122, + -132, -2,-32768,-32768,-32768, 66, 116,-32768,-32768, -106, + -40, 1,-32768, -52,-32768, 37, 213,-32768,-32768,-32768, + -32768,-32768, 7 }; -#define YYLAST 425 +#define YYLAST 428 static const short yytable[] = { - 16, 132, 44, 45, 79, 80, 175, 133, 5, -59, - 52, 96, 97, 164, 87, 140, 106, 107, 158, 6, - 7, 8, 9, 10, 83, 52, 52, 72, 73, 159, - 128, 84, 6, 7, 8, 9, 10, 236, -168, 197, - 6, 7, 129, 6, 7, 129, 182, 187, 183, 189, - 104, 105, 132, 141, 155, 220, 95, 196, 133, 121, - 52, 81, 86, 156, 64, 208, 231, -168, 98, 11, - 65, 69, 12, 103, 103, 103, 13, 132, 132, 235, - 132, 70, 11, 133, 133, 12, 133, 161, 125, 13, - 71, 136, 162, 226, 155, 225, 163, 161, 87, 207, - 85, 77, 206, 205, 132, 184, 1, 2, 3, 103, - 133, 6, 7, 129, 130, 149, 78, 153, 154, 243, - 244, 245, 95, 109, 132, 126, 139, 142, 141, 145, - 133, 143, 146, 157, 173, 209, 147, 177, 192, 160, - 170, 176, 180, 181, 169, 172, 53, 18, 54, 55, - 56, 19, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 188, 190, 191, 256, 200, 125, 136, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 195, 203, 204, - 237, 238, 239, 240, 257, 57, 211, 202, 214, 248, - 261, 262, 267, 265, 246, 268, 227, 62, 90, 210, - 221, 222, 213, 150, 215, 151, 94, 186, 52, 185, - 264, 232, 233, 63, 0, 0, 144, 234, 0, 52, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, - 252, 253, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 91, 0, 18, 0, 0, 263, 19, - 249, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 16, 132, 44, 45, 79, 80, 133, 177, 5, 157, + 52, 96, 97, 166, -59, 157, 106, 107, 87, 6, + 7, 8, 9, 10, 140, 52, 52, 83, 64, 223, + 128, 189, 95, 191, 84, 121, 6, 7, 8, 9, + 10, 234, 199, 6, 7, 129, 6, 7, 129, 155, + 184, -171, 132, 185, 155, 72, 73, 133, 156, 65, + 52, 198, 141, 208, 158, 69, 81, 211, 98, 11, + 206, 70, 12, 103, 103, 103, 13, 71, 229, 132, + 132, 160, 132, 238, 133, 133, 11, 133, 125, 12, + 86, 136, 161, 13, 6, 7, 129, 130, 163, 165, + 163, 228, 210, 164, 87, 209, 132, 186, 77, 103, + 78, 133, 1, 2, 3, 149, 85, 153, 154, 53, + 18, 54, 55, 56, 19, 239, -171, 132, 246, 247, + 248, 95, 133, 104, 105, 109, 139, 212, 126, 141, + 142, 178, 143, 146, 171, 174, 175, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 145, 147, 57, 259, + 162, 172, 179, 190, 183, 182, 192, 193, 125, 136, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 194, + 197, 202, 260, 240, 241, 242, 243, 268, 205, 204, + 251, 214, 217, 264, 270, 265, 271, 249, 230, 90, + 188, 62, 224, 225, 216, 218, 213, 150, 94, 151, + 52, 207, 187, 267, 235, 236, 237, 63, 144, 0, + 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 245, 0, 0, 0, 0, 0, + 0, 0, 0, 255, 256, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 91, 0, 18, 0, + 0, 266, 19, 252, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 219, 253, 18, 0, 0, + 0, 19, 254, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 219, 220, 18, 0, 0, 0, + 19, 221, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 17, 231, 18, 0, 0, 0, 19, + 232, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 216, 250, 18, 0, 0, 0, 19, 251, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 216, 217, 18, 0, 0, 0, 19, 218, 20, + 39, 91, 0, 18, 0, 0, 0, 19, 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 17, 228, 18, 0, 0, 0, 19, 229, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 91, 0, - 18, 0, 0, 0, 19, 0, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39 + 31, 32, 33, 34, 35, 36, 37, 38, 39 }; static const short yycheck[] = { - 2, 84, 3, 3, 44, 45, 141, 84, 1, 8, - 3, 64, 65, 135, 8, 12, 69, 70, 49, 3, - 4, 5, 6, 7, 49, 18, 19, 18, 19, 60, - 83, 56, 3, 4, 5, 6, 7, 55, 56, 174, - 3, 4, 5, 3, 4, 5, 155, 161, 157, 163, - 67, 68, 135, 50, 52, 201, 3, 51, 135, 6, - 53, 60, 53, 61, 51, 187, 212, 56, 52, 53, - 51, 51, 56, 66, 67, 68, 60, 160, 161, 214, - 163, 51, 53, 160, 161, 56, 163, 52, 81, 60, - 8, 84, 57, 207, 52, 204, 59, 52, 8, 59, - 56, 58, 57, 61, 187, 158, 45, 46, 47, 102, - 187, 3, 4, 5, 6, 108, 58, 119, 120, 231, - 232, 233, 3, 56, 207, 8, 49, 54, 50, 57, - 207, 52, 61, 59, 8, 188, 55, 8, 8, 56, - 55, 143, 53, 57, 137, 138, 9, 10, 11, 12, - 13, 14, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 49, 57, 52, 48, 52, 159, 160, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 53, 53, 59, - 220, 221, 222, 223, 8, 48, 52, 180, 52, 48, - 48, 52, 0, 55, 234, 0, 211, 4, 55, 191, - 201, 201, 195, 109, 200, 109, 56, 160, 201, 159, - 262, 212, 212, 4, -1, -1, 102, 212, -1, 212, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, - 241, 241, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 8, -1, 10, -1, -1, 260, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 2, 84, 3, 3, 44, 45, 84, 141, 1, 4, + 3, 64, 65, 135, 8, 4, 69, 70, 8, 3, + 4, 5, 6, 7, 12, 18, 19, 49, 51, 203, + 83, 163, 3, 165, 56, 6, 3, 4, 5, 6, + 7, 215, 176, 3, 4, 5, 3, 4, 5, 52, + 155, 56, 135, 158, 52, 18, 19, 135, 61, 51, + 53, 51, 50, 61, 59, 51, 60, 189, 52, 53, + 59, 51, 56, 66, 67, 68, 60, 8, 210, 162, + 163, 49, 165, 217, 162, 163, 53, 165, 81, 56, + 53, 84, 60, 60, 3, 4, 5, 6, 52, 59, + 52, 206, 59, 57, 8, 57, 189, 160, 58, 102, + 58, 189, 45, 46, 47, 108, 56, 119, 120, 9, + 10, 11, 12, 13, 14, 55, 56, 210, 234, 235, + 236, 3, 210, 67, 68, 56, 49, 190, 8, 50, + 54, 143, 52, 61, 137, 138, 8, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 57, 55, 48, 48, + 56, 55, 8, 49, 57, 53, 57, 52, 161, 162, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 8, + 53, 52, 8, 223, 224, 225, 226, 55, 53, 182, + 48, 52, 52, 48, 0, 52, 0, 237, 214, 55, + 162, 4, 203, 203, 197, 202, 193, 109, 56, 109, + 203, 184, 161, 265, 215, 215, 215, 4, 102, -1, + -1, -1, 215, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 227, -1, -1, -1, -1, -1, + -1, -1, -1, 244, 244, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 8, -1, 10, -1, + -1, 263, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 8, 48, 10, -1, -1, + -1, 14, 54, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 8, 48, 10, -1, -1, -1, + 14, 54, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 8, 48, 10, -1, -1, -1, 14, + 54, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 8, 48, 10, -1, -1, -1, 14, 54, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 8, 48, 10, -1, -1, -1, 14, 54, 16, + 35, 8, -1, 10, -1, -1, -1, 14, -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 8, 48, 10, -1, -1, -1, 14, 54, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 8, -1, - 10, -1, -1, -1, 14, -1, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35 + 27, 28, 29, 30, 31, 32, 33, 34, 35 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/share/bison/bison.simple" @@ -1262,13 +1270,13 @@ yyreduce: switch (yyn) { case 3: -#line 174 "dcParser.yxx" +#line 175 "dcParser.yxx" { parameter_description = yyvsp[0].u.field; } break; case 6: -#line 183 "dcParser.yxx" +#line 184 "dcParser.yxx" { if (!dc_file->add_class(yyvsp[0].u.dclass)) { DCClass *old_class = dc_file->get_class_by_name(yyvsp[0].u.dclass->get_name()); @@ -1281,7 +1289,7 @@ case 6: } break; case 7: -#line 194 "dcParser.yxx" +#line 195 "dcParser.yxx" { if (!dc_file->add_switch(yyvsp[0].u.dswitch)) { yyerror("Duplicate class name: " + yyvsp[0].u.dswitch->get_name()); @@ -1289,49 +1297,49 @@ case 7: } break; case 11: -#line 206 "dcParser.yxx" +#line 207 "dcParser.yxx" { yyval.str = yyvsp[-2].str + string("/") + yyvsp[0].str; } break; case 13: -#line 214 "dcParser.yxx" +#line 215 "dcParser.yxx" { yyval.str = yyvsp[-2].str + string(".") + yyvsp[0].str; } break; case 14: -#line 221 "dcParser.yxx" +#line 222 "dcParser.yxx" { dc_file->add_import_module(yyvsp[0].str); } break; case 15: -#line 225 "dcParser.yxx" +#line 226 "dcParser.yxx" { dc_file->add_import_module(yyvsp[-1].str); } break; case 18: -#line 234 "dcParser.yxx" +#line 235 "dcParser.yxx" { dc_file->add_import_symbol("*"); } break; case 19: -#line 241 "dcParser.yxx" +#line 242 "dcParser.yxx" { dc_file->add_import_symbol(yyvsp[0].str); } break; case 20: -#line 245 "dcParser.yxx" +#line 246 "dcParser.yxx" { dc_file->add_import_symbol(yyvsp[0].str); } break; case 21: -#line 252 "dcParser.yxx" +#line 253 "dcParser.yxx" { if (yyvsp[0].u.parameter != (DCParameter *)NULL) { DCTypedef *dtypedef = new DCTypedef(yyvsp[0].u.parameter); @@ -1348,21 +1356,21 @@ case 21: } break; case 24: -#line 275 "dcParser.yxx" +#line 276 "dcParser.yxx" { yyval.u.dclass = current_class; current_class = new DCClass(yyvsp[0].str, false, false); } break; case 25: -#line 280 "dcParser.yxx" +#line 281 "dcParser.yxx" { yyval.u.dclass = current_class; current_class = yyvsp[-4].u.dclass; } break; case 26: -#line 288 "dcParser.yxx" +#line 289 "dcParser.yxx" { if (dc_file == (DCFile *)NULL) { yyerror("No DCFile available, so no class names are predefined."); @@ -1384,7 +1392,7 @@ case 26: } break; case 29: -#line 316 "dcParser.yxx" +#line 317 "dcParser.yxx" { if (yyvsp[0].u.dclass != (DCClass *)NULL) { current_class->add_parent(yyvsp[0].u.dclass); @@ -1392,7 +1400,7 @@ case 29: } break; case 30: -#line 322 "dcParser.yxx" +#line 323 "dcParser.yxx" { if (yyvsp[0].u.dclass != (DCClass *)NULL) { current_class->add_parent(yyvsp[0].u.dclass); @@ -1400,7 +1408,7 @@ case 30: } break; case 33: -#line 333 "dcParser.yxx" +#line 334 "dcParser.yxx" { if (yyvsp[0].u.field == (DCField *)NULL) { // Pass this error up. @@ -1412,7 +1420,7 @@ case 33: } break; case 34: -#line 346 "dcParser.yxx" +#line 347 "dcParser.yxx" { if (yyvsp[-1].u.field != (DCField *)NULL) { if (yyvsp[-1].u.field->get_name().empty()) { @@ -1424,7 +1432,7 @@ case 34: } break; case 36: -#line 357 "dcParser.yxx" +#line 358 "dcParser.yxx" { yyerror("Unnamed parameters are not allowed on a dclass"); if (yyvsp[-2].u.parameter != (DCField *)NULL) { @@ -1434,7 +1442,7 @@ case 36: } break; case 37: -#line 365 "dcParser.yxx" +#line 366 "dcParser.yxx" { if (yyvsp[-1].u.parameter != (DCField *)NULL) { yyvsp[-1].u.parameter->set_flags(yyvsp[0].u.s_int); @@ -1443,21 +1451,21 @@ case 37: } break; case 38: -#line 375 "dcParser.yxx" +#line 376 "dcParser.yxx" { yyval.u.dclass = current_class; current_class = new DCClass(yyvsp[0].str, true, false); } break; case 39: -#line 380 "dcParser.yxx" +#line 381 "dcParser.yxx" { yyval.u.dclass = current_class; current_class = yyvsp[-4].u.dclass; } break; case 40: -#line 388 "dcParser.yxx" +#line 389 "dcParser.yxx" { if (dc_file == (DCFile *)NULL) { yyerror("No DCFile available, so no struct names are predefined."); @@ -1479,7 +1487,7 @@ case 40: } break; case 43: -#line 416 "dcParser.yxx" +#line 417 "dcParser.yxx" { if (yyvsp[0].u.dclass != (DCClass *)NULL) { current_class->add_parent(yyvsp[0].u.dclass); @@ -1487,7 +1495,7 @@ case 43: } break; case 44: -#line 422 "dcParser.yxx" +#line 423 "dcParser.yxx" { if (yyvsp[0].u.dclass != (DCClass *)NULL) { current_class->add_parent(yyvsp[0].u.dclass); @@ -1495,7 +1503,7 @@ case 44: } break; case 47: -#line 433 "dcParser.yxx" +#line 434 "dcParser.yxx" { if (yyvsp[0].u.field == (DCField *)NULL) { // Pass this error up. @@ -1505,7 +1513,7 @@ case 47: } break; case 48: -#line 444 "dcParser.yxx" +#line 445 "dcParser.yxx" { if (yyvsp[-1].u.field->get_name().empty()) { yyerror("Field name required."); @@ -1514,33 +1522,33 @@ case 48: } break; case 50: -#line 452 "dcParser.yxx" +#line 453 "dcParser.yxx" { yyval.u.field = yyvsp[-2].u.parameter; } break; case 51: -#line 456 "dcParser.yxx" +#line 457 "dcParser.yxx" { yyval.u.field = yyvsp[-1].u.parameter; } break; case 52: -#line 463 "dcParser.yxx" +#line 464 "dcParser.yxx" { yyval.u.field = current_atomic; current_atomic = new DCAtomicField(yyvsp[-1].str); } break; case 53: -#line 468 "dcParser.yxx" +#line 469 "dcParser.yxx" { yyval.u.field = current_atomic; current_atomic = yyvsp[-2].u.atomic; } break; case 58: -#line 486 "dcParser.yxx" +#line 487 "dcParser.yxx" { if (yyvsp[0].u.parameter != (DCParameter *)NULL) { current_atomic->add_element(yyvsp[0].u.parameter); @@ -1548,19 +1556,19 @@ case 58: } break; case 59: -#line 495 "dcParser.yxx" +#line 496 "dcParser.yxx" { current_parameter = yyvsp[0].u.parameter; } break; case 60: -#line 499 "dcParser.yxx" +#line 500 "dcParser.yxx" { yyval.u.parameter = yyvsp[0].u.parameter; } break; case 63: -#line 511 "dcParser.yxx" +#line 512 "dcParser.yxx" { current_packer = &default_packer; current_packer->clear_data(); @@ -1570,7 +1578,7 @@ case 63: } break; case 64: -#line 519 "dcParser.yxx" +#line 520 "dcParser.yxx" { bool is_valid = false; if (yyvsp[-3].u.parameter != (DCField *)NULL) { @@ -1590,7 +1598,7 @@ case 64: } break; case 66: -#line 541 "dcParser.yxx" +#line 542 "dcParser.yxx" { current_packer = &default_packer; current_packer->clear_data(); @@ -1600,7 +1608,7 @@ case 66: } break; case 67: -#line 549 "dcParser.yxx" +#line 550 "dcParser.yxx" { bool is_valid = false; if (yyvsp[-3].u.parameter != (DCField *)NULL) { @@ -1620,31 +1628,31 @@ case 67: } break; case 72: -#line 580 "dcParser.yxx" +#line 581 "dcParser.yxx" { yyval.u.field = yyvsp[-1].u.field; } break; case 73: -#line 584 "dcParser.yxx" +#line 585 "dcParser.yxx" { yyval.u.field = yyvsp[-1].u.parameter; } break; case 74: -#line 588 "dcParser.yxx" +#line 589 "dcParser.yxx" { yyval.u.field = yyvsp[-1].u.parameter; } break; case 75: -#line 595 "dcParser.yxx" +#line 596 "dcParser.yxx" { yyval.u.parameter = new DCSimpleParameter(yyvsp[0].u.subatomic); } break; case 76: -#line 599 "dcParser.yxx" +#line 600 "dcParser.yxx" { DCSimpleParameter *simple_param = new DCSimpleParameter(yyvsp[-3].u.subatomic); if (!simple_param->set_range(double_range)) { @@ -1654,7 +1662,7 @@ case 76: } break; case 77: -#line 607 "dcParser.yxx" +#line 608 "dcParser.yxx" { DCSimpleParameter *simple_param = new DCSimpleParameter(yyvsp[-2].u.subatomic); if (yyvsp[0].u.s_uint == 0) { @@ -1667,7 +1675,7 @@ case 77: } break; case 78: -#line 618 "dcParser.yxx" +#line 619 "dcParser.yxx" { DCSimpleParameter *simple_param = new DCSimpleParameter(yyvsp[-5].u.subatomic); if (yyvsp[-3].u.s_uint == 0) { @@ -1683,7 +1691,7 @@ case 78: } break; case 79: -#line 632 "dcParser.yxx" +#line 633 "dcParser.yxx" { DCSimpleParameter *simple_param = new DCSimpleParameter(yyvsp[-5].u.subatomic); if (yyvsp[0].u.s_uint == 0) { @@ -1699,7 +1707,7 @@ case 79: } break; case 80: -#line 646 "dcParser.yxx" +#line 647 "dcParser.yxx" { if (dc_file == (DCFile *)NULL) { yyerror("Invalid type."); @@ -1736,7 +1744,7 @@ case 80: } break; case 81: -#line 681 "dcParser.yxx" +#line 682 "dcParser.yxx" { // This is an inline struct definition. if (yyvsp[0].u.dclass == (DCClass *)NULL) { @@ -1754,7 +1762,7 @@ case 81: } break; case 82: -#line 697 "dcParser.yxx" +#line 698 "dcParser.yxx" { // This is an inline switch definition. if (yyvsp[0].u.dswitch == (DCSwitch *)NULL) { @@ -1772,13 +1780,13 @@ case 82: } break; case 83: -#line 716 "dcParser.yxx" +#line 717 "dcParser.yxx" { double_range.clear(); } break; case 84: -#line 720 "dcParser.yxx" +#line 721 "dcParser.yxx" { double_range.clear(); if (!double_range.add_range(yyvsp[0].u.real, yyvsp[0].u.real)) { @@ -1787,7 +1795,7 @@ case 84: } break; case 85: -#line 727 "dcParser.yxx" +#line 728 "dcParser.yxx" { double_range.clear(); if (!double_range.add_range(yyvsp[-2].u.real, yyvsp[0].u.real)) { @@ -1796,7 +1804,7 @@ case 85: } break; case 86: -#line 734 "dcParser.yxx" +#line 735 "dcParser.yxx" { double_range.clear(); if (yyvsp[0].u.real >= 0) { @@ -1807,7 +1815,7 @@ case 86: } break; case 87: -#line 743 "dcParser.yxx" +#line 744 "dcParser.yxx" { if (!double_range.add_range(yyvsp[0].u.real, yyvsp[0].u.real)) { yyerror("Overlapping range"); @@ -1815,7 +1823,7 @@ case 87: } break; case 88: -#line 749 "dcParser.yxx" +#line 750 "dcParser.yxx" { if (!double_range.add_range(yyvsp[-2].u.real, yyvsp[0].u.real)) { yyerror("Overlapping range"); @@ -1823,7 +1831,7 @@ case 88: } break; case 89: -#line 755 "dcParser.yxx" +#line 756 "dcParser.yxx" { if (yyvsp[0].u.real >= 0) { yyerror("Syntax error"); @@ -1833,13 +1841,13 @@ case 89: } break; case 90: -#line 766 "dcParser.yxx" +#line 767 "dcParser.yxx" { uint_range.clear(); } break; case 91: -#line 770 "dcParser.yxx" +#line 771 "dcParser.yxx" { uint_range.clear(); if (!uint_range.add_range(yyvsp[0].u.s_uint, yyvsp[0].u.s_uint)) { @@ -1848,7 +1856,7 @@ case 91: } break; case 92: -#line 777 "dcParser.yxx" +#line 778 "dcParser.yxx" { uint_range.clear(); if (!uint_range.add_range(yyvsp[-2].u.s_uint, yyvsp[0].u.s_uint)) { @@ -1857,15 +1865,24 @@ case 92: } break; case 93: -#line 784 "dcParser.yxx" +#line 785 "dcParser.yxx" +{ + uint_range.clear(); + if (!uint_range.add_range(yyvsp[-1].u.s_uint, yyvsp[0].u.s_uint)) { + yyerror("Overlapping range"); + } +} + break; +case 94: +#line 792 "dcParser.yxx" { if (!uint_range.add_range(yyvsp[0].u.s_uint, yyvsp[0].u.s_uint)) { yyerror("Overlapping range"); } } break; -case 94: -#line 790 "dcParser.yxx" +case 95: +#line 798 "dcParser.yxx" { if (!uint_range.add_range(yyvsp[-2].u.s_uint, yyvsp[0].u.s_uint)) { yyerror("Overlapping range"); @@ -1873,7 +1890,15 @@ case 94: } break; case 96: -#line 800 "dcParser.yxx" +#line 804 "dcParser.yxx" +{ + if (!uint_range.add_range(yyvsp[-1].u.s_uint, yyvsp[0].u.s_uint)) { + yyerror("Overlapping range"); + } +} + break; +case 98: +#line 814 "dcParser.yxx" { if (yyvsp[-3].u.parameter == (DCParameter *)NULL) { yyval.u.parameter = NULL; @@ -1882,15 +1907,15 @@ case 96: } } break; -case 97: -#line 811 "dcParser.yxx" +case 99: +#line 825 "dcParser.yxx" { current_parameter->set_name(yyvsp[0].str); yyval.u.parameter = current_parameter; } break; -case 98: -#line 816 "dcParser.yxx" +case 100: +#line 830 "dcParser.yxx" { if (yyvsp[0].u.s_uint == 0) { yyerror("Invalid divisor."); @@ -1905,14 +1930,14 @@ case 98: } } break; -case 99: -#line 830 "dcParser.yxx" +case 101: +#line 844 "dcParser.yxx" { yyval.u.parameter = new DCArrayParameter(yyvsp[-3].u.parameter, uint_range); } break; -case 100: -#line 837 "dcParser.yxx" +case 102: +#line 851 "dcParser.yxx" { if (yyvsp[0].str.length() != 1) { yyerror("Single character required."); @@ -1922,8 +1947,8 @@ case 100: } } break; -case 102: -#line 850 "dcParser.yxx" +case 104: +#line 864 "dcParser.yxx" { yyval.u.s_uint = (unsigned int)yyvsp[0].u.uint64; if (yyval.u.s_uint != yyvsp[0].u.uint64) { @@ -1933,19 +1958,32 @@ case 102: } break; case 105: -#line 869 "dcParser.yxx" +#line 875 "dcParser.yxx" +{ + yyval.u.s_uint = (unsigned int)-yyvsp[0].u.int64; + if (yyvsp[0].u.int64 >= 0) { + yyerror("Syntax error."); + + } else if (yyval.u.s_uint != -yyvsp[0].u.int64) { + yyerror("Number out of range."); + yyval.u.s_uint = 1; + } +} + break; +case 108: +#line 897 "dcParser.yxx" { yyval.u.real = (double)yyvsp[0].u.uint64; } break; -case 106: -#line 873 "dcParser.yxx" +case 109: +#line 901 "dcParser.yxx" { yyval.u.real = (double)yyvsp[0].u.int64; } break; -case 108: -#line 881 "dcParser.yxx" +case 111: +#line 909 "dcParser.yxx" { if (yyvsp[0].str.length() != 1) { yyerror("Single character required."); @@ -1955,286 +1993,286 @@ case 108: } } break; -case 110: -#line 895 "dcParser.yxx" +case 113: +#line 923 "dcParser.yxx" { current_packer->pack_int64(yyvsp[0].u.int64); } break; -case 111: -#line 899 "dcParser.yxx" +case 114: +#line 927 "dcParser.yxx" { current_packer->pack_uint64(yyvsp[0].u.uint64); } break; -case 112: -#line 903 "dcParser.yxx" +case 115: +#line 931 "dcParser.yxx" { current_packer->pack_double(yyvsp[0].u.real); } break; -case 113: -#line 907 "dcParser.yxx" +case 116: +#line 935 "dcParser.yxx" { current_packer->pack_string(yyvsp[0].str); } break; -case 114: -#line 911 "dcParser.yxx" +case 117: +#line 939 "dcParser.yxx" { current_packer->pack_literal_value(yyvsp[0].str); } break; -case 115: -#line 915 "dcParser.yxx" -{ - current_packer->push(); -} - break; -case 116: -#line 919 "dcParser.yxx" -{ - current_packer->pop(); -} - break; -case 117: -#line 923 "dcParser.yxx" -{ - current_packer->push(); -} - break; case 118: -#line 927 "dcParser.yxx" +#line 943 "dcParser.yxx" { - current_packer->pop(); + current_packer->push(); } break; case 119: -#line 931 "dcParser.yxx" -{ - current_packer->push(); -} - break; -case 120: -#line 935 "dcParser.yxx" +#line 947 "dcParser.yxx" { current_packer->pop(); } break; +case 120: +#line 951 "dcParser.yxx" +{ + current_packer->push(); +} + break; case 121: -#line 939 "dcParser.yxx" +#line 955 "dcParser.yxx" +{ + current_packer->pop(); +} + break; +case 122: +#line 959 "dcParser.yxx" +{ + current_packer->push(); +} + break; +case 123: +#line 963 "dcParser.yxx" +{ + current_packer->pop(); +} + break; +case 124: +#line 967 "dcParser.yxx" { for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) { current_packer->pack_int64(yyvsp[-2].u.int64); } } break; -case 122: -#line 945 "dcParser.yxx" +case 125: +#line 973 "dcParser.yxx" { for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) { current_packer->pack_uint64(yyvsp[-2].u.uint64); } } break; -case 123: -#line 951 "dcParser.yxx" +case 126: +#line 979 "dcParser.yxx" { for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) { current_packer->pack_double(yyvsp[-2].u.real); } } break; -case 124: -#line 957 "dcParser.yxx" +case 127: +#line 985 "dcParser.yxx" { for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) { current_packer->pack_literal_value(yyvsp[-2].str); } } break; -case 131: -#line 981 "dcParser.yxx" +case 134: +#line 1009 "dcParser.yxx" { yyval.u.subatomic = ST_int8; } break; -case 132: -#line 985 "dcParser.yxx" +case 135: +#line 1013 "dcParser.yxx" { yyval.u.subatomic = ST_int16; } break; -case 133: -#line 989 "dcParser.yxx" +case 136: +#line 1017 "dcParser.yxx" { yyval.u.subatomic = ST_int32; } break; -case 134: -#line 993 "dcParser.yxx" +case 137: +#line 1021 "dcParser.yxx" { yyval.u.subatomic = ST_int64; } break; -case 135: -#line 997 "dcParser.yxx" +case 138: +#line 1025 "dcParser.yxx" { yyval.u.subatomic = ST_uint8; } break; -case 136: -#line 1001 "dcParser.yxx" +case 139: +#line 1029 "dcParser.yxx" { yyval.u.subatomic = ST_uint16; } break; -case 137: -#line 1005 "dcParser.yxx" +case 140: +#line 1033 "dcParser.yxx" { yyval.u.subatomic = ST_uint32; } break; -case 138: -#line 1009 "dcParser.yxx" +case 141: +#line 1037 "dcParser.yxx" { yyval.u.subatomic = ST_uint64; } break; -case 139: -#line 1013 "dcParser.yxx" +case 142: +#line 1041 "dcParser.yxx" { yyval.u.subatomic = ST_float64; } break; -case 140: -#line 1017 "dcParser.yxx" +case 143: +#line 1045 "dcParser.yxx" { yyval.u.subatomic = ST_string; } break; -case 141: -#line 1021 "dcParser.yxx" +case 144: +#line 1049 "dcParser.yxx" { yyval.u.subatomic = ST_blob; } break; -case 142: -#line 1025 "dcParser.yxx" +case 145: +#line 1053 "dcParser.yxx" { yyval.u.subatomic = ST_blob32; } break; -case 143: -#line 1029 "dcParser.yxx" +case 146: +#line 1057 "dcParser.yxx" { yyval.u.subatomic = ST_int8array; } break; -case 144: -#line 1033 "dcParser.yxx" +case 147: +#line 1061 "dcParser.yxx" { yyval.u.subatomic = ST_int16array; } break; -case 145: -#line 1037 "dcParser.yxx" +case 148: +#line 1065 "dcParser.yxx" { yyval.u.subatomic = ST_int32array; } break; -case 146: -#line 1041 "dcParser.yxx" +case 149: +#line 1069 "dcParser.yxx" { yyval.u.subatomic = ST_uint8array; } break; -case 147: -#line 1045 "dcParser.yxx" +case 150: +#line 1073 "dcParser.yxx" { yyval.u.subatomic = ST_uint16array; } break; -case 148: -#line 1049 "dcParser.yxx" +case 151: +#line 1077 "dcParser.yxx" { yyval.u.subatomic = ST_uint32array; } break; -case 149: -#line 1053 "dcParser.yxx" +case 152: +#line 1081 "dcParser.yxx" { yyval.u.subatomic = ST_uint32uint8array; } break; -case 150: -#line 1057 "dcParser.yxx" +case 153: +#line 1085 "dcParser.yxx" { yyval.u.subatomic = ST_char; } break; -case 151: -#line 1064 "dcParser.yxx" +case 154: +#line 1092 "dcParser.yxx" { yyval.u.s_int = 0; } break; -case 152: -#line 1068 "dcParser.yxx" +case 155: +#line 1096 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_required; } break; -case 153: -#line 1072 "dcParser.yxx" +case 156: +#line 1100 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_broadcast; } break; -case 154: -#line 1076 "dcParser.yxx" +case 157: +#line 1104 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_p2p; } break; -case 155: -#line 1080 "dcParser.yxx" +case 158: +#line 1108 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_ram; } break; -case 156: -#line 1084 "dcParser.yxx" +case 159: +#line 1112 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_db; } break; -case 157: -#line 1088 "dcParser.yxx" +case 160: +#line 1116 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_clsend; } break; -case 158: -#line 1092 "dcParser.yxx" +case 161: +#line 1120 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_clrecv; } break; -case 159: -#line 1096 "dcParser.yxx" +case 162: +#line 1124 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_ownsend; } break; -case 160: -#line 1100 "dcParser.yxx" +case 163: +#line 1128 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_airecv; } break; -case 161: -#line 1107 "dcParser.yxx" +case 164: +#line 1135 "dcParser.yxx" { if (yyvsp[0].u.s_int != 0) { yyerror("Server flags are not allowed here."); @@ -2242,20 +2280,20 @@ case 161: yyval.u.s_int = yyvsp[0].u.s_int; } break; -case 162: -#line 1117 "dcParser.yxx" +case 165: +#line 1145 "dcParser.yxx" { current_molecular = new DCMolecularField(yyvsp[-1].str); } break; -case 163: -#line 1121 "dcParser.yxx" +case 166: +#line 1149 "dcParser.yxx" { yyval.u.field = current_molecular; } break; -case 164: -#line 1128 "dcParser.yxx" +case 167: +#line 1156 "dcParser.yxx" { DCField *field = current_class->get_field_by_name(yyvsp[0].str); yyval.u.atomic = (DCAtomicField *)NULL; @@ -2269,16 +2307,16 @@ case 164: } } break; -case 165: -#line 1144 "dcParser.yxx" +case 168: +#line 1172 "dcParser.yxx" { if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) { current_molecular->add_atomic(yyvsp[0].u.atomic); } } break; -case 166: -#line 1150 "dcParser.yxx" +case 169: +#line 1178 "dcParser.yxx" { if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) { current_molecular->add_atomic(yyvsp[0].u.atomic); @@ -2290,28 +2328,28 @@ case 166: } } break; -case 167: -#line 1164 "dcParser.yxx" +case 170: +#line 1192 "dcParser.yxx" { yyval.str = ""; } break; -case 169: -#line 1172 "dcParser.yxx" +case 172: +#line 1200 "dcParser.yxx" { yyval.u.dswitch = current_switch; current_switch = new DCSwitch(yyvsp[-4].str, yyvsp[-2].u.parameter); } break; -case 170: -#line 1177 "dcParser.yxx" +case 173: +#line 1205 "dcParser.yxx" { yyval.u.dswitch = current_switch; current_switch = (DCSwitch *)yyvsp[-2].u.parameter; } break; -case 174: -#line 1189 "dcParser.yxx" +case 177: +#line 1217 "dcParser.yxx" { if (current_switch->get_num_cases() == 0) { yyerror("case declaration required before first element"); @@ -2322,16 +2360,16 @@ case 174: } } break; -case 175: -#line 1202 "dcParser.yxx" +case 178: +#line 1230 "dcParser.yxx" { current_packer = &default_packer; current_packer->clear_data(); current_packer->begin_pack(current_switch->get_key_parameter()); } break; -case 176: -#line 1208 "dcParser.yxx" +case 179: +#line 1236 "dcParser.yxx" { if (!current_packer->end_pack()) { yyerror("Invalid value for switch parameter"); @@ -2340,14 +2378,14 @@ case 176: } } break; -case 177: -#line 1219 "dcParser.yxx" +case 180: +#line 1247 "dcParser.yxx" { yyval.u.field = yyvsp[-1].u.parameter; } break; -case 178: -#line 1223 "dcParser.yxx" +case 181: +#line 1251 "dcParser.yxx" { yyval.u.field = yyvsp[0].u.parameter; } @@ -2585,4 +2623,4 @@ yyreturn: #endif return yyresult; } -#line 1231 "dcParser.yxx" +#line 1259 "dcParser.yxx" diff --git a/direct/src/dcparser/dcParser.yxx b/direct/src/dcparser/dcParser.yxx index aacdc85002..ff17cc93da 100644 --- a/direct/src/dcparser/dcParser.yxx +++ b/direct/src/dcparser/dcParser.yxx @@ -160,6 +160,7 @@ dc_cleanup_parser() { %type optional_name %type char_or_uint %type small_unsigned_integer +%type small_negative_integer %type signed_integer %type unsigned_integer %type char_or_number @@ -779,6 +780,13 @@ uint_range: if (!uint_range.add_range($1, $3)) { yyerror("Overlapping range"); } +} + | char_or_uint small_negative_integer +{ + uint_range.clear(); + if (!uint_range.add_range($1, $2)) { + yyerror("Overlapping range"); + } } | uint_range ',' char_or_uint { @@ -791,6 +799,12 @@ uint_range: if (!uint_range.add_range($3, $5)) { yyerror("Overlapping range"); } +} + | uint_range ',' char_or_uint small_negative_integer +{ + if (!uint_range.add_range($3, $4)) { + yyerror("Overlapping range"); + } } ; @@ -856,6 +870,20 @@ small_unsigned_integer: } ; +small_negative_integer: + SIGNED_INTEGER +{ + $$ = (unsigned int)-$1; + if ($1 >= 0) { + yyerror("Syntax error."); + + } else if ($$ != -$1) { + yyerror("Number out of range."); + $$ = 1; + } +} + ; + signed_integer: SIGNED_INTEGER ;