prebuild bison

This commit is contained in:
David Rose 2004-06-16 18:09:32 +00:00
parent 326ad4b109
commit 96e4161169

View File

@ -56,6 +56,8 @@
#include "dcClass.h" #include "dcClass.h"
#include "dcAtomicField.h" #include "dcAtomicField.h"
#include "dcMolecularField.h" #include "dcMolecularField.h"
#include "dcSimpleType.h"
#include "dcPacker.h"
// Because our token type contains objects of type string, which // Because our token type contains objects of type string, which
// require correct copy construction (and not simply memcpying), we // require correct copy construction (and not simply memcpying), we
@ -69,7 +71,8 @@ static DCFile *dc_file = (DCFile *)NULL;
static DCClass *current_class = (DCClass *)NULL; static DCClass *current_class = (DCClass *)NULL;
static DCAtomicField *current_atomic = (DCAtomicField *)NULL; static DCAtomicField *current_atomic = (DCAtomicField *)NULL;
static DCMolecularField *current_molecular = (DCMolecularField *)NULL; static DCMolecularField *current_molecular = (DCMolecularField *)NULL;
static DCAtomicField::ElementType atomic_element; static DCAtomicField::ElementType atomic_element(new DCSimpleType(ST_invalid));
static DCPacker default_value_packer;
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Defining the interface to the parser. // Defining the interface to the parser.
@ -92,12 +95,12 @@ dc_cleanup_parser() {
#define YYFINAL 122 #define YYFINAL 121
#define YYFLAG -32768 #define YYFLAG -32768
#define YYNTBASE 51 #define YYNTBASE 51
/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
#define YYTRANSLATE(x) ((unsigned)(x) <= 293 ? yytranslate[x] : 82) #define YYTRANSLATE(x) ((unsigned)(x) <= 293 ? yytranslate[x] : 84)
/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
static const char yytranslate[] = static const char yytranslate[] =
@ -141,40 +144,38 @@ static const short yyprhs[] =
28, 30, 34, 37, 38, 44, 46, 48, 50, 54, 28, 30, 34, 37, 38, 44, 46, 48, 50, 54,
56, 59, 61, 65, 67, 70, 73, 76, 77, 84, 56, 59, 61, 65, 67, 70, 73, 76, 77, 84,
86, 88, 90, 92, 96, 97, 101, 103, 107, 110, 86, 88, 90, 92, 96, 97, 101, 103, 107, 110,
114, 118, 122, 126, 132, 134, 137, 139, 141, 143, 111, 116, 118, 120, 122, 124, 125, 130, 134, 138,
147, 149, 151, 153, 155, 159, 163, 167, 169, 171, 142, 144, 147, 149, 151, 153, 157, 159, 161, 163,
173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183,
193, 195, 197, 199, 201, 203, 205, 207, 210, 213, 185, 187, 189, 191, 193, 195, 197, 200, 203, 206,
216, 219, 222, 225, 228, 231, 234, 235, 240, 242, 209, 212, 215, 218, 221, 224, 225, 230, 232, 236
246
}; };
static const short yyrhs[] = static const short yyrhs[] =
{ {
81, 0, 51, 40, 0, 51, 52, 0, 51, 57, 83, 0, 51, 40, 0, 51, 52, 0, 51, 57,
0, 0, 8, 7, 53, 61, 41, 63, 42, 0, 0, 0, 8, 7, 53, 61, 41, 63, 42, 0,
7, 0, 7, 0, 55, 43, 7, 0, 55, 0, 7, 0, 7, 0, 55, 43, 7, 0, 55, 0,
56, 44, 55, 0, 10, 56, 0, 0, 9, 56, 56, 44, 55, 0, 10, 56, 0, 0, 9, 56,
10, 58, 59, 0, 60, 0, 45, 0, 55, 0, 10, 58, 59, 0, 60, 0, 45, 0, 55, 0,
60, 46, 55, 0, 81, 0, 47, 62, 0, 54, 60, 46, 55, 0, 83, 0, 47, 62, 0, 54,
0, 62, 46, 54, 0, 81, 0, 63, 40, 0, 0, 62, 46, 54, 0, 83, 0, 63, 40, 0,
63, 64, 0, 63, 78, 0, 0, 7, 48, 65, 63, 64, 0, 63, 80, 0, 0, 7, 48, 65,
67, 49, 77, 0, 7, 0, 81, 0, 68, 0, 67, 49, 79, 0, 7, 0, 83, 0, 68, 0,
69, 0, 68, 46, 69, 0, 0, 76, 70, 71, 69, 0, 68, 46, 69, 0, 0, 78, 70, 71,
0, 81, 0, 71, 43, 3, 0, 71, 7, 0, 0, 83, 0, 71, 43, 3, 0, 71, 7, 0,
71, 50, 3, 0, 71, 50, 4, 0, 71, 50, 0, 71, 50, 72, 73, 0, 3, 0, 4, 0,
5, 0, 71, 50, 6, 0, 71, 50, 41, 72, 5, 0, 6, 0, 0, 41, 74, 75, 42, 0,
42, 0, 81, 0, 74, 73, 0, 81, 0, 46, 3, 45, 3, 0, 4, 45, 3, 0, 6, 45,
0, 75, 0, 74, 46, 75, 0, 3, 0, 4, 3, 0, 83, 0, 77, 76, 0, 83, 0, 46,
0, 5, 0, 6, 0, 3, 45, 3, 0, 4, 0, 73, 0, 77, 46, 73, 0, 11, 0, 12,
45, 3, 0, 6, 45, 3, 0, 11, 0, 12,
0, 13, 0, 14, 0, 15, 0, 16, 0, 17, 0, 13, 0, 14, 0, 15, 0, 16, 0, 17,
0, 18, 0, 19, 0, 20, 0, 21, 0, 22, 0, 18, 0, 19, 0, 20, 0, 21, 0, 22,
0, 23, 0, 24, 0, 25, 0, 26, 0, 27, 0, 23, 0, 24, 0, 25, 0, 26, 0, 27,
0, 28, 0, 29, 0, 81, 0, 77, 31, 0, 0, 28, 0, 29, 0, 83, 0, 79, 31, 0,
77, 32, 0, 77, 33, 0, 77, 34, 0, 77, 79, 32, 0, 79, 33, 0, 79, 34, 0, 79,
35, 0, 77, 36, 0, 77, 37, 0, 77, 38, 35, 0, 79, 36, 0, 79, 37, 0, 79, 38,
0, 77, 39, 0, 0, 7, 47, 79, 80, 0, 0, 79, 39, 0, 0, 7, 47, 81, 82, 0,
66, 0, 80, 46, 66, 0, 0 66, 0, 82, 46, 66, 0, 0
}; };
#endif #endif
@ -183,16 +184,15 @@ static const short yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const short yyrline[] = static const short yyrline[] =
{ {
0, 93, 95, 96, 97, 100, 100, 116, 130, 132, 0, 96, 98, 99, 100, 103, 103, 119, 133, 135,
138, 140, 146, 151, 151, 158, 160, 166, 171, 177, 141, 143, 149, 154, 154, 161, 163, 169, 174, 180,
179, 182, 189, 197, 199, 200, 201, 204, 204, 215, 182, 185, 192, 200, 202, 203, 204, 207, 207, 218,
231, 233, 236, 238, 241, 241, 253, 255, 259, 263, 234, 236, 239, 241, 244, 244, 255, 257, 266, 270,
269, 275, 281, 287, 297, 299, 302, 304, 307, 309, 270, 285, 290, 294, 298, 302, 302, 310, 316, 322,
312, 319, 325, 331, 337, 346, 355, 366, 371, 375, 330, 332, 335, 337, 340, 342, 345, 350, 354, 358,
379, 383, 387, 391, 395, 399, 403, 407, 411, 415, 362, 366, 370, 374, 378, 382, 386, 390, 394, 398,
419, 423, 427, 431, 435, 439, 445, 447, 451, 455, 402, 406, 410, 414, 418, 424, 426, 430, 434, 438,
459, 463, 467, 471, 475, 479, 485, 485, 496, 503, 442, 446, 450, 454, 458, 464, 464, 475, 482, 495
516
}; };
#endif #endif
@ -216,9 +216,9 @@ static const char *const yytname[] =
"import_symbol_list_or_star", "import_symbol_list", "dclass_derivation", "import_symbol_list_or_star", "import_symbol_list", "dclass_derivation",
"base_list", "dclass_fields", "atomic_field", "@3", "atomic_name", "base_list", "dclass_fields", "atomic_field", "@3", "atomic_name",
"parameter_list", "nonempty_parameter_list", "atomic_element", "@4", "parameter_list", "nonempty_parameter_list", "atomic_element", "@4",
"atomic_element_definition", "default_array", "maybe_comma", "atomic_element_definition", "@5", "default_value", "@6",
"default_array_def", "default_array_element", "type_token", "default_array", "maybe_comma", "default_array_def", "type_token",
"atomic_flags", "molecular_field", "@5", "molecular_atom_list", "empty", 0 "atomic_flags", "molecular_field", "@7", "molecular_atom_list", "empty", 0
}; };
#endif #endif
@ -228,13 +228,12 @@ static const short yyr1[] =
0, 51, 51, 51, 51, 53, 52, 54, 55, 55, 0, 51, 51, 51, 51, 53, 52, 54, 55, 55,
56, 56, 57, 58, 57, 59, 59, 60, 60, 61, 56, 56, 57, 58, 57, 59, 59, 60, 60, 61,
61, 62, 62, 63, 63, 63, 63, 65, 64, 66, 61, 62, 62, 63, 63, 63, 63, 65, 64, 66,
67, 67, 68, 68, 70, 69, 71, 71, 71, 71, 67, 67, 68, 68, 70, 69, 71, 71, 71, 72,
71, 71, 71, 71, 72, 72, 73, 73, 74, 74, 71, 73, 73, 73, 73, 74, 73, 73, 73, 73,
75, 75, 75, 75, 75, 75, 75, 76, 76, 76, 75, 75, 76, 76, 77, 77, 78, 78, 78, 78,
76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78,
76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79,
77, 77, 77, 77, 77, 77, 79, 78, 80, 80, 79, 79, 79, 79, 79, 81, 80, 82, 82, 83
81
}; };
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
@ -243,13 +242,12 @@ static const short yyr2[] =
0, 1, 2, 2, 2, 0, 7, 1, 1, 3, 0, 1, 2, 2, 2, 0, 7, 1, 1, 3,
1, 3, 2, 0, 5, 1, 1, 1, 3, 1, 1, 3, 2, 0, 5, 1, 1, 1, 3, 1,
2, 1, 3, 1, 2, 2, 2, 0, 6, 1, 2, 1, 3, 1, 2, 2, 2, 0, 6, 1,
1, 1, 1, 3, 0, 3, 1, 3, 2, 3, 1, 1, 1, 3, 0, 3, 1, 3, 2, 0,
3, 3, 3, 5, 1, 2, 1, 1, 1, 3, 4, 1, 1, 1, 1, 0, 4, 3, 3, 3,
1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 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, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 0, 4, 1, 3, 2, 2, 2, 2, 2, 0, 4, 1, 3, 0
0
}; };
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
@ -257,84 +255,84 @@ static const short yyr2[] =
error. */ error. */
static const short yydefact[] = static const short yydefact[] =
{ {
90, 0, 1, 0, 0, 0, 2, 3, 4, 5, 89, 0, 1, 0, 0, 0, 2, 3, 4, 5,
8, 10, 0, 12, 90, 0, 13, 0, 0, 0, 8, 10, 0, 12, 89, 0, 13, 0, 0, 0,
19, 9, 0, 11, 7, 21, 20, 90, 16, 17, 19, 9, 0, 11, 7, 21, 20, 89, 16, 17,
14, 15, 0, 0, 23, 0, 22, 0, 24, 6, 14, 15, 0, 0, 23, 0, 22, 0, 24, 6,
25, 26, 18, 86, 27, 0, 90, 29, 88, 87, 25, 26, 18, 85, 27, 0, 89, 29, 87, 86,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 66, 67, 68, 69, 70, 71, 72, 73, 74, 0,
31, 32, 34, 30, 0, 90, 0, 90, 89, 28, 31, 32, 34, 30, 0, 89, 0, 89, 88, 28,
76, 33, 35, 36, 77, 78, 79, 80, 81, 82, 75, 33, 35, 36, 76, 77, 78, 79, 80, 81,
83, 84, 85, 38, 0, 0, 37, 39, 40, 41, 82, 83, 84, 38, 0, 39, 37, 0, 41, 42,
42, 90, 50, 51, 52, 53, 0, 90, 48, 44, 43, 44, 45, 40, 0, 0, 0, 89, 47, 48,
0, 0, 0, 43, 47, 45, 46, 54, 55, 56, 49, 54, 0, 89, 50, 46, 53, 51, 52, 55,
49, 0, 0 0, 0
}; };
static const short yydefgoto[] = static const short yydefgoto[] =
{ {
1, 7, 14, 25, 11, 12, 8, 22, 30, 31, 1, 7, 14, 25, 11, 12, 8, 22, 30, 31,
19, 26, 33, 40, 46, 48, 69, 70, 71, 77, 19, 26, 33, 40, 46, 48, 69, 70, 71, 77,
82, 106, 115, 107, 108, 72, 79, 41, 45, 49, 82, 97, 103, 107, 112, 117, 113, 72, 79, 41,
2 45, 49, 2
}; };
static const short yypact[] = static const short yypact[] =
{ {
-32768, 2,-32768, 27, 28, 28,-32768,-32768,-32768,-32768, -32768, 2,-32768, 12, 23, 23,-32768,-32768,-32768,-32768,
-32768, -36, -1, -8, -9, 32,-32768, 28, 33, 4, -32768, -12, -1, -9, -13, 29,-32768, 23, 31, 4,
-32768,-32768, 1, -36,-32768,-32768, 5,-32768,-32768, -36, -32768,-32768, 1, -12,-32768,-32768, -7,-32768,-32768, -12,
-32768, 6, 33, 7,-32768, 28,-32768, -17,-32768,-32768, -32768, 5, 31, 7,-32768, 23,-32768, -30,-32768,-32768,
-32768,-32768, -36,-32768,-32768, 41, 53,-32768,-32768, 8, -32768,-32768, -12,-32768,-32768, 33, 53,-32768,-32768, 6,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 9, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 8,
10,-32768,-32768,-32768, 41,-32768, 53,-32768,-32768, -10, 9,-32768,-32768,-32768, 33,-32768, 53,-32768,-32768, -10,
-32768,-32768, -6,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768, -6,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768, 47, 0,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768, 45,-32768,-32768, 0, 11, 13,
-32768, 13, 12, 14,-32768, 15, 11, 16,-32768,-32768, -32768, 14,-32768,-32768, 47, 50, 51, 0,-32768,-32768,
52, 80, 81,-32768, 13,-32768,-32768,-32768,-32768,-32768, -32768,-32768, 18, 16,-32768,-32768, 0,-32768,-32768,-32768,
-32768, 85,-32768 83,-32768
}; };
static const short yypgoto[] = static const short yypgoto[] =
{ {
-32768,-32768,-32768, 54, -2, 83,-32768,-32768,-32768,-32768, -32768,-32768,-32768, 52, -2, 80,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768, 17,-32768,-32768, 18,-32768, -32768,-32768,-32768,-32768,-32768, 15,-32768,-32768, 10,-32768,
-32768,-32768,-32768,-32768, -25,-32768,-32768,-32768,-32768,-32768, -32768,-32768, -100,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-14 -32768,-32768, -14
}; };
#define YYLAST 94 #define YYLAST 99
static const short yytable[] = static const short yytable[] =
{ {
20, 93, 121, 97, 98, 99, 100, 15, 10, 16, 20, 93, 120, 98, 99, 100, 101, 111, 10, 16,
3, 4, 5, 34, 37, 23, 102, 103, 104, 105, 3, 4, 5, 34, 37, 23, 119, 43, 44, 9,
29, 84, 85, 86, 87, 88, 89, 90, 91, 92, 29, 84, 85, 86, 87, 88, 89, 90, 91, 92,
43, 44, 73, 42, 9, 10, 17, 94, 18, 21, 10, 15, 73, 42, 18, 17, 21, 94, 24, 32,
24, 101, 6, 17, 95, 27, 28, 38, 47, 39, 47, 102, 6, 17, 95, 27, 28, 38, 96, 39,
96, 32, 35, 113, 74, 117, 76, 110, 75, 111, 108, 35, 74, 109, 110, 76, 104, 75, 105, 106,
112, 80, 114, 83, 50, 51, 52, 53, 54, 55, 115, 80, 116, 83, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
66, 67, 68, 118, 119, 122, 36, 109, 13, 120, 66, 67, 68, 121, 36, 13, 81, 0, 0, 78,
0, 78, 0, 116, 81 0, 0, 0, 114, 0, 0, 0, 0, 0, 118
}; };
static const short yycheck[] = static const short yycheck[] =
{ {
14, 7, 0, 3, 4, 5, 6, 43, 7, 10, 14, 7, 0, 3, 4, 5, 6, 107, 7, 10,
8, 9, 10, 27, 7, 17, 3, 4, 5, 6, 8, 9, 10, 27, 7, 17, 116, 47, 48, 7,
22, 31, 32, 33, 34, 35, 36, 37, 38, 39, 22, 31, 32, 33, 34, 35, 36, 37, 38, 39,
47, 48, 46, 35, 7, 7, 44, 43, 47, 7, 7, 43, 46, 35, 47, 44, 7, 43, 7, 46,
7, 41, 40, 44, 50, 41, 45, 40, 7, 42, 7, 41, 40, 44, 50, 41, 45, 40, 3, 42,
3, 46, 46, 42, 46, 3, 46, 45, 49, 45, 3, 46, 46, 3, 3, 46, 45, 49, 45, 45,
45, 75, 46, 77, 11, 12, 13, 14, 15, 16, 42, 75, 46, 77, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 3, 3, 0, 32, 101, 5, 114, 27, 28, 29, 0, 32, 5, 76, -1, -1, 74,
-1, 74, -1, 107, 76 -1, -1, -1, 107, -1, -1, -1, -1, -1, 113
}; };
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/share/bison/bison.simple" #line 3 "/usr/share/bison/bison.simple"
@ -1044,7 +1042,7 @@ yyreduce:
switch (yyn) { switch (yyn) {
case 5: case 5:
#line 102 "dcParser.yxx" #line 105 "dcParser.yxx"
{ {
current_class = new DCClass(yyvsp[0].str); current_class = new DCClass(yyvsp[0].str);
if (!dc_file->add_class(current_class)) { if (!dc_file->add_class(current_class)) {
@ -1058,7 +1056,7 @@ case 5:
} }
break; break;
case 7: case 7:
#line 118 "dcParser.yxx" #line 121 "dcParser.yxx"
{ {
DCFile::ClassesByName::const_iterator ni; DCFile::ClassesByName::const_iterator ni;
ni = dc_file->_classes_by_name.find(yyvsp[0].str); ni = dc_file->_classes_by_name.find(yyvsp[0].str);
@ -1071,49 +1069,49 @@ case 7:
} }
break; break;
case 9: case 9:
#line 133 "dcParser.yxx" #line 136 "dcParser.yxx"
{ {
yyval.str = yyvsp[-2].str + string("/") + yyvsp[0].str; yyval.str = yyvsp[-2].str + string("/") + yyvsp[0].str;
} }
break; break;
case 11: case 11:
#line 141 "dcParser.yxx" #line 144 "dcParser.yxx"
{ {
yyval.str = yyvsp[-2].str + string(".") + yyvsp[0].str; yyval.str = yyvsp[-2].str + string(".") + yyvsp[0].str;
} }
break; break;
case 12: case 12:
#line 148 "dcParser.yxx" #line 151 "dcParser.yxx"
{ {
dc_file->add_import_module(yyvsp[0].str); dc_file->add_import_module(yyvsp[0].str);
} }
break; break;
case 13: case 13:
#line 152 "dcParser.yxx" #line 155 "dcParser.yxx"
{ {
dc_file->add_import_module(yyvsp[-1].str); dc_file->add_import_module(yyvsp[-1].str);
} }
break; break;
case 16: case 16:
#line 161 "dcParser.yxx" #line 164 "dcParser.yxx"
{ {
dc_file->add_import_symbol("*"); dc_file->add_import_symbol("*");
} }
break; break;
case 17: case 17:
#line 168 "dcParser.yxx" #line 171 "dcParser.yxx"
{ {
dc_file->add_import_symbol(yyvsp[0].str); dc_file->add_import_symbol(yyvsp[0].str);
} }
break; break;
case 18: case 18:
#line 172 "dcParser.yxx" #line 175 "dcParser.yxx"
{ {
dc_file->add_import_symbol(yyvsp[0].str); dc_file->add_import_symbol(yyvsp[0].str);
} }
break; break;
case 21: case 21:
#line 184 "dcParser.yxx" #line 187 "dcParser.yxx"
{ {
if (yyvsp[0].u.dclass != (DCClass *)NULL) { if (yyvsp[0].u.dclass != (DCClass *)NULL) {
current_class->add_parent(yyvsp[0].u.dclass); current_class->add_parent(yyvsp[0].u.dclass);
@ -1121,7 +1119,7 @@ case 21:
} }
break; break;
case 22: case 22:
#line 190 "dcParser.yxx" #line 193 "dcParser.yxx"
{ {
if (yyvsp[0].u.dclass != (DCClass *)NULL) { if (yyvsp[0].u.dclass != (DCClass *)NULL) {
current_class->add_parent(yyvsp[0].u.dclass); current_class->add_parent(yyvsp[0].u.dclass);
@ -1129,7 +1127,7 @@ case 22:
} }
break; break;
case 27: case 27:
#line 206 "dcParser.yxx" #line 209 "dcParser.yxx"
{ {
current_atomic = new DCAtomicField(yyvsp[-1].str); current_atomic = new DCAtomicField(yyvsp[-1].str);
if (!current_class->add_field(current_atomic)) { if (!current_class->add_field(current_atomic)) {
@ -1138,7 +1136,7 @@ case 27:
} }
break; break;
case 29: case 29:
#line 217 "dcParser.yxx" #line 220 "dcParser.yxx"
{ {
DCField *field = current_class->get_field_by_name(yyvsp[0].str); DCField *field = current_class->get_field_by_name(yyvsp[0].str);
yyval.u.atomic = (DCAtomicField *)NULL; yyval.u.atomic = (DCAtomicField *)NULL;
@ -1153,307 +1151,281 @@ case 29:
} }
break; break;
case 34: case 34:
#line 243 "dcParser.yxx" #line 246 "dcParser.yxx"
{ {
atomic_element = DCAtomicField::ElementType(); atomic_element = DCAtomicField::ElementType(new DCSimpleType(yyvsp[0].u.subatomic));
atomic_element._type = yyvsp[0].u.subatomic;
} }
break; break;
case 35: case 35:
#line 248 "dcParser.yxx" #line 250 "dcParser.yxx"
{ {
current_atomic->_elements.push_back(atomic_element); current_atomic->_elements.push_back(atomic_element);
} }
break; break;
case 37: case 37:
#line 256 "dcParser.yxx" #line 258 "dcParser.yxx"
{ {
atomic_element._divisor = yyvsp[0].u.integer; if (atomic_element._type->as_simple_type() == NULL) {
yyerror("Invalid divisor on complex type");
} else {
atomic_element._type->as_simple_type()->set_divisor(yyvsp[0].u.integer);
}
} }
break; break;
case 38: case 38:
#line 260 "dcParser.yxx" #line 267 "dcParser.yxx"
{ {
atomic_element._name = yyvsp[0].str; atomic_element._name = yyvsp[0].str;
} }
break; break;
case 39: case 39:
#line 264 "dcParser.yxx" #line 271 "dcParser.yxx"
{ {
if (!atomic_element.set_default_value(yyvsp[0].u.integer)) { default_value_packer.begin(atomic_element._type);
yyerror("Invalid default value: " + yyvsp[0].str);
}
} }
break; break;
case 40: case 40:
#line 270 "dcParser.yxx" #line 275 "dcParser.yxx"
{ {
if (!atomic_element.set_default_value(yyvsp[0].u.real)) { if (!default_value_packer.end()) {
yyerror("Invalid default value: " + yyvsp[0].str); yyerror("Invalid default value for type");
} else {
atomic_element.set_default_value(default_value_packer.get_string());
} }
} }
break; break;
case 41: case 41:
#line 276 "dcParser.yxx" #line 287 "dcParser.yxx"
{ {
if (!atomic_element.set_default_value(yyvsp[0].str)) { default_value_packer.pack_value(yyvsp[0].u.integer);
yyerror("Invalid default value: \"" + yyvsp[0].str + "\"");
}
} }
break; break;
case 42: case 42:
#line 282 "dcParser.yxx" #line 291 "dcParser.yxx"
{ {
if (!atomic_element.set_default_value_literal(yyvsp[0].str)) { default_value_packer.pack_value(yyvsp[0].u.real);
yyerror("Invalid default hex string value");
}
} }
break; break;
case 43: case 43:
#line 288 "dcParser.yxx" #line 295 "dcParser.yxx"
{ {
if (!atomic_element.end_array()) { default_value_packer.pack_value(yyvsp[0].str);
yyerror("Array default value inappropriate");
} else {
atomic_element._has_default_value = true;
}
} }
break; break;
case 50: case 44:
#line 314 "dcParser.yxx" #line 299 "dcParser.yxx"
{ {
if (!atomic_element.add_default_value(yyvsp[0].u.integer)) { default_value_packer.pack_literal_value(yyvsp[0].str);
yyerror("Invalid default value: " + yyvsp[0].str);
}
} }
break; break;
case 51: case 45:
#line 320 "dcParser.yxx" #line 303 "dcParser.yxx"
{ {
if (!atomic_element.add_default_value(yyvsp[0].u.real)) { default_value_packer.push();
yyerror("Invalid default value: " + yyvsp[0].str);
}
} }
break; break;
case 52: case 46:
#line 326 "dcParser.yxx" #line 307 "dcParser.yxx"
{ {
if (!atomic_element.add_default_value(yyvsp[0].str)) { default_value_packer.pop();
yyerror("Invalid default value: " + yyvsp[0].str);
}
} }
break; break;
case 53: case 47:
#line 332 "dcParser.yxx" #line 311 "dcParser.yxx"
{
if (!atomic_element.add_default_value_literal(yyvsp[0].str)) {
yyerror("Invalid hex literal in default array");
}
}
break;
case 54:
#line 338 "dcParser.yxx"
{ {
for (int i = 0; i < yyvsp[0].u.integer; i++) { for (int i = 0; i < yyvsp[0].u.integer; i++) {
if (!atomic_element.add_default_value(yyvsp[-2].u.integer)) { default_value_packer.pack_value(yyvsp[-2].u.integer);
yyerror("Invalid default value: " + yyvsp[-2].str);
break;
}
} }
} }
break; break;
case 55: case 48:
#line 347 "dcParser.yxx" #line 317 "dcParser.yxx"
{ {
for (int i = 0; i < yyvsp[0].u.integer; i++) { for (int i = 0; i < yyvsp[0].u.integer; i++) {
if (!atomic_element.add_default_value(yyvsp[-2].u.real)) { default_value_packer.pack_value(yyvsp[-2].u.real);
yyerror("Invalid default value: " + yyvsp[-2].str); }
break; }
} break;
case 49:
#line 323 "dcParser.yxx"
{
for (int i = 0; i < yyvsp[0].u.integer; i++) {
default_value_packer.pack_literal_value(yyvsp[-2].str);
} }
} }
break; break;
case 56: case 56:
#line 356 "dcParser.yxx" #line 347 "dcParser.yxx"
{
for (int i = 0; i < yyvsp[0].u.integer; i++) {
if (!atomic_element.add_default_value_literal(yyvsp[-2].str)) {
yyerror("Invalid hex literal in default array");
break;
}
}
}
break;
case 57:
#line 368 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_int8; yyval.u.subatomic = ST_int8;
} }
break; break;
case 58: case 57:
#line 372 "dcParser.yxx" #line 351 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_int16; yyval.u.subatomic = ST_int16;
} }
break; break;
case 59: case 58:
#line 376 "dcParser.yxx" #line 355 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_int32; yyval.u.subatomic = ST_int32;
} }
break; break;
case 60: case 59:
#line 380 "dcParser.yxx" #line 359 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_int64; yyval.u.subatomic = ST_int64;
} }
break; break;
case 61: case 60:
#line 384 "dcParser.yxx" #line 363 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_uint8; yyval.u.subatomic = ST_uint8;
} }
break; break;
case 62: case 61:
#line 388 "dcParser.yxx" #line 367 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_uint16; yyval.u.subatomic = ST_uint16;
} }
break; break;
case 63: case 62:
#line 392 "dcParser.yxx" #line 371 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_uint32; yyval.u.subatomic = ST_uint32;
} }
break; break;
case 64: case 63:
#line 396 "dcParser.yxx" #line 375 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_uint64; yyval.u.subatomic = ST_uint64;
} }
break; break;
case 65: case 64:
#line 400 "dcParser.yxx" #line 379 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_float64; yyval.u.subatomic = ST_float64;
} }
break; break;
case 66: case 65:
#line 404 "dcParser.yxx" #line 383 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_string; yyval.u.subatomic = ST_string;
} }
break; break;
case 67: case 66:
#line 408 "dcParser.yxx" #line 387 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_blob; yyval.u.subatomic = ST_blob;
} }
break; break;
case 68: case 67:
#line 412 "dcParser.yxx" #line 391 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_blob32; yyval.u.subatomic = ST_blob32;
} }
break; break;
case 69: case 68:
#line 416 "dcParser.yxx" #line 395 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_int8array; yyval.u.subatomic = ST_int8array;
} }
break; break;
case 70: case 69:
#line 420 "dcParser.yxx" #line 399 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_int16array; yyval.u.subatomic = ST_int16array;
} }
break; break;
case 71: case 70:
#line 424 "dcParser.yxx" #line 403 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_int32array; yyval.u.subatomic = ST_int32array;
} }
break; break;
case 72: case 71:
#line 428 "dcParser.yxx" #line 407 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_uint8array; yyval.u.subatomic = ST_uint8array;
} }
break; break;
case 73: case 72:
#line 432 "dcParser.yxx" #line 411 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_uint16array; yyval.u.subatomic = ST_uint16array;
} }
break; break;
case 74: case 73:
#line 436 "dcParser.yxx" #line 415 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_uint32array; yyval.u.subatomic = ST_uint32array;
} }
break; break;
case 75: case 74:
#line 440 "dcParser.yxx" #line 419 "dcParser.yxx"
{ {
yyval.u.subatomic = ST_uint32uint8array; yyval.u.subatomic = ST_uint32uint8array;
} }
break; break;
case 77: case 76:
#line 448 "dcParser.yxx" #line 427 "dcParser.yxx"
{ {
current_atomic->_flags |= DCAtomicField::F_required; current_atomic->_flags |= DCAtomicField::F_required;
} }
break; break;
case 78: case 77:
#line 452 "dcParser.yxx" #line 431 "dcParser.yxx"
{ {
current_atomic->_flags |= DCAtomicField::F_broadcast; current_atomic->_flags |= DCAtomicField::F_broadcast;
} }
break; break;
case 79: case 78:
#line 456 "dcParser.yxx" #line 435 "dcParser.yxx"
{ {
current_atomic->_flags |= DCAtomicField::F_p2p; current_atomic->_flags |= DCAtomicField::F_p2p;
} }
break; break;
case 80: case 79:
#line 460 "dcParser.yxx" #line 439 "dcParser.yxx"
{ {
current_atomic->_flags |= DCAtomicField::F_ram; current_atomic->_flags |= DCAtomicField::F_ram;
} }
break; break;
case 81: case 80:
#line 464 "dcParser.yxx" #line 443 "dcParser.yxx"
{ {
current_atomic->_flags |= DCAtomicField::F_db; current_atomic->_flags |= DCAtomicField::F_db;
} }
break; break;
case 82: case 81:
#line 468 "dcParser.yxx" #line 447 "dcParser.yxx"
{ {
current_atomic->_flags |= DCAtomicField::F_clsend; current_atomic->_flags |= DCAtomicField::F_clsend;
} }
break; break;
case 83: case 82:
#line 472 "dcParser.yxx" #line 451 "dcParser.yxx"
{ {
current_atomic->_flags |= DCAtomicField::F_clrecv; current_atomic->_flags |= DCAtomicField::F_clrecv;
} }
break; break;
case 84: case 83:
#line 476 "dcParser.yxx" #line 455 "dcParser.yxx"
{ {
current_atomic->_flags |= DCAtomicField::F_ownsend; current_atomic->_flags |= DCAtomicField::F_ownsend;
} }
break; break;
case 85: case 84:
#line 480 "dcParser.yxx" #line 459 "dcParser.yxx"
{ {
current_atomic->_flags |= DCAtomicField::F_airecv; current_atomic->_flags |= DCAtomicField::F_airecv;
} }
break; break;
case 86: case 85:
#line 487 "dcParser.yxx" #line 466 "dcParser.yxx"
{ {
current_molecular = new DCMolecularField(yyvsp[-1].str); current_molecular = new DCMolecularField(yyvsp[-1].str);
if (!current_class->add_field(current_molecular)) { if (!current_class->add_field(current_molecular)) {
@ -1461,16 +1433,16 @@ case 86:
} }
} }
break; break;
case 88: case 87:
#line 498 "dcParser.yxx" #line 477 "dcParser.yxx"
{ {
if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) { if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
current_molecular->_fields.push_back(yyvsp[0].u.atomic); current_molecular->_fields.push_back(yyvsp[0].u.atomic);
} }
} }
break; break;
case 89: case 88:
#line 504 "dcParser.yxx" #line 483 "dcParser.yxx"
{ {
if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) { if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
current_molecular->_fields.push_back(yyvsp[0].u.atomic); current_molecular->_fields.push_back(yyvsp[0].u.atomic);
@ -1715,4 +1687,4 @@ yyreturn:
#endif #endif
return yyresult; return yyresult;
} }
#line 518 "dcParser.yxx" #line 497 "dcParser.yxx"