From 01ecc7124eb198a199e9fa05a6afba6d2434753d Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 25 May 2005 22:10:58 +0000 Subject: [PATCH] show field names on output --- direct/src/dcparser/dcAtomicField.cxx | 2 +- direct/src/dcparser/dcClass.cxx | 2 +- direct/src/dcparser/dcField.cxx | 2 +- direct/src/dcparser/dcPacker.I | 30 +- direct/src/dcparser/dcPacker.cxx | 28 +- direct/src/dcparser/dcPacker.h | 7 +- direct/src/dcparser/dcParser.cxx.prebuilt | 761 +++++++++++----------- direct/src/dcparser/dcParser.yxx | 20 + 8 files changed, 477 insertions(+), 375 deletions(-) diff --git a/direct/src/dcparser/dcAtomicField.cxx b/direct/src/dcparser/dcAtomicField.cxx index bff8feb489..5c0c9eb91b 100644 --- a/direct/src/dcparser/dcAtomicField.cxx +++ b/direct/src/dcparser/dcAtomicField.cxx @@ -331,7 +331,7 @@ output_element(ostream &out, bool brief, DCParameter *element) const { DCPacker packer; packer.set_unpack_data(element->get_default_value()); packer.begin_unpack(element); - packer.unpack_and_format(out); + packer.unpack_and_format(out, false); packer.end_unpack(); } } diff --git a/direct/src/dcparser/dcClass.cxx b/direct/src/dcparser/dcClass.cxx index afc1051940..29b3fabffb 100644 --- a/direct/src/dcparser/dcClass.cxx +++ b/direct/src/dcparser/dcClass.cxx @@ -1035,7 +1035,7 @@ write(ostream &out, bool brief, int indent_level) const { DCPacker packer; packer.set_unpack_data((*fi)->get_default_value()); packer.begin_unpack(*fi); - packer.unpack_and_format(out); + packer.unpack_and_format(out, false); if (!packer.end_unpack()) { out << ""; } diff --git a/direct/src/dcparser/dcField.cxx b/direct/src/dcparser/dcField.cxx index 4415df3467..43b89938e4 100644 --- a/direct/src/dcparser/dcField.cxx +++ b/direct/src/dcparser/dcField.cxx @@ -199,7 +199,7 @@ format_data(const string &packed_data) { DCPacker packer; packer.set_unpack_data(packed_data); packer.begin_unpack(this); - string result = packer.unpack_and_format(); + string result = packer.unpack_and_format(true); if (!packer.end_unpack()) { return string(); } diff --git a/direct/src/dcparser/dcPacker.I b/direct/src/dcparser/dcPacker.I index 2ca83294c5..cf7fd28e28 100755 --- a/direct/src/dcparser/dcPacker.I +++ b/direct/src/dcparser/dcPacker.I @@ -154,6 +154,22 @@ get_pack_type() const { } } +//////////////////////////////////////////////////////////////////// +// Function: DCPacker::get_current_field_name +// Access: Published +// Description: Returns the name of the current field, if it has a +// name, or the empty string if the field does not have +// a name or there is no current field. +//////////////////////////////////////////////////////////////////// +INLINE string DCPacker:: +get_current_field_name() const { + if (_current_field == NULL) { + return string(); + } else { + return _current_field->get_name(); + } +} + //////////////////////////////////////////////////////////////////// // Function: DCPacker::pack_double // Access: Published @@ -550,6 +566,18 @@ unpack_literal_value(string &value) { value.assign(_unpack_data + start, _unpack_p - start); } +//////////////////////////////////////////////////////////////////// +// Function: DCPacker::had_parse_error +// Access: Published +// Description: Returns true if there has been an parse error +// since the most recent call to begin(); this can only +// happen if you call parse_and_pack(). +//////////////////////////////////////////////////////////////////// +INLINE bool DCPacker:: +had_parse_error() const { + return _parse_error; +} + //////////////////////////////////////////////////////////////////// // Function: DCPacker::had_pack_error // Access: Published @@ -599,7 +627,7 @@ had_range_error() const { //////////////////////////////////////////////////////////////////// INLINE bool DCPacker:: had_error() const { - return _range_error || _pack_error; + return _range_error || _pack_error || _parse_error; } //////////////////////////////////////////////////////////////////// diff --git a/direct/src/dcparser/dcPacker.cxx b/direct/src/dcparser/dcPacker.cxx index 55c0ae6707..f8130f1b1a 100755 --- a/direct/src/dcparser/dcPacker.cxx +++ b/direct/src/dcparser/dcPacker.cxx @@ -40,6 +40,7 @@ DCPacker() { _owns_unpack_data = false; _unpack_p = 0; _live_catalog = NULL; + _parse_error = false; _pack_error = false; _range_error = false; _stack = NULL; @@ -76,6 +77,7 @@ begin_pack(const DCPackerInterface *root) { nassertv(_mode == M_idle); _mode = M_pack; + _parse_error = false; _pack_error = false; _range_error = false; @@ -168,6 +170,7 @@ begin_unpack(const DCPackerInterface *root) { nassertv(_unpack_data != NULL); _mode = M_unpack; + _parse_error = false; _pack_error = false; _range_error = false; @@ -238,6 +241,7 @@ begin_repack(const DCPackerInterface *root) { nassertv(_unpack_p == 0); _mode = M_repack; + _parse_error = false; _pack_error = false; _range_error = false; _pack_data.clear(); @@ -914,7 +918,12 @@ parse_and_pack(istream &in) { dcyyparse(); dc_cleanup_parser(); - return (dc_error_count() == 0); + bool parse_error = (dc_error_count() != 0); + if (parse_error) { + _parse_error = true; + } + + return !parse_error; } //////////////////////////////////////////////////////////////////// @@ -925,9 +934,9 @@ parse_and_pack(istream &in) { // default value), or as an input to parse_object. //////////////////////////////////////////////////////////////////// string DCPacker:: -unpack_and_format() { +unpack_and_format(bool show_field_names) { ostringstream strm; - unpack_and_format(strm); + unpack_and_format(strm, show_field_names); return strm.str(); } @@ -939,9 +948,18 @@ unpack_and_format() { // default value), or as an input to parse_object. //////////////////////////////////////////////////////////////////// void DCPacker:: -unpack_and_format(ostream &out) { +unpack_and_format(ostream &out, bool show_field_names) { DCPackType pack_type = get_pack_type(); + if (show_field_names && !get_current_field_name().empty()) { + nassertv(_current_field != (DCPackerInterface *)NULL); + const DCField *field = _current_field->as_field(); + if (field != (DCField *)NULL && + field->as_parameter() != (DCParameter *)NULL) { + out << field->get_name() << " = "; + } + } + switch (pack_type) { case PT_invalid: out << ""; @@ -995,7 +1013,7 @@ unpack_and_format(ostream &out) { push(); while (more_nested_fields() && !had_pack_error()) { - unpack_and_format(out); + unpack_and_format(out, show_field_names); if (more_nested_fields()) { out << ", "; diff --git a/direct/src/dcparser/dcPacker.h b/direct/src/dcparser/dcPacker.h index 09556f9f01..7ddad12d5a 100755 --- a/direct/src/dcparser/dcPacker.h +++ b/direct/src/dcparser/dcPacker.h @@ -72,6 +72,7 @@ PUBLISHED: INLINE const DCPackerInterface *get_current_field() const; INLINE const DCSwitchParameter *get_last_switch() const; INLINE DCPackType get_pack_type() const; + INLINE string get_current_field_name() const; void push(); void pop(); @@ -115,9 +116,10 @@ PUBLISHED: bool parse_and_pack(const string &formatted_object); bool parse_and_pack(istream &in); - string unpack_and_format(); - void unpack_and_format(ostream &out); + string unpack_and_format(bool show_field_names = false); + void unpack_and_format(ostream &out, bool show_field_names = false); + INLINE bool had_parse_error() const; INLINE bool had_pack_error() const; INLINE bool had_range_error() const; INLINE bool had_error() const; @@ -252,6 +254,7 @@ private: int _num_nested_fields; const DCSwitchParameter *_last_switch; + bool _parse_error; bool _pack_error; bool _range_error; }; diff --git a/direct/src/dcparser/dcParser.cxx.prebuilt b/direct/src/dcparser/dcParser.cxx.prebuilt index 6d5205f14e..4a5702fdde 100644 --- a/direct/src/dcparser/dcParser.cxx.prebuilt +++ b/direct/src/dcparser/dcParser.cxx.prebuilt @@ -139,12 +139,12 @@ dc_cleanup_parser() { -#define YYFINAL 279 +#define YYFINAL 284 #define YYFLAG -32768 #define YYNTBASE 65 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ -#define YYTRANSLATE(x) ((unsigned)(x) <= 303 ? yytranslate[x] : 142) +#define YYTRANSLATE(x) ((unsigned)(x) <= 303 ? yytranslate[x] : 144) /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ static const char yytranslate[] = @@ -196,70 +196,72 @@ static const short yyprhs[] = 225, 229, 231, 233, 235, 237, 239, 241, 245, 248, 252, 258, 263, 265, 267, 271, 274, 278, 284, 289, 291, 296, 298, 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, 506, 509, 510, 515, 518, 521, 524, 526 + 321, 323, 325, 327, 329, 331, 333, 335, 336, 341, + 343, 345, 347, 349, 351, 352, 357, 358, 363, 364, + 369, 373, 377, 381, 385, 387, 390, 392, 394, 396, + 400, 402, 404, 406, 408, 410, 412, 414, 416, 418, + 420, 422, 424, 426, 428, 430, 432, 434, 436, 438, + 440, 442, 445, 448, 451, 454, 457, 460, 463, 466, + 469, 471, 472, 477, 479, 481, 485, 487, 489, 490, + 500, 502, 505, 508, 511, 514, 517, 518, 523, 526, + 529, 532, 534 }; static const short yyrhs[] = { - 47, 66, 0, 48, 118, 0, 49, 104, 0, 141, - 0, 66, 50, 0, 66, 74, 0, 66, 133, 0, + 47, 66, 0, 48, 118, 0, 49, 104, 0, 143, + 0, 66, 50, 0, 66, 74, 0, 66, 135, 0, 66, 69, 0, 66, 73, 0, 8, 0, 67, 51, 8, 0, 67, 0, 68, 52, 67, 0, 12, 68, 0, 0, 11, 68, 12, 70, 71, 0, 72, 0, 53, 0, 67, 0, 72, 54, 67, 0, 13, 102, - 0, 75, 0, 82, 0, 0, 9, 132, 76, 78, - 55, 80, 56, 0, 8, 0, 141, 0, 57, 79, - 0, 77, 0, 79, 54, 77, 0, 141, 0, 80, - 50, 0, 80, 81, 0, 89, 126, 0, 128, 127, - 0, 99, 126, 50, 0, 97, 126, 0, 0, 10, - 132, 83, 85, 55, 87, 56, 0, 8, 0, 141, + 0, 75, 0, 82, 0, 0, 9, 134, 76, 78, + 55, 80, 56, 0, 8, 0, 143, 0, 57, 79, + 0, 77, 0, 79, 54, 77, 0, 143, 0, 80, + 50, 0, 80, 81, 0, 89, 128, 0, 130, 129, + 0, 99, 128, 50, 0, 97, 128, 0, 0, 10, + 134, 83, 85, 55, 87, 56, 0, 8, 0, 143, 0, 57, 86, 0, 84, 0, 86, 54, 84, 0, - 141, 0, 87, 50, 0, 87, 88, 0, 89, 127, - 0, 128, 127, 0, 99, 127, 50, 0, 97, 127, - 0, 0, 132, 58, 90, 91, 59, 0, 141, 0, + 143, 0, 87, 50, 0, 87, 88, 0, 89, 129, + 0, 130, 129, 0, 99, 129, 50, 0, 97, 129, + 0, 0, 134, 58, 90, 91, 59, 0, 143, 0, 92, 0, 93, 0, 92, 54, 93, 0, 102, 0, 0, 109, 95, 110, 0, 109, 0, 94, 0, 0, 94, 60, 98, 118, 0, 96, 0, 0, 96, 60, 100, 118, 0, 94, 0, 96, 0, 97, 0, 99, - 0, 101, 0, 89, 0, 89, 127, 0, 99, 127, - 0, 97, 127, 0, 125, 0, 105, 58, 107, 59, + 0, 101, 0, 89, 0, 89, 129, 0, 99, 129, + 0, 97, 129, 0, 127, 0, 105, 58, 107, 59, 0, 105, 51, 112, 0, 105, 61, 116, 0, 105, - 0, 8, 0, 82, 0, 133, 0, 141, 0, 117, + 0, 8, 0, 82, 0, 135, 0, 143, 0, 117, 0, 117, 62, 117, 0, 117, 116, 0, 107, 54, 117, 0, 107, 54, 117, 62, 117, 0, 107, 54, - 117, 116, 0, 141, 0, 111, 0, 111, 62, 111, + 117, 116, 0, 143, 0, 111, 0, 111, 62, 111, 0, 111, 113, 0, 108, 54, 111, 0, 108, 54, 111, 62, 111, 0, 108, 54, 111, 113, 0, 106, 0, 109, 63, 108, 64, 0, 8, 0, 110, 51, 112, 0, 110, 61, 116, 0, 110, 63, 108, 64, 0, 6, 0, 112, 0, 3, 0, 4, 0, 4, 0, 3, 0, 115, 0, 114, 0, 5, 0, 6, - 0, 116, 0, 114, 0, 115, 0, 5, 0, 6, - 0, 7, 0, 0, 55, 119, 122, 56, 0, 0, - 63, 120, 122, 64, 0, 0, 58, 121, 122, 59, - 0, 114, 53, 112, 0, 115, 53, 112, 0, 5, - 53, 112, 0, 7, 53, 112, 0, 123, 0, 124, - 123, 0, 141, 0, 54, 0, 118, 0, 124, 54, - 118, 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, 36, 0, - 37, 0, 141, 0, 126, 38, 0, 126, 39, 0, - 126, 40, 0, 126, 41, 0, 126, 42, 0, 126, - 43, 0, 126, 44, 0, 126, 45, 0, 126, 46, - 0, 126, 0, 0, 8, 57, 129, 131, 0, 8, - 0, 130, 0, 131, 54, 130, 0, 141, 0, 8, - 0, 0, 14, 132, 58, 103, 59, 55, 134, 135, - 56, 0, 141, 0, 135, 50, 0, 135, 136, 0, - 135, 138, 0, 135, 139, 0, 135, 140, 0, 0, - 15, 137, 118, 57, 0, 16, 57, 0, 17, 50, - 0, 99, 50, 0, 97, 0, 0 + 0, 116, 0, 120, 0, 0, 8, 60, 119, 120, + 0, 114, 0, 115, 0, 5, 0, 6, 0, 7, + 0, 0, 55, 121, 124, 56, 0, 0, 63, 122, + 124, 64, 0, 0, 58, 123, 124, 59, 0, 114, + 53, 112, 0, 115, 53, 112, 0, 5, 53, 112, + 0, 7, 53, 112, 0, 125, 0, 126, 125, 0, + 143, 0, 54, 0, 118, 0, 126, 54, 118, 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, 36, 0, 37, 0, + 143, 0, 128, 38, 0, 128, 39, 0, 128, 40, + 0, 128, 41, 0, 128, 42, 0, 128, 43, 0, + 128, 44, 0, 128, 45, 0, 128, 46, 0, 128, + 0, 0, 8, 57, 131, 133, 0, 8, 0, 132, + 0, 133, 54, 132, 0, 143, 0, 8, 0, 0, + 14, 134, 58, 103, 59, 55, 136, 137, 56, 0, + 143, 0, 137, 50, 0, 137, 138, 0, 137, 140, + 0, 137, 141, 0, 137, 142, 0, 0, 15, 139, + 118, 57, 0, 16, 57, 0, 17, 50, 0, 99, + 50, 0, 97, 0, 0 }; #endif @@ -279,14 +281,15 @@ static const short yyrline[] = 650, 664, 666, 698, 714, 732, 737, 744, 751, 760, 766, 772, 782, 787, 794, 801, 808, 814, 820, 828, 830, 840, 846, 861, 876, 882, 892, 895, 906, 920, - 924, 928, 933, 937, 940, 950, 954, 959, 963, 967, - 971, 975, 975, 983, 983, 991, 991, 999, 1005, 1011, - 1017, 1025, 1027, 1030, 1032, 1035, 1037, 1040, 1045, 1049, - 1053, 1057, 1061, 1065, 1069, 1073, 1077, 1081, 1085, 1089, - 1093, 1097, 1101, 1105, 1109, 1113, 1117, 1123, 1128, 1132, - 1136, 1140, 1144, 1148, 1152, 1156, 1160, 1166, 1176, 1176, - 1187, 1203, 1210, 1223, 1228, 1231, 1231, 1245, 1247, 1248, - 1249, 1250, 1251, 1263, 1263, 1284, 1293, 1300, 1305, 1311 + 924, 928, 933, 937, 940, 950, 954, 959, 959, 974, + 979, 983, 987, 991, 995, 995, 1003, 1003, 1011, 1011, + 1019, 1025, 1031, 1037, 1045, 1047, 1050, 1052, 1055, 1057, + 1060, 1065, 1069, 1073, 1077, 1081, 1085, 1089, 1093, 1097, + 1101, 1105, 1109, 1113, 1117, 1121, 1125, 1129, 1133, 1137, + 1143, 1148, 1152, 1156, 1160, 1164, 1168, 1172, 1176, 1180, + 1186, 1196, 1196, 1207, 1223, 1230, 1243, 1248, 1251, 1251, + 1265, 1267, 1268, 1269, 1270, 1271, 1283, 1283, 1304, 1313, + 1320, 1325, 1331 }; #endif @@ -322,11 +325,12 @@ static const char *const yytname[] = "double_range", "uint_range", "type_definition", "parameter_definition", "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_default", "switch_break", "switch_field", "empty", 0 + "parameter_value", "@8", "parameter_actual_value", "@9", "@10", "@11", + "array", "maybe_comma", "array_def", "type_token", "server_flags", + "no_server_flags", "molecular_field", "@12", "atomic_name", + "molecular_atom_list", "optional_name", "switch", "@13", + "switch_fields", "switch_case", "@14", "switch_default", "switch_break", + "switch_field", "empty", 0 }; #endif @@ -344,14 +348,15 @@ static const short yyr1[] = 105, 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, 107, 108, 108, 108, 108, 108, 108, 108, 109, 109, 110, 110, 110, 110, 111, 111, 112, 113, 114, - 115, 116, 116, 116, 117, 117, 118, 118, 118, 118, - 118, 119, 118, 120, 118, 121, 118, 118, 118, 118, - 118, 122, 122, 123, 123, 124, 124, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 127, 129, 128, - 130, 131, 131, 132, 132, 134, 133, 135, 135, 135, - 135, 135, 135, 137, 136, 138, 139, 140, 140, 141 + 115, 116, 116, 116, 117, 117, 118, 119, 118, 120, + 120, 120, 120, 120, 121, 120, 122, 120, 123, 120, + 120, 120, 120, 120, 124, 124, 125, 125, 126, 126, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 129, 131, 130, 132, 133, 133, 134, 134, 136, 135, + 137, 137, 137, 137, 137, 137, 139, 138, 140, 141, + 142, 142, 143 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -368,14 +373,15 @@ static const short yyr2[] = 3, 1, 1, 1, 1, 1, 1, 3, 2, 3, 5, 4, 1, 1, 3, 2, 3, 5, 4, 1, 4, 1, 3, 3, 4, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 4, 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, 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, 2, 2, 0, 4, 2, 2, 2, 1, 0 + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 0, 4, 1, 1, 3, 1, 1, 0, 9, + 1, 2, 2, 2, 2, 2, 0, 4, 2, 2, + 2, 1, 0 }; /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE @@ -383,190 +389,194 @@ static const short yyr2[] = error. */ static const short yydefact[] = { - 0, 189, 0, 189, 1, 4, 110, 109, 118, 119, - 120, 121, 125, 123, 116, 117, 2, 82, 189, 189, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 83, 189, 62, 65, 189, 189, 3, 81, 99, 61, - 77, 0, 84, 173, 189, 0, 0, 0, 5, 8, - 9, 6, 22, 23, 7, 0, 0, 189, 189, 189, - 0, 0, 174, 38, 0, 167, 74, 157, 63, 66, - 76, 75, 0, 189, 0, 189, 0, 52, 24, 10, - 12, 0, 14, 82, 70, 71, 21, 107, 129, 130, - 134, 135, 0, 131, 189, 133, 0, 0, 127, 128, - 189, 189, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 0, 0, 79, 113, 114, 0, 112, 111, 115, - 86, 85, 80, 105, 0, 93, 106, 92, 101, 60, - 189, 189, 0, 15, 0, 122, 134, 132, 126, 124, - 0, 0, 41, 73, 68, 69, 72, 0, 64, 67, - 0, 78, 0, 88, 0, 100, 108, 0, 95, 0, - 0, 189, 0, 55, 56, 58, 54, 0, 0, 27, - 11, 0, 13, 136, 40, 43, 42, 189, 0, 89, - 87, 96, 94, 102, 103, 0, 53, 0, 26, 29, - 28, 189, 18, 19, 16, 17, 0, 189, 45, 175, - 0, 91, 0, 98, 104, 57, 0, 189, 31, 0, - 44, 82, 46, 39, 47, 189, 189, 189, 189, 189, - 90, 97, 30, 32, 25, 33, 189, 189, 189, 189, - 20, 168, 48, 51, 0, 49, 0, 177, 34, 37, - 0, 35, 0, 50, 183, 0, 0, 178, 176, 188, - 0, 179, 180, 181, 182, 36, 170, 171, 169, 0, - 185, 186, 187, 0, 0, 172, 184, 0, 0, 0 + 0, 192, 0, 192, 1, 4, 110, 109, 121, 122, + 123, 0, 124, 128, 126, 119, 120, 2, 116, 82, + 192, 192, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 83, 192, 62, 65, 192, 192, 3, 81, + 99, 61, 77, 0, 84, 176, 192, 0, 0, 0, + 5, 8, 9, 6, 22, 23, 7, 0, 0, 117, + 192, 192, 192, 0, 0, 177, 38, 0, 170, 74, + 160, 63, 66, 76, 75, 0, 192, 0, 192, 0, + 52, 24, 10, 12, 0, 14, 82, 70, 71, 21, + 107, 132, 133, 0, 137, 138, 0, 134, 192, 136, + 0, 0, 130, 131, 192, 192, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 0, 0, 79, 113, 114, + 0, 112, 111, 115, 86, 85, 80, 105, 0, 93, + 106, 92, 101, 60, 192, 192, 0, 15, 0, 118, + 125, 137, 135, 129, 127, 0, 0, 41, 73, 68, + 69, 72, 0, 64, 67, 0, 78, 0, 88, 0, + 100, 108, 0, 95, 0, 0, 192, 0, 55, 56, + 58, 54, 0, 0, 27, 11, 0, 13, 139, 40, + 43, 42, 192, 0, 89, 87, 96, 94, 102, 103, + 0, 53, 0, 26, 29, 28, 192, 18, 19, 16, + 17, 0, 192, 45, 178, 0, 91, 0, 98, 104, + 57, 0, 192, 31, 0, 44, 82, 46, 39, 47, + 192, 192, 192, 192, 192, 90, 97, 30, 32, 25, + 33, 192, 192, 192, 192, 20, 171, 48, 51, 0, + 49, 0, 180, 34, 37, 0, 35, 0, 50, 186, + 0, 0, 181, 179, 191, 0, 182, 183, 184, 185, + 36, 173, 174, 172, 0, 188, 189, 190, 0, 0, + 175, 187, 0, 0, 0 }; static const short yydefgoto[] = { - 277, 4, 90, 91, 59, 181, 204, 205, 60, 61, - 62, 141, 199, 178, 200, 217, 235, 40, 110, 185, - 151, 186, 207, 224, 41, 140, 172, 173, 174, 42, - 86, 43, 94, 121, 95, 122, 156, 175, 157, 46, - 47, 48, 126, 134, 49, 139, 135, 136, 168, 14, - 15, 129, 130, 101, 67, 69, 68, 102, 103, 104, - 50, 75, 76, 228, 252, 267, 268, 51, 52, 229, - 246, 261, 269, 262, 263, 264, 77 + 282, 4, 93, 94, 61, 186, 209, 210, 62, 63, + 64, 145, 204, 183, 205, 222, 240, 42, 114, 190, + 156, 191, 212, 229, 43, 144, 177, 178, 179, 44, + 89, 45, 97, 125, 98, 126, 161, 180, 162, 48, + 49, 50, 130, 138, 51, 143, 139, 140, 173, 15, + 16, 133, 134, 105, 103, 18, 70, 72, 71, 106, + 107, 108, 52, 78, 79, 233, 257, 272, 273, 53, + 54, 234, 251, 266, 274, 267, 268, 269, 80 }; static const short yypact[] = { - 33,-32768, 31, 371, 118,-32768,-32768,-32768, -29,-32768, - -20,-32768,-32768,-32768, 5, 19,-32768, 2, 83, 83, + 96,-32768, 42, 376, 122,-32768,-32768,-32768, -28,-32768, + -19, -18,-32768,-32768,-32768, 2, 9,-32768,-32768, 6, + 49, 49,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + -32768,-32768,-32768,-32768, 10, 26,-32768,-32768,-32768, 52, + -32768, 27,-32768, 41,-32768,-32768, 49, 77, 77, 406, + -32768,-32768,-32768,-32768,-32768,-32768,-32768, 101, 101,-32768, + 25, 25, 25, 101, 101,-32768,-32768, 62, 125,-32768, + -32768,-32768,-32768,-32768,-32768, 101, 134, 156, 37, 114, + -32768,-32768,-32768, 90, 29, 128,-32768,-32768,-32768,-32768, + -32768,-32768,-32768, 123,-32768,-32768, 126,-32768, 129,-32768, + 130, 120,-32768,-32768, 131, 376,-32768,-32768,-32768,-32768, + -32768,-32768,-32768,-32768,-32768, 42, 42,-32768,-32768,-32768, + 28,-32768,-32768,-32768, 16,-32768,-32768,-32768, 4, 7, + -32768,-32768,-32768, -7, 406, 133, 177,-32768, 77,-32768, + -32768, 42,-32768,-32768,-32768, 179, 141,-32768,-32768,-32768, + -32768,-32768, 138,-32768,-32768, 134,-32768, 134,-32768, 37, + -32768,-32768, 37,-32768, 101, 156, 37, 139, 145,-32768, + -32768,-32768, 192, 146,-32768,-32768, 14, 90,-32768,-32768, + -32768, 148,-32768, 149, 33,-32768, 22,-32768,-32768,-32768, + 12,-32768, 406,-32768,-32768, 152,-32768,-32768, 90,-32768, + 153, 179, 298,-32768,-32768, 134,-32768, 37,-32768,-32768, + -32768, 192, 337,-32768, 77,-32768, 57,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768, 54, 56,-32768,-32768,-32768, 64,-32768, 35, - -32768, 46,-32768,-32768, 83, 113, 113, 401,-32768,-32768, - -32768,-32768,-32768,-32768,-32768, 140, 140, 8, 8, 8, - 140, 140,-32768,-32768, 106, 111,-32768,-32768,-32768,-32768, - -32768,-32768, 140, 104, 155, 67, 159,-32768,-32768,-32768, - 119, 4, 117,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768, 115,-32768, 120,-32768, 114, 108,-32768,-32768, - 122, 371,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768, 31, 31,-32768,-32768,-32768, 10,-32768,-32768,-32768, - 26,-32768,-32768,-32768, -10, 16,-32768,-32768,-32768, -6, - 401, 123, 167,-32768, 113,-32768, 31,-32768,-32768,-32768, - 168, 126,-32768,-32768,-32768,-32768,-32768, 124,-32768,-32768, - 104,-32768, 104,-32768, 67,-32768,-32768, 67,-32768, 140, - 155, 67, 125, 128,-32768,-32768,-32768, 169, 134,-32768, - -32768, 24, 119,-32768,-32768,-32768, 136,-32768, 137, 37, - -32768, 17,-32768,-32768,-32768, -5,-32768, 401,-32768,-32768, - 139,-32768,-32768, 119,-32768, 141, 168, 293,-32768,-32768, - 104,-32768, 67,-32768,-32768,-32768, 169, 332,-32768, 113, - -32768, 44,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 119,-32768,-32768,-32768, 146,-32768, 254,-32768, 111, 111, - 96,-32768, 183,-32768,-32768, 143, 147,-32768,-32768,-32768, - 148,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 149, 31, - -32768,-32768,-32768, 183, 144,-32768,-32768, 202, 204,-32768 + -32768,-32768,-32768,-32768,-32768, 90,-32768,-32768,-32768, 158, + -32768, 259,-32768, 125, 125, 112,-32768, 195,-32768,-32768, + 157, 160,-32768,-32768,-32768, 163,-32768,-32768,-32768,-32768, + -32768,-32768,-32768, 162, 42,-32768,-32768,-32768, 195, 161, + -32768,-32768, 217, 219,-32768 }; static const short yypgoto[] = { - -32768,-32768, -135, 153,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768, -11,-32768,-32768,-32768,-32768, 206,-32768, 6, - -32768,-32768,-32768,-32768, -94,-32768,-32768,-32768, 14, 102, - -32768, 107, -1,-32768, 0,-32768,-32768, 158,-32768,-32768, - -32768,-32768,-32768, 48,-32768,-32768, -116, -43, 29, -77, - -65, -83, -110, -2,-32768,-32768,-32768, 97, 121,-32768, - -32768, -75, -40, 9,-32768, -52,-32768, 49, 218,-32768, - -32768,-32768,-32768,-32768,-32768,-32768, 7 + -32768,-32768, -147, 165,-32768,-32768,-32768,-32768,-32768,-32768, + -32768,-32768, 5,-32768,-32768,-32768,-32768, 216,-32768, 13, + -32768,-32768,-32768,-32768, -103,-32768,-32768,-32768, 30, 113, + -32768, 115, -1,-32768, 0,-32768,-32768, 168,-32768,-32768, + -32768,-32768,-32768, 53,-32768,-32768, -109, -58, 35, -73, + -69, -82, -114, -2,-32768, 132,-32768,-32768,-32768, 105, + 135,-32768,-32768, -68, -39, 11,-32768, -44,-32768, 51, + 232,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 3 }; -#define YYLAST 438 +#define YYLAST 443 static const short yytable[] = { - 16, 132, 44, 45, 80, 81, 127, 127, 5, 182, - 53, 6, 7, 8, 9, 10, 143, 153, 128, 128, - 166, 166, 98, 99, 65, 53, 53, 108, 109, 6, - 7, 124, 89, 66, 6, 7, 8, 9, 10, 123, - 6, 7, 124, -59, 164, 169, 203, 163, 191, 164, - 189, 192, 190, 127, 165, 170, 144, 171, 70, 214, - -174, 53, 100, 11, 160, 128, 12, 73, 74, 161, - 97, 13, 71, 133, 105, 105, 105, 202, 167, 212, - 1, 2, 3, 127, 240, 127, 11, 194, 162, 12, - 131, 72, 137, 127, 13, 128, 231, 128, 85, 210, - 230, 241, -174, 88, 87, 128, 211, 6, 7, 124, - 125, 105, 127, 225, 78, 82, 79, 152, 53, 158, - 159, 89, 83, 236, 128, 84, 193, 54, 18, 55, - 56, 57, 19, 127, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 97, 183, 128, 265, 176, 179, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 6, 7, - 124, 248, 249, 250, 111, 106, 107, 138, 58, 144, - 142, 145, 149, 148, 146, 180, 184, 198, 137, 150, - 177, 187, 197, 188, 196, 242, 243, 244, 245, 201, - 206, 266, 209, 216, 208, 219, 253, 271, 272, 251, - 270, 276, 278, 273, 279, 232, 226, 227, 218, 92, - 63, 215, 220, 154, 53, 96, 237, 238, 155, 195, - 213, 275, 64, 0, 53, 147, 239, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 247, 0, 0, 0, - 0, 0, 0, 0, 0, 259, 260, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 93, 0, 18, 0, 0, 274, 19, 254, - 255, 256, 20, 21, 22, 23, 24, 25, 26, 27, + 17, 187, 46, 47, 5, 136, 55, 83, 84, 101, + 102, 171, 158, 131, 131, 112, 113, 132, 132, 6, + 7, 128, 92, 55, 55, 67, 171, 127, 6, 7, + 8, 9, 10, 11, 68, -59, 6, 7, 128, 208, + 100, 147, 69, 137, 174, 6, 7, 8, 9, 10, + 11, 194, 168, 195, 175, 73, 176, 75, 169, 55, + 196, 131, 74, 197, -177, 132, 169, 207, 170, 172, + 81, 76, 77, 109, 109, 109, 219, 245, 167, 104, + 12, 148, 165, 13, 217, 92, 82, 166, 14, 135, + 88, 141, 131, 199, 131, 215, 132, 12, 132, 90, + 13, 235, 131, 85, 100, 14, 132, 91, 236, 230, + 86, 109, 216, 87, 246, -177, 198, 157, 55, 241, + 115, 131, 142, 163, 164, 132, 6, 7, 8, 9, + 10, 56, 20, 57, 58, 59, 21, 6, 7, 128, + 129, 146, 131, 1, 2, 3, 132, 181, 184, 188, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 6, + 7, 128, 270, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 60, 253, 254, 255, 110, 111, 12, 141, + 148, 13, 150, 151, 154, 185, 14, 189, 155, 153, + 182, 247, 248, 249, 250, 213, 192, 193, 201, 202, + 203, 206, 211, 271, 214, 256, 221, 224, 258, 223, + 276, 231, 232, 277, 275, 55, 278, 283, 281, 284, + 65, 242, 243, 95, 225, 55, 237, 99, 159, 200, + 160, 218, 220, 244, 280, 149, 66, 252, 0, 0, + 0, 0, 0, 152, 0, 0, 0, 0, 0, 0, + 264, 265, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 96, 0, 20, + 0, 0, 279, 21, 259, 260, 261, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 226, 0, 20, 262, + 0, 0, 21, 0, 0, 263, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 226, 0, 20, 227, 0, + 0, 21, 0, 0, 228, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 19, 0, 20, 238, 0, 0, + 21, 0, 0, 239, 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, 221, 0, 18, 257, 0, 0, 19, 0, 0, - 258, 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, - 221, 0, 18, 222, 0, 0, 19, 0, 0, 223, - 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, 17, - 0, 18, 233, 0, 0, 19, 0, 0, 234, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 93, - 0, 18, 0, 0, 0, 19, 0, 0, 0, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39 + 38, 39, 40, 41, 96, 0, 20, 0, 0, 0, + 21, 0, 0, 0, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41 }; static const short yycheck[] = { - 2, 84, 3, 3, 44, 45, 83, 84, 1, 144, - 3, 3, 4, 5, 6, 7, 12, 111, 83, 84, - 4, 4, 65, 66, 53, 18, 19, 70, 71, 3, - 4, 5, 8, 53, 3, 4, 5, 6, 7, 82, - 3, 4, 5, 8, 54, 51, 181, 130, 164, 54, - 160, 167, 162, 130, 64, 61, 52, 63, 53, 64, - 58, 54, 54, 55, 54, 130, 58, 18, 19, 59, - 3, 63, 53, 6, 67, 68, 69, 53, 62, 62, - 47, 48, 49, 160, 219, 162, 55, 170, 62, 58, - 83, 8, 85, 170, 63, 160, 212, 162, 63, 62, - 210, 57, 58, 54, 58, 170, 189, 3, 4, 5, - 6, 104, 189, 207, 60, 51, 60, 110, 111, 121, - 122, 8, 58, 217, 189, 61, 169, 9, 10, 11, - 12, 13, 14, 210, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 3, 146, 210, 50, 140, 141, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 3, 4, - 5, 236, 237, 238, 58, 68, 69, 8, 50, 52, - 51, 56, 64, 59, 54, 8, 8, 8, 171, 57, - 57, 55, 54, 59, 59, 225, 226, 227, 228, 55, - 54, 8, 55, 54, 187, 54, 50, 50, 50, 239, - 57, 57, 0, 54, 0, 216, 207, 207, 201, 56, - 4, 197, 206, 111, 207, 57, 217, 217, 111, 171, - 191, 273, 4, -1, 217, 104, 217, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 229, -1, -1, -1, - -1, -1, -1, -1, -1, 246, 246, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 8, -1, 10, -1, -1, 269, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 8, -1, 10, 50, -1, -1, 14, -1, -1, - 56, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 8, -1, 10, 50, -1, -1, 14, -1, -1, 56, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, - -1, 10, 50, -1, -1, 14, -1, -1, 56, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 8, - -1, 10, -1, -1, -1, 14, -1, -1, -1, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37 + 2, 148, 3, 3, 1, 87, 3, 46, 47, 67, + 68, 4, 115, 86, 87, 73, 74, 86, 87, 3, + 4, 5, 8, 20, 21, 53, 4, 85, 3, 4, + 5, 6, 7, 8, 53, 8, 3, 4, 5, 186, + 3, 12, 60, 6, 51, 3, 4, 5, 6, 7, + 8, 165, 134, 167, 61, 53, 63, 8, 54, 56, + 169, 134, 53, 172, 58, 134, 54, 53, 64, 62, + 60, 20, 21, 70, 71, 72, 64, 224, 62, 54, + 55, 52, 54, 58, 62, 8, 60, 59, 63, 86, + 63, 88, 165, 175, 167, 62, 165, 55, 167, 58, + 58, 215, 175, 51, 3, 63, 175, 56, 217, 212, + 58, 108, 194, 61, 57, 58, 174, 114, 115, 222, + 58, 194, 8, 125, 126, 194, 3, 4, 5, 6, + 7, 9, 10, 11, 12, 13, 14, 3, 4, 5, + 6, 51, 215, 47, 48, 49, 215, 144, 145, 151, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 3, + 4, 5, 50, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 50, 241, 242, 243, 71, 72, 55, 176, + 52, 58, 56, 54, 64, 8, 63, 8, 57, 59, + 57, 230, 231, 232, 233, 192, 55, 59, 59, 54, + 8, 55, 54, 8, 55, 244, 54, 54, 50, 206, + 50, 212, 212, 50, 57, 212, 54, 0, 57, 0, + 4, 222, 222, 58, 211, 222, 221, 59, 115, 176, + 115, 196, 202, 222, 278, 103, 4, 234, -1, -1, + -1, -1, -1, 108, -1, -1, -1, -1, -1, -1, + 251, 251, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 8, -1, 10, + -1, -1, 274, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 8, -1, 10, 50, + -1, -1, 14, -1, -1, 56, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 8, -1, 10, 50, -1, + -1, 14, -1, -1, 56, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 8, -1, 10, 50, -1, -1, + 14, -1, -1, 56, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 8, -1, 10, -1, -1, -1, + 14, -1, -1, -1, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/share/bison/bison.simple" @@ -2028,283 +2038,306 @@ case 114: case 116: #line 956 "dcParser.yxx" { - current_packer->pack_int64(yyvsp[0].u.int64); + yyval = yyvsp[0]; } break; case 117: #line 960 "dcParser.yxx" { - current_packer->pack_uint64(yyvsp[0].u.uint64); + if (yyvsp[-1].str != current_packer->get_current_field_name()) { + ostringstream strm; + strm << "Got '" << yyvsp[-1].str << "', expected '" + << current_packer->get_current_field_name() << "'"; + yyerror(strm.str()); + } } break; case 118: -#line 964 "dcParser.yxx" +#line 969 "dcParser.yxx" +{ + yyval = yyvsp[0]; +} + break; +case 119: +#line 976 "dcParser.yxx" +{ + current_packer->pack_int64(yyvsp[0].u.int64); +} + break; +case 120: +#line 980 "dcParser.yxx" +{ + current_packer->pack_uint64(yyvsp[0].u.uint64); +} + break; +case 121: +#line 984 "dcParser.yxx" { current_packer->pack_double(yyvsp[0].u.real); } break; -case 119: -#line 968 "dcParser.yxx" +case 122: +#line 988 "dcParser.yxx" { current_packer->pack_string(yyvsp[0].str); } break; -case 120: -#line 972 "dcParser.yxx" +case 123: +#line 992 "dcParser.yxx" { current_packer->pack_literal_value(yyvsp[0].str); } break; -case 121: -#line 976 "dcParser.yxx" -{ - current_packer->push(); -} - break; -case 122: -#line 980 "dcParser.yxx" -{ - current_packer->pop(); -} - break; -case 123: -#line 984 "dcParser.yxx" -{ - current_packer->push(); -} - break; case 124: -#line 988 "dcParser.yxx" +#line 996 "dcParser.yxx" { - current_packer->pop(); + current_packer->push(); } break; case 125: -#line 992 "dcParser.yxx" -{ - current_packer->push(); -} - break; -case 126: -#line 996 "dcParser.yxx" +#line 1000 "dcParser.yxx" { current_packer->pop(); } break; +case 126: +#line 1004 "dcParser.yxx" +{ + current_packer->push(); +} + break; case 127: -#line 1000 "dcParser.yxx" +#line 1008 "dcParser.yxx" +{ + current_packer->pop(); +} + break; +case 128: +#line 1012 "dcParser.yxx" +{ + current_packer->push(); +} + break; +case 129: +#line 1016 "dcParser.yxx" +{ + current_packer->pop(); +} + break; +case 130: +#line 1020 "dcParser.yxx" { for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) { current_packer->pack_int64(yyvsp[-2].u.int64); } } break; -case 128: -#line 1006 "dcParser.yxx" +case 131: +#line 1026 "dcParser.yxx" { for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) { current_packer->pack_uint64(yyvsp[-2].u.uint64); } } break; -case 129: -#line 1012 "dcParser.yxx" +case 132: +#line 1032 "dcParser.yxx" { for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) { current_packer->pack_double(yyvsp[-2].u.real); } } break; -case 130: -#line 1018 "dcParser.yxx" +case 133: +#line 1038 "dcParser.yxx" { for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) { current_packer->pack_literal_value(yyvsp[-2].str); } } break; -case 137: -#line 1042 "dcParser.yxx" +case 140: +#line 1062 "dcParser.yxx" { yyval.u.subatomic = ST_int8; } break; -case 138: -#line 1046 "dcParser.yxx" +case 141: +#line 1066 "dcParser.yxx" { yyval.u.subatomic = ST_int16; } break; -case 139: -#line 1050 "dcParser.yxx" +case 142: +#line 1070 "dcParser.yxx" { yyval.u.subatomic = ST_int32; } break; -case 140: -#line 1054 "dcParser.yxx" +case 143: +#line 1074 "dcParser.yxx" { yyval.u.subatomic = ST_int64; } break; -case 141: -#line 1058 "dcParser.yxx" +case 144: +#line 1078 "dcParser.yxx" { yyval.u.subatomic = ST_uint8; } break; -case 142: -#line 1062 "dcParser.yxx" +case 145: +#line 1082 "dcParser.yxx" { yyval.u.subatomic = ST_uint16; } break; -case 143: -#line 1066 "dcParser.yxx" +case 146: +#line 1086 "dcParser.yxx" { yyval.u.subatomic = ST_uint32; } break; -case 144: -#line 1070 "dcParser.yxx" +case 147: +#line 1090 "dcParser.yxx" { yyval.u.subatomic = ST_uint64; } break; -case 145: -#line 1074 "dcParser.yxx" +case 148: +#line 1094 "dcParser.yxx" { yyval.u.subatomic = ST_float64; } break; -case 146: -#line 1078 "dcParser.yxx" +case 149: +#line 1098 "dcParser.yxx" { yyval.u.subatomic = ST_string; } break; -case 147: -#line 1082 "dcParser.yxx" +case 150: +#line 1102 "dcParser.yxx" { yyval.u.subatomic = ST_blob; } break; -case 148: -#line 1086 "dcParser.yxx" +case 151: +#line 1106 "dcParser.yxx" { yyval.u.subatomic = ST_blob32; } break; -case 149: -#line 1090 "dcParser.yxx" +case 152: +#line 1110 "dcParser.yxx" { yyval.u.subatomic = ST_int8array; } break; -case 150: -#line 1094 "dcParser.yxx" +case 153: +#line 1114 "dcParser.yxx" { yyval.u.subatomic = ST_int16array; } break; -case 151: -#line 1098 "dcParser.yxx" +case 154: +#line 1118 "dcParser.yxx" { yyval.u.subatomic = ST_int32array; } break; -case 152: -#line 1102 "dcParser.yxx" +case 155: +#line 1122 "dcParser.yxx" { yyval.u.subatomic = ST_uint8array; } break; -case 153: -#line 1106 "dcParser.yxx" +case 156: +#line 1126 "dcParser.yxx" { yyval.u.subatomic = ST_uint16array; } break; -case 154: -#line 1110 "dcParser.yxx" +case 157: +#line 1130 "dcParser.yxx" { yyval.u.subatomic = ST_uint32array; } break; -case 155: -#line 1114 "dcParser.yxx" +case 158: +#line 1134 "dcParser.yxx" { yyval.u.subatomic = ST_uint32uint8array; } break; -case 156: -#line 1118 "dcParser.yxx" +case 159: +#line 1138 "dcParser.yxx" { yyval.u.subatomic = ST_char; } break; -case 157: -#line 1125 "dcParser.yxx" +case 160: +#line 1145 "dcParser.yxx" { yyval.u.s_int = 0; } break; -case 158: -#line 1129 "dcParser.yxx" +case 161: +#line 1149 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_required; } break; -case 159: -#line 1133 "dcParser.yxx" +case 162: +#line 1153 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_broadcast; } break; -case 160: -#line 1137 "dcParser.yxx" +case 163: +#line 1157 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_p2p; } break; -case 161: -#line 1141 "dcParser.yxx" +case 164: +#line 1161 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_ram; } break; -case 162: -#line 1145 "dcParser.yxx" +case 165: +#line 1165 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_db; } break; -case 163: -#line 1149 "dcParser.yxx" +case 166: +#line 1169 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_clsend; } break; -case 164: -#line 1153 "dcParser.yxx" +case 167: +#line 1173 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_clrecv; } break; -case 165: -#line 1157 "dcParser.yxx" +case 168: +#line 1177 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_ownsend; } break; -case 166: -#line 1161 "dcParser.yxx" +case 169: +#line 1181 "dcParser.yxx" { yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_airecv; } break; -case 167: -#line 1168 "dcParser.yxx" +case 170: +#line 1188 "dcParser.yxx" { if (yyvsp[0].u.s_int != 0) { yyerror("Server flags are not allowed here."); @@ -2312,20 +2345,20 @@ case 167: yyval.u.s_int = yyvsp[0].u.s_int; } break; -case 168: -#line 1178 "dcParser.yxx" +case 171: +#line 1198 "dcParser.yxx" { current_molecular = new DCMolecularField(yyvsp[-1].str, current_class); } break; -case 169: -#line 1182 "dcParser.yxx" +case 172: +#line 1202 "dcParser.yxx" { yyval.u.field = current_molecular; } break; -case 170: -#line 1189 "dcParser.yxx" +case 173: +#line 1209 "dcParser.yxx" { DCField *field = current_class->get_field_by_name(yyvsp[0].str); yyval.u.atomic = (DCAtomicField *)NULL; @@ -2339,16 +2372,16 @@ case 170: } } break; -case 171: -#line 1205 "dcParser.yxx" +case 174: +#line 1225 "dcParser.yxx" { if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) { current_molecular->add_atomic(yyvsp[0].u.atomic); } } break; -case 172: -#line 1211 "dcParser.yxx" +case 175: +#line 1231 "dcParser.yxx" { if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) { current_molecular->add_atomic(yyvsp[0].u.atomic); @@ -2360,28 +2393,28 @@ case 172: } } break; -case 173: -#line 1225 "dcParser.yxx" +case 176: +#line 1245 "dcParser.yxx" { yyval.str = ""; } break; -case 175: -#line 1233 "dcParser.yxx" +case 178: +#line 1253 "dcParser.yxx" { yyval.u.dswitch = current_switch; current_switch = new DCSwitch(yyvsp[-4].str, yyvsp[-2].u.field); } break; -case 176: -#line 1238 "dcParser.yxx" +case 179: +#line 1258 "dcParser.yxx" { yyval.u.dswitch = current_switch; current_switch = (DCSwitch *)yyvsp[-2].u.parameter; } break; -case 182: -#line 1252 "dcParser.yxx" +case 185: +#line 1272 "dcParser.yxx" { if (!current_switch->is_field_valid()) { yyerror("case declaration required before first element"); @@ -2392,16 +2425,16 @@ case 182: } } break; -case 183: -#line 1265 "dcParser.yxx" +case 186: +#line 1285 "dcParser.yxx" { current_packer = &default_packer; current_packer->clear_data(); current_packer->begin_pack(current_switch->get_key_parameter()); } break; -case 184: -#line 1271 "dcParser.yxx" +case 187: +#line 1291 "dcParser.yxx" { if (!current_packer->end_pack()) { yyerror("Invalid value for switch parameter"); @@ -2414,28 +2447,28 @@ case 184: } } break; -case 185: -#line 1286 "dcParser.yxx" +case 188: +#line 1306 "dcParser.yxx" { if (!current_switch->add_default()) { yyerror("Default case already defined"); } } break; -case 186: -#line 1295 "dcParser.yxx" +case 189: +#line 1315 "dcParser.yxx" { current_switch->add_break(); } break; -case 187: -#line 1302 "dcParser.yxx" +case 190: +#line 1322 "dcParser.yxx" { yyval.u.field = yyvsp[-1].u.parameter; } break; -case 188: -#line 1306 "dcParser.yxx" +case 191: +#line 1326 "dcParser.yxx" { yyval.u.field = yyvsp[0].u.parameter; } @@ -2673,4 +2706,4 @@ yyreturn: #endif return yyresult; } -#line 1314 "dcParser.yxx" +#line 1334 "dcParser.yxx" diff --git a/direct/src/dcparser/dcParser.yxx b/direct/src/dcparser/dcParser.yxx index fe0f916ac3..7397123d61 100644 --- a/direct/src/dcparser/dcParser.yxx +++ b/direct/src/dcparser/dcParser.yxx @@ -952,6 +952,26 @@ char_or_number: parameter_value: + parameter_actual_value +{ + $$ = $1; +} + | IDENTIFIER '=' +{ + if ($1 != current_packer->get_current_field_name()) { + ostringstream strm; + strm << "Got '" << $1 << "', expected '" + << current_packer->get_current_field_name() << "'"; + yyerror(strm.str()); + } +} + parameter_actual_value +{ + $$ = $4; +} + ; + +parameter_actual_value: signed_integer { current_packer->pack_int64($1);