2627 lines
76 KiB
Plaintext
2627 lines
76 KiB
Plaintext
/* 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_INT8 270
|
||
# define KW_INT16 271
|
||
# define KW_INT32 272
|
||
# define KW_INT64 273
|
||
# define KW_UINT8 274
|
||
# define KW_UINT16 275
|
||
# define KW_UINT32 276
|
||
# define KW_UINT64 277
|
||
# define KW_FLOAT64 278
|
||
# define KW_STRING 279
|
||
# define KW_BLOB 280
|
||
# define KW_BLOB32 281
|
||
# define KW_INT8ARRAY 282
|
||
# define KW_INT16ARRAY 283
|
||
# define KW_INT32ARRAY 284
|
||
# define KW_UINT8ARRAY 285
|
||
# define KW_UINT16ARRAY 286
|
||
# define KW_UINT32ARRAY 287
|
||
# define KW_UINT32UINT8ARRAY 288
|
||
# define KW_CHAR 289
|
||
# define KW_REQUIRED 290
|
||
# define KW_BROADCAST 291
|
||
# define KW_P2P 292
|
||
# define KW_RAM 293
|
||
# define KW_DB 294
|
||
# define KW_CLSEND 295
|
||
# define KW_CLRECV 296
|
||
# define KW_OWNSEND 297
|
||
# define KW_AIRECV 298
|
||
# define START_DC 299
|
||
# define START_PARAMETER_VALUE 300
|
||
# define START_PARAMETER_DESCRIPTION 301
|
||
|
||
#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 271
|
||
#define YYFLAG -32768
|
||
#define YYNTBASE 62
|
||
|
||
/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
|
||
#define YYTRANSLATE(x) ((unsigned)(x) <= 301 ? yytranslate[x] : 135)
|
||
|
||
/* 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, 2, 2, 2,
|
||
56, 57, 51, 2, 52, 59, 50, 49, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 55, 48,
|
||
2, 58, 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, 60, 2, 61, 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, 53, 2, 54, 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
|
||
};
|
||
|
||
#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, 204, 207, 210, 212, 217, 221, 228,
|
||
235, 237, 239, 241, 243, 245, 249, 252, 256, 262,
|
||
267, 269, 271, 275, 278, 282, 288, 293, 295, 300,
|
||
302, 306, 311, 313, 315, 317, 319, 321, 323, 325,
|
||
327, 329, 331, 333, 335, 337, 339, 341, 343, 344,
|
||
349, 350, 355, 356, 361, 365, 369, 373, 377, 379,
|
||
382, 384, 386, 388, 392, 394, 396, 398, 400, 402,
|
||
404, 406, 408, 410, 412, 414, 416, 418, 420, 422,
|
||
424, 426, 428, 430, 432, 434, 437, 440, 443, 446,
|
||
449, 452, 455, 458, 461, 463, 464, 469, 471, 473,
|
||
477, 479, 481, 482, 492, 494, 497, 500, 503, 504,
|
||
509, 512, 514
|
||
};
|
||
static const short yyrhs[] =
|
||
{
|
||
45, 63, 0, 46, 113, 0, 47, 100, 0, 134,
|
||
0, 63, 48, 0, 63, 71, 0, 63, 128, 0,
|
||
63, 66, 0, 63, 70, 0, 8, 0, 64, 49,
|
||
8, 0, 64, 0, 65, 50, 64, 0, 12, 65,
|
||
0, 0, 11, 65, 12, 67, 68, 0, 69, 0,
|
||
51, 0, 64, 0, 69, 52, 64, 0, 13, 99,
|
||
0, 72, 0, 79, 0, 0, 9, 127, 73, 75,
|
||
53, 77, 54, 0, 8, 0, 134, 0, 55, 76,
|
||
0, 74, 0, 76, 52, 74, 0, 134, 0, 77,
|
||
48, 0, 77, 78, 0, 86, 121, 0, 123, 122,
|
||
0, 96, 121, 48, 0, 94, 121, 0, 0, 10,
|
||
127, 80, 82, 53, 84, 54, 0, 8, 0, 134,
|
||
0, 55, 83, 0, 81, 0, 83, 52, 81, 0,
|
||
134, 0, 84, 48, 0, 84, 85, 0, 86, 122,
|
||
0, 123, 122, 0, 96, 122, 48, 0, 94, 122,
|
||
0, 0, 127, 56, 87, 88, 57, 0, 134, 0,
|
||
89, 0, 90, 0, 89, 52, 90, 0, 99, 0,
|
||
0, 104, 92, 105, 0, 104, 0, 91, 0, 0,
|
||
91, 58, 95, 113, 0, 93, 0, 0, 93, 58,
|
||
97, 113, 0, 91, 0, 93, 0, 94, 0, 96,
|
||
0, 86, 122, 0, 96, 122, 0, 94, 122, 0,
|
||
120, 0, 120, 56, 102, 57, 0, 120, 49, 107,
|
||
0, 120, 49, 107, 56, 102, 57, 0, 120, 56,
|
||
102, 57, 49, 107, 0, 8, 0, 79, 0, 128,
|
||
0, 134, 0, 112, 0, 112, 59, 112, 0, 112,
|
||
111, 0, 102, 52, 112, 0, 102, 52, 112, 59,
|
||
112, 0, 102, 52, 112, 111, 0, 134, 0, 106,
|
||
0, 106, 59, 106, 0, 106, 108, 0, 103, 52,
|
||
106, 0, 103, 52, 106, 59, 106, 0, 103, 52,
|
||
106, 108, 0, 101, 0, 104, 60, 103, 61, 0,
|
||
8, 0, 105, 49, 107, 0, 105, 60, 103, 61,
|
||
0, 6, 0, 107, 0, 3, 0, 4, 0, 4,
|
||
0, 3, 0, 110, 0, 109, 0, 5, 0, 6,
|
||
0, 111, 0, 109, 0, 110, 0, 5, 0, 6,
|
||
0, 7, 0, 0, 53, 114, 117, 54, 0, 0,
|
||
60, 115, 117, 61, 0, 0, 56, 116, 117, 57,
|
||
0, 109, 51, 107, 0, 110, 51, 107, 0, 5,
|
||
51, 107, 0, 7, 51, 107, 0, 118, 0, 119,
|
||
118, 0, 134, 0, 52, 0, 113, 0, 119, 52,
|
||
113, 0, 16, 0, 17, 0, 18, 0, 19, 0,
|
||
20, 0, 21, 0, 22, 0, 23, 0, 24, 0,
|
||
25, 0, 26, 0, 27, 0, 28, 0, 29, 0,
|
||
30, 0, 31, 0, 32, 0, 33, 0, 34, 0,
|
||
35, 0, 134, 0, 121, 36, 0, 121, 37, 0,
|
||
121, 38, 0, 121, 39, 0, 121, 40, 0, 121,
|
||
41, 0, 121, 42, 0, 121, 43, 0, 121, 44,
|
||
0, 121, 0, 0, 8, 55, 124, 126, 0, 8,
|
||
0, 125, 0, 126, 52, 125, 0, 134, 0, 8,
|
||
0, 0, 14, 127, 56, 98, 57, 53, 129, 130,
|
||
54, 0, 134, 0, 130, 48, 0, 130, 131, 0,
|
||
130, 133, 0, 0, 15, 132, 113, 55, 0, 96,
|
||
48, 0, 94, 0, 0
|
||
};
|
||
|
||
#endif
|
||
|
||
#if YYDEBUG
|
||
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
||
static const short yyrline[] =
|
||
{
|
||
0, 171, 173, 174, 180, 182, 183, 194, 200, 201,
|
||
204, 206, 212, 214, 220, 225, 225, 232, 234, 240,
|
||
245, 251, 269, 271, 274, 274, 287, 310, 312, 315,
|
||
322, 330, 332, 333, 345, 356, 357, 365, 374, 374,
|
||
387, 410, 412, 415, 422, 430, 432, 433, 443, 451,
|
||
452, 456, 462, 462, 475, 477, 480, 482, 485, 494,
|
||
494, 505, 509, 511, 511, 539, 541, 541, 569, 571,
|
||
574, 576, 579, 584, 588, 594, 599, 607, 618, 632,
|
||
646, 681, 697, 715, 720, 727, 734, 743, 749, 755,
|
||
765, 770, 777, 784, 791, 797, 803, 811, 813, 823,
|
||
829, 843, 849, 859, 862, 873, 887, 891, 895, 900,
|
||
904, 907, 917, 921, 926, 930, 934, 938, 942, 942,
|
||
950, 950, 958, 958, 966, 972, 978, 984, 992, 994,
|
||
997, 999, 1002, 1004, 1007, 1012, 1016, 1020, 1024, 1028,
|
||
1032, 1036, 1040, 1044, 1048, 1052, 1056, 1060, 1064, 1068,
|
||
1072, 1076, 1080, 1084, 1090, 1095, 1099, 1103, 1107, 1111,
|
||
1115, 1119, 1123, 1127, 1133, 1143, 1143, 1154, 1170, 1177,
|
||
1190, 1195, 1198, 1198, 1212, 1214, 1215, 1216, 1228, 1228,
|
||
1245, 1250, 1256
|
||
};
|
||
#endif
|
||
|
||
|
||
#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_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_description", "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", "@9", "@10", "array", "maybe_comma",
|
||
"array_def", "type_token", "server_flags", "no_server_flags",
|
||
"molecular_field", "@11", "atomic_name", "molecular_atom_list",
|
||
"optional_name", "switch", "@12", "switch_fields", "switch_case", "@13",
|
||
"switch_field", "empty", 0
|
||
};
|
||
#endif
|
||
|
||
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
||
static const short yyr1[] =
|
||
{
|
||
0, 62, 62, 62, 63, 63, 63, 63, 63, 63,
|
||
64, 64, 65, 65, 66, 67, 66, 68, 68, 69,
|
||
69, 70, 71, 71, 73, 72, 74, 75, 75, 76,
|
||
76, 77, 77, 77, 78, 78, 78, 78, 80, 79,
|
||
81, 82, 82, 83, 83, 84, 84, 84, 85, 85,
|
||
85, 85, 87, 86, 88, 88, 89, 89, 90, 92,
|
||
91, 93, 94, 95, 94, 96, 97, 96, 98, 98,
|
||
99, 99, 100, 100, 100, 101, 101, 101, 101, 101,
|
||
101, 101, 101, 102, 102, 102, 102, 102, 102, 102,
|
||
103, 103, 103, 103, 103, 103, 103, 104, 104, 105,
|
||
105, 105, 106, 106, 107, 108, 109, 110, 111, 111,
|
||
111, 112, 112, 113, 113, 113, 113, 113, 114, 113,
|
||
115, 113, 116, 113, 113, 113, 113, 113, 117, 117,
|
||
118, 118, 119, 119, 120, 120, 120, 120, 120, 120,
|
||
120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
|
||
120, 120, 120, 120, 121, 121, 121, 121, 121, 121,
|
||
121, 121, 121, 121, 122, 124, 123, 125, 126, 126,
|
||
127, 127, 129, 128, 130, 130, 130, 130, 132, 131,
|
||
133, 133, 134
|
||
};
|
||
|
||
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
||
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, 2, 2, 2, 1, 4, 3, 6, 6,
|
||
1, 1, 1, 1, 1, 3, 2, 3, 5, 4,
|
||
1, 1, 3, 2, 3, 5, 4, 1, 4, 1,
|
||
3, 4, 1, 1, 1, 1, 1, 1, 1, 1,
|
||
1, 1, 1, 1, 1, 1, 1, 1, 0, 4,
|
||
0, 4, 0, 4, 3, 3, 3, 3, 1, 2,
|
||
1, 1, 1, 3, 1, 1, 1, 1, 1, 1,
|
||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||
1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 1, 0, 4, 1, 1, 3,
|
||
1, 1, 0, 9, 1, 2, 2, 2, 0, 4,
|
||
2, 1, 0
|
||
};
|
||
|
||
/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
|
||
doesn't specify something else to do. Zero means the default is an
|
||
error. */
|
||
static const short yydefact[] =
|
||
{
|
||
0, 182, 0, 182, 1, 4, 107, 106, 115, 116,
|
||
117, 118, 122, 120, 113, 114, 2, 80, 182, 182,
|
||
134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
|
||
144, 145, 146, 147, 148, 149, 150, 151, 152, 153,
|
||
81, 182, 62, 65, 182, 182, 3, 97, 61, 75,
|
||
0, 82, 170, 182, 0, 0, 0, 5, 8, 9,
|
||
6, 22, 23, 7, 0, 0, 182, 182, 182, 0,
|
||
0, 171, 38, 0, 164, 72, 154, 63, 66, 74,
|
||
73, 182, 0, 0, 182, 52, 24, 10, 12, 0,
|
||
14, 80, 70, 71, 21, 104, 126, 127, 131, 132,
|
||
0, 128, 182, 130, 0, 0, 124, 125, 182, 0,
|
||
155, 156, 157, 158, 159, 160, 161, 162, 163, 0,
|
||
0, 102, 0, 91, 103, 90, 99, 60, 77, 110,
|
||
111, 0, 109, 108, 112, 84, 83, 182, 182, 0,
|
||
15, 0, 119, 131, 129, 123, 121, 0, 0, 41,
|
||
68, 69, 0, 64, 67, 0, 98, 105, 0, 93,
|
||
0, 182, 182, 0, 76, 0, 86, 0, 55, 56,
|
||
58, 54, 0, 0, 27, 11, 0, 13, 133, 40,
|
||
43, 42, 182, 0, 94, 92, 100, 0, 0, 87,
|
||
0, 85, 53, 0, 26, 29, 28, 182, 18, 19,
|
||
16, 17, 0, 182, 45, 172, 0, 96, 101, 78,
|
||
0, 89, 79, 57, 0, 182, 31, 0, 44, 80,
|
||
46, 39, 47, 182, 182, 182, 182, 182, 95, 88,
|
||
30, 32, 25, 33, 182, 182, 182, 182, 20, 165,
|
||
48, 51, 0, 49, 0, 174, 34, 37, 0, 35,
|
||
0, 50, 178, 175, 173, 181, 0, 176, 177, 36,
|
||
167, 168, 166, 0, 180, 0, 0, 169, 179, 0,
|
||
0, 0
|
||
};
|
||
|
||
static const short yydefgoto[] =
|
||
{
|
||
269, 4, 88, 89, 58, 176, 200, 201, 59, 60,
|
||
61, 138, 195, 173, 196, 215, 233, 40, 108, 180,
|
||
148, 181, 203, 222, 41, 137, 167, 168, 169, 42,
|
||
82, 43, 92, 119, 93, 120, 152, 170, 46, 47,
|
||
131, 122, 48, 127, 123, 124, 159, 14, 15, 134,
|
||
135, 99, 66, 68, 67, 100, 101, 102, 49, 74,
|
||
75, 226, 250, 261, 262, 50, 51, 227, 244, 257,
|
||
263, 258, 76
|
||
};
|
||
|
||
static const short yypact[] =
|
||
{
|
||
67,-32768, 33, 365, 110,-32768,-32768,-32768, -23,-32768,
|
||
8,-32768,-32768,-32768, 14, 20,-32768, -5, 69, 69,
|
||
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
|
||
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
|
||
-32768,-32768, 50, 52,-32768,-32768,-32768,-32768, 6, -22,
|
||
60,-32768,-32768, 69, 96, 96, 393,-32768,-32768,-32768,
|
||
-32768,-32768,-32768,-32768, 128, 128, 16, 16, 16, 128,
|
||
128,-32768,-32768, 79, 134,-32768,-32768,-32768,-32768,-32768,
|
||
-32768, 29, 130, 128, 91,-32768,-32768,-32768, 87, 12,
|
||
89,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
|
||
86,-32768, 90,-32768, 99, 82,-32768,-32768, 102, 393,
|
||
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 33,
|
||
33,-32768, -3, 5,-32768,-32768,-32768, 32, 104,-32768,
|
||
-32768, 46,-32768,-32768,-32768, 40,-32768, 393, 106, 138,
|
||
-32768, 96,-32768, 33,-32768,-32768,-32768, 154, 112,-32768,
|
||
-32768,-32768, 107,-32768,-32768, 29,-32768,-32768, 29,-32768,
|
||
128, 29, 91, 91, 114, 91,-32768, 109, 115,-32768,
|
||
-32768,-32768, 171, 127,-32768,-32768, 10, 87,-32768,-32768,
|
||
-32768, 129,-32768, 135, 11,-32768,-32768, 2, 48, 43,
|
||
128,-32768,-32768, 393,-32768,-32768, 139,-32768,-32768, 87,
|
||
-32768, 140, 154, 287,-32768,-32768, 29,-32768,-32768,-32768,
|
||
91,-32768,-32768,-32768, 171, 326,-32768, 96,-32768, 70,
|
||
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
|
||
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 87,-32768,
|
||
-32768,-32768, 142,-32768, 248,-32768, 134, 134, 111,-32768,
|
||
174,-32768,-32768,-32768,-32768,-32768, 145,-32768,-32768,-32768,
|
||
-32768,-32768, 143, 33,-32768, 174, 132,-32768,-32768, 194,
|
||
196,-32768
|
||
};
|
||
|
||
static const short yypgoto[] =
|
||
{
|
||
-32768,-32768, -134, 144,-32768,-32768,-32768,-32768,-32768,-32768,
|
||
-32768,-32768, -16,-32768,-32768,-32768,-32768, 197,-32768, 3,
|
||
-32768,-32768,-32768,-32768, -174,-32768,-32768,-32768, 13, 98,
|
||
-32768, 100, -1,-32768, 0,-32768,-32768, 152,-32768,-32768,
|
||
38, 51,-32768,-32768, -105, -53, 27, -83, -78, -122,
|
||
-132, -2,-32768,-32768,-32768, 66, 116,-32768,-32768, -106,
|
||
-40, 1,-32768, -52,-32768, 37, 213,-32768,-32768,-32768,
|
||
-32768,-32768, 7
|
||
};
|
||
|
||
|
||
#define YYLAST 428
|
||
|
||
|
||
static const short yytable[] =
|
||
{
|
||
16, 132, 44, 45, 79, 80, 133, 177, 5, 157,
|
||
52, 96, 97, 166, -59, 157, 106, 107, 87, 6,
|
||
7, 8, 9, 10, 140, 52, 52, 83, 64, 223,
|
||
128, 189, 95, 191, 84, 121, 6, 7, 8, 9,
|
||
10, 234, 199, 6, 7, 129, 6, 7, 129, 155,
|
||
184, -171, 132, 185, 155, 72, 73, 133, 156, 65,
|
||
52, 198, 141, 208, 158, 69, 81, 211, 98, 11,
|
||
206, 70, 12, 103, 103, 103, 13, 71, 229, 132,
|
||
132, 160, 132, 238, 133, 133, 11, 133, 125, 12,
|
||
86, 136, 161, 13, 6, 7, 129, 130, 163, 165,
|
||
163, 228, 210, 164, 87, 209, 132, 186, 77, 103,
|
||
78, 133, 1, 2, 3, 149, 85, 153, 154, 53,
|
||
18, 54, 55, 56, 19, 239, -171, 132, 246, 247,
|
||
248, 95, 133, 104, 105, 109, 139, 212, 126, 141,
|
||
142, 178, 143, 146, 171, 174, 175, 110, 111, 112,
|
||
113, 114, 115, 116, 117, 118, 145, 147, 57, 259,
|
||
162, 172, 179, 190, 183, 182, 192, 193, 125, 136,
|
||
110, 111, 112, 113, 114, 115, 116, 117, 118, 194,
|
||
197, 202, 260, 240, 241, 242, 243, 268, 205, 204,
|
||
251, 214, 217, 264, 270, 265, 271, 249, 230, 90,
|
||
188, 62, 224, 225, 216, 218, 213, 150, 94, 151,
|
||
52, 207, 187, 267, 235, 236, 237, 63, 144, 0,
|
||
0, 0, 52, 0, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 245, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 255, 256, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 0, 91, 0, 18, 0,
|
||
0, 266, 19, 252, 20, 21, 22, 23, 24, 25,
|
||
26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
|
||
36, 37, 38, 39, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 219, 253, 18, 0, 0,
|
||
0, 19, 254, 20, 21, 22, 23, 24, 25, 26,
|
||
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
|
||
37, 38, 39, 0, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 219, 220, 18, 0, 0, 0,
|
||
19, 221, 20, 21, 22, 23, 24, 25, 26, 27,
|
||
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
|
||
38, 39, 0, 0, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 17, 231, 18, 0, 0, 0, 19,
|
||
232, 20, 21, 22, 23, 24, 25, 26, 27, 28,
|
||
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
|
||
39, 91, 0, 18, 0, 0, 0, 19, 0, 20,
|
||
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
|
||
31, 32, 33, 34, 35, 36, 37, 38, 39
|
||
};
|
||
|
||
static const short yycheck[] =
|
||
{
|
||
2, 84, 3, 3, 44, 45, 84, 141, 1, 4,
|
||
3, 64, 65, 135, 8, 4, 69, 70, 8, 3,
|
||
4, 5, 6, 7, 12, 18, 19, 49, 51, 203,
|
||
83, 163, 3, 165, 56, 6, 3, 4, 5, 6,
|
||
7, 215, 176, 3, 4, 5, 3, 4, 5, 52,
|
||
155, 56, 135, 158, 52, 18, 19, 135, 61, 51,
|
||
53, 51, 50, 61, 59, 51, 60, 189, 52, 53,
|
||
59, 51, 56, 66, 67, 68, 60, 8, 210, 162,
|
||
163, 49, 165, 217, 162, 163, 53, 165, 81, 56,
|
||
53, 84, 60, 60, 3, 4, 5, 6, 52, 59,
|
||
52, 206, 59, 57, 8, 57, 189, 160, 58, 102,
|
||
58, 189, 45, 46, 47, 108, 56, 119, 120, 9,
|
||
10, 11, 12, 13, 14, 55, 56, 210, 234, 235,
|
||
236, 3, 210, 67, 68, 56, 49, 190, 8, 50,
|
||
54, 143, 52, 61, 137, 138, 8, 36, 37, 38,
|
||
39, 40, 41, 42, 43, 44, 57, 55, 48, 48,
|
||
56, 55, 8, 49, 57, 53, 57, 52, 161, 162,
|
||
36, 37, 38, 39, 40, 41, 42, 43, 44, 8,
|
||
53, 52, 8, 223, 224, 225, 226, 55, 53, 182,
|
||
48, 52, 52, 48, 0, 52, 0, 237, 214, 55,
|
||
162, 4, 203, 203, 197, 202, 193, 109, 56, 109,
|
||
203, 184, 161, 265, 215, 215, 215, 4, 102, -1,
|
||
-1, -1, 215, -1, -1, -1, -1, -1, -1, -1,
|
||
-1, -1, -1, -1, 227, -1, -1, -1, -1, -1,
|
||
-1, -1, -1, 244, 244, -1, -1, -1, -1, -1,
|
||
-1, -1, -1, -1, -1, -1, 8, -1, 10, -1,
|
||
-1, 263, 14, 15, 16, 17, 18, 19, 20, 21,
|
||
22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||
32, 33, 34, 35, -1, -1, -1, -1, -1, -1,
|
||
-1, -1, -1, -1, -1, 8, 48, 10, -1, -1,
|
||
-1, 14, 54, 16, 17, 18, 19, 20, 21, 22,
|
||
23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
|
||
33, 34, 35, -1, -1, -1, -1, -1, -1, -1,
|
||
-1, -1, -1, -1, 8, 48, 10, -1, -1, -1,
|
||
14, 54, 16, 17, 18, 19, 20, 21, 22, 23,
|
||
24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
|
||
34, 35, -1, -1, -1, -1, -1, -1, -1, -1,
|
||
-1, -1, -1, 8, 48, 10, -1, -1, -1, 14,
|
||
54, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
||
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
|
||
35, 8, -1, 10, -1, -1, -1, 14, -1, 16,
|
||
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
|
||
27, 28, 29, 30, 31, 32, 33, 34, 35
|
||
};
|
||
/* -*-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 175 "dcParser.yxx"
|
||
{
|
||
parameter_description = yyvsp[0].u.field;
|
||
}
|
||
break;
|
||
case 6:
|
||
#line 184 "dcParser.yxx"
|
||
{
|
||
if (!dc_file->add_class(yyvsp[0].u.dclass)) {
|
||
DCClass *old_class = dc_file->get_class_by_name(yyvsp[0].u.dclass->get_name());
|
||
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 195 "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 207 "dcParser.yxx"
|
||
{
|
||
yyval.str = yyvsp[-2].str + string("/") + yyvsp[0].str;
|
||
}
|
||
break;
|
||
case 13:
|
||
#line 215 "dcParser.yxx"
|
||
{
|
||
yyval.str = yyvsp[-2].str + string(".") + yyvsp[0].str;
|
||
}
|
||
break;
|
||
case 14:
|
||
#line 222 "dcParser.yxx"
|
||
{
|
||
dc_file->add_import_module(yyvsp[0].str);
|
||
}
|
||
break;
|
||
case 15:
|
||
#line 226 "dcParser.yxx"
|
||
{
|
||
dc_file->add_import_module(yyvsp[-1].str);
|
||
}
|
||
break;
|
||
case 18:
|
||
#line 235 "dcParser.yxx"
|
||
{
|
||
dc_file->add_import_symbol("*");
|
||
}
|
||
break;
|
||
case 19:
|
||
#line 242 "dcParser.yxx"
|
||
{
|
||
dc_file->add_import_symbol(yyvsp[0].str);
|
||
}
|
||
break;
|
||
case 20:
|
||
#line 246 "dcParser.yxx"
|
||
{
|
||
dc_file->add_import_symbol(yyvsp[0].str);
|
||
}
|
||
break;
|
||
case 21:
|
||
#line 253 "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 276 "dcParser.yxx"
|
||
{
|
||
yyval.u.dclass = current_class;
|
||
current_class = new DCClass(yyvsp[0].str, false, false);
|
||
}
|
||
break;
|
||
case 25:
|
||
#line 281 "dcParser.yxx"
|
||
{
|
||
yyval.u.dclass = current_class;
|
||
current_class = yyvsp[-4].u.dclass;
|
||
}
|
||
break;
|
||
case 26:
|
||
#line 289 "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(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 317 "dcParser.yxx"
|
||
{
|
||
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
|
||
current_class->add_parent(yyvsp[0].u.dclass);
|
||
}
|
||
}
|
||
break;
|
||
case 30:
|
||
#line 323 "dcParser.yxx"
|
||
{
|
||
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
|
||
current_class->add_parent(yyvsp[0].u.dclass);
|
||
}
|
||
}
|
||
break;
|
||
case 33:
|
||
#line 334 "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 347 "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 358 "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 366 "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 376 "dcParser.yxx"
|
||
{
|
||
yyval.u.dclass = current_class;
|
||
current_class = new DCClass(yyvsp[0].str, true, false);
|
||
}
|
||
break;
|
||
case 39:
|
||
#line 381 "dcParser.yxx"
|
||
{
|
||
yyval.u.dclass = current_class;
|
||
current_class = yyvsp[-4].u.dclass;
|
||
}
|
||
break;
|
||
case 40:
|
||
#line 389 "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(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 417 "dcParser.yxx"
|
||
{
|
||
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
|
||
current_class->add_parent(yyvsp[0].u.dclass);
|
||
}
|
||
}
|
||
break;
|
||
case 44:
|
||
#line 423 "dcParser.yxx"
|
||
{
|
||
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
|
||
current_class->add_parent(yyvsp[0].u.dclass);
|
||
}
|
||
}
|
||
break;
|
||
case 47:
|
||
#line 434 "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 445 "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 453 "dcParser.yxx"
|
||
{
|
||
yyval.u.field = yyvsp[-2].u.parameter;
|
||
}
|
||
break;
|
||
case 51:
|
||
#line 457 "dcParser.yxx"
|
||
{
|
||
yyval.u.field = yyvsp[-1].u.parameter;
|
||
}
|
||
break;
|
||
case 52:
|
||
#line 464 "dcParser.yxx"
|
||
{
|
||
yyval.u.field = current_atomic;
|
||
current_atomic = new DCAtomicField(yyvsp[-1].str);
|
||
}
|
||
break;
|
||
case 53:
|
||
#line 469 "dcParser.yxx"
|
||
{
|
||
yyval.u.field = current_atomic;
|
||
current_atomic = yyvsp[-2].u.atomic;
|
||
}
|
||
break;
|
||
case 58:
|
||
#line 487 "dcParser.yxx"
|
||
{
|
||
if (yyvsp[0].u.parameter != (DCParameter *)NULL) {
|
||
current_atomic->add_element(yyvsp[0].u.parameter);
|
||
}
|
||
}
|
||
break;
|
||
case 59:
|
||
#line 496 "dcParser.yxx"
|
||
{
|
||
current_parameter = yyvsp[0].u.parameter;
|
||
}
|
||
break;
|
||
case 60:
|
||
#line 500 "dcParser.yxx"
|
||
{
|
||
yyval.u.parameter = yyvsp[0].u.parameter;
|
||
}
|
||
break;
|
||
case 63:
|
||
#line 512 "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 520 "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 542 "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 550 "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 581 "dcParser.yxx"
|
||
{
|
||
yyval.u.field = yyvsp[-1].u.field;
|
||
}
|
||
break;
|
||
case 73:
|
||
#line 585 "dcParser.yxx"
|
||
{
|
||
yyval.u.field = yyvsp[-1].u.parameter;
|
||
}
|
||
break;
|
||
case 74:
|
||
#line 589 "dcParser.yxx"
|
||
{
|
||
yyval.u.field = yyvsp[-1].u.parameter;
|
||
}
|
||
break;
|
||
case 75:
|
||
#line 596 "dcParser.yxx"
|
||
{
|
||
yyval.u.parameter = new DCSimpleParameter(yyvsp[0].u.subatomic);
|
||
}
|
||
break;
|
||
case 76:
|
||
#line 600 "dcParser.yxx"
|
||
{
|
||
DCSimpleParameter *simple_param = new DCSimpleParameter(yyvsp[-3].u.subatomic);
|
||
if (!simple_param->set_range(double_range)) {
|
||
yyerror("Inappropriate range for type");
|
||
}
|
||
yyval.u.parameter = simple_param;
|
||
}
|
||
break;
|
||
case 77:
|
||
#line 608 "dcParser.yxx"
|
||
{
|
||
DCSimpleParameter *simple_param = new DCSimpleParameter(yyvsp[-2].u.subatomic);
|
||
if (yyvsp[0].u.s_uint == 0) {
|
||
yyerror("Invalid divisor.");
|
||
|
||
} else if (!simple_param->set_divisor(yyvsp[0].u.s_uint)) {
|
||
yyerror("A divisor is only valid on a numeric type.");
|
||
}
|
||
yyval.u.parameter = simple_param;
|
||
}
|
||
break;
|
||
case 78:
|
||
#line 619 "dcParser.yxx"
|
||
{
|
||
DCSimpleParameter *simple_param = new DCSimpleParameter(yyvsp[-5].u.subatomic);
|
||
if (yyvsp[-3].u.s_uint == 0) {
|
||
yyerror("Invalid divisor.");
|
||
|
||
} else if (!simple_param->set_divisor(yyvsp[-3].u.s_uint)) {
|
||
yyerror("A divisor is only valid on a numeric type.");
|
||
}
|
||
if (!simple_param->set_range(double_range)) {
|
||
yyerror("Inappropriate range for type");
|
||
}
|
||
yyval.u.parameter = simple_param;
|
||
}
|
||
break;
|
||
case 79:
|
||
#line 633 "dcParser.yxx"
|
||
{
|
||
DCSimpleParameter *simple_param = new DCSimpleParameter(yyvsp[-5].u.subatomic);
|
||
if (yyvsp[0].u.s_uint == 0) {
|
||
yyerror("Invalid divisor.");
|
||
|
||
} else if (!simple_param->set_divisor(yyvsp[0].u.s_uint)) {
|
||
yyerror("A divisor is only valid on a numeric type.");
|
||
}
|
||
if (!simple_param->set_range(double_range)) {
|
||
yyerror("Inappropriate range for type");
|
||
}
|
||
yyval.u.parameter = simple_param;
|
||
}
|
||
break;
|
||
case 80:
|
||
#line 647 "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) {
|
||
if (!dclass->is_struct()) {
|
||
yyerror("cannot embed a dclass object within a message; use a struct");
|
||
}
|
||
// 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 81:
|
||
#line 682 "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 82:
|
||
#line 698 "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 83:
|
||
#line 717 "dcParser.yxx"
|
||
{
|
||
double_range.clear();
|
||
}
|
||
break;
|
||
case 84:
|
||
#line 721 "dcParser.yxx"
|
||
{
|
||
double_range.clear();
|
||
if (!double_range.add_range(yyvsp[0].u.real, yyvsp[0].u.real)) {
|
||
yyerror("Overlapping range");
|
||
}
|
||
}
|
||
break;
|
||
case 85:
|
||
#line 728 "dcParser.yxx"
|
||
{
|
||
double_range.clear();
|
||
if (!double_range.add_range(yyvsp[-2].u.real, yyvsp[0].u.real)) {
|
||
yyerror("Overlapping range");
|
||
}
|
||
}
|
||
break;
|
||
case 86:
|
||
#line 735 "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 87:
|
||
#line 744 "dcParser.yxx"
|
||
{
|
||
if (!double_range.add_range(yyvsp[0].u.real, yyvsp[0].u.real)) {
|
||
yyerror("Overlapping range");
|
||
}
|
||
}
|
||
break;
|
||
case 88:
|
||
#line 750 "dcParser.yxx"
|
||
{
|
||
if (!double_range.add_range(yyvsp[-2].u.real, yyvsp[0].u.real)) {
|
||
yyerror("Overlapping range");
|
||
}
|
||
}
|
||
break;
|
||
case 89:
|
||
#line 756 "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 90:
|
||
#line 767 "dcParser.yxx"
|
||
{
|
||
uint_range.clear();
|
||
}
|
||
break;
|
||
case 91:
|
||
#line 771 "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 92:
|
||
#line 778 "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 93:
|
||
#line 785 "dcParser.yxx"
|
||
{
|
||
uint_range.clear();
|
||
if (!uint_range.add_range(yyvsp[-1].u.s_uint, yyvsp[0].u.s_uint)) {
|
||
yyerror("Overlapping range");
|
||
}
|
||
}
|
||
break;
|
||
case 94:
|
||
#line 792 "dcParser.yxx"
|
||
{
|
||
if (!uint_range.add_range(yyvsp[0].u.s_uint, yyvsp[0].u.s_uint)) {
|
||
yyerror("Overlapping range");
|
||
}
|
||
}
|
||
break;
|
||
case 95:
|
||
#line 798 "dcParser.yxx"
|
||
{
|
||
if (!uint_range.add_range(yyvsp[-2].u.s_uint, yyvsp[0].u.s_uint)) {
|
||
yyerror("Overlapping range");
|
||
}
|
||
}
|
||
break;
|
||
case 96:
|
||
#line 804 "dcParser.yxx"
|
||
{
|
||
if (!uint_range.add_range(yyvsp[-1].u.s_uint, yyvsp[0].u.s_uint)) {
|
||
yyerror("Overlapping range");
|
||
}
|
||
}
|
||
break;
|
||
case 98:
|
||
#line 814 "dcParser.yxx"
|
||
{
|
||
if (yyvsp[-3].u.parameter == (DCParameter *)NULL) {
|
||
yyval.u.parameter = NULL;
|
||
} else {
|
||
yyval.u.parameter = new DCArrayParameter(yyvsp[-3].u.parameter, uint_range);
|
||
}
|
||
}
|
||
break;
|
||
case 99:
|
||
#line 825 "dcParser.yxx"
|
||
{
|
||
current_parameter->set_name(yyvsp[0].str);
|
||
yyval.u.parameter = current_parameter;
|
||
}
|
||
break;
|
||
case 100:
|
||
#line 830 "dcParser.yxx"
|
||
{
|
||
if (yyvsp[0].u.s_uint == 0) {
|
||
yyerror("Invalid divisor.");
|
||
|
||
} else if (yyvsp[-2].u.parameter->as_simple_parameter() == NULL || yyvsp[-2].u.parameter->get_typedef() != (DCTypedef *)NULL) {
|
||
yyerror("A divisor is only allowed on a primitive type.");
|
||
|
||
} else {
|
||
if (!yyvsp[-2].u.parameter->as_simple_parameter()->set_divisor(yyvsp[0].u.s_uint)) {
|
||
yyerror("A divisor is only valid on a numeric type.");
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
case 101:
|
||
#line 844 "dcParser.yxx"
|
||
{
|
||
yyval.u.parameter = new DCArrayParameter(yyvsp[-3].u.parameter, uint_range);
|
||
}
|
||
break;
|
||
case 102:
|
||
#line 851 "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 104:
|
||
#line 864 "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 105:
|
||
#line 875 "dcParser.yxx"
|
||
{
|
||
yyval.u.s_uint = (unsigned int)-yyvsp[0].u.int64;
|
||
if (yyvsp[0].u.int64 >= 0) {
|
||
yyerror("Syntax error.");
|
||
|
||
} else if (yyval.u.s_uint != -yyvsp[0].u.int64) {
|
||
yyerror("Number out of range.");
|
||
yyval.u.s_uint = 1;
|
||
}
|
||
}
|
||
break;
|
||
case 108:
|
||
#line 897 "dcParser.yxx"
|
||
{
|
||
yyval.u.real = (double)yyvsp[0].u.uint64;
|
||
}
|
||
break;
|
||
case 109:
|
||
#line 901 "dcParser.yxx"
|
||
{
|
||
yyval.u.real = (double)yyvsp[0].u.int64;
|
||
}
|
||
break;
|
||
case 111:
|
||
#line 909 "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 113:
|
||
#line 923 "dcParser.yxx"
|
||
{
|
||
current_packer->pack_int64(yyvsp[0].u.int64);
|
||
}
|
||
break;
|
||
case 114:
|
||
#line 927 "dcParser.yxx"
|
||
{
|
||
current_packer->pack_uint64(yyvsp[0].u.uint64);
|
||
}
|
||
break;
|
||
case 115:
|
||
#line 931 "dcParser.yxx"
|
||
{
|
||
current_packer->pack_double(yyvsp[0].u.real);
|
||
}
|
||
break;
|
||
case 116:
|
||
#line 935 "dcParser.yxx"
|
||
{
|
||
current_packer->pack_string(yyvsp[0].str);
|
||
}
|
||
break;
|
||
case 117:
|
||
#line 939 "dcParser.yxx"
|
||
{
|
||
current_packer->pack_literal_value(yyvsp[0].str);
|
||
}
|
||
break;
|
||
case 118:
|
||
#line 943 "dcParser.yxx"
|
||
{
|
||
current_packer->push();
|
||
}
|
||
break;
|
||
case 119:
|
||
#line 947 "dcParser.yxx"
|
||
{
|
||
current_packer->pop();
|
||
}
|
||
break;
|
||
case 120:
|
||
#line 951 "dcParser.yxx"
|
||
{
|
||
current_packer->push();
|
||
}
|
||
break;
|
||
case 121:
|
||
#line 955 "dcParser.yxx"
|
||
{
|
||
current_packer->pop();
|
||
}
|
||
break;
|
||
case 122:
|
||
#line 959 "dcParser.yxx"
|
||
{
|
||
current_packer->push();
|
||
}
|
||
break;
|
||
case 123:
|
||
#line 963 "dcParser.yxx"
|
||
{
|
||
current_packer->pop();
|
||
}
|
||
break;
|
||
case 124:
|
||
#line 967 "dcParser.yxx"
|
||
{
|
||
for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) {
|
||
current_packer->pack_int64(yyvsp[-2].u.int64);
|
||
}
|
||
}
|
||
break;
|
||
case 125:
|
||
#line 973 "dcParser.yxx"
|
||
{
|
||
for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) {
|
||
current_packer->pack_uint64(yyvsp[-2].u.uint64);
|
||
}
|
||
}
|
||
break;
|
||
case 126:
|
||
#line 979 "dcParser.yxx"
|
||
{
|
||
for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) {
|
||
current_packer->pack_double(yyvsp[-2].u.real);
|
||
}
|
||
}
|
||
break;
|
||
case 127:
|
||
#line 985 "dcParser.yxx"
|
||
{
|
||
for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) {
|
||
current_packer->pack_literal_value(yyvsp[-2].str);
|
||
}
|
||
}
|
||
break;
|
||
case 134:
|
||
#line 1009 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_int8;
|
||
}
|
||
break;
|
||
case 135:
|
||
#line 1013 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_int16;
|
||
}
|
||
break;
|
||
case 136:
|
||
#line 1017 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_int32;
|
||
}
|
||
break;
|
||
case 137:
|
||
#line 1021 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_int64;
|
||
}
|
||
break;
|
||
case 138:
|
||
#line 1025 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_uint8;
|
||
}
|
||
break;
|
||
case 139:
|
||
#line 1029 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_uint16;
|
||
}
|
||
break;
|
||
case 140:
|
||
#line 1033 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_uint32;
|
||
}
|
||
break;
|
||
case 141:
|
||
#line 1037 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_uint64;
|
||
}
|
||
break;
|
||
case 142:
|
||
#line 1041 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_float64;
|
||
}
|
||
break;
|
||
case 143:
|
||
#line 1045 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_string;
|
||
}
|
||
break;
|
||
case 144:
|
||
#line 1049 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_blob;
|
||
}
|
||
break;
|
||
case 145:
|
||
#line 1053 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_blob32;
|
||
}
|
||
break;
|
||
case 146:
|
||
#line 1057 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_int8array;
|
||
}
|
||
break;
|
||
case 147:
|
||
#line 1061 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_int16array;
|
||
}
|
||
break;
|
||
case 148:
|
||
#line 1065 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_int32array;
|
||
}
|
||
break;
|
||
case 149:
|
||
#line 1069 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_uint8array;
|
||
}
|
||
break;
|
||
case 150:
|
||
#line 1073 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_uint16array;
|
||
}
|
||
break;
|
||
case 151:
|
||
#line 1077 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_uint32array;
|
||
}
|
||
break;
|
||
case 152:
|
||
#line 1081 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_uint32uint8array;
|
||
}
|
||
break;
|
||
case 153:
|
||
#line 1085 "dcParser.yxx"
|
||
{
|
||
yyval.u.subatomic = ST_char;
|
||
}
|
||
break;
|
||
case 154:
|
||
#line 1092 "dcParser.yxx"
|
||
{
|
||
yyval.u.s_int = 0;
|
||
}
|
||
break;
|
||
case 155:
|
||
#line 1096 "dcParser.yxx"
|
||
{
|
||
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_required;
|
||
}
|
||
break;
|
||
case 156:
|
||
#line 1100 "dcParser.yxx"
|
||
{
|
||
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_broadcast;
|
||
}
|
||
break;
|
||
case 157:
|
||
#line 1104 "dcParser.yxx"
|
||
{
|
||
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_p2p;
|
||
}
|
||
break;
|
||
case 158:
|
||
#line 1108 "dcParser.yxx"
|
||
{
|
||
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_ram;
|
||
}
|
||
break;
|
||
case 159:
|
||
#line 1112 "dcParser.yxx"
|
||
{
|
||
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_db;
|
||
}
|
||
break;
|
||
case 160:
|
||
#line 1116 "dcParser.yxx"
|
||
{
|
||
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_clsend;
|
||
}
|
||
break;
|
||
case 161:
|
||
#line 1120 "dcParser.yxx"
|
||
{
|
||
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_clrecv;
|
||
}
|
||
break;
|
||
case 162:
|
||
#line 1124 "dcParser.yxx"
|
||
{
|
||
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_ownsend;
|
||
}
|
||
break;
|
||
case 163:
|
||
#line 1128 "dcParser.yxx"
|
||
{
|
||
yyval.u.s_int = yyvsp[-1].u.s_int | DCAtomicField::F_airecv;
|
||
}
|
||
break;
|
||
case 164:
|
||
#line 1135 "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 165:
|
||
#line 1145 "dcParser.yxx"
|
||
{
|
||
current_molecular = new DCMolecularField(yyvsp[-1].str);
|
||
}
|
||
break;
|
||
case 166:
|
||
#line 1149 "dcParser.yxx"
|
||
{
|
||
yyval.u.field = current_molecular;
|
||
}
|
||
break;
|
||
case 167:
|
||
#line 1156 "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 168:
|
||
#line 1172 "dcParser.yxx"
|
||
{
|
||
if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
|
||
current_molecular->add_atomic(yyvsp[0].u.atomic);
|
||
}
|
||
}
|
||
break;
|
||
case 169:
|
||
#line 1178 "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 170:
|
||
#line 1192 "dcParser.yxx"
|
||
{
|
||
yyval.str = "";
|
||
}
|
||
break;
|
||
case 172:
|
||
#line 1200 "dcParser.yxx"
|
||
{
|
||
yyval.u.dswitch = current_switch;
|
||
current_switch = new DCSwitch(yyvsp[-4].str, yyvsp[-2].u.parameter);
|
||
}
|
||
break;
|
||
case 173:
|
||
#line 1205 "dcParser.yxx"
|
||
{
|
||
yyval.u.dswitch = current_switch;
|
||
current_switch = (DCSwitch *)yyvsp[-2].u.parameter;
|
||
}
|
||
break;
|
||
case 177:
|
||
#line 1217 "dcParser.yxx"
|
||
{
|
||
if (current_switch->get_num_cases() == 0) {
|
||
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 178:
|
||
#line 1230 "dcParser.yxx"
|
||
{
|
||
current_packer = &default_packer;
|
||
current_packer->clear_data();
|
||
current_packer->begin_pack(current_switch->get_key_parameter());
|
||
}
|
||
break;
|
||
case 179:
|
||
#line 1236 "dcParser.yxx"
|
||
{
|
||
if (!current_packer->end_pack()) {
|
||
yyerror("Invalid value for switch parameter");
|
||
} else {
|
||
current_switch->add_case(current_packer->get_string());
|
||
}
|
||
}
|
||
break;
|
||
case 180:
|
||
#line 1247 "dcParser.yxx"
|
||
{
|
||
yyval.u.field = yyvsp[-1].u.parameter;
|
||
}
|
||
break;
|
||
case 181:
|
||
#line 1251 "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 1259 "dcParser.yxx"
|