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

2965 lines
83 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 by GNU Bison 1.875b. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 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. */
/* Written by Richard Stallman by simplifying the original so called
``semantic'' parser. */
/* 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. */
/* Identify Bison output. */
#define YYBISON 1
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Pure parsers. */
#define YYPURE 0
/* Using locations. */
#define YYLSP_NEEDED 0
/* If NAME_PREFIX is specified substitute the variables and functions
names. */
#define yyparse dcyyparse
#define yylex dcyylex
#define yyerror dcyyerror
#define yylval dcyylval
#define yychar dcyychar
#define yydebug dcyydebug
#define yynerrs dcyynerrs
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
UNSIGNED_INTEGER = 258,
SIGNED_INTEGER = 259,
REAL = 260,
STRING = 261,
HEX_STRING = 262,
IDENTIFIER = 263,
KEYWORD = 264,
KW_DCLASS = 265,
KW_STRUCT = 266,
KW_FROM = 267,
KW_IMPORT = 268,
KW_TYPEDEF = 269,
KW_KEYWORD = 270,
KW_SWITCH = 271,
KW_CASE = 272,
KW_DEFAULT = 273,
KW_BREAK = 274,
KW_INT8 = 275,
KW_INT16 = 276,
KW_INT32 = 277,
KW_INT64 = 278,
KW_UINT8 = 279,
KW_UINT16 = 280,
KW_UINT32 = 281,
KW_UINT64 = 282,
KW_FLOAT64 = 283,
KW_STRING = 284,
KW_BLOB = 285,
KW_BLOB32 = 286,
KW_INT8ARRAY = 287,
KW_INT16ARRAY = 288,
KW_INT32ARRAY = 289,
KW_UINT8ARRAY = 290,
KW_UINT16ARRAY = 291,
KW_UINT32ARRAY = 292,
KW_UINT32UINT8ARRAY = 293,
KW_CHAR = 294,
START_DC = 295,
START_PARAMETER_VALUE = 296,
START_PARAMETER_DESCRIPTION = 297
};
#endif
#define UNSIGNED_INTEGER 258
#define SIGNED_INTEGER 259
#define REAL 260
#define STRING 261
#define HEX_STRING 262
#define IDENTIFIER 263
#define KEYWORD 264
#define KW_DCLASS 265
#define KW_STRUCT 266
#define KW_FROM 267
#define KW_IMPORT 268
#define KW_TYPEDEF 269
#define KW_KEYWORD 270
#define KW_SWITCH 271
#define KW_CASE 272
#define KW_DEFAULT 273
#define KW_BREAK 274
#define KW_INT8 275
#define KW_INT16 276
#define KW_INT32 277
#define KW_INT64 278
#define KW_UINT8 279
#define KW_UINT16 280
#define KW_UINT32 281
#define KW_UINT64 282
#define KW_FLOAT64 283
#define KW_STRING 284
#define KW_BLOB 285
#define KW_BLOB32 286
#define KW_INT8ARRAY 287
#define KW_INT16ARRAY 288
#define KW_INT32ARRAY 289
#define KW_UINT8ARRAY 290
#define KW_UINT16ARRAY 291
#define KW_UINT32ARRAY 292
#define KW_UINT32UINT8ARRAY 293
#define KW_CHAR 294
#define START_DC 295
#define START_PARAMETER_VALUE 296
#define START_PARAMETER_DESCRIPTION 297
/* Copy the first part of user declarations. */
#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 "dcKeyword.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
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 DCKeywordList current_keyword_list;
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;
}
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
typedef int YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
/* Copy the second part of user declarations. */
/* Line 214 of yacc.c. */
#line 258 "y.tab.c"
#if ! defined (yyoverflow) || 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) || YYERROR_VERBOSE */
#if (! defined (yyoverflow) \
&& (! defined (__cplusplus) \
|| (YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
short yyss;
YYSTYPE yyvs;
};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
((N) * (sizeof (short) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
/* 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_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)
#endif
#if defined (__STDC__) || defined (__cplusplus)
typedef signed char yysigned_char;
#else
typedef short yysigned_char;
#endif
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 57
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 430
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 58
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 82
/* YYNRULES -- Number of rules. */
#define YYNRULES 190
/* YYNRULES -- Number of states. */
#define YYNSTATES 282
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 297
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const unsigned 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, 54, 2, 2,
51, 52, 46, 2, 47, 55, 45, 44, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 50, 43,
2, 53, 2, 2, 2, 2, 2, 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, 2, 57, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 48, 2, 49, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 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, 2, 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
};
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
static const unsigned short yyprhs[] =
{
0, 0, 3, 6, 9, 12, 14, 17, 20, 23,
26, 29, 32, 34, 38, 40, 44, 47, 48, 54,
56, 58, 60, 64, 67, 70, 72, 75, 78, 80,
82, 83, 91, 93, 95, 98, 100, 104, 106, 109,
113, 116, 119, 122, 125, 126, 134, 136, 138, 141,
143, 147, 149, 152, 156, 159, 162, 165, 168, 169,
175, 177, 179, 181, 185, 187, 188, 192, 194, 196,
197, 202, 204, 205, 210, 212, 214, 216, 218, 220,
222, 225, 228, 231, 233, 238, 242, 246, 248, 250,
252, 254, 256, 258, 262, 265, 269, 275, 280, 282,
284, 288, 291, 295, 301, 306, 308, 313, 315, 319,
323, 328, 330, 332, 334, 336, 338, 340, 342, 344,
346, 348, 350, 352, 353, 358, 360, 362, 364, 366,
368, 369, 374, 375, 380, 381, 386, 390, 394, 398,
402, 404, 407, 409, 411, 413, 417, 419, 421, 423,
425, 427, 429, 431, 433, 435, 437, 439, 441, 443,
445, 447, 449, 451, 453, 455, 457, 459, 462, 464,
465, 470, 472, 474, 478, 480, 482, 483, 493, 495,
498, 501, 504, 508, 512, 513, 518, 521, 523, 525,
527
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const short yyrhs[] =
{
59, 0, -1, 40, 60, -1, 41, 114, -1, 42,
100, -1, 139, -1, 60, 43, -1, 60, 70, -1,
60, 131, -1, 60, 63, -1, 60, 67, -1, 60,
68, -1, 8, -1, 61, 44, 8, -1, 61, -1,
62, 45, 61, -1, 13, 62, -1, -1, 12, 62,
13, 64, 65, -1, 66, -1, 46, -1, 61, -1,
66, 47, 61, -1, 14, 98, -1, 15, 69, -1,
139, -1, 69, 8, -1, 69, 9, -1, 71, -1,
78, -1, -1, 10, 130, 72, 74, 48, 76, 49,
-1, 8, -1, 139, -1, 50, 75, -1, 73, -1,
75, 47, 73, -1, 139, -1, 76, 43, -1, 76,
77, 43, -1, 85, 124, -1, 126, 125, -1, 95,
124, -1, 93, 124, -1, -1, 11, 130, 79, 81,
48, 83, 49, -1, 8, -1, 139, -1, 50, 82,
-1, 80, -1, 82, 47, 80, -1, 139, -1, 83,
43, -1, 83, 84, 43, -1, 85, 125, -1, 126,
125, -1, 95, 125, -1, 93, 125, -1, -1, 130,
51, 86, 87, 52, -1, 139, -1, 88, -1, 89,
-1, 88, 47, 89, -1, 98, -1, -1, 105, 91,
106, -1, 105, -1, 90, -1, -1, 90, 53, 94,
114, -1, 92, -1, -1, 92, 53, 96, 114, -1,
90, -1, 92, -1, 93, -1, 95, -1, 97, -1,
85, -1, 85, 125, -1, 95, 125, -1, 93, 125,
-1, 123, -1, 101, 51, 103, 52, -1, 101, 44,
108, -1, 101, 54, 112, -1, 101, -1, 8, -1,
78, -1, 131, -1, 139, -1, 113, -1, 113, 55,
113, -1, 113, 112, -1, 103, 47, 113, -1, 103,
47, 113, 55, 113, -1, 103, 47, 113, 112, -1,
139, -1, 107, -1, 107, 55, 107, -1, 107, 109,
-1, 104, 47, 107, -1, 104, 47, 107, 55, 107,
-1, 104, 47, 107, 109, -1, 102, -1, 105, 56,
104, 57, -1, 8, -1, 106, 44, 108, -1, 106,
54, 112, -1, 106, 56, 104, 57, -1, 6, -1,
108, -1, 3, -1, 4, -1, 4, -1, 3, -1,
111, -1, 110, -1, 5, -1, 6, -1, 112, -1,
116, -1, -1, 8, 53, 115, 116, -1, 110, -1,
111, -1, 5, -1, 6, -1, 7, -1, -1, 48,
117, 120, 49, -1, -1, 56, 118, 120, 57, -1,
-1, 51, 119, 120, 52, -1, 110, 46, 108, -1,
111, 46, 108, -1, 5, 46, 108, -1, 7, 46,
108, -1, 121, -1, 122, 121, -1, 139, -1, 47,
-1, 114, -1, 122, 47, 114, -1, 20, -1, 21,
-1, 22, -1, 23, -1, 24, -1, 25, -1, 26,
-1, 27, -1, 28, -1, 29, -1, 30, -1, 31,
-1, 32, -1, 33, -1, 34, -1, 35, -1, 36,
-1, 37, -1, 38, -1, 39, -1, 139, -1, 124,
9, -1, 124, -1, -1, 8, 50, 127, 129, -1,
8, -1, 128, -1, 129, 47, 128, -1, 139, -1,
8, -1, -1, 16, 130, 51, 99, 52, 48, 132,
133, 49, -1, 139, -1, 133, 43, -1, 133, 134,
-1, 133, 136, -1, 133, 137, 43, -1, 133, 138,
43, -1, -1, 17, 135, 114, 50, -1, 18, 50,
-1, 19, -1, 95, -1, 93, -1, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned short yyrline[] =
{
0, 168, 168, 169, 170, 177, 178, 179, 190, 196,
197, 198, 202, 203, 210, 211, 218, 223, 222, 230,
231, 238, 242, 249, 267, 271, 272, 276, 287, 288,
293, 292, 305, 328, 329, 333, 339, 353, 354, 355,
368, 378, 379, 387, 398, 397, 410, 433, 434, 438,
444, 453, 454, 455, 466, 473, 474, 478, 486, 485,
504, 505, 509, 510, 514, 524, 523, 534, 538, 540,
539, 568, 570, 569, 598, 599, 603, 604, 608, 612,
619, 623, 627, 634, 638, 647, 663, 678, 679, 711,
727, 746, 750, 757, 764, 773, 779, 785, 796, 800,
807, 814, 821, 827, 833, 842, 843, 854, 859, 874,
889, 896, 905, 909, 920, 934, 938, 942, 946, 950,
954, 963, 968, 973, 972, 988, 992, 996, 1000, 1004,
1009, 1008, 1017, 1016, 1025, 1024, 1032, 1038, 1044, 1050,
1059, 1060, 1064, 1065, 1069, 1070, 1074, 1078, 1082, 1086,
1090, 1094, 1098, 1102, 1106, 1110, 1114, 1118, 1122, 1126,
1130, 1134, 1138, 1142, 1146, 1150, 1157, 1161, 1168, 1178,
1177, 1188, 1204, 1210, 1224, 1228, 1233, 1232, 1246, 1247,
1248, 1249, 1250, 1251, 1265, 1264, 1285, 1294, 1301, 1305,
1311
};
#endif
#if YYDEBUG || YYERROR_VERBOSE
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "UNSIGNED_INTEGER", "SIGNED_INTEGER",
"REAL", "STRING", "HEX_STRING", "IDENTIFIER", "KEYWORD", "KW_DCLASS",
"KW_STRUCT", "KW_FROM", "KW_IMPORT", "KW_TYPEDEF", "KW_KEYWORD",
"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",
"START_DC", "START_PARAMETER_VALUE", "START_PARAMETER_DESCRIPTION",
"';'", "'/'", "'.'", "'*'", "','", "'{'", "'}'", "':'", "'('", "')'",
"'='", "'%'", "'-'", "'['", "']'", "$accept", "grammar", "dc",
"slash_identifier", "import_identifier", "import", "@1",
"import_symbol_list_or_star", "import_symbol_list", "typedef_decl",
"keyword_decl", "keyword_decl_list", "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", "keyword_list",
"no_keyword_list", "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
# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
token YYLEX-NUM. */
static const unsigned short yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
295, 296, 297, 59, 47, 46, 42, 44, 123, 125,
58, 40, 41, 61, 37, 45, 91, 93
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const unsigned char yyr1[] =
{
0, 58, 59, 59, 59, 60, 60, 60, 60, 60,
60, 60, 61, 61, 62, 62, 63, 64, 63, 65,
65, 66, 66, 67, 68, 69, 69, 69, 70, 70,
72, 71, 73, 74, 74, 75, 75, 76, 76, 76,
77, 77, 77, 77, 79, 78, 80, 81, 81, 82,
82, 83, 83, 83, 84, 84, 84, 84, 86, 85,
87, 87, 88, 88, 89, 91, 90, 92, 93, 94,
93, 95, 96, 95, 97, 97, 98, 98, 99, 99,
100, 100, 100, 101, 101, 101, 101, 102, 102, 102,
102, 103, 103, 103, 103, 103, 103, 103, 104, 104,
104, 104, 104, 104, 104, 105, 105, 106, 106, 106,
106, 107, 107, 108, 109, 110, 111, 112, 112, 112,
113, 113, 114, 115, 114, 116, 116, 116, 116, 116,
117, 116, 118, 116, 119, 116, 116, 116, 116, 116,
120, 120, 121, 121, 122, 122, 123, 123, 123, 123,
123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
123, 123, 123, 123, 123, 123, 124, 124, 125, 127,
126, 128, 129, 129, 130, 130, 132, 131, 133, 133,
133, 133, 133, 133, 135, 134, 136, 137, 138, 138,
139
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const unsigned char yyr2[] =
{
0, 2, 2, 2, 2, 1, 2, 2, 2, 2,
2, 2, 1, 3, 1, 3, 2, 0, 5, 1,
1, 1, 3, 2, 2, 1, 2, 2, 1, 1,
0, 7, 1, 1, 2, 1, 3, 1, 2, 3,
2, 2, 2, 2, 0, 7, 1, 1, 2, 1,
3, 1, 2, 3, 2, 2, 2, 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, 1, 0,
4, 1, 1, 3, 1, 1, 0, 9, 1, 2,
2, 2, 3, 3, 0, 4, 2, 1, 1, 1,
0
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const unsigned char yydefact[] =
{
0, 190, 0, 190, 0, 2, 5, 116, 115, 127,
128, 129, 0, 130, 134, 132, 125, 126, 3, 122,
88, 190, 190, 146, 147, 148, 149, 150, 151, 152,
153, 154, 155, 156, 157, 158, 159, 160, 161, 162,
163, 164, 165, 89, 190, 68, 71, 190, 190, 4,
87, 105, 67, 83, 0, 90, 174, 1, 190, 0,
0, 0, 190, 6, 9, 10, 11, 7, 28, 29,
8, 0, 0, 123, 190, 190, 190, 0, 0, 175,
44, 0, 168, 80, 166, 69, 72, 82, 81, 0,
190, 0, 190, 0, 58, 30, 12, 14, 0, 16,
88, 76, 77, 23, 24, 25, 113, 138, 139, 0,
143, 144, 0, 140, 190, 142, 0, 0, 136, 137,
190, 190, 167, 0, 0, 85, 119, 120, 0, 118,
117, 121, 92, 91, 86, 111, 0, 99, 112, 98,
107, 66, 190, 190, 0, 17, 0, 26, 27, 124,
131, 143, 141, 135, 133, 0, 0, 47, 79, 74,
75, 78, 0, 70, 73, 0, 84, 0, 94, 0,
106, 114, 0, 101, 0, 0, 190, 0, 61, 62,
64, 60, 0, 0, 33, 13, 0, 15, 145, 46,
49, 48, 190, 0, 95, 93, 102, 100, 108, 109,
0, 59, 0, 32, 35, 34, 190, 20, 21, 18,
19, 0, 190, 51, 176, 0, 97, 0, 104, 110,
63, 0, 190, 37, 0, 50, 88, 52, 45, 0,
190, 190, 190, 190, 190, 96, 103, 36, 38, 31,
0, 190, 190, 190, 190, 22, 169, 53, 54, 57,
56, 55, 0, 178, 39, 40, 43, 42, 41, 0,
184, 0, 187, 179, 177, 189, 188, 180, 181, 0,
0, 171, 172, 170, 0, 186, 182, 183, 0, 0,
173, 185
};
/* YYDEFGOTO[NTERM-NUM]. */
static const short yydefgoto[] =
{
-1, 4, 5, 97, 98, 64, 186, 209, 210, 65,
66, 104, 67, 68, 143, 204, 183, 205, 222, 240,
43, 120, 190, 156, 191, 212, 229, 44, 142, 177,
178, 179, 45, 93, 46, 101, 123, 102, 124, 161,
180, 162, 49, 50, 51, 128, 136, 52, 141, 137,
138, 173, 16, 17, 131, 132, 111, 109, 19, 74,
76, 75, 112, 113, 114, 53, 82, 83, 233, 259,
272, 273, 54, 55, 234, 252, 267, 274, 268, 269,
270, 84
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -127
static const short yypact[] =
{
8, -127, 104, 359, 35, 128, -127, -127, -127, 20,
-127, 22, 28, -127, -127, -127, 37, 53, -127, -127,
54, 139, 139, -127, -127, -127, -127, -127, -127, -127,
-127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
-127, -127, -127, -127, -127, 95, 97, -127, -127, -127,
2, -127, 26, -127, 100, -127, -127, -127, 139, 145,
145, 391, -127, -127, -127, -127, -127, -127, -127, -127,
-127, 151, 151, -127, 24, 24, 24, 151, 151, -127,
-127, 108, 152, -127, -127, -127, -127, -127, -127, 151,
127, 98, 64, 154, -127, -127, -127, 119, 13, 120,
-127, -127, -127, -127, 106, -127, -127, -127, -127, 122,
-127, -127, 115, -127, 121, -127, 114, 110, -127, -127,
124, 359, -127, 104, 104, -127, -127, -127, 12, -127,
-127, -127, 14, -127, -127, -127, 16, 7, -127, -127,
-127, 1, 391, 125, 161, -127, 145, -127, -127, -127,
-127, 104, -127, -127, -127, 164, 129, -127, -127, -127,
-127, -127, 130, -127, -127, 127, -127, 127, -127, 64,
-127, -127, 64, -127, 151, 98, 64, 131, 133, -127,
-127, -127, 168, 136, -127, -127, 6, 119, -127, -127,
-127, 134, -127, 137, 33, -127, 19, -127, -127, -127,
43, -127, 391, -127, -127, 140, -127, -127, 119, -127,
141, 164, 291, -127, -127, 127, -127, 64, -127, -127,
-127, 168, 325, -127, 145, -127, 69, -127, -127, 143,
-127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
146, -127, -127, -127, -127, 119, -127, -127, -127, -127,
-127, -127, 257, -127, -127, 152, 152, 152, -127, 186,
-127, 147, -127, -127, -127, -127, -127, -127, -127, 153,
155, -127, -127, 156, 104, -127, -127, -127, 186, 149,
-127, -127
};
/* YYPGOTO[NTERM-NUM]. */
static const short yypgoto[] =
{
-127, -127, -127, -126, 142, -127, -127, -127, -127, -127,
-127, -127, -127, -127, -127, -21, -127, -127, -127, -127,
196, -127, -6, -127, -127, -127, -127, -116, -127, -127,
-127, 4, 86, -127, 87, -1, -127, 0, -127, -127,
157, -127, -127, -127, -127, -127, 34, -127, -127, -125,
-56, 17, -81, -78, -90, -124, -2, -127, 105, -127,
-127, -127, 60, 102, -127, -127, -85, -40, -5, -127,
-59, -127, 18, 215, -127, -127, -127, -127, -127, -127,
-127, 3
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -176
static const short yytable[] =
{
18, 134, 47, 48, 6, 158, 56, 87, 88, 129,
129, 171, 130, 130, 96, 107, 108, 7, 8, 126,
187, 118, 119, 171, 56, 56, 145, 7, 8, 9,
10, 11, 12, 125, -65, 57, 7, 8, 126, 80,
81, 194, 168, 195, 196, 174, 89, 197, 1, 2,
3, 129, 207, 90, 130, 175, 91, 176, 146, 165,
208, 56, 172, 169, 166, 105, 71, 106, 72, 167,
135, 110, 13, 170, 217, 14, 95, 115, 115, 115,
15, 73, 92, 77, 129, 199, 129, 130, 215, 130,
169, 235, 236, 133, 129, 139, 230, 130, 245, 78,
219, 7, 8, 126, 216, -175, 241, 7, 8, 9,
10, 11, 12, 129, 147, 148, 130, 115, 198, 246,
-175, 163, 164, 157, 56, 7, 8, 9, 10, 11,
7, 8, 126, 127, 129, 116, 117, 130, 58, 21,
59, 60, 61, 62, 22, 181, 184, 79, 85, 188,
86, 94, 13, 96, 106, 14, 255, 256, 257, 121,
15, 122, 140, 144, 150, 146, 153, 154, 151, 185,
13, 63, 189, 14, 155, 182, 203, 192, 15, 139,
202, 211, 193, 201, 206, 214, 247, 221, 224, 254,
248, 249, 250, 251, 271, 213, 276, 275, 277, 281,
237, 69, 99, 278, 258, 225, 220, 159, 160, 223,
200, 231, 232, 218, 149, 56, 152, 244, 103, 280,
70, 242, 243, 0, 0, 56, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 253, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 265, 266, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 100, 0, 0, 21, 0,
0, 0, 279, 22, 260, 261, 262, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 0, 0, 226,
263, 0, 21, 0, 0, 0, 264, 22, 0, 0,
0, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 0, 0, 226, 227, 0, 21, 0, 0, 0,
228, 22, 0, 0, 0, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 0, 0, 20, 238, 0,
21, 0, 0, 0, 239, 22, 0, 0, 0, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
34, 35, 36, 37, 38, 39, 40, 41, 42, 100,
0, 0, 21, 0, 0, 0, 0, 22, 0, 0,
0, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42
};
static const short yycheck[] =
{
2, 91, 3, 3, 1, 121, 3, 47, 48, 90,
91, 4, 90, 91, 8, 71, 72, 3, 4, 5,
146, 77, 78, 4, 21, 22, 13, 3, 4, 5,
6, 7, 8, 89, 8, 0, 3, 4, 5, 21,
22, 165, 132, 167, 169, 44, 44, 172, 40, 41,
42, 132, 46, 51, 132, 54, 54, 56, 45, 47,
186, 58, 55, 47, 52, 62, 46, 3, 46, 55,
6, 47, 48, 57, 55, 51, 58, 74, 75, 76,
56, 53, 56, 46, 165, 175, 167, 165, 55, 167,
47, 215, 217, 90, 175, 92, 212, 175, 224, 46,
57, 3, 4, 5, 194, 51, 222, 3, 4, 5,
6, 7, 8, 194, 8, 9, 194, 114, 174, 50,
51, 123, 124, 120, 121, 3, 4, 5, 6, 7,
3, 4, 5, 6, 215, 75, 76, 215, 10, 11,
12, 13, 14, 15, 16, 142, 143, 8, 53, 151,
53, 51, 48, 8, 3, 51, 241, 242, 243, 51,
56, 9, 8, 44, 49, 45, 52, 57, 47, 8,
48, 43, 8, 51, 50, 50, 8, 48, 56, 176,
47, 47, 52, 52, 48, 48, 43, 47, 47, 43,
230, 231, 232, 233, 8, 192, 43, 50, 43, 50,
221, 5, 60, 47, 244, 211, 202, 121, 121, 206,
176, 212, 212, 196, 109, 212, 114, 222, 61, 278,
5, 222, 222, -1, -1, 222, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 234, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 252, 252, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 8, -1, -1, 11, -1,
-1, -1, 274, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
33, 34, 35, 36, 37, 38, 39, -1, -1, 8,
43, -1, 11, -1, -1, -1, 49, 16, -1, -1,
-1, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, -1, -1, 8, 43, -1, 11, -1, -1, -1,
49, 16, -1, -1, -1, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, -1, -1, 8, 43, -1,
11, -1, -1, -1, 49, 16, -1, -1, -1, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 8,
-1, -1, 11, -1, -1, -1, -1, 16, -1, -1,
-1, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const unsigned char yystos[] =
{
0, 40, 41, 42, 59, 60, 139, 3, 4, 5,
6, 7, 8, 48, 51, 56, 110, 111, 114, 116,
8, 11, 16, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 78, 85, 90, 92, 93, 95, 100,
101, 102, 105, 123, 130, 131, 139, 0, 10, 12,
13, 14, 15, 43, 63, 67, 68, 70, 71, 78,
131, 46, 46, 53, 117, 119, 118, 46, 46, 8,
130, 130, 124, 125, 139, 53, 53, 125, 125, 44,
51, 54, 56, 91, 51, 130, 8, 61, 62, 62,
8, 93, 95, 98, 69, 139, 3, 108, 108, 115,
47, 114, 120, 121, 122, 139, 120, 120, 108, 108,
79, 51, 9, 94, 96, 108, 5, 6, 103, 110,
111, 112, 113, 139, 112, 6, 104, 107, 108, 139,
8, 106, 86, 72, 44, 13, 45, 8, 9, 116,
49, 47, 121, 52, 57, 50, 81, 139, 85, 90,
92, 97, 99, 114, 114, 47, 52, 55, 112, 47,
57, 4, 55, 109, 44, 54, 56, 87, 88, 89,
98, 139, 50, 74, 139, 8, 64, 61, 114, 8,
80, 82, 48, 52, 113, 113, 107, 107, 108, 112,
104, 52, 47, 8, 73, 75, 48, 46, 61, 65,
66, 47, 83, 139, 48, 55, 112, 55, 109, 57,
89, 47, 76, 139, 47, 80, 8, 43, 49, 84,
85, 93, 95, 126, 132, 113, 107, 73, 43, 49,
77, 85, 93, 95, 126, 61, 50, 43, 125, 125,
125, 125, 133, 139, 43, 124, 124, 124, 125, 127,
17, 18, 19, 43, 49, 93, 95, 134, 136, 137,
138, 8, 128, 129, 135, 50, 43, 43, 47, 114,
128, 50
};
#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); \
yytoken = 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). */
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
Current.first_line = Rhs[1].first_line; \
Current.first_column = Rhs[1].first_column; \
Current.last_line = Rhs[N].last_line; \
Current.last_column = Rhs[N].last_column;
#endif
/* YYLEX -- calling `yylex' with the right arguments. */
#ifdef YYLEX_PARAM
# define YYLEX yylex (YYLEX_PARAM)
#else
# define YYLEX yylex ()
#endif
/* 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)
# define YYDSYMPRINT(Args) \
do { \
if (yydebug) \
yysymprint Args; \
} while (0)
# define YYDSYMPRINTF(Title, Token, Value, Location) \
do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yysymprint (stderr, \
Token, Value); \
YYFPRINTF (stderr, "\n"); \
} \
} while (0)
/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (cinluded). |
`------------------------------------------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
static void
yy_stack_print (short *bottom, short *top)
#else
static void
yy_stack_print (bottom, top)
short *bottom;
short *top;
#endif
{
YYFPRINTF (stderr, "Stack now");
for (/* Nothing. */; bottom <= top; ++bottom)
YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
# define YY_STACK_PRINT(Bottom, Top) \
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
} while (0)
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
static void
yy_reduce_print (int yyrule)
#else
static void
yy_reduce_print (yyrule)
int yyrule;
#endif
{
int yyi;
unsigned int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
yyrule - 1, yylno);
/* Print the symbols being reduced, and their result. */
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
}
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
yy_reduce_print (Rule); \
} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
# define YYDSYMPRINT(Args)
# define YYDSYMPRINTF(Title, Token, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#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
#if 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 /* !YYERROR_VERBOSE */
#if YYDEBUG
/*--------------------------------.
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
static void
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
#else
static void
yysymprint (yyoutput, yytype, yyvaluep)
FILE *yyoutput;
int yytype;
YYSTYPE *yyvaluep;
#endif
{
/* Pacify ``unused variable'' warnings. */
(void) yyvaluep;
if (yytype < YYNTOKENS)
{
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
# ifdef YYPRINT
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# endif
}
else
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
switch (yytype)
{
default:
break;
}
YYFPRINTF (yyoutput, ")");
}
#endif /* ! YYDEBUG */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
static void
yydestruct (int yytype, YYSTYPE *yyvaluep)
#else
static void
yydestruct (yytype, yyvaluep)
int yytype;
YYSTYPE *yyvaluep;
#endif
{
/* Pacify ``unused variable'' warnings. */
(void) yyvaluep;
switch (yytype)
{
default:
break;
}
}
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM);
# else
int yyparse ();
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
/* The lookahead symbol. */
int yychar;
/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
/* Number of syntax errors so far. */
int yynerrs;
/*----------.
| yyparse. |
`----------*/
#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM)
# else
int yyparse (YYPARSE_PARAM)
void *YYPARSE_PARAM;
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
int
yyparse (void)
#else
int
yyparse ()
#endif
#endif
{
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 yytoken = 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;
#define YYPOPSTACK (yyvsp--, yyssp--)
YYSIZE_T yystacksize = YYINITDEPTH;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
/* 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;
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 (yyss + yystacksize - 1 <= yyssp)
{
/* 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. 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),
&yystacksize);
yyss = yyss1;
yyvs = yyvs1;
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
goto yyoverflowlab;
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyoverflowlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
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);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
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 == YYPACT_NINF)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
yychar = YYLEX;
}
if (yychar <= YYEOF)
{
yychar = yytoken = YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
else
{
yytoken = YYTRANSLATE (yychar);
YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
}
/* If the proper action on seeing token YYTOKEN is to reduce or to
detect an error, take that action. */
yyn += yytoken;
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
goto yydefault;
yyn = yytable[yyn];
if (yyn <= 0)
{
if (yyn == 0 || yyn == YYTABLE_NINF)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
/* 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 garbage.
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];
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
case 4:
#line 171 "dcParser.yxx"
{
parameter_description = yyvsp[0].u.field;
}
break;
case 7:
#line 180 "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 8:
#line 191 "dcParser.yxx"
{
if (!dc_file->add_switch(yyvsp[0].u.dswitch)) {
yyerror("Duplicate class name: " + yyvsp[0].u.dswitch->get_name());
}
}
break;
case 13:
#line 204 "dcParser.yxx"
{
yyval.str = yyvsp[-2].str + string("/") + yyvsp[0].str;
}
break;
case 15:
#line 212 "dcParser.yxx"
{
yyval.str = yyvsp[-2].str + string(".") + yyvsp[0].str;
}
break;
case 16:
#line 219 "dcParser.yxx"
{
dc_file->add_import_module(yyvsp[0].str);
}
break;
case 17:
#line 223 "dcParser.yxx"
{
dc_file->add_import_module(yyvsp[-1].str);
}
break;
case 20:
#line 232 "dcParser.yxx"
{
dc_file->add_import_symbol("*");
}
break;
case 21:
#line 239 "dcParser.yxx"
{
dc_file->add_import_symbol(yyvsp[0].str);
}
break;
case 22:
#line 243 "dcParser.yxx"
{
dc_file->add_import_symbol(yyvsp[0].str);
}
break;
case 23:
#line 250 "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 26:
#line 273 "dcParser.yxx"
{
dc_file->add_keyword(yyvsp[0].str);
}
break;
case 27:
#line 277 "dcParser.yxx"
{
// This keyword has already been defined. But since we are now
// explicitly defining it, clear its bitmask, so that we will have a
// new hash code--doing this will allow us to phase out the
// historical hash code support later.
((DCKeyword *)yyvsp[0].u.keyword)->clear_historical_flag();
}
break;
case 30:
#line 293 "dcParser.yxx"
{
yyval.u.dclass = current_class;
current_class = new DCClass(dc_file, yyvsp[0].str, false, false);
}
break;
case 31:
#line 298 "dcParser.yxx"
{
yyval.u.dclass = current_class;
current_class = yyvsp[-4].u.dclass;
}
break;
case 32:
#line 306 "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 35:
#line 334 "dcParser.yxx"
{
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
current_class->add_parent(yyvsp[0].u.dclass);
}
}
break;
case 36:
#line 340 "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 39:
#line 356 "dcParser.yxx"
{
if (yyvsp[-1].u.field == (DCField *)NULL) {
// Pass this error up.
} else if (!current_class->add_field(yyvsp[-1].u.field)) {
yyerror("Duplicate field name: " + yyvsp[-1].u.field->get_name());
} else if (yyvsp[-1].u.field->get_number() < 0) {
yyerror("A non-network field cannot be stored on a dclass");
}
}
break;
case 40:
#line 369 "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->copy_keywords(current_keyword_list);
}
yyval.u.field = yyvsp[-1].u.field;
}
break;
case 42:
#line 380 "dcParser.yxx"
{
yyerror("Unnamed parameters are not allowed on a dclass");
if (yyvsp[-1].u.parameter != (DCField *)NULL) {
yyvsp[-1].u.parameter->copy_keywords(current_keyword_list);
}
yyval.u.field = yyvsp[-1].u.parameter;
}
break;
case 43:
#line 388 "dcParser.yxx"
{
if (yyvsp[-1].u.parameter != (DCField *)NULL) {
yyvsp[-1].u.parameter->copy_keywords(current_keyword_list);
}
yyval.u.field = yyvsp[-1].u.parameter;
}
break;
case 44:
#line 398 "dcParser.yxx"
{
yyval.u.dclass = current_class;
current_class = new DCClass(dc_file, yyvsp[0].str, true, false);
}
break;
case 45:
#line 403 "dcParser.yxx"
{
yyval.u.dclass = current_class;
current_class = yyvsp[-4].u.dclass;
}
break;
case 46:
#line 411 "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 49:
#line 439 "dcParser.yxx"
{
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
current_class->add_parent(yyvsp[0].u.dclass);
}
}
break;
case 50:
#line 445 "dcParser.yxx"
{
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
current_class->add_parent(yyvsp[0].u.dclass);
}
}
break;
case 53:
#line 456 "dcParser.yxx"
{
if (yyvsp[-1].u.field == (DCField *)NULL) {
// Pass this error up.
} else if (!current_class->add_field(yyvsp[-1].u.field)) {
yyerror("Duplicate field name: " + yyvsp[-1].u.field->get_name());
}
}
break;
case 54:
#line 467 "dcParser.yxx"
{
if (yyvsp[-1].u.field->get_name().empty()) {
yyerror("Field name required.");
}
yyval.u.field = yyvsp[-1].u.field;
}
break;
case 56:
#line 475 "dcParser.yxx"
{
yyval.u.field = yyvsp[-1].u.parameter;
}
break;
case 57:
#line 479 "dcParser.yxx"
{
yyval.u.field = yyvsp[-1].u.parameter;
}
break;
case 58:
#line 486 "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 59:
#line 497 "dcParser.yxx"
{
yyval.u.field = current_atomic;
current_atomic = yyvsp[-2].u.atomic;
}
break;
case 64:
#line 515 "dcParser.yxx"
{
if (yyvsp[0].u.parameter != (DCParameter *)NULL) {
current_atomic->add_element(yyvsp[0].u.parameter);
}
}
break;
case 65:
#line 524 "dcParser.yxx"
{
current_parameter = yyvsp[0].u.parameter;
}
break;
case 66:
#line 528 "dcParser.yxx"
{
yyval.u.parameter = yyvsp[0].u.parameter;
}
break;
case 69:
#line 540 "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 70:
#line 548 "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 570 "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 73:
#line 578 "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 78:
#line 609 "dcParser.yxx"
{
yyval.u.field = yyvsp[0].u.parameter;
}
break;
case 79:
#line 613 "dcParser.yxx"
{
yyval.u.field = yyvsp[0].u.field;
}
break;
case 80:
#line 620 "dcParser.yxx"
{
yyval.u.field = yyvsp[-1].u.field;
}
break;
case 81:
#line 624 "dcParser.yxx"
{
yyval.u.field = yyvsp[-1].u.parameter;
}
break;
case 82:
#line 628 "dcParser.yxx"
{
yyval.u.field = yyvsp[-1].u.parameter;
}
break;
case 83:
#line 635 "dcParser.yxx"
{
yyval.u.parameter = new DCSimpleParameter(yyvsp[0].u.subatomic);
}
break;
case 84:
#line 639 "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 85:
#line 648 "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 86:
#line 664 "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 88:
#line 680 "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 89:
#line 712 "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 90:
#line 728 "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 91:
#line 747 "dcParser.yxx"
{
double_range.clear();
}
break;
case 92:
#line 751 "dcParser.yxx"
{
double_range.clear();
if (!double_range.add_range(yyvsp[0].u.real, yyvsp[0].u.real)) {
yyerror("Overlapping range");
}
}
break;
case 93:
#line 758 "dcParser.yxx"
{
double_range.clear();
if (!double_range.add_range(yyvsp[-2].u.real, yyvsp[0].u.real)) {
yyerror("Overlapping range");
}
}
break;
case 94:
#line 765 "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 95:
#line 774 "dcParser.yxx"
{
if (!double_range.add_range(yyvsp[0].u.real, yyvsp[0].u.real)) {
yyerror("Overlapping range");
}
}
break;
case 96:
#line 780 "dcParser.yxx"
{
if (!double_range.add_range(yyvsp[-2].u.real, yyvsp[0].u.real)) {
yyerror("Overlapping range");
}
}
break;
case 97:
#line 786 "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 98:
#line 797 "dcParser.yxx"
{
uint_range.clear();
}
break;
case 99:
#line 801 "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 100:
#line 808 "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 101:
#line 815 "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 102:
#line 822 "dcParser.yxx"
{
if (!uint_range.add_range(yyvsp[0].u.s_uint, yyvsp[0].u.s_uint)) {
yyerror("Overlapping range");
}
}
break;
case 103:
#line 828 "dcParser.yxx"
{
if (!uint_range.add_range(yyvsp[-2].u.s_uint, yyvsp[0].u.s_uint)) {
yyerror("Overlapping range");
}
}
break;
case 104:
#line 834 "dcParser.yxx"
{
if (!uint_range.add_range(yyvsp[-1].u.s_uint, yyvsp[0].u.s_uint)) {
yyerror("Overlapping range");
}
}
break;
case 106:
#line 844 "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 107:
#line 855 "dcParser.yxx"
{
current_parameter->set_name(yyvsp[0].str);
yyval.u.parameter = current_parameter;
}
break;
case 108:
#line 860 "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 109:
#line 875 "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 110:
#line 890 "dcParser.yxx"
{
yyval.u.parameter = yyvsp[-3].u.parameter->append_array_specification(uint_range);
}
break;
case 111:
#line 897 "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 113:
#line 910 "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 114:
#line 921 "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 117:
#line 943 "dcParser.yxx"
{
yyval.u.real = (double)yyvsp[0].u.uint64;
}
break;
case 118:
#line 947 "dcParser.yxx"
{
yyval.u.real = (double)yyvsp[0].u.int64;
}
break;
case 120:
#line 955 "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 122:
#line 969 "dcParser.yxx"
{
yyval = yyvsp[0];
}
break;
case 123:
#line 973 "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 124:
#line 982 "dcParser.yxx"
{
yyval = yyvsp[0];
}
break;
case 125:
#line 989 "dcParser.yxx"
{
current_packer->pack_int64(yyvsp[0].u.int64);
}
break;
case 126:
#line 993 "dcParser.yxx"
{
current_packer->pack_uint64(yyvsp[0].u.uint64);
}
break;
case 127:
#line 997 "dcParser.yxx"
{
current_packer->pack_double(yyvsp[0].u.real);
}
break;
case 128:
#line 1001 "dcParser.yxx"
{
current_packer->pack_string(yyvsp[0].str);
}
break;
case 129:
#line 1005 "dcParser.yxx"
{
current_packer->pack_literal_value(yyvsp[0].str);
}
break;
case 130:
#line 1009 "dcParser.yxx"
{
current_packer->push();
}
break;
case 131:
#line 1013 "dcParser.yxx"
{
current_packer->pop();
}
break;
case 132:
#line 1017 "dcParser.yxx"
{
current_packer->push();
}
break;
case 133:
#line 1021 "dcParser.yxx"
{
current_packer->pop();
}
break;
case 134:
#line 1025 "dcParser.yxx"
{
current_packer->push();
}
break;
case 135:
#line 1029 "dcParser.yxx"
{
current_packer->pop();
}
break;
case 136:
#line 1033 "dcParser.yxx"
{
for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) {
current_packer->pack_int64(yyvsp[-2].u.int64);
}
}
break;
case 137:
#line 1039 "dcParser.yxx"
{
for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) {
current_packer->pack_uint64(yyvsp[-2].u.uint64);
}
}
break;
case 138:
#line 1045 "dcParser.yxx"
{
for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) {
current_packer->pack_double(yyvsp[-2].u.real);
}
}
break;
case 139:
#line 1051 "dcParser.yxx"
{
for (unsigned int i = 0; i < yyvsp[0].u.s_uint; i++) {
current_packer->pack_literal_value(yyvsp[-2].str);
}
}
break;
case 146:
#line 1075 "dcParser.yxx"
{
yyval.u.subatomic = ST_int8;
}
break;
case 147:
#line 1079 "dcParser.yxx"
{
yyval.u.subatomic = ST_int16;
}
break;
case 148:
#line 1083 "dcParser.yxx"
{
yyval.u.subatomic = ST_int32;
}
break;
case 149:
#line 1087 "dcParser.yxx"
{
yyval.u.subatomic = ST_int64;
}
break;
case 150:
#line 1091 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint8;
}
break;
case 151:
#line 1095 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint16;
}
break;
case 152:
#line 1099 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint32;
}
break;
case 153:
#line 1103 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint64;
}
break;
case 154:
#line 1107 "dcParser.yxx"
{
yyval.u.subatomic = ST_float64;
}
break;
case 155:
#line 1111 "dcParser.yxx"
{
yyval.u.subatomic = ST_string;
}
break;
case 156:
#line 1115 "dcParser.yxx"
{
yyval.u.subatomic = ST_blob;
}
break;
case 157:
#line 1119 "dcParser.yxx"
{
yyval.u.subatomic = ST_blob32;
}
break;
case 158:
#line 1123 "dcParser.yxx"
{
yyval.u.subatomic = ST_int8array;
}
break;
case 159:
#line 1127 "dcParser.yxx"
{
yyval.u.subatomic = ST_int16array;
}
break;
case 160:
#line 1131 "dcParser.yxx"
{
yyval.u.subatomic = ST_int32array;
}
break;
case 161:
#line 1135 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint8array;
}
break;
case 162:
#line 1139 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint16array;
}
break;
case 163:
#line 1143 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint32array;
}
break;
case 164:
#line 1147 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint32uint8array;
}
break;
case 165:
#line 1151 "dcParser.yxx"
{
yyval.u.subatomic = ST_char;
}
break;
case 166:
#line 1158 "dcParser.yxx"
{
current_keyword_list.clear_keywords();
}
break;
case 167:
#line 1162 "dcParser.yxx"
{
current_keyword_list.add_keyword(yyvsp[0].u.keyword);
}
break;
case 168:
#line 1169 "dcParser.yxx"
{
if (current_keyword_list.get_num_keywords() != 0) {
yyerror("Communication keywords are not allowed here.");
}
}
break;
case 169:
#line 1178 "dcParser.yxx"
{
current_molecular = new DCMolecularField(yyvsp[-1].str, current_class);
}
break;
case 170:
#line 1182 "dcParser.yxx"
{
yyval.u.field = current_molecular;
}
break;
case 171:
#line 1189 "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 172:
#line 1205 "dcParser.yxx"
{
if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
current_molecular->add_atomic(yyvsp[0].u.atomic);
}
}
break;
case 173:
#line 1211 "dcParser.yxx"
{
if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
current_molecular->add_atomic(yyvsp[0].u.atomic);
if (!current_molecular->compare_keywords(*yyvsp[0].u.atomic)) {
yyerror("Mismatched keywords in molecule between " +
current_molecular->get_atomic(0)->get_name() + " and " +
yyvsp[0].u.atomic->get_name());
}
}
}
break;
case 174:
#line 1225 "dcParser.yxx"
{
yyval.str = "";
}
break;
case 176:
#line 1233 "dcParser.yxx"
{
yyval.u.dswitch = current_switch;
current_switch = new DCSwitch(yyvsp[-4].str, yyvsp[-2].u.field);
}
break;
case 177:
#line 1238 "dcParser.yxx"
{
yyval.u.dswitch = current_switch;
current_switch = (DCSwitch *)yyvsp[-2].u.parameter;
}
break;
case 183:
#line 1252 "dcParser.yxx"
{
if (!current_switch->is_field_valid()) {
yyerror("case declaration required before first element");
} else if (yyvsp[-1].u.field != (DCField *)NULL) {
if (!current_switch->add_field(yyvsp[-1].u.field)) {
yyerror("Duplicate field name: " + yyvsp[-1].u.field->get_name());
}
}
}
break;
case 184:
#line 1265 "dcParser.yxx"
{
current_packer = &default_packer;
current_packer->clear_data();
current_packer->begin_pack(current_switch->get_key_parameter());
}
break;
case 185:
#line 1271 "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 186:
#line 1286 "dcParser.yxx"
{
if (!current_switch->add_default()) {
yyerror("Default case already defined");
}
}
break;
case 187:
#line 1295 "dcParser.yxx"
{
current_switch->add_break();
}
break;
case 188:
#line 1302 "dcParser.yxx"
{
yyval.u.field = yyvsp[0].u.parameter;
}
break;
case 189:
#line 1306 "dcParser.yxx"
{
yyval.u.field = yyvsp[0].u.parameter;
}
break;
}
/* Line 999 of yacc.c. */
#line 2759 "y.tab.c"
yyvsp -= yylen;
yyssp -= yylen;
YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
/* 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 - YYNTOKENS] + *yyssp;
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTOKENS];
goto yynewstate;
/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
#if YYERROR_VERBOSE
yyn = yypact[yystate];
if (YYPACT_NINF < yyn && yyn < YYLAST)
{
YYSIZE_T yysize = 0;
int yytype = YYTRANSLATE (yychar);
const char* yyprefix;
char *yymsg;
int yyx;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = YYLAST - yyn;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
int yycount = 0;
yyprefix = ", expecting ";
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
yycount += 1;
if (yycount == 5)
{
yysize = 0;
break;
}
}
yysize += (sizeof ("syntax error, unexpected ")
+ yystrlen (yytname[yytype]));
yymsg = (char *) YYSTACK_ALLOC (yysize);
if (yymsg != 0)
{
char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
yyp = yystpcpy (yyp, yytname[yytype]);
if (yycount < 5)
{
yyprefix = ", expecting ";
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
yyp = yystpcpy (yyp, yyprefix);
yyp = yystpcpy (yyp, yytname[yyx]);
yyprefix = " or ";
}
}
yyerror (yymsg);
YYSTACK_FREE (yymsg);
}
else
yyerror ("syntax error; also virtual memory exhausted");
}
else
#endif /* YYERROR_VERBOSE */
yyerror ("syntax error");
}
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)
{
/* Pop the error token. */
YYPOPSTACK;
/* Pop the rest of the stack. */
while (yyss < yyssp)
{
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
yydestruct (yystos[*yyssp], yyvsp);
YYPOPSTACK;
}
YYABORT;
}
YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
yydestruct (yytoken, &yylval);
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token after shifting the error
token. */
goto yyerrlab1;
/*----------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action. |
`----------------------------------------------------*/
yyerrlab1:
yyerrstatus = 3; /* Each real token shifted decrements this. */
for (;;)
{
yyn = yypact[yystate];
if (yyn != YYPACT_NINF)
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
{
yyn = yytable[yyn];
if (0 < yyn)
break;
}
}
/* Pop the current state because it cannot handle the error token. */
if (yyssp == yyss)
YYABORT;
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
yydestruct (yystos[yystate], yyvsp);
yyvsp--;
yystate = *--yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
if (yyn == YYFINAL)
YYACCEPT;
YYDPRINTF ((stderr, "Shifting error token, "));
*++yyvsp = yylval;
yystate = yyn;
goto yynewstate;
/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here. |
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
goto yyreturn;
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
goto yyreturn;
#ifndef yyoverflow
/*----------------------------------------------.
| yyoverflowlab -- parser overflow comes here. |
`----------------------------------------------*/
yyoverflowlab:
yyerror ("parser stack overflow");
yyresult = 2;
/* Fall through. */
#endif
yyreturn:
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
return yyresult;
}