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

1824 lines
48 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.875. */
/* Skeleton parser for Yacc-like parsing with 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. */
/* 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 {
INTEGER = 258,
REAL = 259,
STRING = 260,
HEX_STRING = 261,
IDENTIFIER = 262,
KW_DCLASS = 263,
KW_INT8 = 264,
KW_INT16 = 265,
KW_INT32 = 266,
KW_INT64 = 267,
KW_UINT8 = 268,
KW_UINT16 = 269,
KW_UINT32 = 270,
KW_UINT64 = 271,
KW_FLOAT64 = 272,
KW_STRING = 273,
KW_BLOB = 274,
KW_INT8ARRAY = 275,
KW_INT16ARRAY = 276,
KW_INT32ARRAY = 277,
KW_UINT8ARRAY = 278,
KW_UINT16ARRAY = 279,
KW_UINT32ARRAY = 280,
KW_UINT32UINT8ARRAY = 281,
KW_MOL = 282,
KW_REQUIRED = 283,
KW_BROADCAST = 284,
KW_P2P = 285,
KW_RAM = 286,
KW_DB = 287,
KW_CLSEND = 288,
KW_CLRECV = 289,
KW_OWNSEND = 290
};
#endif
#define INTEGER 258
#define REAL 259
#define STRING 260
#define HEX_STRING 261
#define IDENTIFIER 262
#define KW_DCLASS 263
#define KW_INT8 264
#define KW_INT16 265
#define KW_INT32 266
#define KW_INT64 267
#define KW_UINT8 268
#define KW_UINT16 269
#define KW_UINT32 270
#define KW_UINT64 271
#define KW_FLOAT64 272
#define KW_STRING 273
#define KW_BLOB 274
#define KW_INT8ARRAY 275
#define KW_INT16ARRAY 276
#define KW_INT32ARRAY 277
#define KW_UINT8ARRAY 278
#define KW_UINT16ARRAY 279
#define KW_UINT32ARRAY 280
#define KW_UINT32UINT8ARRAY 281
#define KW_MOL 282
#define KW_REQUIRED 283
#define KW_BROADCAST 284
#define KW_P2P 285
#define KW_RAM 286
#define KW_DB 287
#define KW_CLSEND 288
#define KW_CLRECV 289
#define KW_OWNSEND 290
/* Copy the first part of user declarations. */
#line 6 "dcParser.yxx"
#include "dcLexerDefs.h"
#include "dcParserDefs.h"
#include "dcFile.h"
#include "dcClass.h"
#include "dcAtomicField.h"
#include "dcMolecularField.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 DCAtomicField *current_atomic = (DCAtomicField *)NULL;
static DCMolecularField *current_molecular = (DCMolecularField *)NULL;
static DCAtomicField::ElementType atomic_element;
////////////////////////////////////////////////////////////////////
// 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_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 204 "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 3
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 79
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 46
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 26
/* YYNRULES -- Number of rules. */
#define YYNRULES 77
/* YYNRULES -- Number of states. */
#define YYNSTATES 101
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 290
#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, 2, 2, 2,
41, 42, 45, 2, 40, 2, 2, 43, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 39, 36,
2, 44, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 37, 2, 38, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 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
};
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
static const unsigned char yyprhs[] =
{
0, 0, 3, 5, 8, 11, 12, 20, 22, 24,
27, 29, 33, 35, 38, 41, 44, 45, 52, 54,
56, 58, 60, 64, 65, 69, 71, 75, 78, 82,
86, 90, 94, 100, 102, 105, 107, 109, 111, 115,
117, 119, 121, 123, 127, 131, 135, 137, 139, 141,
143, 145, 147, 149, 151, 153, 155, 157, 159, 161,
163, 165, 167, 169, 171, 173, 176, 179, 182, 185,
188, 191, 194, 197, 198, 203, 205, 209
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yysigned_char yyrhs[] =
{
47, 0, -1, 71, -1, 47, 36, -1, 47, 48,
-1, -1, 8, 7, 49, 51, 37, 53, 38, -1,
7, -1, 71, -1, 39, 52, -1, 50, -1, 52,
40, 50, -1, 71, -1, 53, 36, -1, 53, 54,
-1, 53, 68, -1, -1, 7, 41, 55, 57, 42,
67, -1, 7, -1, 71, -1, 58, -1, 59, -1,
58, 40, 59, -1, -1, 66, 60, 61, -1, 71,
-1, 61, 43, 3, -1, 61, 7, -1, 61, 44,
3, -1, 61, 44, 4, -1, 61, 44, 5, -1,
61, 44, 6, -1, 61, 44, 37, 62, 38, -1,
71, -1, 64, 63, -1, 71, -1, 40, -1, 65,
-1, 64, 40, 65, -1, 3, -1, 4, -1, 5,
-1, 6, -1, 3, 45, 3, -1, 4, 45, 3,
-1, 6, 45, 3, -1, 9, -1, 10, -1, 11,
-1, 12, -1, 13, -1, 14, -1, 15, -1, 16,
-1, 17, -1, 18, -1, 19, -1, 20, -1, 21,
-1, 22, -1, 23, -1, 24, -1, 25, -1, 26,
-1, 71, -1, 67, 28, -1, 67, 29, -1, 67,
30, -1, 67, 31, -1, 67, 32, -1, 67, 33,
-1, 67, 34, -1, 67, 35, -1, -1, 7, 39,
69, 70, -1, 56, -1, 70, 40, 56, -1, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const unsigned short yyrline[] =
{
0, 88, 88, 89, 90, 95, 94, 106, 120, 121,
125, 131, 140, 141, 142, 143, 148, 147, 159, 175,
176, 180, 181, 186, 185, 197, 198, 202, 206, 212,
218, 224, 230, 241, 242, 246, 247, 251, 252, 256,
262, 268, 274, 280, 289, 298, 310, 314, 318, 322,
326, 330, 334, 338, 342, 346, 350, 354, 358, 362,
366, 370, 374, 378, 385, 386, 390, 394, 398, 402,
406, 410, 414, 422, 421, 433, 439, 452
};
#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", "INTEGER", "REAL", "STRING", "HEX_STRING",
"IDENTIFIER", "KW_DCLASS", "KW_INT8", "KW_INT16", "KW_INT32",
"KW_INT64", "KW_UINT8", "KW_UINT16", "KW_UINT32", "KW_UINT64",
"KW_FLOAT64", "KW_STRING", "KW_BLOB", "KW_INT8ARRAY", "KW_INT16ARRAY",
"KW_INT32ARRAY", "KW_UINT8ARRAY", "KW_UINT16ARRAY", "KW_UINT32ARRAY",
"KW_UINT32UINT8ARRAY", "KW_MOL", "KW_REQUIRED", "KW_BROADCAST",
"KW_P2P", "KW_RAM", "KW_DB", "KW_CLSEND", "KW_CLRECV", "KW_OWNSEND",
"';'", "'{'", "'}'", "':'", "','", "'('", "')'", "'/'", "'='", "'*'",
"$accept", "dc", "dclass", "@1", "dclass_name", "dclass_derivation",
"base_list", "dclass_fields", "atomic_field", "@2", "atomic_name",
"parameter_list", "nonempty_parameter_list", "atomic_element", "@3",
"atomic_element_definition", "default_array", "maybe_comma",
"default_array_def", "default_array_element", "type_token",
"atomic_flags", "molecular_field", "@4", "molecular_atom_list", "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, 59, 123, 125, 58,
44, 40, 41, 47, 61, 42
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const unsigned char yyr1[] =
{
0, 46, 47, 47, 47, 49, 48, 50, 51, 51,
52, 52, 53, 53, 53, 53, 55, 54, 56, 57,
57, 58, 58, 60, 59, 61, 61, 61, 61, 61,
61, 61, 61, 62, 62, 63, 63, 64, 64, 65,
65, 65, 65, 65, 65, 65, 66, 66, 66, 66,
66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
66, 66, 66, 66, 67, 67, 67, 67, 67, 67,
67, 67, 67, 69, 68, 70, 70, 71
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const unsigned char yyr2[] =
{
0, 2, 1, 2, 2, 0, 7, 1, 1, 2,
1, 3, 1, 2, 2, 2, 0, 6, 1, 1,
1, 1, 3, 0, 3, 1, 3, 2, 3, 3,
3, 3, 5, 1, 2, 1, 1, 1, 3, 1,
1, 1, 1, 3, 3, 3, 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, 0, 4, 1, 3, 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[] =
{
77, 0, 2, 1, 0, 3, 4, 5, 77, 0,
0, 8, 7, 10, 9, 77, 0, 0, 12, 11,
0, 13, 6, 14, 15, 73, 16, 0, 77, 18,
75, 74, 46, 47, 48, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
0, 20, 21, 23, 19, 0, 77, 0, 77, 76,
17, 64, 22, 24, 25, 65, 66, 67, 68, 69,
70, 71, 72, 27, 0, 0, 26, 28, 29, 30,
31, 77, 39, 40, 41, 42, 0, 77, 37, 33,
0, 0, 0, 32, 36, 34, 35, 43, 44, 45,
38
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yysigned_char yydefgoto[] =
{
-1, 1, 6, 8, 13, 10, 14, 17, 23, 28,
30, 50, 51, 52, 58, 63, 86, 95, 87, 88,
53, 60, 24, 27, 31, 2
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -36
static const yysigned_char yypact[] =
{
-36, 3, -36, -36, -2, -36, -36, -36, -31, 2,
-27, -36, -36, -36, -11, -36, 2, -5, -36, -36,
-35, -36, -36, -36, -36, -36, -36, 23, 42, -36,
-36, -4, -36, -36, -36, -36, -36, -36, -36, -36,
-36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
-10, 0, -36, -36, -36, 23, -36, 42, -36, -36,
-7, -36, -36, -6, -36, -36, -36, -36, -36, -36,
-36, -36, -36, -36, 31, 9, -36, -36, -36, -36,
-36, 13, -3, -1, -36, 4, 5, 1, -36, -36,
32, 44, 66, -36, 13, -36, -36, -36, -36, -36,
-36
};
/* YYPGOTO[NTERM-NUM]. */
static const yysigned_char yypgoto[] =
{
-36, -36, -36, -36, 29, -36, -36, -36, -36, -36,
15, -36, -36, 14, -36, -36, -36, -36, -36, -22,
-36, -36, -36, -36, -36, -8
};
/* 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 -1
static const unsigned char yytable[] =
{
11, 73, 20, 3, 25, 7, 26, 18, 9, 12,
15, 4, 77, 78, 79, 80, 82, 83, 84, 85,
54, 65, 66, 67, 68, 69, 70, 71, 72, 16,
29, 21, 56, 22, 76, 97, 55, 74, 75, 5,
57, 94, 90, 93, 91, 19, 81, 98, 61, 92,
64, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 99,
59, 62, 100, 89, 0, 0, 0, 0, 0, 96
};
static const yysigned_char yycheck[] =
{
8, 7, 7, 0, 39, 7, 41, 15, 39, 7,
37, 8, 3, 4, 5, 6, 3, 4, 5, 6,
28, 28, 29, 30, 31, 32, 33, 34, 35, 40,
7, 36, 42, 38, 3, 3, 40, 43, 44, 36,
40, 40, 45, 38, 45, 16, 37, 3, 56, 45,
58, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 3,
55, 57, 94, 81, -1, -1, -1, -1, -1, 87
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const unsigned char yystos[] =
{
0, 47, 71, 0, 8, 36, 48, 7, 49, 39,
51, 71, 7, 50, 52, 37, 40, 53, 71, 50,
7, 36, 38, 54, 68, 39, 41, 69, 55, 7,
56, 70, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
57, 58, 59, 66, 71, 40, 42, 40, 60, 56,
67, 71, 59, 61, 71, 28, 29, 30, 31, 32,
33, 34, 35, 7, 43, 44, 3, 3, 4, 5,
6, 37, 3, 4, 5, 6, 62, 64, 65, 71,
45, 45, 45, 38, 40, 63, 71, 3, 3, 3,
65
};
#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 yylineno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
yyrule - 1, yylineno);
/* 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 5:
#line 95 "dcParser.yxx"
{
current_class = new DCClass;
current_class->_name = yyvsp[0].str;
if (!dc_file->add_class(current_class)) {
yyerror("Duplicate class name: " + current_class->_name);
}
}
break;
case 7:
#line 107 "dcParser.yxx"
{
DCFile::ClassesByName::const_iterator ni;
ni = dc_file->_classes_by_name.find(yyvsp[0].str);
if (ni == dc_file->_classes_by_name.end()) {
yyerror("Unknown class: " + yyvsp[0].str);
yyval.u.dclass = (DCClass *)NULL;
} else {
yyval.u.dclass = (*ni).second;
}
}
break;
case 10:
#line 126 "dcParser.yxx"
{
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
current_class->_parents.push_back(yyvsp[0].u.dclass);
}
}
break;
case 11:
#line 132 "dcParser.yxx"
{
if (yyvsp[0].u.dclass != (DCClass *)NULL) {
current_class->_parents.push_back(yyvsp[0].u.dclass);
}
}
break;
case 16:
#line 148 "dcParser.yxx"
{
current_atomic = new DCAtomicField;
current_atomic->_name = yyvsp[-1].str;
if (!current_class->add_field(current_atomic)) {
yyerror("Duplicate field name: " + current_atomic->_name);
}
}
break;
case 18:
#line 160 "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 23:
#line 186 "dcParser.yxx"
{
atomic_element = DCAtomicField::ElementType();
atomic_element._type = yyvsp[0].u.subatomic;
}
break;
case 24:
#line 191 "dcParser.yxx"
{
current_atomic->_elements.push_back(atomic_element);
}
break;
case 26:
#line 199 "dcParser.yxx"
{
atomic_element._divisor = yyvsp[0].u.integer;
}
break;
case 27:
#line 203 "dcParser.yxx"
{
atomic_element._name = yyvsp[0].str;
}
break;
case 28:
#line 207 "dcParser.yxx"
{
if (!atomic_element.set_default_value(yyvsp[0].u.integer)) {
yyerror("Invalid default value: " + yyvsp[0].str);
}
}
break;
case 29:
#line 213 "dcParser.yxx"
{
if (!atomic_element.set_default_value(yyvsp[0].u.real)) {
yyerror("Invalid default value: " + yyvsp[0].str);
}
}
break;
case 30:
#line 219 "dcParser.yxx"
{
if (!atomic_element.set_default_value(yyvsp[0].str)) {
yyerror("Invalid default value: \"" + yyvsp[0].str + "\"");
}
}
break;
case 31:
#line 225 "dcParser.yxx"
{
if (!atomic_element.set_default_value_literal(yyvsp[0].str)) {
yyerror("Invalid default hex string value");
}
}
break;
case 32:
#line 231 "dcParser.yxx"
{
if (!atomic_element.end_array()) {
yyerror("Array default value inappropriate");
} else {
atomic_element._has_default_value = true;
}
}
break;
case 39:
#line 257 "dcParser.yxx"
{
if (!atomic_element.add_default_value(yyvsp[0].u.integer)) {
yyerror("Invalid default value: " + yyvsp[0].str);
}
}
break;
case 40:
#line 263 "dcParser.yxx"
{
if (!atomic_element.add_default_value(yyvsp[0].u.real)) {
yyerror("Invalid default value: " + yyvsp[0].str);
}
}
break;
case 41:
#line 269 "dcParser.yxx"
{
if (!atomic_element.add_default_value(yyvsp[0].str)) {
yyerror("Invalid default value: " + yyvsp[0].str);
}
}
break;
case 42:
#line 275 "dcParser.yxx"
{
if (!atomic_element.add_default_value_literal(yyvsp[0].str)) {
yyerror("Invalid hex literal in default array");
}
}
break;
case 43:
#line 281 "dcParser.yxx"
{
for (int i = 0; i < yyvsp[0].u.integer; i++) {
if (!atomic_element.add_default_value(yyvsp[-2].u.integer)) {
yyerror("Invalid default value: " + yyvsp[-2].str);
break;
}
}
}
break;
case 44:
#line 290 "dcParser.yxx"
{
for (int i = 0; i < yyvsp[0].u.integer; i++) {
if (!atomic_element.add_default_value(yyvsp[-2].u.real)) {
yyerror("Invalid default value: " + yyvsp[-2].str);
break;
}
}
}
break;
case 45:
#line 299 "dcParser.yxx"
{
for (int i = 0; i < yyvsp[0].u.integer; i++) {
if (!atomic_element.add_default_value_literal(yyvsp[-2].str)) {
yyerror("Invalid hex literal in default array");
break;
}
}
}
break;
case 46:
#line 311 "dcParser.yxx"
{
yyval.u.subatomic = ST_int8;
}
break;
case 47:
#line 315 "dcParser.yxx"
{
yyval.u.subatomic = ST_int16;
}
break;
case 48:
#line 319 "dcParser.yxx"
{
yyval.u.subatomic = ST_int32;
}
break;
case 49:
#line 323 "dcParser.yxx"
{
yyval.u.subatomic = ST_int64;
}
break;
case 50:
#line 327 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint8;
}
break;
case 51:
#line 331 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint16;
}
break;
case 52:
#line 335 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint32;
}
break;
case 53:
#line 339 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint64;
}
break;
case 54:
#line 343 "dcParser.yxx"
{
yyval.u.subatomic = ST_float64;
}
break;
case 55:
#line 347 "dcParser.yxx"
{
yyval.u.subatomic = ST_string;
}
break;
case 56:
#line 351 "dcParser.yxx"
{
yyval.u.subatomic = ST_blob;
}
break;
case 57:
#line 355 "dcParser.yxx"
{
yyval.u.subatomic = ST_int8array;
}
break;
case 58:
#line 359 "dcParser.yxx"
{
yyval.u.subatomic = ST_int16array;
}
break;
case 59:
#line 363 "dcParser.yxx"
{
yyval.u.subatomic = ST_int32array;
}
break;
case 60:
#line 367 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint8array;
}
break;
case 61:
#line 371 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint16array;
}
break;
case 62:
#line 375 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint32array;
}
break;
case 63:
#line 379 "dcParser.yxx"
{
yyval.u.subatomic = ST_uint32uint8array;
}
break;
case 65:
#line 387 "dcParser.yxx"
{
current_atomic->_flags |= DCAtomicField::F_required;
}
break;
case 66:
#line 391 "dcParser.yxx"
{
current_atomic->_flags |= DCAtomicField::F_broadcast;
}
break;
case 67:
#line 395 "dcParser.yxx"
{
current_atomic->_flags |= DCAtomicField::F_p2p;
}
break;
case 68:
#line 399 "dcParser.yxx"
{
current_atomic->_flags |= DCAtomicField::F_ram;
}
break;
case 69:
#line 403 "dcParser.yxx"
{
current_atomic->_flags |= DCAtomicField::F_db;
}
break;
case 70:
#line 407 "dcParser.yxx"
{
current_atomic->_flags |= DCAtomicField::F_clsend;
}
break;
case 71:
#line 411 "dcParser.yxx"
{
current_atomic->_flags |= DCAtomicField::F_clrecv;
}
break;
case 72:
#line 415 "dcParser.yxx"
{
current_atomic->_flags |= DCAtomicField::F_ownsend;
}
break;
case 73:
#line 422 "dcParser.yxx"
{
current_molecular = new DCMolecularField;
current_molecular->_name = yyvsp[-1].str;
if (!current_class->add_field(current_molecular)) {
yyerror("Duplicate field name: " + current_molecular->_name);
}
}
break;
case 75:
#line 434 "dcParser.yxx"
{
if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
current_molecular->_fields.push_back(yyvsp[0].u.atomic);
}
}
break;
case 76:
#line 440 "dcParser.yxx"
{
if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
current_molecular->_fields.push_back(yyvsp[0].u.atomic);
if (current_molecular->_fields[0]->_flags != yyvsp[0].u.atomic->_flags) {
yyerror("Mismatched flags in molecule between " +
current_molecular->_fields[0]->_name + " and " +
yyvsp[0].u.atomic->_name);
}
}
}
break;
}
/* Line 991 of yacc.c. */
#line 1614 "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);
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 && yyx != YYTERROR)
yysize += yystrlen (yytname[yyx]) + 15, yycount++;
yysize += yystrlen ("syntax error, unexpected ") + 1;
yysize += 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)
{
yycount = 0;
for (yyx = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *));
yyx++)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
const char *yyq = ! yycount ? ", expecting " : " or ";
yyp = yystpcpy (yyp, yyq);
yyp = yystpcpy (yyp, yytname[yyx]);
yycount++;
}
}
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 yyerrlab2;
/*----------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action. |
`----------------------------------------------------*/
yyerrlab1:
/* Suppress GCC warning that yyerrlab1 is unused when no action
invokes YYERROR. */
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
__attribute__ ((__unused__))
#endif
goto yyerrlab2;
/*---------------------------------------------------------------.
| yyerrlab2 -- pop states until the error token can be shifted. |
`---------------------------------------------------------------*/
yyerrlab2:
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;
}