open_toontown_panda3d/direct/src/dcparser/dcParser.cxx.prebuilt

2710 lines
78 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* A Bison parser, made from dcParser.yxx
by GNU bison 1.35. */
#define YYBISON 1 /* Identify Bison output. */
#define yyparse dcyyparse
#define yylex dcyylex
#define yyerror dcyyerror
#define yylval dcyylval
#define yychar dcyychar
#define yydebug dcyydebug
#define yynerrs dcyynerrs
# define UNSIGNED_INTEGER 257
# define SIGNED_INTEGER 258
# define REAL 259
# define STRING 260
# define HEX_STRING 261
# define IDENTIFIER 262
# define KW_DCLASS 263
# define KW_STRUCT 264
# define KW_FROM 265
# define KW_IMPORT 266
# define KW_TYPEDEF 267
# define KW_SWITCH 268
# define KW_CASE 269
# define KW_DEFAULT 270
# define KW_BREAK 271
# define KW_INT8 272
# define KW_INT16 273
# define KW_INT32 274
# define KW_INT64 275
# define KW_UINT8 276
# define KW_UINT16 277
# define KW_UINT32 278
# define KW_UINT64 279
# define KW_FLOAT64 280
# define KW_STRING 281
# define KW_BLOB 282
# define KW_BLOB32 283
# define KW_INT8ARRAY 284
# define KW_INT16ARRAY 285
# define KW_INT32ARRAY 286
# define KW_UINT8ARRAY 287
# define KW_UINT16ARRAY 288
# define KW_UINT32ARRAY 289
# define KW_UINT32UINT8ARRAY 290
# define KW_CHAR 291
# define KW_REQUIRED 292
# define KW_BROADCAST 293
# define KW_P2P 294
# define KW_RAM 295
# define KW_DB 296
# define KW_CLSEND 297
# define KW_CLRECV 298
# define KW_OWNSEND 299
# define KW_AIRECV 300
# define START_DC 301
# define START_PARAMETER_VALUE 302
# define START_PARAMETER_DESCRIPTION 303
#line 6 "dcParser.yxx"
#include "dcLexerDefs.h"
#include "dcParserDefs.h"
#include "dcFile.h"
#include "dcClass.h"
#include "dcSwitch.h"
#include "dcAtomicField.h"
#include "dcMolecularField.h"
#include "dcClassParameter.h"
#include "dcSwitchParameter.h"
#include "dcArrayParameter.h"
#include "dcSimpleParameter.h"
#include "dcTypedef.h"
#include "dcPacker.h"
#include "dcNumericRange.h"
// Because our token type contains objects of type string, which
// require correct copy construction (and not simply memcpying), we
// cannot use bison's built-in auto-stack-grow feature. As an easy
// solution, we ensure here that we have enough yacc stack to start
// with, and that it doesn't ever try to grow.
#define YYINITDEPTH 1000
#define YYMAXDEPTH 1000
static DCFile *dc_file = (DCFile *)NULL;
static DCClass *current_class = (DCClass *)NULL;
static DCSwitch *current_switch = (DCSwitch *)NULL;
static DCAtomicField *current_atomic = (DCAtomicField *)NULL;
static DCMolecularField *current_molecular = (DCMolecularField *)NULL;
static DCParameter *current_parameter = (DCParameter *)NULL;
static DCPacker default_packer;
static DCPacker *current_packer;
static DCDoubleRange double_range;
static DCUnsignedIntRange uint_range;
static DCField *parameter_description = (DCField *)NULL;
////////////////////////////////////////////////////////////////////
// Defining the interface to the parser.
////////////////////////////////////////////////////////////////////
void
dc_init_parser(istream &in, const string &filename, DCFile &file) {
dc_file = &file;
dc_init_lexer(in, filename);
}
void
dc_init_parser_parameter_value(istream &in, const string &filename,
DCPacker &packer) {
dc_file = NULL;
current_packer = &packer;
dc_init_lexer(in, filename);
dc_start_parameter_value();
}
void
dc_init_parser_parameter_description(istream &in, const string &filename,
DCFile *file) {
dc_file = file;
dc_init_lexer(in, filename);
parameter_description = NULL;
dc_start_parameter_description();
}
DCField *
dc_get_parameter_description() {
return parameter_description;
}
void
dc_cleanup_parser() {
dc_file = (DCFile *)NULL;
}
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#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] : 144)
/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
static const char yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 61, 2, 2,
58, 59, 53, 2, 54, 62, 52, 51, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 57, 50,
2, 60, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 63, 2, 64, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 55, 2, 56, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49
};
#if YYDEBUG
static const short yyprhs[] =
{
0, 0, 3, 6, 9, 11, 14, 17, 20, 23,
26, 28, 32, 34, 38, 41, 42, 48, 50, 52,
54, 58, 61, 63, 65, 66, 74, 76, 78, 81,
83, 87, 89, 92, 95, 98, 101, 105, 108, 109,
117, 119, 121, 124, 126, 130, 132, 135, 138, 141,
144, 148, 151, 152, 158, 160, 162, 164, 168, 170,
171, 175, 177, 179, 180, 185, 187, 188, 193, 195,
197, 199, 201, 203, 205, 208, 211, 214, 216, 221,
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, 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, 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, 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,
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, 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, 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, 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, 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
#if YYDEBUG
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const short yyrline[] =
{
0, 175, 177, 178, 184, 186, 187, 198, 204, 205,
208, 210, 216, 218, 224, 229, 229, 236, 238, 244,
249, 255, 273, 275, 278, 278, 291, 314, 316, 319,
326, 339, 341, 342, 354, 365, 366, 374, 383, 383,
396, 419, 421, 424, 431, 439, 441, 442, 452, 460,
461, 465, 471, 471, 490, 492, 495, 497, 500, 509,
509, 520, 524, 526, 526, 554, 556, 556, 584, 586,
589, 591, 594, 599, 605, 610, 614, 620, 625, 634,
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, 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
#if (YYDEBUG) || defined YYERROR_VERBOSE
/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
static const char *const yytname[] =
{
"$", "error", "$undefined.", "UNSIGNED_INTEGER", "SIGNED_INTEGER", "REAL",
"STRING", "HEX_STRING", "IDENTIFIER", "KW_DCLASS", "KW_STRUCT",
"KW_FROM", "KW_IMPORT", "KW_TYPEDEF", "KW_SWITCH", "KW_CASE",
"KW_DEFAULT", "KW_BREAK", "KW_INT8", "KW_INT16", "KW_INT32", "KW_INT64",
"KW_UINT8", "KW_UINT16", "KW_UINT32", "KW_UINT64", "KW_FLOAT64",
"KW_STRING", "KW_BLOB", "KW_BLOB32", "KW_INT8ARRAY", "KW_INT16ARRAY",
"KW_INT32ARRAY", "KW_UINT8ARRAY", "KW_UINT16ARRAY", "KW_UINT32ARRAY",
"KW_UINT32UINT8ARRAY", "KW_CHAR", "KW_REQUIRED", "KW_BROADCAST",
"KW_P2P", "KW_RAM", "KW_DB", "KW_CLSEND", "KW_CLRECV", "KW_OWNSEND",
"KW_AIRECV", "START_DC", "START_PARAMETER_VALUE",
"START_PARAMETER_DESCRIPTION", "';'", "'/'", "'.'", "'*'", "','", "'{'",
"'}'", "':'", "'('", "')'", "'='", "'%'", "'-'", "'['", "']'",
"grammar", "dc", "slash_identifier", "import_identifier", "import",
"@1", "import_symbol_list_or_star", "import_symbol_list",
"typedef_decl", "dclass_or_struct", "dclass", "@2", "dclass_name",
"dclass_derivation", "dclass_base_list", "dclass_fields",
"dclass_field", "struct", "@3", "struct_name", "struct_derivation",
"struct_base_list", "struct_fields", "struct_field", "atomic_field",
"@4", "parameter_list", "nonempty_parameter_list", "atomic_element",
"named_parameter", "@5", "unnamed_parameter",
"named_parameter_with_default", "@6", "unnamed_parameter_with_default",
"@7", "parameter", "parameter_with_default", "parameter_or_atomic",
"parameter_description", "simple_type_name", "type_name",
"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", "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
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const short yyr1[] =
{
0, 65, 65, 65, 66, 66, 66, 66, 66, 66,
67, 67, 68, 68, 69, 70, 69, 71, 71, 72,
72, 73, 74, 74, 76, 75, 77, 78, 78, 79,
79, 80, 80, 80, 81, 81, 81, 81, 83, 82,
84, 85, 85, 86, 86, 87, 87, 87, 88, 88,
88, 88, 90, 89, 91, 91, 92, 92, 93, 95,
94, 96, 97, 98, 97, 99, 100, 99, 101, 101,
102, 102, 103, 103, 104, 104, 104, 105, 105, 105,
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, 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. */
static const short yyr2[] =
{
0, 2, 2, 2, 1, 2, 2, 2, 2, 2,
1, 3, 1, 3, 2, 0, 5, 1, 1, 1,
3, 2, 1, 1, 0, 7, 1, 1, 2, 1,
3, 1, 2, 2, 2, 2, 3, 2, 0, 7,
1, 1, 2, 1, 3, 1, 2, 2, 2, 2,
3, 2, 0, 5, 1, 1, 1, 3, 1, 0,
3, 1, 1, 0, 4, 1, 0, 4, 1, 1,
1, 1, 1, 1, 2, 2, 2, 1, 4, 3,
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, 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
};
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
doesn't specify something else to do. Zero means the default is an
error. */
static const short yydefact[] =
{
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[] =
{
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[] =
{
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,-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, -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 443
static const short yytable[] =
{
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, 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, 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"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* This is the parser code that is written into each bison parser when
the %semantic_parser declaration is not specified in the grammar.
It was written by Richard Stallman by simplifying the hairy parser
used when %semantic_parser is specified. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
There are some unavoidable exceptions within include files to
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
/* The parser invokes alloca or malloc; define the necessary symbols. */
# if YYSTACK_USE_ALLOCA
# define YYSTACK_ALLOC alloca
# else
# ifndef YYSTACK_USE_ALLOCA
# if defined (alloca) || defined (_ALLOCA_H)
# define YYSTACK_ALLOC alloca
# else
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
/* Pacify GCC's `empty if-body' warning. */
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# else
# if defined (__STDC__) || defined (__cplusplus)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# endif
# define YYSTACK_ALLOC malloc
# define YYSTACK_FREE free
# endif
#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
#if (! defined (yyoverflow) \
&& (! defined (__cplusplus) \
|| (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
short yyss;
YYSTYPE yyvs;
# if YYLSP_NEEDED
YYLTYPE yyls;
# endif
};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# if YYLSP_NEEDED
# define YYSTACK_BYTES(N) \
((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ 2 * YYSTACK_GAP_MAX)
# else
# define YYSTACK_BYTES(N) \
((N) * (sizeof (short) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAX)
# endif
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
# if 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
register YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
while (0)
# endif
# endif
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
# define YYSTACK_RELOCATE(Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)
#endif
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
#endif
#if ! defined (YYSIZE_T) && defined (size_t)
# define YYSIZE_T size_t
#endif
#if ! defined (YYSIZE_T)
# if defined (__STDC__) || defined (__cplusplus)
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# endif
#endif
#if ! defined (YYSIZE_T)
# define YYSIZE_T unsigned int
#endif
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(Token, Value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
{ \
yychar = (Token); \
yylval = (Value); \
yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ \
yyerror ("syntax error: cannot back up"); \
YYERROR; \
} \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
/* YYLLOC_DEFAULT -- Compute the default location (before the actions
are run).
When YYLLOC_DEFAULT is run, CURRENT is set the location of the
first token. By default, to implement support for ranges, extend
its range to the last symbol. */
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
Current.last_line = Rhs[N].last_line; \
Current.last_column = Rhs[N].last_column;
#endif
/* YYLEX -- calling `yylex' with the right arguments. */
#if YYPURE
# if YYLSP_NEEDED
# ifdef YYLEX_PARAM
# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
# else
# define YYLEX yylex (&yylval, &yylloc)
# endif
# else /* !YYLSP_NEEDED */
# ifdef YYLEX_PARAM
# define YYLEX yylex (&yylval, YYLEX_PARAM)
# else
# define YYLEX yylex (&yylval)
# endif
# endif /* !YYLSP_NEEDED */
#else /* !YYPURE */
# define YYLEX yylex ()
#endif /* !YYPURE */
/* Enable debugging if requested. */
#if YYDEBUG
# ifndef YYFPRINTF
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
# define YYFPRINTF fprintf
# endif
# define YYDPRINTF(Args) \
do { \
if (yydebug) \
YYFPRINTF Args; \
} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
#endif /* !YYDEBUG */
/* YYINITDEPTH -- initial size of the parser's stacks. */
#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
if the built-in stack extension method is used).
Do not make this value too large; the results are undefined if
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */
#if YYMAXDEPTH == 0
# undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif
#ifdef YYERROR_VERBOSE
# ifndef yystrlen
# if defined (__GLIBC__) && defined (_STRING_H)
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
static YYSIZE_T
# if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
# else
yystrlen (yystr)
const char *yystr;
# endif
{
register const char *yys = yystr;
while (*yys++ != '\0')
continue;
return yys - yystr - 1;
}
# endif
# endif
# ifndef yystpcpy
# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
static char *
# if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
# else
yystpcpy (yydest, yysrc)
char *yydest;
const char *yysrc;
# endif
{
register char *yyd = yydest;
register const char *yys = yysrc;
while ((*yyd++ = *yys++) != '\0')
continue;
return yyd - 1;
}
# endif
# endif
#endif
#line 315 "/usr/share/bison/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
It should actually point to an object.
Grammar actions can access the variable by casting it
to the proper pointer type. */
#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
# define YYPARSE_PARAM_DECL
# else
# define YYPARSE_PARAM_ARG YYPARSE_PARAM
# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
# endif
#else /* !YYPARSE_PARAM */
# define YYPARSE_PARAM_ARG
# define YYPARSE_PARAM_DECL
#endif /* !YYPARSE_PARAM */
/* Prevent warning if -Wstrict-prototypes. */
#ifdef __GNUC__
# ifdef YYPARSE_PARAM
int yyparse (void *);
# else
int yyparse (void);
# endif
#endif
/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
variables are global, or local to YYPARSE. */
#define YY_DECL_NON_LSP_VARIABLES \
/* The lookahead symbol. */ \
int yychar; \
\
/* The semantic value of the lookahead symbol. */ \
YYSTYPE yylval; \
\
/* Number of parse errors so far. */ \
int yynerrs;
#if YYLSP_NEEDED
# define YY_DECL_VARIABLES \
YY_DECL_NON_LSP_VARIABLES \
\
/* Location data for the lookahead symbol. */ \
YYLTYPE yylloc;
#else
# define YY_DECL_VARIABLES \
YY_DECL_NON_LSP_VARIABLES
#endif
/* If nonreentrant, generate the variables here. */
#if !YYPURE
YY_DECL_VARIABLES
#endif /* !YYPURE */
int
yyparse (YYPARSE_PARAM_ARG)
YYPARSE_PARAM_DECL
{
/* If reentrant, generate the variables here. */
#if YYPURE
YY_DECL_VARIABLES
#endif /* !YYPURE */
register int yystate;
register int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
/* Lookahead token as an internal (translated) token number. */
int yychar1 = 0;
/* Three stacks and their tools:
`yyss': related to states,
`yyvs': related to semantic values,
`yyls': related to locations.
Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
short yyssa[YYINITDEPTH];
short *yyss = yyssa;
register short *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
register YYSTYPE *yyvsp;
#if YYLSP_NEEDED
/* The location stack. */
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
#endif
#if YYLSP_NEEDED
# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
#else
# define YYPOPSTACK (yyvsp--, yyssp--)
#endif
YYSIZE_T yystacksize = YYINITDEPTH;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
#if YYLSP_NEEDED
YYLTYPE yyloc;
#endif
/* When reducing, the number of symbols on the RHS of the reduced
rule. */
int yylen;
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss;
yyvsp = yyvs;
#if YYLSP_NEEDED
yylsp = yyls;
#endif
goto yysetstate;
/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate. |
`------------------------------------------------------------*/
yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. so pushing a state here evens the stacks.
*/
yyssp++;
yysetstate:
*yyssp = yystate;
if (yyssp >= yyss + yystacksize - 1)
{
/* Get the current used size of the three stacks, in elements. */
YYSIZE_T yysize = yyssp - yyss + 1;
#ifdef yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
YYSTYPE *yyvs1 = yyvs;
short *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. */
# if YYLSP_NEEDED
YYLTYPE *yyls1 = yyls;
/* This used to be a conditional around just the two extra args,
but that might be undefined if yyoverflow is a macro. */
yyoverflow ("parser stack overflow",
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yyls1, yysize * sizeof (*yylsp),
&yystacksize);
yyls = yyls1;
# else
yyoverflow ("parser stack overflow",
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
# endif
yyss = yyss1;
yyvs = yyvs1;
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
goto yyoverflowlab;
# else
/* Extend the stack our own way. */
if (yystacksize >= YYMAXDEPTH)
goto yyoverflowlab;
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
{
short *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyoverflowlab;
YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs);
# if YYLSP_NEEDED
YYSTACK_RELOCATE (yyls);
# endif
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
#if YYLSP_NEEDED
yylsp = yyls + yysize - 1;
#endif
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
goto yybackup;
/*-----------.
| yybackup. |
`-----------*/
yybackup:
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
/* yyresume: */
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
/* yychar is either YYEMPTY or YYEOF
or a valid token in external form. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
yychar = YYLEX;
}
/* Convert token to internal form (in yychar1) for indexing tables with */
if (yychar <= 0) /* This means end of input. */
{
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more */
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
else
{
yychar1 = YYTRANSLATE (yychar);
#if YYDEBUG
/* We have to keep this `#if YYDEBUG', since we use variables
which are defined only if `YYDEBUG' is set. */
if (yydebug)
{
YYFPRINTF (stderr, "Next token is %d (%s",
yychar, yytname[yychar1]);
/* Give the individual parser a way to print the precise
meaning of a token, for further debugging info. */
# ifdef YYPRINT
YYPRINT (stderr, yychar, yylval);
# endif
YYFPRINTF (stderr, ")\n");
}
#endif
}
yyn += yychar1;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
goto yydefault;
yyn = yytable[yyn];
/* yyn is what to do for this token type in this state.
Negative => reduce, -yyn is rule number.
Positive => shift, yyn is new state.
New state is final state => don't bother to shift,
just return success.
0, or most negative number => error. */
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
YYDPRINTF ((stderr, "Shifting token %d (%s), ",
yychar, yytname[yychar1]));
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
#if YYLSP_NEEDED
*++yylsp = yylloc;
#endif
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
yystate = yyn;
goto yynewstate;
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
goto yyreduce;
/*-----------------------------.
| yyreduce -- Do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
`$$ = $1'.
Otherwise, the following line sets YYVAL to the semantic value of
the lookahead token. This behavior is undocumented and Bison
users should not rely upon it. Assigning to YYVAL
unconditionally makes the parser a bit smaller, and it avoids a
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
#if YYLSP_NEEDED
/* Similarly for the default location. Let the user run additional
commands if for instance locations are ranges. */
yyloc = yylsp[1-yylen];
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
#endif
#if YYDEBUG
/* We have to keep this `#if YYDEBUG', since we use variables which
are defined only if `YYDEBUG' is set. */
if (yydebug)
{
int yyi;
YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
yyn, yyrline[yyn]);
/* Print the symbols being reduced, and their result. */
for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
}
#endif
switch (yyn) {
case 3:
#line 179 "dcParser.yxx"
{
parameter_description = yyvsp[0].u.field;
}
break;
case 6:
#line 188 "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());
if (old_class != (DCClass *)NULL && old_class->is_bogus_class()) {
yyerror("Base class defined after its first reference: " + yyvsp[0].u.dclass->get_name());
} else {
yyerror("Duplicate class name: " + yyvsp[0].u.dclass->get_name());
}
}
}
break;
case 7:
#line 199 "dcParser.yxx"
{
if (!dc_file->add_switch(yyvsp[0].u.dswitch)) {
yyerror("Duplicate class name: " + yyvsp[0].u.dswitch->get_name());
}
}
break;
case 11:
#line 211 "dcParser.yxx"
{
yyval.str = yyvsp[-2].str + string("/") + yyvsp[0].str;
}
break;
case 13:
#line 219 "dcParser.yxx"
{
yyval.str = yyvsp[-2].str + string(".") + yyvsp[0].str;
}
break;
case 14:
#line 226 "dcParser.yxx"
{
dc_file->add_import_module(yyvsp[0].str);
}
break;
case 15:
#line 230 "dcParser.yxx"
{
dc_file->add_import_module(yyvsp[-1].str);
}
break;
case 18:
#line 239 "dcParser.yxx"
{
dc_file->add_import_symbol("*");
}
break;
case 19:
#line 246 "dcParser.yxx"
{
dc_file->add_import_symbol(yyvsp[0].str);
}
break;
case 20:
#line 250 "dcParser.yxx"
{
dc_file->add_import_symbol(yyvsp[0].str);
}
break;
case 21:
#line 257 "dcParser.yxx"
{
if (yyvsp[0].u.parameter != (DCParameter *)NULL) {
DCTypedef *dtypedef = new DCTypedef(yyvsp[0].u.parameter);
if (!dc_file->add_typedef(dtypedef)) {
DCTypedef *old_typedef = dc_file->get_typedef_by_name(dtypedef->get_name());
if (old_typedef->is_bogus_typedef()) {
yyerror("typedef defined after its first reference: " + dtypedef->get_name());
} else {
yyerror("Duplicate typedef name: " + dtypedef->get_name());
}
}
}
}
break;
case 24:
#line 280 "dcParser.yxx"
{
yyval.u.dclass = current_class;
current_class = new DCClass(dc_file, yyvsp[0].str, false, false);
}
break;
case 25:
#line 285 "dcParser.yxx"
{
yyval.u.dclass = current_class;
current_class = yyvsp[-4].u.dclass;
}
break;
case 26:
#line 293 "dcParser.yxx"
{
if (dc_file == (DCFile *)NULL) {
yyerror("No DCFile available, so no class names are predefined.");
yyval.u.dclass = NULL;
} else {
DCClass *dclass = dc_file->get_class_by_name(yyvsp[0].str);
if (dclass == (DCClass *)NULL) {
// Create a bogus class as a forward reference.
dclass = new DCClass(dc_file, yyvsp[0].str, false, true);
dc_file->add_class(dclass);
}
if (dclass->is_struct()) {
yyerror("struct name not allowed");
}
yyval.u.dclass = dclass;
}
}
break;
case 29:
#line 321 "dcParser.yxx"
{
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
current_class->add_parent(yyvsp[0].u.dclass);
}
}
break;
case 30:
#line 327 "dcParser.yxx"
{
if (!dc_multiple_inheritance) {
yyerror("Multiple inheritance is not supported without \"dc-multiple-inheritance 1\" in your Config.prc file.");
} else {
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
current_class->add_parent(yyvsp[0].u.dclass);
}
}
}
break;
case 33:
#line 343 "dcParser.yxx"
{
if (yyvsp[0].u.field == (DCField *)NULL) {
// Pass this error up.
} else if (!current_class->add_field(yyvsp[0].u.field)) {
yyerror("Duplicate field name: " + yyvsp[0].u.field->get_name());
} else if (yyvsp[0].u.field->get_number() < 0) {
yyerror("A non-network field cannot be stored on a dclass");
}
}
break;
case 34:
#line 356 "dcParser.yxx"
{
if (yyvsp[-1].u.field != (DCField *)NULL) {
if (yyvsp[-1].u.field->get_name().empty()) {
yyerror("Field name required.");
}
yyvsp[-1].u.field->set_flags(yyvsp[0].u.s_int);
}
yyval.u.field = yyvsp[-1].u.field;
}
break;
case 36:
#line 367 "dcParser.yxx"
{
yyerror("Unnamed parameters are not allowed on a dclass");
if (yyvsp[-2].u.parameter != (DCField *)NULL) {
yyvsp[-2].u.parameter->set_flags(yyvsp[-1].u.s_int);
}
yyval.u.field = yyvsp[-2].u.parameter;
}
break;
case 37:
#line 375 "dcParser.yxx"
{
if (yyvsp[-1].u.parameter != (DCField *)NULL) {
yyvsp[-1].u.parameter->set_flags(yyvsp[0].u.s_int);
}
yyval.u.field = yyvsp[-1].u.parameter;
}
break;
case 38:
#line 385 "dcParser.yxx"
{
yyval.u.dclass = current_class;
current_class = new DCClass(dc_file, yyvsp[0].str, true, false);
}
break;
case 39:
#line 390 "dcParser.yxx"
{
yyval.u.dclass = current_class;
current_class = yyvsp[-4].u.dclass;
}
break;
case 40:
#line 398 "dcParser.yxx"
{
if (dc_file == (DCFile *)NULL) {
yyerror("No DCFile available, so no struct names are predefined.");
yyval.u.dclass = NULL;
} else {
DCClass *dstruct = dc_file->get_class_by_name(yyvsp[0].str);
if (dstruct == (DCClass *)NULL) {
// Create a bogus class as a forward reference.
dstruct = new DCClass(dc_file, yyvsp[0].str, false, true);
dc_file->add_class(dstruct);
}
if (!dstruct->is_struct()) {
yyerror("struct name required");
}
yyval.u.dclass = dstruct;
}
}
break;
case 43:
#line 426 "dcParser.yxx"
{
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
current_class->add_parent(yyvsp[0].u.dclass);
}
}
break;
case 44:
#line 432 "dcParser.yxx"
{
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
current_class->add_parent(yyvsp[0].u.dclass);
}
}
break;
case 47:
#line 443 "dcParser.yxx"
{
if (yyvsp[0].u.field == (DCField *)NULL) {
// Pass this error up.
} else if (!current_class->add_field(yyvsp[0].u.field)) {
yyerror("Duplicate field name: " + yyvsp[0].u.field->get_name());
}
}
break;
case 48:
#line 454 "dcParser.yxx"
{
if (yyvsp[-1].u.field->get_name().empty()) {
yyerror("Field name required.");
}
yyval.u.field = yyvsp[-1].u.field;
}
break;
case 50:
#line 462 "dcParser.yxx"
{
yyval.u.field = yyvsp[-2].u.parameter;
}
break;
case 51:
#line 466 "dcParser.yxx"
{
yyval.u.field = yyvsp[-1].u.parameter;
}
break;
case 52:
#line 473 "dcParser.yxx"
{
yyval.u.field = current_atomic;
if (current_class == (DCClass *)NULL) {
yyerror("Cannot define a method outside of a struct or class.");
DCClass *temp_class = new DCClass(dc_file, "temp", false, false); // memory leak.
current_atomic = new DCAtomicField(yyvsp[-1].str, temp_class);
} else {
current_atomic = new DCAtomicField(yyvsp[-1].str, current_class);
}
}
break;
case 53:
#line 484 "dcParser.yxx"
{
yyval.u.field = current_atomic;
current_atomic = yyvsp[-2].u.atomic;
}
break;
case 58:
#line 502 "dcParser.yxx"
{
if (yyvsp[0].u.parameter != (DCParameter *)NULL) {
current_atomic->add_element(yyvsp[0].u.parameter);
}
}
break;
case 59:
#line 511 "dcParser.yxx"
{
current_parameter = yyvsp[0].u.parameter;
}
break;
case 60:
#line 515 "dcParser.yxx"
{
yyval.u.parameter = yyvsp[0].u.parameter;
}
break;
case 63:
#line 527 "dcParser.yxx"
{
current_packer = &default_packer;
current_packer->clear_data();
if (yyvsp[-1].u.parameter != (DCField *)NULL) {
current_packer->begin_pack(yyvsp[-1].u.parameter);
}
}
break;
case 64:
#line 535 "dcParser.yxx"
{
bool is_valid = false;
if (yyvsp[-3].u.parameter != (DCField *)NULL) {
is_valid = yyvsp[-3].u.parameter->is_valid();
}
if (current_packer->end_pack()) {
yyvsp[-3].u.parameter->set_default_value(current_packer->get_string());
} else {
if (is_valid) {
yyerror("Invalid default value for type");
}
// If the current parameter isn't valid, we don't mind a pack
// error (there's no way for us to validate the syntax). So we'll
// just ignore the default value in this case.
}
}
break;
case 66:
#line 557 "dcParser.yxx"
{
current_packer = &default_packer;
current_packer->clear_data();
if (yyvsp[-1].u.parameter != (DCField *)NULL) {
current_packer->begin_pack(yyvsp[-1].u.parameter);
}
}
break;
case 67:
#line 565 "dcParser.yxx"
{
bool is_valid = false;
if (yyvsp[-3].u.parameter != (DCField *)NULL) {
is_valid = yyvsp[-3].u.parameter->is_valid();
}
if (current_packer->end_pack()) {
yyvsp[-3].u.parameter->set_default_value(current_packer->get_string());
} else {
if (is_valid) {
yyerror("Invalid default value for type");
}
// If the current parameter isn't valid, we don't mind a pack
// error (there's no way for us to validate the syntax). So we'll
// just ignore the default value in this case.
}
}
break;
case 72:
#line 596 "dcParser.yxx"
{
yyval.u.field = yyvsp[0].u.parameter;
}
break;
case 73:
#line 600 "dcParser.yxx"
{
yyval.u.field = yyvsp[0].u.field;
}
break;
case 74:
#line 607 "dcParser.yxx"
{
yyval.u.field = yyvsp[-1].u.field;
}
break;
case 75:
#line 611 "dcParser.yxx"
{
yyval.u.field = yyvsp[-1].u.parameter;
}
break;
case 76:
#line 615 "dcParser.yxx"
{
yyval.u.field = yyvsp[-1].u.parameter;
}
break;
case 77:
#line 622 "dcParser.yxx"
{
yyval.u.parameter = new DCSimpleParameter(yyvsp[0].u.subatomic);
}
break;
case 78:
#line 626 "dcParser.yxx"
{
DCSimpleParameter *simple_param = yyvsp[-3].u.parameter->as_simple_parameter();
nassertr(simple_param != (DCSimpleParameter *)NULL, 0);
if (!simple_param->set_range(double_range)) {
yyerror("Inappropriate range for type");
}
yyval.u.parameter = simple_param;
}
break;
case 79:
#line 635 "dcParser.yxx"
{
DCSimpleParameter *simple_param = yyvsp[-2].u.parameter->as_simple_parameter();
nassertr(simple_param != (DCSimpleParameter *)NULL, 0);
if (!simple_param->is_numeric_type()) {
yyerror("A divisor is only valid on a numeric type.");
} else if (!simple_param->set_divisor(yyvsp[0].u.s_uint)) {
yyerror("Invalid divisor.");
} else if (simple_param->has_modulus() && !simple_param->set_modulus(simple_param->get_modulus())) {
// Changing the divisor may change the valid range for the modulus.
yyerror("Invalid modulus.");
}
yyval.u.parameter = simple_param;
}
break;
case 80:
#line 651 "dcParser.yxx"
{
DCSimpleParameter *simple_param = yyvsp[-2].u.parameter->as_simple_parameter();
nassertr(simple_param != (DCSimpleParameter *)NULL, 0);
if (!simple_param->is_numeric_type()) {
yyerror("A divisor is only valid on a numeric type.");
} else if (!simple_param->set_modulus(yyvsp[0].u.real)) {
yyerror("Invalid modulus.");
}
yyval.u.parameter = simple_param;
}
break;
case 82:
#line 667 "dcParser.yxx"
{
if (dc_file == (DCFile *)NULL) {
yyerror("Invalid type.");
yyval.u.parameter = NULL;
} else {
DCTypedef *dtypedef = dc_file->get_typedef_by_name(yyvsp[0].str);
if (dtypedef == (DCTypedef *)NULL) {
// Maybe it's a class name.
DCClass *dclass = dc_file->get_class_by_name(yyvsp[0].str);
if (dclass != (DCClass *)NULL) {
// Create an implicit typedef for this.
dtypedef = new DCTypedef(new DCClassParameter(dclass), true);
} else {
// Maybe it's a switch name.
DCSwitch *dswitch = dc_file->get_switch_by_name(yyvsp[0].str);
if (dswitch != (DCSwitch *)NULL) {
// This also gets an implicit typedef.
dtypedef = new DCTypedef(new DCSwitchParameter(dswitch), true);
} else {
// It's an undefined typedef. Create a bogus forward reference.
dtypedef = new DCTypedef(yyvsp[0].str);
}
}
dc_file->add_typedef(dtypedef);
}
yyval.u.parameter = dtypedef->make_new_parameter();
}
}
break;
case 83:
#line 699 "dcParser.yxx"
{
// This is an inline struct definition.
if (yyvsp[0].u.dclass == (DCClass *)NULL) {
yyval.u.parameter = NULL;
} else {
if (dc_file != (DCFile *)NULL) {
dc_file->add_thing_to_delete(yyvsp[0].u.dclass);
} else {
// This is a memory leak--this happens when we put an anonymous
// struct reference within the string passed to
// DCPackerInterface::check_match(). Maybe it doesn't really matter.
}
yyval.u.parameter = new DCClassParameter(yyvsp[0].u.dclass);
}
}
break;
case 84:
#line 715 "dcParser.yxx"
{
// This is an inline switch definition.
if (yyvsp[0].u.dswitch == (DCSwitch *)NULL) {
yyval.u.parameter = NULL;
} else {
if (dc_file != (DCFile *)NULL) {
dc_file->add_thing_to_delete(yyvsp[0].u.dswitch);
} else {
// This is a memory leak--this happens when we put an anonymous
// switch reference within the string passed to
// DCPackerInterface::check_match(). Maybe it doesn't really matter.
}
yyval.u.parameter = new DCSwitchParameter(yyvsp[0].u.dswitch);
}
}
break;
case 85:
#line 734 "dcParser.yxx"
{
double_range.clear();
}
break;
case 86:
#line 738 "dcParser.yxx"
{
double_range.clear();
if (!double_range.add_range(yyvsp[0].u.real, yyvsp[0].u.real)) {
yyerror("Overlapping range");
}
}
break;
case 87:
#line 745 "dcParser.yxx"
{
double_range.clear();
if (!double_range.add_range(yyvsp[-2].u.real, yyvsp[0].u.real)) {
yyerror("Overlapping range");
}
}
break;
case 88:
#line 752 "dcParser.yxx"
{
double_range.clear();
if (yyvsp[0].u.real >= 0) {
yyerror("Syntax error");
} else if (!double_range.add_range(yyvsp[-1].u.real, -yyvsp[0].u.real)) {
yyerror("Overlapping range");
}
}
break;
case 89:
#line 761 "dcParser.yxx"
{
if (!double_range.add_range(yyvsp[0].u.real, yyvsp[0].u.real)) {
yyerror("Overlapping range");
}
}
break;
case 90:
#line 767 "dcParser.yxx"
{
if (!double_range.add_range(yyvsp[-2].u.real, yyvsp[0].u.real)) {
yyerror("Overlapping range");
}
}
break;
case 91:
#line 773 "dcParser.yxx"
{
if (yyvsp[0].u.real >= 0) {
yyerror("Syntax error");
} else if (!double_range.add_range(yyvsp[-1].u.real, -yyvsp[0].u.real)) {
yyerror("Overlapping range");
}
}
break;
case 92:
#line 784 "dcParser.yxx"
{
uint_range.clear();
}
break;
case 93:
#line 788 "dcParser.yxx"
{
uint_range.clear();
if (!uint_range.add_range(yyvsp[0].u.s_uint, yyvsp[0].u.s_uint)) {
yyerror("Overlapping range");
}
}
break;
case 94:
#line 795 "dcParser.yxx"
{
uint_range.clear();
if (!uint_range.add_range(yyvsp[-2].u.s_uint, yyvsp[0].u.s_uint)) {
yyerror("Overlapping range");
}
}
break;
case 95:
#line 802 "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 96:
#line 809 "dcParser.yxx"
{
if (!uint_range.add_range(yyvsp[0].u.s_uint, yyvsp[0].u.s_uint)) {
yyerror("Overlapping range");
}
}
break;
case 97:
#line 815 "dcParser.yxx"
{
if (!uint_range.add_range(yyvsp[-2].u.s_uint, yyvsp[0].u.s_uint)) {
yyerror("Overlapping range");
}
}
break;
case 98:
#line 821 "dcParser.yxx"
{
if (!uint_range.add_range(yyvsp[-1].u.s_uint, yyvsp[0].u.s_uint)) {
yyerror("Overlapping range");
}
}
break;
case 100:
#line 831 "dcParser.yxx"
{
if (yyvsp[-3].u.parameter == (DCParameter *)NULL) {
yyval.u.parameter = NULL;
} else {
yyval.u.parameter = yyvsp[-3].u.parameter->append_array_specification(uint_range);
}
}
break;
case 101:
#line 842 "dcParser.yxx"
{
current_parameter->set_name(yyvsp[0].str);
yyval.u.parameter = current_parameter;
}
break;
case 102:
#line 847 "dcParser.yxx"
{
DCSimpleParameter *simple_param = yyvsp[-2].u.parameter->as_simple_parameter();
if (simple_param == NULL || simple_param->get_typedef() != (DCTypedef *)NULL) {
yyerror("A divisor is only allowed on a primitive type.");
} else if (!simple_param->is_numeric_type()) {
yyerror("A divisor is only valid on a numeric type.");
} else {
if (!simple_param->set_divisor(yyvsp[0].u.s_uint)) {
yyerror("Invalid divisor.");
}
}
}
break;
case 103:
#line 862 "dcParser.yxx"
{
DCSimpleParameter *simple_param = yyvsp[-2].u.parameter->as_simple_parameter();
if (simple_param == NULL || simple_param->get_typedef() != (DCTypedef *)NULL) {
yyerror("A modulus is only allowed on a primitive type.");
} else if (!simple_param->is_numeric_type()) {
yyerror("A modulus is only valid on a numeric type.");
} else {
if (!simple_param->set_modulus(yyvsp[0].u.real)) {
yyerror("Invalid modulus.");
}
}
}
break;
case 104:
#line 877 "dcParser.yxx"
{
yyval.u.parameter = yyvsp[-3].u.parameter->append_array_specification(uint_range);
}
break;
case 105:
#line 884 "dcParser.yxx"
{
if (yyvsp[0].str.length() != 1) {
yyerror("Single character required.");
yyval.u.s_uint = 0;
} else {
yyval.u.s_uint = (unsigned char)yyvsp[0].str[0];
}
}
break;
case 107:
#line 897 "dcParser.yxx"
{
yyval.u.s_uint = (unsigned int)yyvsp[0].u.uint64;
if (yyval.u.s_uint != yyvsp[0].u.uint64) {
yyerror("Number out of range.");
yyval.u.s_uint = 1;
}
}
break;
case 108:
#line 908 "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 111:
#line 930 "dcParser.yxx"
{
yyval.u.real = (double)yyvsp[0].u.uint64;
}
break;
case 112:
#line 934 "dcParser.yxx"
{
yyval.u.real = (double)yyvsp[0].u.int64;
}
break;
case 114:
#line 942 "dcParser.yxx"
{
if (yyvsp[0].str.length() != 1) {
yyerror("Single character required.");
yyval.u.real = 0;
} else {
yyval.u.real = (double)(unsigned char)yyvsp[0].str[0];
}
}
break;
case 116:
#line 956 "dcParser.yxx"
{
yyval = yyvsp[0];
}
break;
case 117:
#line 960 "dcParser.yxx"
{
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 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 122:
#line 988 "dcParser.yxx"
{
current_packer->pack_string(yyvsp[0].str);
}
break;
case 123:
#line 992 "dcParser.yxx"
{
current_packer->pack_literal_value(yyvsp[0].str);
}
break;
case 124:
#line 996 "dcParser.yxx"
{
current_packer->push();
}
break;
case 125:
#line 1000 "dcParser.yxx"
{
current_packer->pop();
}
break;
case 126:
#line 1004 "dcParser.yxx"
{
current_packer->push();
}
break;
case 127:
#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 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 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 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 140:
#line 1062 "dcParser.yxx"
{
yyval.u.subatomic = ST_int8;
}
break;
case 141:
#line 1066 "dcParser.yxx"
{
yyval.u.subatomic = ST_int16;
}
break;
case 142:
#line 1070 "dcParser.yxx"
{
yyval.u.subatomic = ST_int32;
}
break;
case 143:
#line 1074 "dcParser.yxx"
{
yyval.u.subatomic = ST_int64;
}
break;
case 144:
#line 1078 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint8;
}
break;
case 145:
#line 1082 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint16;
}
break;
case 146:
#line 1086 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint32;
}
break;
case 147:
#line 1090 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint64;
}
break;
case 148:
#line 1094 "dcParser.yxx"
{
yyval.u.subatomic = ST_float64;
}
break;
case 149:
#line 1098 "dcParser.yxx"
{
yyval.u.subatomic = ST_string;
}
break;
case 150:
#line 1102 "dcParser.yxx"
{
yyval.u.subatomic = ST_blob;
}
break;
case 151:
#line 1106 "dcParser.yxx"
{
yyval.u.subatomic = ST_blob32;
}
break;
case 152:
#line 1110 "dcParser.yxx"
{
yyval.u.subatomic = ST_int8array;
}
break;
case 153:
#line 1114 "dcParser.yxx"
{
yyval.u.subatomic = ST_int16array;
}
break;
case 154:
#line 1118 "dcParser.yxx"
{
yyval.u.subatomic = ST_int32array;
}
break;
case 155:
#line 1122 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint8array;
}
break;
case 156:
#line 1126 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint16array;
}
break;
case 157:
#line 1130 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint32array;
}
break;
case 158:
#line 1134 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint32uint8array;
}
break;
case 159:
#line 1138 "dcParser.yxx"
{
yyval.u.subatomic = ST_char;
}
break;
case 160:
#line 1145 "dcParser.yxx"
{
yyval.u.s_int = 0;
}
break;
case 161:
#line 1149 "dcParser.yxx"
{
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_required;
}
break;
case 162:
#line 1153 "dcParser.yxx"
{
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_broadcast;
}
break;
case 163:
#line 1157 "dcParser.yxx"
{
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_p2p;
}
break;
case 164:
#line 1161 "dcParser.yxx"
{
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_ram;
}
break;
case 165:
#line 1165 "dcParser.yxx"
{
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_db;
}
break;
case 166:
#line 1169 "dcParser.yxx"
{
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_clsend;
}
break;
case 167:
#line 1173 "dcParser.yxx"
{
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_clrecv;
}
break;
case 168:
#line 1177 "dcParser.yxx"
{
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_ownsend;
}
break;
case 169:
#line 1181 "dcParser.yxx"
{
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_airecv;
}
break;
case 170:
#line 1188 "dcParser.yxx"
{
if (yyvsp[0].u.s_int != 0) {
yyerror("Server flags are not allowed here.");
}
yyval.u.s_int = yyvsp[0].u.s_int;
}
break;
case 171:
#line 1198 "dcParser.yxx"
{
current_molecular = new DCMolecularField(yyvsp[-1].str, current_class);
}
break;
case 172:
#line 1202 "dcParser.yxx"
{
yyval.u.field = current_molecular;
}
break;
case 173:
#line 1209 "dcParser.yxx"
{
DCField *field = current_class->get_field_by_name(yyvsp[0].str);
yyval.u.atomic = (DCAtomicField *)NULL;
if (field == (DCField *)NULL) {
yyerror("Unknown field: " + yyvsp[0].str);
} else {
yyval.u.atomic = field->as_atomic_field();
if (yyval.u.atomic == (DCAtomicField *)NULL) {
yyerror("Not an atomic field: " + yyvsp[0].str);
}
}
}
break;
case 174:
#line 1225 "dcParser.yxx"
{
if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
current_molecular->add_atomic(yyvsp[0].u.atomic);
}
}
break;
case 175:
#line 1231 "dcParser.yxx"
{
if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
current_molecular->add_atomic(yyvsp[0].u.atomic);
if (!current_molecular->compare_flags(*yyvsp[0].u.atomic)) {
yyerror("Mismatched flags in molecule between " +
current_molecular->get_atomic(0)->get_name() + " and " +
yyvsp[0].u.atomic->get_name());
}
}
}
break;
case 176:
#line 1245 "dcParser.yxx"
{
yyval.str = "";
}
break;
case 178:
#line 1253 "dcParser.yxx"
{
yyval.u.dswitch = current_switch;
current_switch = new DCSwitch(yyvsp[-4].str, yyvsp[-2].u.field);
}
break;
case 179:
#line 1258 "dcParser.yxx"
{
yyval.u.dswitch = current_switch;
current_switch = (DCSwitch *)yyvsp[-2].u.parameter;
}
break;
case 185:
#line 1272 "dcParser.yxx"
{
if (!current_switch->is_field_valid()) {
yyerror("case declaration required before first element");
} else if (yyvsp[0].u.field != (DCField *)NULL) {
if (!current_switch->add_field(yyvsp[0].u.field)) {
yyerror("Duplicate field name: " + yyvsp[0].u.field->get_name());
}
}
}
break;
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 187:
#line 1291 "dcParser.yxx"
{
if (!current_packer->end_pack()) {
yyerror("Invalid value for switch parameter");
current_switch->add_invalid_case();
} else {
int case_index = current_switch->add_case(current_packer->get_string());
if (case_index == -1) {
yyerror("Duplicate case value");
}
}
}
break;
case 188:
#line 1306 "dcParser.yxx"
{
if (!current_switch->add_default()) {
yyerror("Default case already defined");
}
}
break;
case 189:
#line 1315 "dcParser.yxx"
{
current_switch->add_break();
}
break;
case 190:
#line 1322 "dcParser.yxx"
{
yyval.u.field = yyvsp[-1].u.parameter;
}
break;
case 191:
#line 1326 "dcParser.yxx"
{
yyval.u.field = yyvsp[0].u.parameter;
}
break;
}
#line 705 "/usr/share/bison/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
#if YYLSP_NEEDED
yylsp -= yylen;
#endif
#if YYDEBUG
if (yydebug)
{
short *yyssp1 = yyss - 1;
YYFPRINTF (stderr, "state stack now");
while (yyssp1 != yyssp)
YYFPRINTF (stderr, " %d", *++yyssp1);
YYFPRINTF (stderr, "\n");
}
#endif
*++yyvsp = yyval;
#if YYLSP_NEEDED
*++yylsp = yyloc;
#endif
/* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
{
YYSIZE_T yysize = 0;
char *yymsg;
int yyx, yycount;
yycount = 0;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
for (yyx = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
if (yycheck[yyx + yyn] == yyx)
yysize += yystrlen (yytname[yyx]) + 15, yycount++;
yysize += yystrlen ("parse error, unexpected ") + 1;
yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
yymsg = (char *) YYSTACK_ALLOC (yysize);
if (yymsg != 0)
{
char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
if (yycount < 5)
{
yycount = 0;
for (yyx = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *));
yyx++)
if (yycheck[yyx + yyn] == yyx)
{
const char *yyq = ! yycount ? ", expecting " : " or ";
yyp = yystpcpy (yyp, yyq);
yyp = yystpcpy (yyp, yytname[yyx]);
yycount++;
}
}
yyerror (yymsg);
YYSTACK_FREE (yymsg);
}
else
yyerror ("parse error; also virtual memory exhausted");
}
else
#endif /* defined (YYERROR_VERBOSE) */
yyerror ("parse error");
}
goto yyerrlab1;
/*--------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action |
`--------------------------------------------------*/
yyerrlab1:
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
error, discard it. */
/* return failure if at end of input */
if (yychar == YYEOF)
YYABORT;
YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
yychar, yytname[yychar1]));
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token after shifting the error
token. */
yyerrstatus = 3; /* Each real token shifted decrements this */
goto yyerrhandle;
/*-------------------------------------------------------------------.
| yyerrdefault -- current state does not do anything special for the |
| error token. |
`-------------------------------------------------------------------*/
yyerrdefault:
#if 0
/* This is wrong; only states that explicitly want error tokens
should shift them. */
/* If its default is to accept any token, ok. Otherwise pop it. */
yyn = yydefact[yystate];
if (yyn)
goto yydefault;
#endif
/*---------------------------------------------------------------.
| yyerrpop -- pop the current state because it cannot handle the |
| error token |
`---------------------------------------------------------------*/
yyerrpop:
if (yyssp == yyss)
YYABORT;
yyvsp--;
yystate = *--yyssp;
#if YYLSP_NEEDED
yylsp--;
#endif
#if YYDEBUG
if (yydebug)
{
short *yyssp1 = yyss - 1;
YYFPRINTF (stderr, "Error: state stack now");
while (yyssp1 != yyssp)
YYFPRINTF (stderr, " %d", *++yyssp1);
YYFPRINTF (stderr, "\n");
}
#endif
/*--------------.
| yyerrhandle. |
`--------------*/
yyerrhandle:
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yyerrdefault;
yyn += YYTERROR;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
goto yyerrdefault;
yyn = yytable[yyn];
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrpop;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
YYDPRINTF ((stderr, "Shifting error token, "));
*++yyvsp = yylval;
#if YYLSP_NEEDED
*++yylsp = yylloc;
#endif
yystate = yyn;
goto yynewstate;
/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here. |
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
goto yyreturn;
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
goto yyreturn;
/*---------------------------------------------.
| yyoverflowab -- parser overflow comes here. |
`---------------------------------------------*/
yyoverflowlab:
yyerror ("parser stack overflow");
yyresult = 2;
/* Fall through. */
yyreturn:
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
return yyresult;
}
#line 1334 "dcParser.yxx"