4881 lines
163 KiB
Plaintext
4881 lines
163 KiB
Plaintext
/* A Bison parser, made by GNU Bison 2.3. */
|
||
|
||
/* Skeleton implementation for Bison's Yacc-like parsers in C
|
||
|
||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||
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., 51 Franklin Street, Fifth Floor,
|
||
Boston, MA 02110-1301, USA. */
|
||
|
||
/* As a special exception, you may create a larger work that contains
|
||
part or all of the Bison parser skeleton and distribute that work
|
||
under terms of your choice, so long as that work isn't itself a
|
||
parser generator using the skeleton or a modified version thereof
|
||
as a parser skeleton. Alternatively, if you modify or redistribute
|
||
the parser skeleton itself, you may (at your option) remove this
|
||
special exception, which will cause the skeleton and the resulting
|
||
Bison output files to be licensed under the GNU General Public
|
||
License without this special exception.
|
||
|
||
This special exception was added by the Free Software Foundation in
|
||
version 2.2 of Bison. */
|
||
|
||
/* C LALR(1) parser skeleton 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
|
||
|
||
/* Bison version. */
|
||
#define YYBISON_VERSION "2.3"
|
||
|
||
/* Skeleton name. */
|
||
#define YYSKELETON_NAME "yacc.c"
|
||
|
||
/* Pure parsers. */
|
||
#define YYPURE 0
|
||
|
||
/* Using locations. */
|
||
#define YYLSP_NEEDED 0
|
||
|
||
/* Substitute the variable and function names. */
|
||
#define yyparse eggyyparse
|
||
#define yylex eggyylex
|
||
#define yyerror eggyyerror
|
||
#define yylval eggyylval
|
||
#define yychar eggyychar
|
||
#define yydebug eggyydebug
|
||
#define yynerrs eggyynerrs
|
||
|
||
|
||
/* Tokens. */
|
||
#ifndef YYTOKENTYPE
|
||
# define YYTOKENTYPE
|
||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||
know about them. */
|
||
enum yytokentype {
|
||
EGG_NUMBER = 258,
|
||
EGG_ULONG = 259,
|
||
EGG_STRING = 260,
|
||
BEZIERCURVE = 261,
|
||
BFACE = 262,
|
||
BILLBOARD = 263,
|
||
BILLBOARDCENTER = 264,
|
||
BINORMAL = 265,
|
||
BUNDLE = 266,
|
||
CLOSED = 267,
|
||
COLLIDE = 268,
|
||
COMMENT = 269,
|
||
COMPONENT = 270,
|
||
COORDSYSTEM = 271,
|
||
CV = 272,
|
||
DART = 273,
|
||
DNORMAL = 274,
|
||
DRGBA = 275,
|
||
DUV = 276,
|
||
DXYZ = 277,
|
||
DCS = 278,
|
||
DISTANCE = 279,
|
||
DTREF = 280,
|
||
DYNAMICVERTEXPOOL = 281,
|
||
EXTERNAL_FILE = 282,
|
||
FLIGHT = 283,
|
||
GROUP = 284,
|
||
HIP = 285,
|
||
INTANGENT = 286,
|
||
JOINT = 287,
|
||
KNOTS = 288,
|
||
INCLUDE = 289,
|
||
INSTANCE = 290,
|
||
LINE = 291,
|
||
LOOP = 292,
|
||
MATERIAL = 293,
|
||
MATRIX3 = 294,
|
||
MATRIX4 = 295,
|
||
MODEL = 296,
|
||
MREF = 297,
|
||
NORMAL = 298,
|
||
NURBSCURVE = 299,
|
||
NURBSSURFACE = 300,
|
||
OBJECTTYPE = 301,
|
||
ORDER = 302,
|
||
OUTTANGENT = 303,
|
||
POINTLIGHT = 304,
|
||
POLYGON = 305,
|
||
REF = 306,
|
||
RGBA = 307,
|
||
ROTATE = 308,
|
||
ROTX = 309,
|
||
ROTY = 310,
|
||
ROTZ = 311,
|
||
SANIM = 312,
|
||
SCALAR = 313,
|
||
SCALE = 314,
|
||
SEQUENCE = 315,
|
||
SHADING = 316,
|
||
SWITCH = 317,
|
||
SWITCHCONDITION = 318,
|
||
TABLE = 319,
|
||
TABLE_V = 320,
|
||
TAG = 321,
|
||
TANGENT = 322,
|
||
TEXLIST = 323,
|
||
TEXTURE = 324,
|
||
TLENGTHS = 325,
|
||
TRANSFORM = 326,
|
||
TRANSLATE = 327,
|
||
TREF = 328,
|
||
TRIANGLEFAN = 329,
|
||
TRIANGLESTRIP = 330,
|
||
TRIM = 331,
|
||
TXT = 332,
|
||
UKNOTS = 333,
|
||
UV = 334,
|
||
VKNOTS = 335,
|
||
VERTEX = 336,
|
||
VERTEXANIM = 337,
|
||
VERTEXPOOL = 338,
|
||
VERTEXREF = 339,
|
||
XFMANIM = 340,
|
||
XFMSANIM = 341,
|
||
START_EGG = 342,
|
||
START_GROUP_BODY = 343,
|
||
START_TEXTURE_BODY = 344,
|
||
START_PRIMITIVE_BODY = 345
|
||
};
|
||
#endif
|
||
/* Tokens. */
|
||
#define EGG_NUMBER 258
|
||
#define EGG_ULONG 259
|
||
#define EGG_STRING 260
|
||
#define BEZIERCURVE 261
|
||
#define BFACE 262
|
||
#define BILLBOARD 263
|
||
#define BILLBOARDCENTER 264
|
||
#define BINORMAL 265
|
||
#define BUNDLE 266
|
||
#define CLOSED 267
|
||
#define COLLIDE 268
|
||
#define COMMENT 269
|
||
#define COMPONENT 270
|
||
#define COORDSYSTEM 271
|
||
#define CV 272
|
||
#define DART 273
|
||
#define DNORMAL 274
|
||
#define DRGBA 275
|
||
#define DUV 276
|
||
#define DXYZ 277
|
||
#define DCS 278
|
||
#define DISTANCE 279
|
||
#define DTREF 280
|
||
#define DYNAMICVERTEXPOOL 281
|
||
#define EXTERNAL_FILE 282
|
||
#define FLIGHT 283
|
||
#define GROUP 284
|
||
#define HIP 285
|
||
#define INTANGENT 286
|
||
#define JOINT 287
|
||
#define KNOTS 288
|
||
#define INCLUDE 289
|
||
#define INSTANCE 290
|
||
#define LINE 291
|
||
#define LOOP 292
|
||
#define MATERIAL 293
|
||
#define MATRIX3 294
|
||
#define MATRIX4 295
|
||
#define MODEL 296
|
||
#define MREF 297
|
||
#define NORMAL 298
|
||
#define NURBSCURVE 299
|
||
#define NURBSSURFACE 300
|
||
#define OBJECTTYPE 301
|
||
#define ORDER 302
|
||
#define OUTTANGENT 303
|
||
#define POINTLIGHT 304
|
||
#define POLYGON 305
|
||
#define REF 306
|
||
#define RGBA 307
|
||
#define ROTATE 308
|
||
#define ROTX 309
|
||
#define ROTY 310
|
||
#define ROTZ 311
|
||
#define SANIM 312
|
||
#define SCALAR 313
|
||
#define SCALE 314
|
||
#define SEQUENCE 315
|
||
#define SHADING 316
|
||
#define SWITCH 317
|
||
#define SWITCHCONDITION 318
|
||
#define TABLE 319
|
||
#define TABLE_V 320
|
||
#define TAG 321
|
||
#define TANGENT 322
|
||
#define TEXLIST 323
|
||
#define TEXTURE 324
|
||
#define TLENGTHS 325
|
||
#define TRANSFORM 326
|
||
#define TRANSLATE 327
|
||
#define TREF 328
|
||
#define TRIANGLEFAN 329
|
||
#define TRIANGLESTRIP 330
|
||
#define TRIM 331
|
||
#define TXT 332
|
||
#define UKNOTS 333
|
||
#define UV 334
|
||
#define VKNOTS 335
|
||
#define VERTEX 336
|
||
#define VERTEXANIM 337
|
||
#define VERTEXPOOL 338
|
||
#define VERTEXREF 339
|
||
#define XFMANIM 340
|
||
#define XFMSANIM 341
|
||
#define START_EGG 342
|
||
#define START_GROUP_BODY 343
|
||
#define START_TEXTURE_BODY 344
|
||
#define START_PRIMITIVE_BODY 345
|
||
|
||
|
||
|
||
|
||
/* Copy the first part of user declarations. */
|
||
#line 6 "parser.yxx"
|
||
|
||
|
||
#include "pandabase.h"
|
||
#include "config_egg.h"
|
||
#include "parserDefs.h"
|
||
#include "lexerDefs.h"
|
||
#include "eggObject.h"
|
||
#include "eggGroup.h"
|
||
#include "eggVertex.h"
|
||
#include "eggVertexPool.h"
|
||
#include "eggVertexUV.h"
|
||
#include "eggPolygon.h"
|
||
#include "eggCompositePrimitive.h"
|
||
#include "eggTriangleFan.h"
|
||
#include "eggTriangleStrip.h"
|
||
#include "eggPoint.h"
|
||
#include "eggLine.h"
|
||
#include "eggNurbsSurface.h"
|
||
#include "eggNurbsCurve.h"
|
||
#include "eggTable.h"
|
||
#include "eggSAnimData.h"
|
||
#include "eggXfmSAnim.h"
|
||
#include "eggXfmAnimData.h"
|
||
#include "eggTexture.h"
|
||
#include "eggMaterial.h"
|
||
#include "eggComment.h"
|
||
#include "eggCoordinateSystem.h"
|
||
#include "eggExternalReference.h"
|
||
#include "eggData.h"
|
||
#include "pt_EggTexture.h"
|
||
#include "pt_EggMaterial.h"
|
||
|
||
#include "string_utils.h"
|
||
#include "filename.h"
|
||
#include "luse.h"
|
||
#include "lmatrix.h"
|
||
#include "coordinateSystem.h"
|
||
#include "pvector.h"
|
||
#include "dcast.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
|
||
|
||
// We need a stack of EggObject pointers. Each time we encounter a
|
||
// nested EggObject of some kind, we'll allocate a new one of these
|
||
// and push it onto the stack. At any given time, the top of the
|
||
// stack is the EggObject we are currently scanning.
|
||
|
||
typedef pvector< PT(EggObject) > EggStack;
|
||
static EggStack egg_stack;
|
||
|
||
// There's one "top-level" egg node, which is where we should parent
|
||
// things (e.g. implicit textures) encountered in the egg file that
|
||
// don't have an explicit place in the tree. If this is NULL, such
|
||
// things won't be parented anywhere.
|
||
static EggGroupNode *egg_top_node;
|
||
|
||
// We need a table mapping vertex pool names to vertex pools.
|
||
typedef pmap<string, PT(EggVertexPool) > VertexPools;
|
||
static VertexPools vertex_pools;
|
||
|
||
// And another one mapping texture names to textures.
|
||
typedef pmap<string, PT_EggTexture > Textures;
|
||
static Textures textures;
|
||
|
||
// And again for material names to materials.
|
||
typedef pmap<string, PT_EggMaterial > Materials;
|
||
static Materials materials;
|
||
|
||
// We need to be able to save the index number requested for a vertex
|
||
// temporarily.
|
||
static int vertex_index;
|
||
|
||
// We need to hold a matrix for a little bit while parsing the
|
||
// <Transform> entries.
|
||
static LMatrix3d matrix_2d;
|
||
|
||
|
||
////////////////////////////////////////////////////////////////////
|
||
// Defining the interface to the parser.
|
||
////////////////////////////////////////////////////////////////////
|
||
|
||
void
|
||
egg_init_parser(istream &in, const string &filename,
|
||
EggObject *tos, EggGroupNode *top_node) {
|
||
egg_init_lexer(in, filename);
|
||
|
||
egg_stack.clear();
|
||
vertex_pools.clear();
|
||
textures.clear();
|
||
materials.clear();
|
||
|
||
egg_stack.push_back(tos);
|
||
egg_top_node = top_node;
|
||
}
|
||
|
||
void
|
||
egg_cleanup_parser() {
|
||
// Check for undefined vertex pools.
|
||
VertexPools::const_iterator vpi;
|
||
for (vpi = vertex_pools.begin(); vpi != vertex_pools.end(); ++vpi) {
|
||
EggVertexPool *pool = (*vpi).second;
|
||
if (pool->has_forward_vertices()) {
|
||
if (!pool->has_defined_vertices()) {
|
||
eggyyerror("Undefined vertex pool " + pool->get_name());
|
||
} else {
|
||
eggyyerror("Undefined vertices in pool " + pool->get_name());
|
||
|
||
egg_cat.error(false)
|
||
<< "Undefined vertex index numbers:";
|
||
EggVertexPool::const_iterator vi;
|
||
for (vi = pool->begin(); vi != pool->end(); ++vi) {
|
||
EggVertex *vertex = (*vi);
|
||
if (vertex->is_forward_reference()) {
|
||
egg_cat.error(false)
|
||
<< " " << vertex->get_index();
|
||
}
|
||
}
|
||
egg_cat.error(false)
|
||
<< "\n";
|
||
}
|
||
}
|
||
}
|
||
|
||
// Clean these out after we're done, so we don't keep big memory
|
||
// structures around needlessly.
|
||
egg_stack.clear();
|
||
vertex_pools.clear();
|
||
textures.clear();
|
||
materials.clear();
|
||
}
|
||
|
||
|
||
|
||
/* 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
|
||
|
||
/* Enabling the token table. */
|
||
#ifndef YYTOKEN_TABLE
|
||
# define YYTOKEN_TABLE 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 216 of yacc.c. */
|
||
#line 433 "y.tab.c"
|
||
|
||
#ifdef short
|
||
# undef short
|
||
#endif
|
||
|
||
#ifdef YYTYPE_UINT8
|
||
typedef YYTYPE_UINT8 yytype_uint8;
|
||
#else
|
||
typedef unsigned char yytype_uint8;
|
||
#endif
|
||
|
||
#ifdef YYTYPE_INT8
|
||
typedef YYTYPE_INT8 yytype_int8;
|
||
#elif (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
typedef signed char yytype_int8;
|
||
#else
|
||
typedef short int yytype_int8;
|
||
#endif
|
||
|
||
#ifdef YYTYPE_UINT16
|
||
typedef YYTYPE_UINT16 yytype_uint16;
|
||
#else
|
||
typedef unsigned short int yytype_uint16;
|
||
#endif
|
||
|
||
#ifdef YYTYPE_INT16
|
||
typedef YYTYPE_INT16 yytype_int16;
|
||
#else
|
||
typedef short int yytype_int16;
|
||
#endif
|
||
|
||
#ifndef YYSIZE_T
|
||
# ifdef __SIZE_TYPE__
|
||
# define YYSIZE_T __SIZE_TYPE__
|
||
# elif defined size_t
|
||
# define YYSIZE_T size_t
|
||
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
|
||
# define YYSIZE_T size_t
|
||
# else
|
||
# define YYSIZE_T unsigned int
|
||
# endif
|
||
#endif
|
||
|
||
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
|
||
|
||
#ifndef YY_
|
||
# if YYENABLE_NLS
|
||
# if ENABLE_NLS
|
||
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
||
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
||
# endif
|
||
# endif
|
||
# ifndef YY_
|
||
# define YY_(msgid) msgid
|
||
# endif
|
||
#endif
|
||
|
||
/* Suppress unused-variable warnings by "using" E. */
|
||
#if ! defined lint || defined __GNUC__
|
||
# define YYUSE(e) ((void) (e))
|
||
#else
|
||
# define YYUSE(e) /* empty */
|
||
#endif
|
||
|
||
/* Identity function, used to suppress warnings about constant conditions. */
|
||
#ifndef lint
|
||
# define YYID(n) (n)
|
||
#else
|
||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
static int
|
||
YYID (int i)
|
||
#else
|
||
static int
|
||
YYID (i)
|
||
int i;
|
||
#endif
|
||
{
|
||
return i;
|
||
}
|
||
#endif
|
||
|
||
#if ! defined yyoverflow || YYERROR_VERBOSE
|
||
|
||
/* The parser invokes alloca or malloc; define the necessary symbols. */
|
||
|
||
# ifdef YYSTACK_USE_ALLOCA
|
||
# if YYSTACK_USE_ALLOCA
|
||
# ifdef __GNUC__
|
||
# define YYSTACK_ALLOC __builtin_alloca
|
||
# elif defined __BUILTIN_VA_ARG_INCR
|
||
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
|
||
# elif defined _AIX
|
||
# define YYSTACK_ALLOC __alloca
|
||
# elif defined _MSC_VER
|
||
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
|
||
# define alloca _alloca
|
||
# else
|
||
# define YYSTACK_ALLOC alloca
|
||
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
||
# ifndef _STDLIB_H
|
||
# define _STDLIB_H 1
|
||
# endif
|
||
# endif
|
||
# endif
|
||
# endif
|
||
# endif
|
||
|
||
# ifdef YYSTACK_ALLOC
|
||
/* Pacify GCC's `empty if-body' warning. */
|
||
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
|
||
# ifndef YYSTACK_ALLOC_MAXIMUM
|
||
/* The OS might guarantee only one guard page at the bottom of the stack,
|
||
and a page size can be as small as 4096 bytes. So we cannot safely
|
||
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
|
||
to allow for a few compiler-allocated temporary stack slots. */
|
||
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
|
||
# endif
|
||
# else
|
||
# define YYSTACK_ALLOC YYMALLOC
|
||
# define YYSTACK_FREE YYFREE
|
||
# ifndef YYSTACK_ALLOC_MAXIMUM
|
||
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
|
||
# endif
|
||
# if (defined __cplusplus && ! defined _STDLIB_H \
|
||
&& ! ((defined YYMALLOC || defined malloc) \
|
||
&& (defined YYFREE || defined free)))
|
||
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
||
# ifndef _STDLIB_H
|
||
# define _STDLIB_H 1
|
||
# endif
|
||
# endif
|
||
# ifndef YYMALLOC
|
||
# define YYMALLOC malloc
|
||
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
|
||
# endif
|
||
# endif
|
||
# ifndef YYFREE
|
||
# define YYFREE free
|
||
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
void free (void *); /* INFRINGES ON USER NAME SPACE */
|
||
# endif
|
||
# endif
|
||
# endif
|
||
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
|
||
|
||
|
||
#if (! defined yyoverflow \
|
||
&& (! defined __cplusplus \
|
||
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
|
||
|
||
/* A type that is properly aligned for any stack member. */
|
||
union yyalloc
|
||
{
|
||
yytype_int16 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 (yytype_int16) + sizeof (YYSTYPE)) \
|
||
+ YYSTACK_GAP_MAXIMUM)
|
||
|
||
/* Copy COUNT objects from FROM to TO. The source and destination do
|
||
not overlap. */
|
||
# ifndef YYCOPY
|
||
# if defined __GNUC__ && 1 < __GNUC__
|
||
# define YYCOPY(To, From, Count) \
|
||
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
|
||
# else
|
||
# define YYCOPY(To, From, Count) \
|
||
do \
|
||
{ \
|
||
YYSIZE_T yyi; \
|
||
for (yyi = 0; yyi < (Count); yyi++) \
|
||
(To)[yyi] = (From)[yyi]; \
|
||
} \
|
||
while (YYID (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 (YYID (0))
|
||
|
||
#endif
|
||
|
||
/* YYFINAL -- State number of the termination state. */
|
||
#define YYFINAL 14
|
||
/* YYLAST -- Last index in YYTABLE. */
|
||
#define YYLAST 1343
|
||
|
||
/* YYNTOKENS -- Number of terminals. */
|
||
#define YYNTOKENS 93
|
||
/* YYNNTS -- Number of nonterminals. */
|
||
#define YYNNTS 117
|
||
/* YYNRULES -- Number of rules. */
|
||
#define YYNRULES 260
|
||
/* YYNRULES -- Number of states. */
|
||
#define YYNSTATES 722
|
||
|
||
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
|
||
#define YYUNDEFTOK 2
|
||
#define YYMAXUTOK 345
|
||
|
||
#define YYTRANSLATE(YYX) \
|
||
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
||
|
||
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
|
||
static const yytype_uint8 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,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 91, 2, 92, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 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, 43, 44,
|
||
45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
|
||
55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
|
||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
|
||
75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
|
||
85, 86, 87, 88, 89, 90
|
||
};
|
||
|
||
#if YYDEBUG
|
||
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
|
||
YYRHS. */
|
||
static const yytype_uint16 yyprhs[] =
|
||
{
|
||
0, 0, 3, 6, 9, 12, 15, 17, 20, 22,
|
||
24, 26, 28, 30, 32, 34, 36, 38, 40, 42,
|
||
44, 46, 48, 50, 52, 54, 59, 65, 66, 74,
|
||
76, 83, 86, 87, 94, 96, 103, 109, 116, 117,
|
||
124, 126, 129, 130, 136, 137, 144, 146, 149, 153,
|
||
158, 159, 167, 173, 179, 188, 197, 200, 204, 212,
|
||
220, 228, 237, 245, 254, 258, 267, 276, 281, 291,
|
||
301, 302, 309, 310, 317, 318, 325, 327, 334, 340,
|
||
348, 356, 362, 368, 374, 380, 386, 392, 398, 405,
|
||
411, 414, 417, 420, 423, 425, 427, 430, 431, 437,
|
||
439, 442, 445, 448, 451, 454, 457, 460, 463, 466,
|
||
469, 472, 475, 481, 488, 493, 498, 503, 508, 516,
|
||
522, 529, 534, 539, 541, 551, 556, 558, 575, 585,
|
||
587, 594, 599, 611, 624, 625, 632, 633, 640, 641,
|
||
648, 649, 656, 657, 664, 665, 672, 673, 680, 682,
|
||
688, 694, 696, 697, 705, 711, 717, 723, 726, 732,
|
||
738, 744, 751, 753, 759, 765, 771, 774, 780, 786,
|
||
792, 798, 804, 810, 813, 819, 826, 828, 834, 840,
|
||
846, 849, 855, 861, 867, 873, 879, 886, 888, 890,
|
||
892, 896, 905, 914, 919, 929, 939, 941, 950, 953,
|
||
955, 957, 959, 965, 967, 970, 972, 974, 975, 982,
|
||
983, 990, 992, 995, 998, 1001, 1004, 1007, 1008, 1015,
|
||
1017, 1024, 1030, 1031, 1038, 1040, 1047, 1053, 1054, 1061,
|
||
1063, 1070, 1073, 1075, 1078, 1080, 1083, 1085, 1087, 1089,
|
||
1091, 1093, 1095, 1097, 1099, 1101, 1103, 1105, 1107, 1109,
|
||
1111, 1113, 1115, 1118, 1120, 1122, 1124, 1126, 1128, 1130,
|
||
1132
|
||
};
|
||
|
||
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
|
||
static const yytype_int16 yyrhs[] =
|
||
{
|
||
94, 0, -1, 87, 95, -1, 88, 123, -1, 89,
|
||
101, -1, 90, 162, -1, 209, -1, 95, 96, -1,
|
||
97, -1, 98, -1, 99, -1, 102, -1, 105, -1,
|
||
106, -1, 117, -1, 119, -1, 121, -1, 147, -1,
|
||
149, -1, 151, -1, 153, -1, 155, -1, 157, -1,
|
||
159, -1, 180, -1, 16, 91, 201, 92, -1, 14,
|
||
200, 91, 204, 92, -1, -1, 69, 199, 91, 201,
|
||
100, 101, 92, -1, 209, -1, 101, 58, 199, 91,
|
||
207, 92, -1, 101, 126, -1, -1, 38, 199, 91,
|
||
103, 104, 92, -1, 209, -1, 104, 58, 199, 91,
|
||
207, 92, -1, 27, 200, 91, 201, 92, -1, 203,
|
||
27, 200, 91, 201, 92, -1, -1, 83, 199, 107,
|
||
91, 108, 92, -1, 209, -1, 108, 109, -1, -1,
|
||
81, 110, 91, 112, 92, -1, -1, 81, 208, 111,
|
||
91, 112, 92, -1, 206, -1, 206, 206, -1, 206,
|
||
206, 206, -1, 206, 206, 206, 206, -1, -1, 112,
|
||
79, 200, 91, 113, 114, 92, -1, 112, 43, 91,
|
||
115, 92, -1, 112, 52, 91, 116, 92, -1, 112,
|
||
22, 203, 91, 206, 206, 206, 92, -1, 112, 22,
|
||
91, 203, 206, 206, 206, 92, -1, 206, 206, -1,
|
||
206, 206, 206, -1, 114, 67, 91, 206, 206, 206,
|
||
92, -1, 114, 10, 91, 206, 206, 206, 92, -1,
|
||
114, 21, 203, 91, 206, 206, 92, -1, 114, 21,
|
||
203, 91, 206, 206, 206, 92, -1, 114, 21, 91,
|
||
203, 206, 206, 92, -1, 114, 21, 91, 203, 206,
|
||
206, 206, 92, -1, 206, 206, 206, -1, 115, 19,
|
||
203, 91, 206, 206, 206, 92, -1, 115, 19, 91,
|
||
203, 206, 206, 206, 92, -1, 206, 206, 206, 206,
|
||
-1, 116, 20, 203, 91, 206, 206, 206, 206, 92,
|
||
-1, 116, 20, 91, 203, 206, 206, 206, 206, 92,
|
||
-1, -1, 29, 200, 118, 91, 123, 92, -1, -1,
|
||
32, 200, 120, 91, 123, 92, -1, -1, 35, 200,
|
||
122, 91, 123, 92, -1, 209, -1, 123, 58, 199,
|
||
91, 207, 92, -1, 123, 8, 91, 203, 92, -1,
|
||
123, 9, 91, 206, 206, 206, 92, -1, 123, 13,
|
||
200, 91, 124, 125, 92, -1, 123, 23, 91, 208,
|
||
92, -1, 123, 23, 91, 5, 92, -1, 123, 18,
|
||
91, 208, 92, -1, 123, 18, 91, 5, 92, -1,
|
||
123, 62, 91, 208, 92, -1, 123, 46, 91, 201,
|
||
92, -1, 123, 41, 91, 208, 92, -1, 123, 66,
|
||
200, 91, 204, 92, -1, 123, 68, 91, 208, 92,
|
||
-1, 123, 126, -1, 123, 143, -1, 123, 145, -1,
|
||
123, 96, -1, 203, -1, 209, -1, 125, 203, -1,
|
||
-1, 71, 127, 91, 128, 92, -1, 209, -1, 128,
|
||
129, -1, 128, 130, -1, 128, 131, -1, 128, 132,
|
||
-1, 128, 133, -1, 128, 134, -1, 128, 135, -1,
|
||
128, 136, -1, 128, 137, -1, 128, 138, -1, 128,
|
||
139, -1, 128, 141, -1, 72, 91, 206, 206, 92,
|
||
-1, 72, 91, 206, 206, 206, 92, -1, 53, 91,
|
||
206, 92, -1, 54, 91, 206, 92, -1, 55, 91,
|
||
206, 92, -1, 56, 91, 206, 92, -1, 53, 91,
|
||
206, 206, 206, 206, 92, -1, 59, 91, 206, 206,
|
||
92, -1, 59, 91, 206, 206, 206, 92, -1, 59,
|
||
91, 206, 92, -1, 39, 91, 140, 92, -1, 209,
|
||
-1, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
||
-1, 40, 91, 142, 92, -1, 209, -1, 206, 206,
|
||
206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
||
206, 206, 206, 206, -1, 84, 91, 194, 144, 51,
|
||
91, 198, 92, 92, -1, 209, -1, 144, 58, 199,
|
||
91, 207, 92, -1, 63, 91, 146, 92, -1, 24,
|
||
91, 206, 206, 81, 91, 206, 206, 206, 92, 92,
|
||
-1, 24, 91, 206, 206, 206, 81, 91, 206, 206,
|
||
206, 92, 92, -1, -1, 50, 200, 148, 91, 162,
|
||
92, -1, -1, 74, 200, 150, 91, 162, 92, -1,
|
||
-1, 75, 200, 152, 91, 162, 92, -1, -1, 49,
|
||
200, 154, 91, 162, 92, -1, -1, 36, 200, 156,
|
||
91, 162, 92, -1, -1, 45, 200, 158, 91, 164,
|
||
92, -1, -1, 44, 200, 160, 91, 165, 92, -1,
|
||
209, -1, 161, 43, 91, 169, 92, -1, 161, 52,
|
||
91, 170, 92, -1, 209, -1, -1, 162, 15, 208,
|
||
91, 163, 161, 92, -1, 162, 73, 91, 166, 92,
|
||
-1, 162, 69, 91, 167, 92, -1, 162, 42, 91,
|
||
168, 92, -1, 162, 172, -1, 162, 43, 91, 169,
|
||
92, -1, 162, 52, 91, 170, 92, -1, 162, 7,
|
||
91, 171, 92, -1, 162, 58, 199, 91, 207, 92,
|
||
-1, 209, -1, 164, 73, 91, 166, 92, -1, 164,
|
||
69, 91, 167, 92, -1, 164, 42, 91, 168, 92,
|
||
-1, 164, 172, -1, 164, 43, 91, 169, 92, -1,
|
||
164, 52, 91, 170, 92, -1, 164, 7, 91, 171,
|
||
92, -1, 164, 47, 91, 173, 92, -1, 164, 78,
|
||
91, 174, 92, -1, 164, 80, 91, 175, 92, -1,
|
||
164, 159, -1, 164, 76, 91, 176, 92, -1, 164,
|
||
58, 199, 91, 207, 92, -1, 209, -1, 165, 73,
|
||
91, 166, 92, -1, 165, 69, 91, 167, 92, -1,
|
||
165, 42, 91, 168, 92, -1, 165, 172, -1, 165,
|
||
43, 91, 169, 92, -1, 165, 52, 91, 170, 92,
|
||
-1, 165, 7, 91, 171, 92, -1, 165, 47, 91,
|
||
178, 92, -1, 165, 33, 91, 179, 92, -1, 165,
|
||
58, 199, 91, 207, 92, -1, 196, -1, 199, -1,
|
||
197, -1, 206, 206, 206, -1, 169, 19, 203, 91,
|
||
206, 206, 206, 92, -1, 169, 19, 91, 203, 206,
|
||
206, 206, 92, -1, 206, 206, 206, 206, -1, 170,
|
||
20, 203, 91, 206, 206, 206, 206, 92, -1, 170,
|
||
20, 91, 203, 206, 206, 206, 206, 92, -1, 208,
|
||
-1, 84, 91, 194, 51, 91, 198, 92, 92, -1,
|
||
208, 208, -1, 195, -1, 195, -1, 209, -1, 176,
|
||
37, 91, 177, 92, -1, 209, -1, 177, 159, -1,
|
||
208, -1, 195, -1, -1, 64, 200, 181, 91, 184,
|
||
92, -1, -1, 11, 200, 183, 91, 184, 92, -1,
|
||
209, -1, 184, 180, -1, 184, 182, -1, 184, 185,
|
||
-1, 184, 188, -1, 184, 191, -1, -1, 57, 200,
|
||
186, 91, 187, 92, -1, 209, -1, 187, 58, 199,
|
||
91, 207, 92, -1, 187, 65, 91, 195, 92, -1,
|
||
-1, 85, 200, 189, 91, 190, 92, -1, 209, -1,
|
||
190, 58, 199, 91, 207, 92, -1, 190, 65, 91,
|
||
195, 92, -1, -1, 86, 200, 192, 91, 193, 92,
|
||
-1, 209, -1, 193, 58, 199, 91, 207, 92, -1,
|
||
193, 185, -1, 209, -1, 194, 208, -1, 209, -1,
|
||
195, 206, -1, 199, -1, 199, -1, 199, -1, 209,
|
||
-1, 203, -1, 202, -1, 209, -1, 203, -1, 209,
|
||
-1, 203, -1, 3, -1, 4, -1, 5, -1, 209,
|
||
-1, 205, -1, 203, -1, 205, 203, -1, 3, -1,
|
||
4, -1, 3, -1, 4, -1, 5, -1, 3, -1,
|
||
4, -1, -1
|
||
};
|
||
|
||
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
||
static const yytype_uint16 yyrline[] =
|
||
{
|
||
0, 216, 216, 217, 218, 219, 230, 231, 247, 248,
|
||
249, 250, 251, 252, 253, 254, 255, 256, 257, 258,
|
||
259, 260, 261, 262, 263, 274, 297, 312, 311, 339,
|
||
340, 664, 676, 675, 702, 703, 798, 805, 826, 825,
|
||
865, 866, 878, 877, 889, 888, 934, 938, 942, 946,
|
||
951, 950, 965, 966, 967, 975, 994, 998, 1002, 1010,
|
||
1018, 1026, 1034, 1042, 1060, 1064, 1072, 1090, 1094, 1102,
|
||
1121, 1120, 1141, 1140, 1162, 1161, 1182, 1183, 1313, 1325,
|
||
1330, 1337, 1343, 1356, 1363, 1376, 1382, 1388, 1394, 1399,
|
||
1405, 1406, 1407, 1408, 1422, 1452, 1453, 1476, 1475, 1491,
|
||
1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501,
|
||
1502, 1503, 1507, 1514, 1521, 1528, 1535, 1542, 1549, 1556,
|
||
1563, 1570, 1577, 1581, 1582, 1594, 1598, 1599, 1621, 1654,
|
||
1658, 1683, 1695, 1700, 1718, 1717, 1737, 1736, 1756, 1755,
|
||
1775, 1774, 1794, 1793, 1813, 1812, 1832, 1831, 1851, 1852,
|
||
1853, 1864, 1866, 1865, 1886, 1887, 1888, 1889, 1890, 1891,
|
||
1892, 1893, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973,
|
||
1974, 1975, 1976, 1977, 1983, 1984, 2048, 2049, 2050, 2051,
|
||
2052, 2053, 2054, 2055, 2056, 2057, 2058, 2127, 2144, 2184,
|
||
2201, 2205, 2213, 2231, 2235, 2243, 2261, 2277, 2308, 2326,
|
||
2346, 2366, 2371, 2382, 2388, 2407, 2423, 2445, 2444, 2467,
|
||
2466, 2488, 2489, 2493, 2497, 2501, 2505, 2521, 2520, 2541,
|
||
2542, 2554, 2569, 2568, 2589, 2590, 2607, 2622, 2621, 2642,
|
||
2643, 2658, 2673, 2677, 2691, 2695, 2709, 2730, 2751, 2777,
|
||
2782, 2794, 2806, 2811, 2822, 2826, 2840, 2844, 2848, 2861,
|
||
2865, 2881, 2885, 2899, 2900, 2915, 2921, 2927, 2944, 2952,
|
||
2958
|
||
};
|
||
#endif
|
||
|
||
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
||
/* YYTNAME[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", "EGG_NUMBER", "EGG_ULONG", "EGG_STRING",
|
||
"BEZIERCURVE", "BFACE", "BILLBOARD", "BILLBOARDCENTER", "BINORMAL",
|
||
"BUNDLE", "CLOSED", "COLLIDE", "COMMENT", "COMPONENT", "COORDSYSTEM",
|
||
"CV", "DART", "DNORMAL", "DRGBA", "DUV", "DXYZ", "DCS", "DISTANCE",
|
||
"DTREF", "DYNAMICVERTEXPOOL", "EXTERNAL_FILE", "FLIGHT", "GROUP", "HIP",
|
||
"INTANGENT", "JOINT", "KNOTS", "INCLUDE", "INSTANCE", "LINE", "LOOP",
|
||
"MATERIAL", "MATRIX3", "MATRIX4", "MODEL", "MREF", "NORMAL",
|
||
"NURBSCURVE", "NURBSSURFACE", "OBJECTTYPE", "ORDER", "OUTTANGENT",
|
||
"POINTLIGHT", "POLYGON", "REF", "RGBA", "ROTATE", "ROTX", "ROTY", "ROTZ",
|
||
"SANIM", "SCALAR", "SCALE", "SEQUENCE", "SHADING", "SWITCH",
|
||
"SWITCHCONDITION", "TABLE", "TABLE_V", "TAG", "TANGENT", "TEXLIST",
|
||
"TEXTURE", "TLENGTHS", "TRANSFORM", "TRANSLATE", "TREF", "TRIANGLEFAN",
|
||
"TRIANGLESTRIP", "TRIM", "TXT", "UKNOTS", "UV", "VKNOTS", "VERTEX",
|
||
"VERTEXANIM", "VERTEXPOOL", "VERTEXREF", "XFMANIM", "XFMSANIM",
|
||
"START_EGG", "START_GROUP_BODY", "START_TEXTURE_BODY",
|
||
"START_PRIMITIVE_BODY", "'{'", "'}'", "$accept", "grammar", "egg",
|
||
"node", "coordsystem", "comment", "texture", "@1", "texture_body",
|
||
"material", "@2", "material_body", "external_reference", "vertex_pool",
|
||
"@3", "vertex_pool_body", "vertex", "@4", "@5", "vertex_body", "@6",
|
||
"vertex_uv_body", "vertex_normal_body", "vertex_color_body", "group",
|
||
"@7", "joint", "@8", "instance", "@9", "group_body", "cs_type",
|
||
"collide_flags", "transform", "@10", "transform_body", "translate2d",
|
||
"translate3d", "rotate2d", "rotx", "roty", "rotz", "rotate3d", "scale2d",
|
||
"scale3d", "uniform_scale", "matrix3", "matrix3_body", "matrix4",
|
||
"matrix4_body", "group_vertex_ref", "group_vertex_membership",
|
||
"switchcondition", "switchcondition_body", "polygon", "@11",
|
||
"trianglefan", "@12", "trianglestrip", "@13", "point_light", "@14",
|
||
"line", "@15", "nurbs_surface", "@16", "nurbs_curve", "@17",
|
||
"primitive_component_body", "primitive_body", "@18",
|
||
"nurbs_surface_body", "nurbs_curve_body", "primitive_tref_body",
|
||
"primitive_texture_body", "primitive_material_body",
|
||
"primitive_normal_body", "primitive_color_body", "primitive_bface_body",
|
||
"primitive_vertex_ref", "nurbs_surface_order_body",
|
||
"nurbs_surface_uknots_body", "nurbs_surface_vknots_body",
|
||
"nurbs_surface_trim_body", "nurbs_surface_trim_loop_body",
|
||
"nurbs_curve_order_body", "nurbs_curve_knots_body", "table", "@19",
|
||
"bundle", "@20", "table_body", "sanim", "@21", "sanim_body", "xfmanim",
|
||
"@22", "xfmanim_body", "xfm_s_anim", "@23", "xfm_s_anim_body",
|
||
"integer_list", "real_list", "texture_name", "material_name",
|
||
"vertex_pool_name", "required_name", "optional_name", "required_string",
|
||
"optional_string", "string", "repeated_string", "repeated_string_body",
|
||
"real", "real_or_string", "integer", "empty", 0
|
||
};
|
||
#endif
|
||
|
||
# ifdef YYPRINT
|
||
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
|
||
token YYLEX-NUM. */
|
||
static const yytype_uint16 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, 298, 299, 300, 301, 302, 303, 304,
|
||
305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
|
||
315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
|
||
325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
|
||
335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
|
||
345, 123, 125
|
||
};
|
||
# endif
|
||
|
||
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
||
static const yytype_uint8 yyr1[] =
|
||
{
|
||
0, 93, 94, 94, 94, 94, 95, 95, 96, 96,
|
||
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
|
||
96, 96, 96, 96, 96, 97, 98, 100, 99, 101,
|
||
101, 101, 103, 102, 104, 104, 105, 105, 107, 106,
|
||
108, 108, 110, 109, 111, 109, 112, 112, 112, 112,
|
||
113, 112, 112, 112, 112, 112, 114, 114, 114, 114,
|
||
114, 114, 114, 114, 115, 115, 115, 116, 116, 116,
|
||
118, 117, 120, 119, 122, 121, 123, 123, 123, 123,
|
||
123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
|
||
123, 123, 123, 123, 124, 125, 125, 127, 126, 128,
|
||
128, 128, 128, 128, 128, 128, 128, 128, 128, 128,
|
||
128, 128, 129, 130, 131, 132, 133, 134, 135, 136,
|
||
137, 138, 139, 140, 140, 141, 142, 142, 143, 144,
|
||
144, 145, 146, 146, 148, 147, 150, 149, 152, 151,
|
||
154, 153, 156, 155, 158, 157, 160, 159, 161, 161,
|
||
161, 162, 163, 162, 162, 162, 162, 162, 162, 162,
|
||
162, 162, 164, 164, 164, 164, 164, 164, 164, 164,
|
||
164, 164, 164, 164, 164, 164, 165, 165, 165, 165,
|
||
165, 165, 165, 165, 165, 165, 165, 166, 167, 168,
|
||
169, 169, 169, 170, 170, 170, 171, 172, 173, 174,
|
||
175, 176, 176, 177, 177, 178, 179, 181, 180, 183,
|
||
182, 184, 184, 184, 184, 184, 184, 186, 185, 187,
|
||
187, 187, 189, 188, 190, 190, 190, 192, 191, 193,
|
||
193, 193, 194, 194, 195, 195, 196, 197, 198, 199,
|
||
199, 200, 201, 201, 202, 202, 203, 203, 203, 204,
|
||
204, 205, 205, 206, 206, 207, 207, 207, 208, 208,
|
||
209
|
||
};
|
||
|
||
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
|
||
static const yytype_uint8 yyr2[] =
|
||
{
|
||
0, 2, 2, 2, 2, 2, 1, 2, 1, 1,
|
||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||
1, 1, 1, 1, 1, 4, 5, 0, 7, 1,
|
||
6, 2, 0, 6, 1, 6, 5, 6, 0, 6,
|
||
1, 2, 0, 5, 0, 6, 1, 2, 3, 4,
|
||
0, 7, 5, 5, 8, 8, 2, 3, 7, 7,
|
||
7, 8, 7, 8, 3, 8, 8, 4, 9, 9,
|
||
0, 6, 0, 6, 0, 6, 1, 6, 5, 7,
|
||
7, 5, 5, 5, 5, 5, 5, 5, 6, 5,
|
||
2, 2, 2, 2, 1, 1, 2, 0, 5, 1,
|
||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||
2, 2, 5, 6, 4, 4, 4, 4, 7, 5,
|
||
6, 4, 4, 1, 9, 4, 1, 16, 9, 1,
|
||
6, 4, 11, 12, 0, 6, 0, 6, 0, 6,
|
||
0, 6, 0, 6, 0, 6, 0, 6, 1, 5,
|
||
5, 1, 0, 7, 5, 5, 5, 2, 5, 5,
|
||
5, 6, 1, 5, 5, 5, 2, 5, 5, 5,
|
||
5, 5, 5, 2, 5, 6, 1, 5, 5, 5,
|
||
2, 5, 5, 5, 5, 5, 6, 1, 1, 1,
|
||
3, 8, 8, 4, 9, 9, 1, 8, 2, 1,
|
||
1, 1, 5, 1, 2, 1, 1, 0, 6, 0,
|
||
6, 1, 2, 2, 2, 2, 2, 0, 6, 1,
|
||
6, 5, 0, 6, 1, 6, 5, 0, 6, 1,
|
||
6, 2, 1, 2, 1, 2, 1, 1, 1, 1,
|
||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||
1, 1, 2, 1, 1, 1, 1, 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 yytype_uint16 yydefact[] =
|
||
{
|
||
0, 260, 260, 260, 260, 0, 2, 6, 3, 76,
|
||
4, 29, 5, 151, 1, 246, 247, 248, 260, 0,
|
||
260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
|
||
260, 260, 260, 260, 260, 7, 8, 9, 10, 11,
|
||
12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
|
||
22, 23, 24, 0, 0, 0, 260, 0, 0, 0,
|
||
0, 260, 0, 0, 260, 0, 97, 0, 93, 90,
|
||
91, 92, 260, 31, 0, 0, 0, 0, 0, 260,
|
||
0, 0, 0, 157, 0, 241, 245, 244, 260, 0,
|
||
70, 72, 74, 142, 0, 240, 239, 146, 144, 140,
|
||
134, 207, 0, 136, 138, 38, 260, 0, 0, 0,
|
||
0, 0, 0, 260, 0, 0, 0, 0, 0, 0,
|
||
260, 0, 0, 258, 259, 0, 260, 0, 0, 0,
|
||
260, 260, 260, 260, 0, 243, 242, 260, 0, 0,
|
||
0, 0, 32, 0, 0, 0, 0, 0, 260, 0,
|
||
0, 0, 0, 0, 253, 254, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 0, 0, 0, 260, 0,
|
||
260, 260, 232, 0, 0, 196, 152, 0, 189, 237,
|
||
0, 0, 0, 0, 0, 0, 188, 0, 187, 236,
|
||
0, 251, 0, 250, 249, 25, 0, 260, 260, 260,
|
||
260, 260, 260, 260, 260, 260, 260, 27, 260, 260,
|
||
260, 260, 78, 0, 260, 94, 84, 83, 82, 81,
|
||
87, 86, 255, 256, 257, 0, 85, 0, 131, 0,
|
||
89, 0, 99, 0, 233, 129, 0, 160, 260, 156,
|
||
0, 158, 0, 0, 159, 0, 0, 155, 154, 0,
|
||
26, 252, 36, 0, 0, 0, 0, 0, 34, 0,
|
||
176, 0, 162, 0, 0, 0, 211, 260, 0, 0,
|
||
0, 40, 0, 0, 0, 95, 77, 0, 88, 0,
|
||
0, 0, 0, 0, 0, 0, 0, 98, 100, 101,
|
||
102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
|
||
0, 260, 30, 0, 148, 0, 0, 190, 0, 0,
|
||
0, 161, 260, 71, 73, 75, 143, 260, 33, 0,
|
||
0, 0, 0, 0, 0, 260, 0, 0, 147, 180,
|
||
0, 0, 0, 0, 0, 260, 0, 0, 0, 0,
|
||
0, 145, 173, 166, 141, 135, 260, 260, 260, 260,
|
||
208, 212, 213, 214, 215, 216, 0, 137, 139, 42,
|
||
39, 41, 37, 79, 80, 96, 0, 260, 260, 0,
|
||
0, 0, 0, 0, 0, 260, 0, 0, 0, 153,
|
||
0, 0, 0, 0, 193, 0, 238, 0, 0, 260,
|
||
260, 0, 0, 0, 0, 260, 260, 0, 260, 0,
|
||
0, 0, 0, 260, 260, 260, 260, 260, 209, 217,
|
||
222, 227, 28, 0, 44, 0, 0, 0, 0, 123,
|
||
0, 0, 126, 0, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||
0, 206, 234, 0, 0, 0, 205, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||
0, 201, 0, 199, 0, 200, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 122, 0, 125, 0, 114, 0,
|
||
115, 116, 117, 121, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 197, 0, 183, 185, 235, 179,
|
||
181, 184, 182, 0, 178, 177, 169, 165, 167, 170,
|
||
198, 168, 0, 164, 163, 0, 174, 171, 172, 260,
|
||
260, 260, 260, 0, 46, 0, 0, 0, 0, 0,
|
||
0, 119, 0, 112, 0, 128, 130, 149, 150, 0,
|
||
0, 0, 0, 35, 186, 175, 260, 0, 0, 219,
|
||
0, 224, 0, 229, 0, 0, 0, 260, 43, 47,
|
||
0, 0, 0, 0, 0, 0, 120, 113, 192, 191,
|
||
0, 0, 0, 203, 210, 260, 0, 218, 260, 0,
|
||
223, 260, 228, 231, 0, 0, 0, 0, 0, 48,
|
||
45, 0, 0, 0, 0, 118, 195, 194, 202, 204,
|
||
0, 260, 0, 260, 0, 0, 0, 0, 0, 0,
|
||
0, 50, 49, 0, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 52, 0, 0, 53, 0,
|
||
0, 132, 0, 0, 0, 0, 221, 0, 226, 0,
|
||
0, 0, 0, 0, 64, 0, 0, 0, 0, 0,
|
||
133, 0, 0, 220, 225, 230, 0, 0, 0, 0,
|
||
0, 0, 67, 0, 0, 0, 51, 56, 124, 0,
|
||
55, 54, 0, 0, 0, 0, 0, 0, 0, 0,
|
||
57, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||
66, 65, 0, 0, 0, 0, 0, 0, 0, 69,
|
||
68, 59, 62, 0, 60, 0, 58, 0, 63, 61,
|
||
0, 127
|
||
};
|
||
|
||
/* YYDEFGOTO[NTERM-NUM]. */
|
||
static const yytype_int16 yydefgoto[] =
|
||
{
|
||
-1, 5, 6, 68, 36, 37, 38, 267, 10, 39,
|
||
201, 257, 40, 41, 151, 270, 361, 413, 471, 523,
|
||
630, 648, 607, 609, 42, 138, 43, 139, 44, 140,
|
||
8, 214, 274, 69, 119, 231, 288, 289, 290, 291,
|
||
292, 293, 294, 295, 296, 297, 298, 417, 299, 420,
|
||
70, 233, 71, 167, 45, 146, 46, 149, 47, 150,
|
||
48, 145, 49, 141, 50, 144, 51, 143, 303, 12,
|
||
238, 261, 259, 187, 185, 177, 180, 182, 174, 83,
|
||
454, 462, 464, 460, 572, 445, 440, 52, 147, 352,
|
||
466, 265, 353, 467, 548, 354, 468, 550, 355, 469,
|
||
552, 171, 441, 188, 178, 385, 179, 84, 134, 85,
|
||
95, 192, 193, 498, 225, 175, 96
|
||
};
|
||
|
||
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
||
STATE-NUM. */
|
||
#define YYPACT_NINF -402
|
||
static const yytype_int16 yypact[] =
|
||
{
|
||
187, -402, -402, -402, -402, 13, 995, -402, 1259, -402,
|
||
115, -402, 255, -402, -402, -402, -402, -402, 286, -84,
|
||
286, 286, 286, 286, 286, 286, 286, 286, 286, 286,
|
||
286, 286, 286, 286, 286, -402, -402, -402, -402, -402,
|
||
-402, -402, -402, -402, -402, -402, -402, -402, -402, -402,
|
||
-402, -402, -402, 90, -63, 22, 286, 42, 65, 81,
|
||
120, 286, 138, 150, 286, 164, -402, 169, -402, -402,
|
||
-402, -402, 286, -402, 181, 192, 190, 191, 203, 286,
|
||
205, 219, 224, -402, 227, -402, -402, -402, 286, 228,
|
||
-402, -402, -402, -402, 231, -402, -402, -402, -402, -402,
|
||
-402, -402, 232, -402, -402, -402, 286, 286, 213, 234,
|
||
301, 326, 192, 286, 236, 192, 125, 241, 192, 242,
|
||
-402, 247, 192, -402, -402, 253, 286, 213, 213, 260,
|
||
286, 286, -402, 286, 143, -402, -402, 286, 261, 262,
|
||
263, 272, -402, 273, 275, 285, 288, 294, 286, 295,
|
||
296, 299, 300, 208, -402, -402, 213, 286, 303, 304,
|
||
305, 307, 309, 311, 332, 313, 302, 314, 286, 315,
|
||
-402, 192, -402, 332, 316, -402, -402, 317, -402, -402,
|
||
6, 213, 14, 213, 332, 318, -402, 319, -402, -402,
|
||
172, -402, 321, 286, -402, -402, 322, -402, -402, -402,
|
||
-402, -402, -402, -402, -402, -402, -402, -402, -402, -402,
|
||
-402, 286, -402, 213, -402, -402, -402, -402, -402, -402,
|
||
-402, -402, -402, -402, -402, 325, -402, 213, -402, 328,
|
||
-402, 306, -402, 60, -402, -402, 329, -402, -402, -402,
|
||
75, -402, 213, 80, -402, 213, 331, -402, -402, 327,
|
||
-402, -402, -402, 921, 1104, 1177, 373, 109, -402, 211,
|
||
-402, 146, -402, 397, 708, 121, -402, -402, 733, 747,
|
||
144, -402, 334, 335, 51, -402, -402, 213, -402, 339,
|
||
347, 350, 352, 353, 354, 356, 357, -402, -402, -402,
|
||
-402, -402, -402, -402, -402, -402, -402, -402, -402, -402,
|
||
359, 286, -402, 116, -402, 286, 360, -402, 286, 362,
|
||
213, -402, 286, -402, -402, -402, -402, 286, -402, 367,
|
||
368, 369, 370, 371, 372, 286, 376, 377, -402, -402,
|
||
378, 381, 383, 384, 386, 286, 391, 392, 393, 396,
|
||
405, -402, -402, -402, -402, -402, 286, 286, 286, 286,
|
||
-402, -402, -402, -402, -402, -402, 174, -402, -402, 192,
|
||
-402, -402, -402, -402, -402, -402, 100, 213, 213, 213,
|
||
213, 213, 213, 213, 213, 286, 406, 407, 408, -402,
|
||
213, 213, 213, 213, -402, 409, -402, 411, 192, -402,
|
||
286, 213, 192, 213, 413, 286, 286, 192, 286, 213,
|
||
192, 213, 414, 286, 286, -402, -402, -402, -402, -402,
|
||
-402, -402, -402, 415, -402, 416, 161, 417, 213, -402,
|
||
418, 213, -402, 7, 419, 420, 422, 44, 213, 423,
|
||
332, 213, 213, 213, 213, 213, 213, 424, 332, 425,
|
||
426, 213, -402, 427, 24, 428, -402, 31, 332, 429,
|
||
430, 431, 432, 34, 440, 192, 43, 332, 441, 442,
|
||
71, -402, 443, 213, 444, 213, 446, 447, 448, 449,
|
||
213, 450, 213, 453, -402, 213, -402, 213, -402, 213,
|
||
-402, -402, -402, -402, 56, 58, 454, 455, 55, 99,
|
||
213, 213, 213, 213, -402, 457, -402, -402, -402, -402,
|
||
-402, -402, -402, 458, -402, -402, -402, -402, -402, -402,
|
||
-402, -402, 460, -402, -402, 463, -402, -402, -402, -402,
|
||
-402, -402, -402, 118, 213, 213, 213, 213, 213, 213,
|
||
213, -402, 464, -402, 465, -402, -402, -402, -402, 466,
|
||
467, 213, 213, -402, -402, -402, -402, 135, 72, -402,
|
||
175, -402, 87, -402, 83, 470, 476, 286, -402, 213,
|
||
209, 213, 213, 213, 213, 477, -402, -402, -402, -402,
|
||
478, 479, 77, -402, -402, 286, 481, -402, 286, 484,
|
||
-402, 286, -402, -402, 286, 485, 213, 213, 486, 213,
|
||
-402, 487, 213, 213, 213, -402, -402, -402, -402, -402,
|
||
489, -402, 492, -402, 493, 213, 213, 62, 213, 102,
|
||
213, -402, -402, 494, 497, 213, 213, 332, 63, 332,
|
||
66, 332, 213, 213, 86, -402, 213, 89, -402, 213,
|
||
213, -402, 499, 213, 213, 500, -402, 504, -402, 505,
|
||
213, 213, 286, 507, -402, 286, 508, 213, 47, 213,
|
||
-402, 213, 213, -402, -402, -402, 509, 510, 213, 213,
|
||
213, 213, -402, 512, 92, 513, -402, 213, -402, 213,
|
||
-402, -402, 213, 213, 213, 213, 213, 286, 514, 213,
|
||
-402, 213, 213, 213, 213, 213, 213, 213, 213, 213,
|
||
213, 516, 518, 213, 213, 213, 213, 213, 213, 213,
|
||
-402, -402, 520, 521, 522, 68, 73, 523, 213, -402,
|
||
-402, -402, -402, 527, -402, 528, -402, 213, -402, -402,
|
||
213, -402
|
||
};
|
||
|
||
/* YYPGOTO[NTERM-NUM]. */
|
||
static const yytype_int16 yypgoto[] =
|
||
{
|
||
-402, -402, -402, 482, -402, -402, -402, -402, 110, -402,
|
||
-402, -402, -402, -402, -402, -402, -402, -402, -402, -61,
|
||
-402, -402, -402, -402, -402, -402, -402, -402, -402, -402,
|
||
151, -402, -402, -9, -402, -402, -402, -402, -402, -402,
|
||
-402, -402, -402, -402, -402, -402, -402, -402, -402, -402,
|
||
-402, -402, -402, -402, -402, -402, -402, -402, -402, -402,
|
||
-402, -402, -402, -402, -402, -402, -258, -402, -402, 112,
|
||
-402, -402, -402, -145, -139, -119, -279, -291, -263, 26,
|
||
-402, -402, -402, -402, -402, -402, -402, -261, -402, -402,
|
||
-402, -19, -44, -402, -402, -402, -402, -402, -402, -402,
|
||
-402, 436, -401, -402, -402, 170, 178, 9, -73, -402,
|
||
-6, 387, -402, 1, -165, -66, 709
|
||
};
|
||
|
||
/* 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 yytype_uint16 yytable[] =
|
||
{
|
||
53, 73, 53, 342, 351, 463, 465, 88, 236, 125,
|
||
154, 155, 86, 14, 86, 86, 86, 86, 86, 246,
|
||
86, 86, 86, 86, 86, 240, 86, 86, 107, 89,
|
||
90, 91, 92, 93, 243, 97, 98, 99, 100, 101,
|
||
163, 103, 104, 240, 159, 161, 162, 154, 155, 165,
|
||
86, 243, 169, 240, 15, 16, 17, 663, 86, 154,
|
||
155, 154, 155, 243, 196, 109, 154, 155, 664, 154,
|
||
155, 154, 155, 117, 240, 207, 154, 155, 15, 16,
|
||
17, 624, 135, 15, 16, 17, 15, 16, 17, 15,
|
||
16, 17, 15, 16, 17, 15, 16, 17, 241, 478,
|
||
86, 153, 447, 154, 155, 234, 244, 135, 515, 156,
|
||
456, 300, 444, 108, 665, 152, 500, 106, 301, 243,
|
||
453, 26, 627, 502, 234, 439, 508, 191, 181, 183,
|
||
575, 135, 346, 110, 451, 511, 483, 576, 272, 666,
|
||
554, 489, 135, 364, 347, 581, 346, 537, 531, 166,
|
||
533, 215, 488, 330, 625, 636, 111, 213, 638, 377,
|
||
712, 555, 191, 516, 577, 714, 305, 317, 378, 598,
|
||
556, 308, 112, 72, 584, 123, 124, 642, 347, 582,
|
||
645, 415, 242, 677, 245, 30, 66, 251, 331, 332,
|
||
26, 538, 347, 333, 628, 123, 124, 557, 334, 30,
|
||
618, 318, 620, 94, 335, 135, 348, 349, 379, 102,
|
||
558, 113, 105, 350, 273, 336, 154, 155, 319, 337,
|
||
348, 349, 338, 249, 339, 359, 340, 574, 277, 115,
|
||
82, 554, 72, 578, 306, 195, 360, 309, 341, 114,
|
||
579, 116, 473, 307, 320, 66, 310, 53, 53, 53,
|
||
121, 450, 555, 321, 322, 118, 449, 129, 323, 459,
|
||
120, 556, 74, 324, 458, 487, 412, 580, 365, 325,
|
||
75, 443, 122, 495, 1, 2, 3, 4, 366, 452,
|
||
326, 126, 127, 503, 327, 329, 351, 343, 557, 15,
|
||
16, 17, 512, 414, 128, 82, 130, 76, 77, 380,
|
||
212, 590, 382, 328, 123, 124, 158, 78, 186, 189,
|
||
131, 384, 256, 79, 599, 132, 263, 264, 133, 137,
|
||
268, 269, 142, 148, 80, 157, 446, 164, 81, 123,
|
||
124, 160, 168, 170, 455, 222, 223, 224, 173, 82,
|
||
86, 86, 86, 86, 176, 279, 280, 73, 253, 254,
|
||
255, 184, 197, 198, 199, 408, 409, 410, 411, 281,
|
||
282, 283, 284, 200, 202, 285, 203, 416, 418, 421,
|
||
423, 424, 425, 426, 427, 428, 204, 356, 286, 205,
|
||
74, 433, 434, 435, 436, 206, 208, 209, 75, 510,
|
||
210, 211, 181, 227, 183, 216, 217, 218, 287, 219,
|
||
181, 220, 183, 221, 74, 226, 228, 230, 237, 239,
|
||
247, 248, 75, 250, 252, 76, 77, 276, 312, 475,
|
||
278, 302, 477, 311, 479, 78, 362, 363, 484, 485,
|
||
367, 79, 181, 183, 490, 491, 492, 493, 368, 76,
|
||
77, 369, 80, 370, 371, 372, 81, 373, 374, 78,
|
||
375, 381, 635, 383, 637, 79, 639, 82, 388, 389,
|
||
390, 391, 392, 393, 560, 316, 80, 395, 396, 397,
|
||
81, 524, 398, 526, 399, 400, 528, 401, 529, 376,
|
||
530, 82, 403, 404, 405, 532, 534, 406, 35, 344,
|
||
386, 539, 540, 541, 542, 387, 407, 430, 431, 432,
|
||
547, 437, 438, 394, 448, 457, 470, 472, 583, 474,
|
||
476, 480, 481, 402, 482, 486, 494, 496, 497, 499,
|
||
501, 504, 505, 506, 507, 559, 524, 561, 562, 563,
|
||
564, 565, 509, 513, 514, 517, 518, 519, 520, 521,
|
||
522, 525, 570, 571, 527, 429, 535, 536, 585, 543,
|
||
544, 86, 545, 386, 546, 229, 566, 567, 568, 569,
|
||
589, 586, 591, 592, 593, 594, 588, 587, 190, 595,
|
||
596, 597, 601, 186, 189, 603, 606, 611, 605, 613,
|
||
617, 186, 189, 619, 621, 0, 631, 608, 610, 632,
|
||
612, 650, 653, 614, 615, 616, 654, 655, 659, 661,
|
||
0, 670, 671, 676, 679, 688, 622, 623, 700, 626,
|
||
701, 629, 709, 710, 711, 716, 633, 634, 643, 718,
|
||
719, 646, 0, 640, 641, 0, 0, 644, 0, 0,
|
||
647, 649, 0, 0, 651, 652, 658, 0, 0, 660,
|
||
0, 656, 657, 0, 0, 0, 0, 0, 662, 0,
|
||
667, 0, 668, 669, 0, 0, 0, 0, 678, 672,
|
||
673, 674, 675, 0, 0, 0, 0, 0, 680, 0,
|
||
681, 687, 0, 682, 683, 684, 685, 686, 0, 0,
|
||
689, 0, 690, 691, 692, 693, 694, 695, 696, 697,
|
||
698, 699, 0, 0, 702, 703, 704, 705, 706, 707,
|
||
708, 0, 0, 0, 0, 0, 713, 715, 0, 717,
|
||
7, 9, 11, 13, 0, 74, 0, 0, 720, 0,
|
||
0, 721, 0, 75, 0, 0, 0, 87, 0, 87,
|
||
87, 87, 87, 87, 0, 87, 87, 87, 87, 87,
|
||
74, 87, 87, 0, 0, 0, 0, 0, 75, 0,
|
||
76, 77, 0, 600, 74, 0, 602, 0, 0, 604,
|
||
78, 0, 75, 0, 0, 87, 79, 0, 0, 0,
|
||
0, 0, 0, 87, 0, 76, 77, 80, 0, 0,
|
||
0, 81, 0, 0, 0, 78, 0, 0, 0, 76,
|
||
77, 79, 82, 0, 0, 0, 0, 136, 0, 78,
|
||
345, 0, 80, 0, 0, 79, 81, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 87, 80, 82, 0, 0,
|
||
81, 0, 136, 0, 0, 357, 0, 0, 0, 172,
|
||
0, 82, 0, 0, 0, 0, 0, 0, 0, 358,
|
||
0, 172, 194, 0, 0, 0, 136, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 0, 0, 136, 0, 0,
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 0, 0, 194, 0, 232,
|
||
235, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 0, 9, 9, 9, 13,
|
||
258, 260, 262, 13, 13, 266, 0, 13, 13, 271,
|
||
136, 0, 0, 275, 15, 16, 17, 0, 0, 54,
|
||
55, 0, 0, 0, 56, 18, 0, 19, 0, 57,
|
||
0, 0, 0, 0, 58, 0, 0, 304, 20, 0,
|
||
21, 0, 0, 22, 0, 0, 23, 24, 0, 25,
|
||
0, 0, 59, 0, 0, 26, 27, 60, 0, 0,
|
||
28, 29, 0, 0, 0, 0, 11, 0, 0, 61,
|
||
0, 0, 0, 62, 63, 30, 0, 64, 0, 65,
|
||
31, 0, 66, 0, 0, 32, 33, 0, 15, 16,
|
||
17, 0, 0, 0, 34, 67, 0, 0, 0, 18,
|
||
0, 19, 0, 313, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 20, 0, 21, 0, 0, 22, 0, 0,
|
||
23, 24, 0, 25, 0, 0, 0, 0, 0, 26,
|
||
27, 0, 0, 0, 28, 29, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 87, 87, 87, 87, 30,
|
||
0, 0, 0, 0, 31, 0, 0, 0, 0, 32,
|
||
33, 0, 0, 0, 0, 0, 419, 422, 34, 0,
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||
0, 0, 0, 0, 0, 0, 0, 0, 442, 0,
|
||
0, 0, 0, 0, 0, 0, 0, 15, 16, 17,
|
||
0, 0, 54, 55, 461, 442, 442, 56, 18, 0,
|
||
19, 0, 57, 0, 0, 0, 0, 58, 0, 0,
|
||
0, 20, 0, 21, 0, 0, 22, 0, 0, 23,
|
||
24, 0, 25, 0, 0, 59, 0, 0, 26, 27,
|
||
60, 0, 0, 28, 29, 0, 0, 0, 0, 0,
|
||
0, 0, 61, 0, 0, 0, 62, 63, 30, 0,
|
||
64, 0, 65, 31, 0, 66, 0, 0, 32, 33,
|
||
15, 16, 17, 0, 0, 54, 55, 34, 67, 0,
|
||
56, 18, 0, 19, 0, 57, 314, 0, 0, 0,
|
||
58, 0, 0, 0, 20, 0, 21, 0, 0, 22,
|
||
0, 0, 23, 24, 0, 25, 0, 0, 59, 0,
|
||
0, 26, 27, 60, 0, 0, 28, 29, 266, 549,
|
||
551, 553, 0, 0, 0, 61, 0, 0, 0, 62,
|
||
63, 30, 0, 64, 0, 65, 31, 0, 66, 0,
|
||
0, 32, 33, 0, 0, 573, 0, 0, 0, 0,
|
||
34, 67, 15, 16, 17, 0, 87, 54, 55, 315,
|
||
0, 0, 56, 18, 0, 19, 0, 57, 0, 0,
|
||
0, 0, 58, 0, 0, 0, 20, 0, 21, 0,
|
||
0, 22, 0, 0, 23, 24, 0, 25, 0, 0,
|
||
59, 0, 0, 26, 27, 60, 0, 0, 28, 29,
|
||
442, 0, 442, 0, 0, 0, 0, 61, 0, 0,
|
||
0, 62, 63, 30, 0, 64, 0, 65, 31, 0,
|
||
66, 0, 0, 32, 33, 0, 0, 0, 0, 0,
|
||
0, 0, 34, 67
|
||
};
|
||
|
||
static const yytype_int16 yycheck[] =
|
||
{
|
||
6, 10, 8, 261, 265, 406, 407, 91, 173, 75,
|
||
3, 4, 18, 0, 20, 21, 22, 23, 24, 184,
|
||
26, 27, 28, 29, 30, 19, 32, 33, 91, 20,
|
||
21, 22, 23, 24, 20, 26, 27, 28, 29, 30,
|
||
113, 32, 33, 19, 110, 111, 112, 3, 4, 115,
|
||
56, 20, 118, 19, 3, 4, 5, 10, 64, 3,
|
||
4, 3, 4, 20, 137, 56, 3, 4, 21, 3,
|
||
4, 3, 4, 64, 19, 148, 3, 4, 3, 4,
|
||
5, 19, 88, 3, 4, 5, 3, 4, 5, 3,
|
||
4, 5, 3, 4, 5, 3, 4, 5, 92, 92,
|
||
106, 107, 393, 3, 4, 171, 92, 113, 37, 108,
|
||
401, 51, 391, 91, 67, 106, 92, 27, 58, 20,
|
||
399, 44, 20, 92, 190, 388, 92, 133, 127, 128,
|
||
58, 137, 11, 91, 397, 92, 92, 65, 211, 92,
|
||
22, 432, 148, 92, 57, 58, 11, 92, 92, 24,
|
||
92, 157, 431, 7, 92, 92, 91, 156, 92, 43,
|
||
92, 43, 168, 92, 92, 92, 91, 58, 52, 92,
|
||
52, 91, 91, 58, 91, 3, 4, 91, 57, 92,
|
||
91, 81, 181, 91, 183, 64, 71, 193, 42, 43,
|
||
44, 92, 57, 47, 92, 3, 4, 79, 52, 64,
|
||
601, 92, 603, 25, 58, 211, 85, 86, 92, 31,
|
||
92, 91, 34, 92, 213, 69, 3, 4, 7, 73,
|
||
85, 86, 76, 51, 78, 81, 80, 92, 227, 91,
|
||
84, 22, 58, 58, 240, 92, 92, 243, 92, 61,
|
||
65, 91, 81, 242, 33, 71, 245, 253, 254, 255,
|
||
72, 396, 43, 42, 43, 91, 395, 79, 47, 404,
|
||
91, 52, 7, 52, 403, 430, 92, 92, 274, 58,
|
||
15, 390, 91, 438, 87, 88, 89, 90, 277, 398,
|
||
69, 91, 91, 448, 73, 259, 547, 261, 79, 3,
|
||
4, 5, 457, 359, 91, 84, 91, 42, 43, 305,
|
||
92, 92, 308, 92, 3, 4, 5, 52, 130, 131,
|
||
91, 310, 200, 58, 572, 91, 204, 205, 91, 91,
|
||
208, 209, 91, 91, 69, 91, 392, 91, 73, 3,
|
||
4, 5, 91, 91, 400, 3, 4, 5, 91, 84,
|
||
346, 347, 348, 349, 91, 39, 40, 356, 197, 198,
|
||
199, 91, 91, 91, 91, 346, 347, 348, 349, 53,
|
||
54, 55, 56, 91, 91, 59, 91, 366, 367, 368,
|
||
369, 370, 371, 372, 373, 374, 91, 267, 72, 91,
|
||
7, 380, 381, 382, 383, 91, 91, 91, 15, 455,
|
||
91, 91, 391, 91, 393, 92, 92, 92, 92, 92,
|
||
399, 92, 401, 92, 7, 92, 92, 92, 92, 92,
|
||
92, 92, 15, 92, 92, 42, 43, 92, 91, 418,
|
||
92, 92, 421, 92, 423, 52, 92, 92, 427, 428,
|
||
91, 58, 431, 432, 433, 434, 435, 436, 91, 42,
|
||
43, 91, 69, 91, 91, 91, 73, 91, 91, 52,
|
||
91, 91, 617, 91, 619, 58, 621, 84, 91, 91,
|
||
91, 91, 91, 91, 525, 92, 69, 91, 91, 91,
|
||
73, 470, 91, 472, 91, 91, 475, 91, 477, 301,
|
||
479, 84, 91, 91, 91, 484, 485, 91, 6, 92,
|
||
312, 490, 491, 492, 493, 317, 91, 91, 91, 91,
|
||
519, 92, 91, 325, 91, 91, 91, 91, 552, 92,
|
||
92, 92, 92, 335, 92, 92, 92, 92, 92, 92,
|
||
92, 92, 92, 92, 92, 524, 525, 526, 527, 528,
|
||
529, 530, 92, 92, 92, 92, 92, 91, 91, 91,
|
||
91, 91, 541, 542, 91, 375, 92, 92, 554, 92,
|
||
92, 557, 92, 375, 91, 168, 92, 92, 92, 92,
|
||
559, 91, 561, 562, 563, 564, 557, 91, 132, 92,
|
||
92, 92, 91, 395, 396, 91, 91, 91, 584, 92,
|
||
91, 403, 404, 91, 91, -1, 92, 586, 587, 92,
|
||
589, 92, 92, 592, 593, 594, 92, 92, 91, 91,
|
||
-1, 92, 92, 91, 91, 91, 605, 606, 92, 608,
|
||
92, 610, 92, 92, 92, 92, 615, 616, 624, 92,
|
||
92, 627, -1, 622, 623, -1, -1, 626, -1, -1,
|
||
629, 630, -1, -1, 633, 634, 642, -1, -1, 645,
|
||
-1, 640, 641, -1, -1, -1, -1, -1, 647, -1,
|
||
649, -1, 651, 652, -1, -1, -1, -1, 664, 658,
|
||
659, 660, 661, -1, -1, -1, -1, -1, 667, -1,
|
||
669, 677, -1, 672, 673, 674, 675, 676, -1, -1,
|
||
679, -1, 681, 682, 683, 684, 685, 686, 687, 688,
|
||
689, 690, -1, -1, 693, 694, 695, 696, 697, 698,
|
||
699, -1, -1, -1, -1, -1, 705, 706, -1, 708,
|
||
1, 2, 3, 4, -1, 7, -1, -1, 717, -1,
|
||
-1, 720, -1, 15, -1, -1, -1, 18, -1, 20,
|
||
21, 22, 23, 24, -1, 26, 27, 28, 29, 30,
|
||
7, 32, 33, -1, -1, -1, -1, -1, 15, -1,
|
||
42, 43, -1, 575, 7, -1, 578, -1, -1, 581,
|
||
52, -1, 15, -1, -1, 56, 58, -1, -1, -1,
|
||
-1, -1, -1, 64, -1, 42, 43, 69, -1, -1,
|
||
-1, 73, -1, -1, -1, 52, -1, -1, -1, 42,
|
||
43, 58, 84, -1, -1, -1, -1, 88, -1, 52,
|
||
92, -1, 69, -1, -1, 58, 73, -1, -1, -1,
|
||
-1, -1, -1, -1, -1, 106, 69, 84, -1, -1,
|
||
73, -1, 113, -1, -1, 92, -1, -1, -1, 120,
|
||
-1, 84, -1, -1, -1, -1, -1, -1, -1, 92,
|
||
-1, 132, 133, -1, -1, -1, 137, -1, -1, -1,
|
||
-1, -1, -1, -1, -1, -1, -1, 148, -1, -1,
|
||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||
-1, -1, -1, -1, -1, -1, -1, 168, -1, 170,
|
||
171, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||
-1, -1, -1, -1, -1, -1, 197, 198, 199, 200,
|
||
201, 202, 203, 204, 205, 206, -1, 208, 209, 210,
|
||
211, -1, -1, 214, 3, 4, 5, -1, -1, 8,
|
||
9, -1, -1, -1, 13, 14, -1, 16, -1, 18,
|
||
-1, -1, -1, -1, 23, -1, -1, 238, 27, -1,
|
||
29, -1, -1, 32, -1, -1, 35, 36, -1, 38,
|
||
-1, -1, 41, -1, -1, 44, 45, 46, -1, -1,
|
||
49, 50, -1, -1, -1, -1, 267, -1, -1, 58,
|
||
-1, -1, -1, 62, 63, 64, -1, 66, -1, 68,
|
||
69, -1, 71, -1, -1, 74, 75, -1, 3, 4,
|
||
5, -1, -1, -1, 83, 84, -1, -1, -1, 14,
|
||
-1, 16, -1, 92, -1, -1, -1, -1, -1, -1,
|
||
-1, -1, 27, -1, 29, -1, -1, 32, -1, -1,
|
||
35, 36, -1, 38, -1, -1, -1, -1, -1, 44,
|
||
45, -1, -1, -1, 49, 50, -1, -1, -1, -1,
|
||
-1, -1, -1, -1, -1, 346, 347, 348, 349, 64,
|
||
-1, -1, -1, -1, 69, -1, -1, -1, -1, 74,
|
||
75, -1, -1, -1, -1, -1, 367, 368, 83, -1,
|
||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||
-1, -1, -1, -1, -1, -1, -1, -1, 389, -1,
|
||
-1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
|
||
-1, -1, 8, 9, 405, 406, 407, 13, 14, -1,
|
||
16, -1, 18, -1, -1, -1, -1, 23, -1, -1,
|
||
-1, 27, -1, 29, -1, -1, 32, -1, -1, 35,
|
||
36, -1, 38, -1, -1, 41, -1, -1, 44, 45,
|
||
46, -1, -1, 49, 50, -1, -1, -1, -1, -1,
|
||
-1, -1, 58, -1, -1, -1, 62, 63, 64, -1,
|
||
66, -1, 68, 69, -1, 71, -1, -1, 74, 75,
|
||
3, 4, 5, -1, -1, 8, 9, 83, 84, -1,
|
||
13, 14, -1, 16, -1, 18, 92, -1, -1, -1,
|
||
23, -1, -1, -1, 27, -1, 29, -1, -1, 32,
|
||
-1, -1, 35, 36, -1, 38, -1, -1, 41, -1,
|
||
-1, 44, 45, 46, -1, -1, 49, 50, 519, 520,
|
||
521, 522, -1, -1, -1, 58, -1, -1, -1, 62,
|
||
63, 64, -1, 66, -1, 68, 69, -1, 71, -1,
|
||
-1, 74, 75, -1, -1, 546, -1, -1, -1, -1,
|
||
83, 84, 3, 4, 5, -1, 557, 8, 9, 92,
|
||
-1, -1, 13, 14, -1, 16, -1, 18, -1, -1,
|
||
-1, -1, 23, -1, -1, -1, 27, -1, 29, -1,
|
||
-1, 32, -1, -1, 35, 36, -1, 38, -1, -1,
|
||
41, -1, -1, 44, 45, 46, -1, -1, 49, 50,
|
||
601, -1, 603, -1, -1, -1, -1, 58, -1, -1,
|
||
-1, 62, 63, 64, -1, 66, -1, 68, 69, -1,
|
||
71, -1, -1, 74, 75, -1, -1, -1, -1, -1,
|
||
-1, -1, 83, 84
|
||
};
|
||
|
||
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
|
||
symbol of state STATE-NUM. */
|
||
static const yytype_uint8 yystos[] =
|
||
{
|
||
0, 87, 88, 89, 90, 94, 95, 209, 123, 209,
|
||
101, 209, 162, 209, 0, 3, 4, 5, 14, 16,
|
||
27, 29, 32, 35, 36, 38, 44, 45, 49, 50,
|
||
64, 69, 74, 75, 83, 96, 97, 98, 99, 102,
|
||
105, 106, 117, 119, 121, 147, 149, 151, 153, 155,
|
||
157, 159, 180, 203, 8, 9, 13, 18, 23, 41,
|
||
46, 58, 62, 63, 66, 68, 71, 84, 96, 126,
|
||
143, 145, 58, 126, 7, 15, 42, 43, 52, 58,
|
||
69, 73, 84, 172, 200, 202, 203, 209, 91, 200,
|
||
200, 200, 200, 200, 199, 203, 209, 200, 200, 200,
|
||
200, 200, 199, 200, 200, 199, 27, 91, 91, 200,
|
||
91, 91, 91, 91, 199, 91, 91, 200, 91, 127,
|
||
91, 199, 91, 3, 4, 208, 91, 91, 91, 199,
|
||
91, 91, 91, 91, 201, 203, 209, 91, 118, 120,
|
||
122, 156, 91, 160, 158, 154, 148, 181, 91, 150,
|
||
152, 107, 200, 203, 3, 4, 206, 91, 5, 208,
|
||
5, 208, 208, 201, 91, 208, 24, 146, 91, 208,
|
||
91, 194, 209, 91, 171, 208, 91, 168, 197, 199,
|
||
169, 206, 170, 206, 91, 167, 199, 166, 196, 199,
|
||
194, 203, 204, 205, 209, 92, 201, 91, 91, 91,
|
||
91, 103, 91, 91, 91, 91, 91, 201, 91, 91,
|
||
91, 91, 92, 206, 124, 203, 92, 92, 92, 92,
|
||
92, 92, 3, 4, 5, 207, 92, 91, 92, 204,
|
||
92, 128, 209, 144, 208, 209, 207, 92, 163, 92,
|
||
19, 92, 206, 20, 92, 206, 207, 92, 92, 51,
|
||
92, 203, 92, 123, 123, 123, 162, 104, 209, 165,
|
||
209, 164, 209, 162, 162, 184, 209, 100, 162, 162,
|
||
108, 209, 201, 206, 125, 209, 92, 206, 92, 39,
|
||
40, 53, 54, 55, 56, 59, 72, 92, 129, 130,
|
||
131, 132, 133, 134, 135, 136, 137, 138, 139, 141,
|
||
51, 58, 92, 161, 209, 91, 203, 206, 91, 203,
|
||
206, 92, 91, 92, 92, 92, 92, 58, 92, 7,
|
||
33, 42, 43, 47, 52, 58, 69, 73, 92, 172,
|
||
7, 42, 43, 47, 52, 58, 69, 73, 76, 78,
|
||
80, 92, 159, 172, 92, 92, 11, 57, 85, 86,
|
||
92, 180, 182, 185, 188, 191, 101, 92, 92, 81,
|
||
92, 109, 92, 92, 92, 203, 206, 91, 91, 91,
|
||
91, 91, 91, 91, 91, 91, 199, 43, 52, 92,
|
||
203, 91, 203, 91, 206, 198, 199, 199, 91, 91,
|
||
91, 91, 91, 91, 199, 91, 91, 91, 91, 91,
|
||
91, 91, 199, 91, 91, 91, 91, 91, 200, 200,
|
||
200, 200, 92, 110, 208, 81, 206, 140, 206, 209,
|
||
142, 206, 209, 206, 206, 206, 206, 206, 206, 198,
|
||
91, 91, 91, 206, 206, 206, 206, 92, 91, 171,
|
||
179, 195, 209, 168, 169, 178, 208, 170, 91, 167,
|
||
166, 171, 168, 169, 173, 208, 170, 91, 167, 166,
|
||
176, 209, 174, 195, 175, 195, 183, 186, 189, 192,
|
||
91, 111, 91, 81, 92, 206, 92, 206, 92, 206,
|
||
92, 92, 92, 92, 206, 206, 92, 207, 169, 170,
|
||
206, 206, 206, 206, 92, 207, 92, 92, 206, 92,
|
||
92, 92, 92, 207, 92, 92, 92, 92, 92, 92,
|
||
208, 92, 207, 92, 92, 37, 92, 92, 92, 91,
|
||
91, 91, 91, 112, 206, 91, 206, 91, 206, 206,
|
||
206, 92, 206, 92, 206, 92, 92, 92, 92, 206,
|
||
206, 206, 206, 92, 92, 92, 91, 184, 187, 209,
|
||
190, 209, 193, 209, 22, 43, 52, 79, 92, 206,
|
||
112, 206, 206, 206, 206, 206, 92, 92, 92, 92,
|
||
206, 206, 177, 209, 92, 58, 65, 92, 58, 65,
|
||
92, 58, 92, 185, 91, 203, 91, 91, 200, 206,
|
||
92, 206, 206, 206, 206, 92, 92, 92, 92, 159,
|
||
199, 91, 199, 91, 199, 203, 91, 115, 206, 116,
|
||
206, 91, 206, 92, 206, 206, 206, 91, 195, 91,
|
||
195, 91, 206, 206, 19, 92, 206, 20, 92, 206,
|
||
113, 92, 92, 206, 206, 207, 92, 207, 92, 207,
|
||
206, 206, 91, 203, 206, 91, 203, 206, 114, 206,
|
||
92, 206, 206, 92, 92, 92, 206, 206, 203, 91,
|
||
203, 91, 206, 10, 21, 67, 92, 206, 206, 206,
|
||
92, 92, 206, 206, 206, 206, 91, 91, 203, 91,
|
||
206, 206, 206, 206, 206, 206, 206, 203, 91, 206,
|
||
206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
|
||
92, 92, 206, 206, 206, 206, 206, 206, 206, 92,
|
||
92, 92, 92, 206, 92, 206, 92, 206, 92, 92,
|
||
206, 206
|
||
};
|
||
|
||
#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 yyerrorlab
|
||
|
||
|
||
/* 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 (1); \
|
||
goto yybackup; \
|
||
} \
|
||
else \
|
||
{ \
|
||
yyerror (YY_("syntax error: cannot back up")); \
|
||
YYERROR; \
|
||
} \
|
||
while (YYID (0))
|
||
|
||
|
||
#define YYTERROR 1
|
||
#define YYERRCODE 256
|
||
|
||
|
||
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
||
If N is 0, then set CURRENT to the empty location which ends
|
||
the previous symbol: RHS[0] (always defined). */
|
||
|
||
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
||
#ifndef YYLLOC_DEFAULT
|
||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||
do \
|
||
if (YYID (N)) \
|
||
{ \
|
||
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
||
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
||
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
||
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
||
} \
|
||
else \
|
||
{ \
|
||
(Current).first_line = (Current).last_line = \
|
||
YYRHSLOC (Rhs, 0).last_line; \
|
||
(Current).first_column = (Current).last_column = \
|
||
YYRHSLOC (Rhs, 0).last_column; \
|
||
} \
|
||
while (YYID (0))
|
||
#endif
|
||
|
||
|
||
/* YY_LOCATION_PRINT -- Print the location on the stream.
|
||
This macro was not mandated originally: define only if we know
|
||
we won't break user code: when these are the locations we know. */
|
||
|
||
#ifndef YY_LOCATION_PRINT
|
||
# if YYLTYPE_IS_TRIVIAL
|
||
# define YY_LOCATION_PRINT(File, Loc) \
|
||
fprintf (File, "%d.%d-%d.%d", \
|
||
(Loc).first_line, (Loc).first_column, \
|
||
(Loc).last_line, (Loc).last_column)
|
||
# else
|
||
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
|
||
# endif
|
||
#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 (YYID (0))
|
||
|
||
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
|
||
do { \
|
||
if (yydebug) \
|
||
{ \
|
||
YYFPRINTF (stderr, "%s ", Title); \
|
||
yy_symbol_print (stderr, \
|
||
Type, Value); \
|
||
YYFPRINTF (stderr, "\n"); \
|
||
} \
|
||
} while (YYID (0))
|
||
|
||
|
||
/*--------------------------------.
|
||
| Print this symbol on YYOUTPUT. |
|
||
`--------------------------------*/
|
||
|
||
/*ARGSUSED*/
|
||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
static void
|
||
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
|
||
#else
|
||
static void
|
||
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
|
||
FILE *yyoutput;
|
||
int yytype;
|
||
YYSTYPE const * const yyvaluep;
|
||
#endif
|
||
{
|
||
if (!yyvaluep)
|
||
return;
|
||
# ifdef YYPRINT
|
||
if (yytype < YYNTOKENS)
|
||
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
|
||
# else
|
||
YYUSE (yyoutput);
|
||
# endif
|
||
switch (yytype)
|
||
{
|
||
default:
|
||
break;
|
||
}
|
||
}
|
||
|
||
|
||
/*--------------------------------.
|
||
| Print this symbol on YYOUTPUT. |
|
||
`--------------------------------*/
|
||
|
||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
static void
|
||
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
|
||
#else
|
||
static void
|
||
yy_symbol_print (yyoutput, yytype, yyvaluep)
|
||
FILE *yyoutput;
|
||
int yytype;
|
||
YYSTYPE const * const yyvaluep;
|
||
#endif
|
||
{
|
||
if (yytype < YYNTOKENS)
|
||
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
|
||
else
|
||
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
|
||
|
||
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
|
||
YYFPRINTF (yyoutput, ")");
|
||
}
|
||
|
||
/*------------------------------------------------------------------.
|
||
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
|
||
| TOP (included). |
|
||
`------------------------------------------------------------------*/
|
||
|
||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
static void
|
||
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
|
||
#else
|
||
static void
|
||
yy_stack_print (bottom, top)
|
||
yytype_int16 *bottom;
|
||
yytype_int16 *top;
|
||
#endif
|
||
{
|
||
YYFPRINTF (stderr, "Stack now");
|
||
for (; 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 (YYID (0))
|
||
|
||
|
||
/*------------------------------------------------.
|
||
| Report that the YYRULE is going to be reduced. |
|
||
`------------------------------------------------*/
|
||
|
||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
static void
|
||
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
|
||
#else
|
||
static void
|
||
yy_reduce_print (yyvsp, yyrule)
|
||
YYSTYPE *yyvsp;
|
||
int yyrule;
|
||
#endif
|
||
{
|
||
int yynrhs = yyr2[yyrule];
|
||
int yyi;
|
||
unsigned long int yylno = yyrline[yyrule];
|
||
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
|
||
yyrule - 1, yylno);
|
||
/* The symbols being reduced. */
|
||
for (yyi = 0; yyi < yynrhs; yyi++)
|
||
{
|
||
fprintf (stderr, " $%d = ", yyi + 1);
|
||
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
|
||
&(yyvsp[(yyi + 1) - (yynrhs)])
|
||
);
|
||
fprintf (stderr, "\n");
|
||
}
|
||
}
|
||
|
||
# define YY_REDUCE_PRINT(Rule) \
|
||
do { \
|
||
if (yydebug) \
|
||
yy_reduce_print (yyvsp, Rule); \
|
||
} while (YYID (0))
|
||
|
||
/* Nonzero means print parse trace. It is left uninitialized so that
|
||
multiple parsers can coexist. */
|
||
int yydebug;
|
||
#else /* !YYDEBUG */
|
||
# define YYDPRINTF(Args)
|
||
# define YY_SYMBOL_PRINT(Title, Type, 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
|
||
YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
|
||
evaluated with infinite-precision integer arithmetic. */
|
||
|
||
#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. */
|
||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
static YYSIZE_T
|
||
yystrlen (const char *yystr)
|
||
#else
|
||
static YYSIZE_T
|
||
yystrlen (yystr)
|
||
const char *yystr;
|
||
#endif
|
||
{
|
||
YYSIZE_T yylen;
|
||
for (yylen = 0; yystr[yylen]; yylen++)
|
||
continue;
|
||
return yylen;
|
||
}
|
||
# 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. */
|
||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
static char *
|
||
yystpcpy (char *yydest, const char *yysrc)
|
||
#else
|
||
static char *
|
||
yystpcpy (yydest, yysrc)
|
||
char *yydest;
|
||
const char *yysrc;
|
||
#endif
|
||
{
|
||
char *yyd = yydest;
|
||
const char *yys = yysrc;
|
||
|
||
while ((*yyd++ = *yys++) != '\0')
|
||
continue;
|
||
|
||
return yyd - 1;
|
||
}
|
||
# endif
|
||
# endif
|
||
|
||
# ifndef yytnamerr
|
||
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
|
||
quotes and backslashes, so that it's suitable for yyerror. The
|
||
heuristic is that double-quoting is unnecessary unless the string
|
||
contains an apostrophe, a comma, or backslash (other than
|
||
backslash-backslash). YYSTR is taken from yytname. If YYRES is
|
||
null, do not copy; instead, return the length of what the result
|
||
would have been. */
|
||
static YYSIZE_T
|
||
yytnamerr (char *yyres, const char *yystr)
|
||
{
|
||
if (*yystr == '"')
|
||
{
|
||
YYSIZE_T yyn = 0;
|
||
char const *yyp = yystr;
|
||
|
||
for (;;)
|
||
switch (*++yyp)
|
||
{
|
||
case '\'':
|
||
case ',':
|
||
goto do_not_strip_quotes;
|
||
|
||
case '\\':
|
||
if (*++yyp != '\\')
|
||
goto do_not_strip_quotes;
|
||
/* Fall through. */
|
||
default:
|
||
if (yyres)
|
||
yyres[yyn] = *yyp;
|
||
yyn++;
|
||
break;
|
||
|
||
case '"':
|
||
if (yyres)
|
||
yyres[yyn] = '\0';
|
||
return yyn;
|
||
}
|
||
do_not_strip_quotes: ;
|
||
}
|
||
|
||
if (! yyres)
|
||
return yystrlen (yystr);
|
||
|
||
return yystpcpy (yyres, yystr) - yyres;
|
||
}
|
||
# endif
|
||
|
||
/* Copy into YYRESULT an error message about the unexpected token
|
||
YYCHAR while in state YYSTATE. Return the number of bytes copied,
|
||
including the terminating null byte. If YYRESULT is null, do not
|
||
copy anything; just return the number of bytes that would be
|
||
copied. As a special case, return 0 if an ordinary "syntax error"
|
||
message will do. Return YYSIZE_MAXIMUM if overflow occurs during
|
||
size calculation. */
|
||
static YYSIZE_T
|
||
yysyntax_error (char *yyresult, int yystate, int yychar)
|
||
{
|
||
int yyn = yypact[yystate];
|
||
|
||
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
|
||
return 0;
|
||
else
|
||
{
|
||
int yytype = YYTRANSLATE (yychar);
|
||
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
|
||
YYSIZE_T yysize = yysize0;
|
||
YYSIZE_T yysize1;
|
||
int yysize_overflow = 0;
|
||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||
int yyx;
|
||
|
||
# if 0
|
||
/* This is so xgettext sees the translatable formats that are
|
||
constructed on the fly. */
|
||
YY_("syntax error, unexpected %s");
|
||
YY_("syntax error, unexpected %s, expecting %s");
|
||
YY_("syntax error, unexpected %s, expecting %s or %s");
|
||
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
|
||
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
|
||
# endif
|
||
char *yyfmt;
|
||
char const *yyf;
|
||
static char const yyunexpected[] = "syntax error, unexpected %s";
|
||
static char const yyexpecting[] = ", expecting %s";
|
||
static char const yyor[] = " or %s";
|
||
char yyformat[sizeof yyunexpected
|
||
+ sizeof yyexpecting - 1
|
||
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
|
||
* (sizeof yyor - 1))];
|
||
char const *yyprefix = yyexpecting;
|
||
|
||
/* 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 + 1;
|
||
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
||
int yycount = 1;
|
||
|
||
yyarg[0] = yytname[yytype];
|
||
yyfmt = yystpcpy (yyformat, yyunexpected);
|
||
|
||
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
||
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
|
||
{
|
||
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
||
{
|
||
yycount = 1;
|
||
yysize = yysize0;
|
||
yyformat[sizeof yyunexpected - 1] = '\0';
|
||
break;
|
||
}
|
||
yyarg[yycount++] = yytname[yyx];
|
||
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
|
||
yysize_overflow |= (yysize1 < yysize);
|
||
yysize = yysize1;
|
||
yyfmt = yystpcpy (yyfmt, yyprefix);
|
||
yyprefix = yyor;
|
||
}
|
||
|
||
yyf = YY_(yyformat);
|
||
yysize1 = yysize + yystrlen (yyf);
|
||
yysize_overflow |= (yysize1 < yysize);
|
||
yysize = yysize1;
|
||
|
||
if (yysize_overflow)
|
||
return YYSIZE_MAXIMUM;
|
||
|
||
if (yyresult)
|
||
{
|
||
/* Avoid sprintf, as that infringes on the user's name space.
|
||
Don't have undefined behavior even if the translation
|
||
produced a string with the wrong number of "%s"s. */
|
||
char *yyp = yyresult;
|
||
int yyi = 0;
|
||
while ((*yyp = *yyf) != '\0')
|
||
{
|
||
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
|
||
{
|
||
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
||
yyf += 2;
|
||
}
|
||
else
|
||
{
|
||
yyp++;
|
||
yyf++;
|
||
}
|
||
}
|
||
}
|
||
return yysize;
|
||
}
|
||
}
|
||
#endif /* YYERROR_VERBOSE */
|
||
|
||
|
||
/*-----------------------------------------------.
|
||
| Release the memory associated to this symbol. |
|
||
`-----------------------------------------------*/
|
||
|
||
/*ARGSUSED*/
|
||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
static void
|
||
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
|
||
#else
|
||
static void
|
||
yydestruct (yymsg, yytype, yyvaluep)
|
||
const char *yymsg;
|
||
int yytype;
|
||
YYSTYPE *yyvaluep;
|
||
#endif
|
||
{
|
||
YYUSE (yyvaluep);
|
||
|
||
if (!yymsg)
|
||
yymsg = "Deleting";
|
||
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
|
||
|
||
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 look-ahead symbol. */
|
||
int yychar;
|
||
|
||
/* The semantic value of the look-ahead symbol. */
|
||
YYSTYPE yylval;
|
||
|
||
/* Number of syntax errors so far. */
|
||
int yynerrs;
|
||
|
||
|
||
|
||
/*----------.
|
||
| yyparse. |
|
||
`----------*/
|
||
|
||
#ifdef YYPARSE_PARAM
|
||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
int
|
||
yyparse (void *YYPARSE_PARAM)
|
||
#else
|
||
int
|
||
yyparse (YYPARSE_PARAM)
|
||
void *YYPARSE_PARAM;
|
||
#endif
|
||
#else /* ! YYPARSE_PARAM */
|
||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||
|| defined __cplusplus || defined _MSC_VER)
|
||
int
|
||
yyparse (void)
|
||
#else
|
||
int
|
||
yyparse ()
|
||
|
||
#endif
|
||
#endif
|
||
{
|
||
|
||
int yystate;
|
||
int yyn;
|
||
int yyresult;
|
||
/* Number of tokens to shift before error messages enabled. */
|
||
int yyerrstatus;
|
||
/* Look-ahead token as an internal (translated) token number. */
|
||
int yytoken = 0;
|
||
#if YYERROR_VERBOSE
|
||
/* Buffer for error messages, and its allocated size. */
|
||
char yymsgbuf[128];
|
||
char *yymsg = yymsgbuf;
|
||
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
|
||
#endif
|
||
|
||
/* 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. */
|
||
yytype_int16 yyssa[YYINITDEPTH];
|
||
yytype_int16 *yyss = yyssa;
|
||
yytype_int16 *yyssp;
|
||
|
||
/* The semantic value stack. */
|
||
YYSTYPE yyvsa[YYINITDEPTH];
|
||
YYSTYPE *yyvs = yyvsa;
|
||
YYSTYPE *yyvsp;
|
||
|
||
|
||
|
||
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
|
||
|
||
YYSIZE_T yystacksize = YYINITDEPTH;
|
||
|
||
/* The variables used to return semantic value and location from the
|
||
action routines. */
|
||
YYSTYPE yyval;
|
||
|
||
|
||
/* The number of symbols on the RHS of the reduced rule.
|
||
Keep to zero when no symbol should be popped. */
|
||
int yylen = 0;
|
||
|
||
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;
|
||
yytype_int16 *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 (YY_("memory exhausted"),
|
||
&yyss1, yysize * sizeof (*yyssp),
|
||
&yyvs1, yysize * sizeof (*yyvsp),
|
||
|
||
&yystacksize);
|
||
|
||
yyss = yyss1;
|
||
yyvs = yyvs1;
|
||
}
|
||
#else /* no yyoverflow */
|
||
# ifndef YYSTACK_RELOCATE
|
||
goto yyexhaustedlab;
|
||
# else
|
||
/* Extend the stack our own way. */
|
||
if (YYMAXDEPTH <= yystacksize)
|
||
goto yyexhaustedlab;
|
||
yystacksize *= 2;
|
||
if (YYMAXDEPTH < yystacksize)
|
||
yystacksize = YYMAXDEPTH;
|
||
|
||
{
|
||
yytype_int16 *yyss1 = yyss;
|
||
union yyalloc *yyptr =
|
||
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
|
||
if (! yyptr)
|
||
goto yyexhaustedlab;
|
||
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
|
||
look-ahead token if we need one and don't already have one. */
|
||
|
||
/* First try to decide what to do without reference to look-ahead token. */
|
||
yyn = yypact[yystate];
|
||
if (yyn == YYPACT_NINF)
|
||
goto yydefault;
|
||
|
||
/* Not known => get a look-ahead token if don't already have one. */
|
||
|
||
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead 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);
|
||
YY_SYMBOL_PRINT ("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;
|
||
|
||
/* Count tokens shifted since error; after three, turn off error
|
||
status. */
|
||
if (yyerrstatus)
|
||
yyerrstatus--;
|
||
|
||
/* Shift the look-ahead token. */
|
||
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
|
||
|
||
/* Discard the shifted token unless it is eof. */
|
||
if (yychar != YYEOF)
|
||
yychar = YYEMPTY;
|
||
|
||
yystate = yyn;
|
||
*++yyvsp = yylval;
|
||
|
||
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 7:
|
||
#line 232 "parser.yxx"
|
||
{
|
||
assert(!egg_stack.empty());
|
||
DCAST(EggData, egg_stack.back())->add_child(DCAST(EggNode, (yyvsp[(2) - (2)]._egg)));
|
||
}
|
||
break;
|
||
|
||
case 25:
|
||
#line 275 "parser.yxx"
|
||
{
|
||
string strval = (yyvsp[(3) - (4)]._string);
|
||
EggCoordinateSystem *cs = new EggCoordinateSystem;
|
||
|
||
CoordinateSystem f = parse_coordinate_system_string(strval);
|
||
if (f == CS_invalid) {
|
||
eggyywarning("Unknown coordinate system " + strval);
|
||
} else {
|
||
cs->set_value(f);
|
||
}
|
||
(yyval._egg) = cs;
|
||
}
|
||
break;
|
||
|
||
case 26:
|
||
#line 298 "parser.yxx"
|
||
{
|
||
(yyval._egg) = new EggComment((yyvsp[(2) - (5)]._string), (yyvsp[(4) - (5)]._string));
|
||
}
|
||
break;
|
||
|
||
case 27:
|
||
#line 312 "parser.yxx"
|
||
{
|
||
string tref_name = (yyvsp[(2) - (4)]._string);
|
||
Filename filename = (yyvsp[(4) - (4)]._string);
|
||
EggTexture *texture = new EggTexture(tref_name, filename);
|
||
|
||
if (textures.find(tref_name) != textures.end()) {
|
||
eggyywarning("Duplicate texture name " + tref_name);
|
||
}
|
||
textures[tref_name] = texture;
|
||
|
||
egg_stack.push_back(texture);
|
||
}
|
||
break;
|
||
|
||
case 28:
|
||
#line 325 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 30:
|
||
#line 341 "parser.yxx"
|
||
{
|
||
EggTexture *texture = DCAST(EggTexture, egg_stack.back());
|
||
string name = (yyvsp[(3) - (6)]._string);
|
||
double value = (yyvsp[(5) - (6)]._number);
|
||
string strval = (yyvsp[(5) - (6)]._string);
|
||
|
||
if (cmp_nocase_uh(name, "type") == 0) {
|
||
EggTexture::TextureType tt = EggTexture::string_texture_type(strval);
|
||
if (tt == EggTexture::TT_unspecified) {
|
||
eggyywarning("Unknown texture texture_type " + strval);
|
||
} else {
|
||
texture->set_texture_type(tt);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "format") == 0) {
|
||
EggTexture::Format f = EggTexture::string_format(strval);
|
||
if (f == EggTexture::F_unspecified) {
|
||
eggyywarning("Unknown texture format " + strval);
|
||
} else {
|
||
texture->set_format(f);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "compression") == 0) {
|
||
EggTexture::CompressionMode w = EggTexture::string_compression_mode(strval);
|
||
if (w == EggTexture::CM_default) {
|
||
eggyywarning("Unknown texture compression mode " + strval);
|
||
} else {
|
||
texture->set_compression_mode(w);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "wrap") == 0) {
|
||
EggTexture::WrapMode w = EggTexture::string_wrap_mode(strval);
|
||
if (w == EggTexture::WM_unspecified) {
|
||
eggyywarning("Unknown texture wrap mode " + strval);
|
||
} else {
|
||
texture->set_wrap_mode(w);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "wrapu") == 0) {
|
||
EggTexture::WrapMode w = EggTexture::string_wrap_mode(strval);
|
||
if (w == EggTexture::WM_unspecified) {
|
||
eggyywarning("Unknown texture wrap mode " + strval);
|
||
} else {
|
||
texture->set_wrap_u(w);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "wrapv") == 0) {
|
||
EggTexture::WrapMode w = EggTexture::string_wrap_mode(strval);
|
||
if (w == EggTexture::WM_unspecified) {
|
||
eggyywarning("Unknown texture wrap mode " + strval);
|
||
} else {
|
||
texture->set_wrap_v(w);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "minfilter") == 0) {
|
||
EggTexture::FilterType f = EggTexture::string_filter_type(strval);
|
||
if (f == EggTexture::FT_unspecified) {
|
||
eggyywarning("Unknown texture filter type " + strval);
|
||
} else {
|
||
texture->set_minfilter(f);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "magfilter") == 0) {
|
||
EggTexture::FilterType f = EggTexture::string_filter_type(strval);
|
||
if (f == EggTexture::FT_unspecified) {
|
||
eggyywarning("Unknown texture filter type " + strval);
|
||
} else {
|
||
texture->set_magfilter(f);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "anisotropic_degree") == 0) {
|
||
texture->set_anisotropic_degree((int)value);
|
||
|
||
} else if (cmp_nocase_uh(name, "envtype") == 0) {
|
||
EggTexture::EnvType e = EggTexture::string_env_type(strval);
|
||
if (e == EggTexture::ET_unspecified) {
|
||
eggyywarning("Unknown texture env type " + strval);
|
||
} else {
|
||
texture->set_env_type(e);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-rgb") == 0) {
|
||
EggTexture::CombineMode cm = EggTexture::string_combine_mode(strval);
|
||
if (cm == EggTexture::CM_unspecified) {
|
||
eggyywarning("Unknown combine mode " + strval);
|
||
} else {
|
||
texture->set_combine_mode(EggTexture::CC_rgb, cm);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-rgb-source0") == 0) {
|
||
EggTexture::CombineSource cs = EggTexture::string_combine_source(strval);
|
||
if (cs == EggTexture::CS_unspecified) {
|
||
eggyywarning("Unknown combine source " + strval);
|
||
} else {
|
||
texture->set_combine_source(EggTexture::CC_rgb, 0, cs);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-rgb-operand0") == 0) {
|
||
EggTexture::CombineOperand co = EggTexture::string_combine_operand(strval);
|
||
if (co == EggTexture::CO_unspecified) {
|
||
eggyywarning("Unknown combine operand " + strval);
|
||
} else {
|
||
texture->set_combine_operand(EggTexture::CC_rgb, 0, co);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-rgb-source1") == 0) {
|
||
EggTexture::CombineSource cs = EggTexture::string_combine_source(strval);
|
||
if (cs == EggTexture::CS_unspecified) {
|
||
eggyywarning("Unknown combine source " + strval);
|
||
} else {
|
||
texture->set_combine_source(EggTexture::CC_rgb, 1, cs);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-rgb-operand1") == 0) {
|
||
EggTexture::CombineOperand co = EggTexture::string_combine_operand(strval);
|
||
if (co == EggTexture::CO_unspecified) {
|
||
eggyywarning("Unknown combine operand " + strval);
|
||
} else {
|
||
texture->set_combine_operand(EggTexture::CC_rgb, 1, co);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-rgb-source2") == 0) {
|
||
EggTexture::CombineSource cs = EggTexture::string_combine_source(strval);
|
||
if (cs == EggTexture::CS_unspecified) {
|
||
eggyywarning("Unknown combine source " + strval);
|
||
} else {
|
||
texture->set_combine_source(EggTexture::CC_rgb, 2, cs);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-rgb-operand2") == 0) {
|
||
EggTexture::CombineOperand co = EggTexture::string_combine_operand(strval);
|
||
if (co == EggTexture::CO_unspecified) {
|
||
eggyywarning("Unknown combine operand " + strval);
|
||
} else {
|
||
texture->set_combine_operand(EggTexture::CC_rgb, 2, co);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-alpha") == 0) {
|
||
EggTexture::CombineMode cm = EggTexture::string_combine_mode(strval);
|
||
if (cm == EggTexture::CM_unspecified) {
|
||
eggyywarning("Unknown combine mode " + strval);
|
||
} else {
|
||
texture->set_combine_mode(EggTexture::CC_alpha, cm);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-alpha-source0") == 0) {
|
||
EggTexture::CombineSource cs = EggTexture::string_combine_source(strval);
|
||
if (cs == EggTexture::CS_unspecified) {
|
||
eggyywarning("Unknown combine source " + strval);
|
||
} else {
|
||
texture->set_combine_source(EggTexture::CC_alpha, 0, cs);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-alpha-operand0") == 0) {
|
||
EggTexture::CombineOperand co = EggTexture::string_combine_operand(strval);
|
||
if (co == EggTexture::CO_unspecified) {
|
||
eggyywarning("Unknown combine operand " + strval);
|
||
} else {
|
||
texture->set_combine_operand(EggTexture::CC_alpha, 0, co);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-alpha-source1") == 0) {
|
||
EggTexture::CombineSource cs = EggTexture::string_combine_source(strval);
|
||
if (cs == EggTexture::CS_unspecified) {
|
||
eggyywarning("Unknown combine source " + strval);
|
||
} else {
|
||
texture->set_combine_source(EggTexture::CC_alpha, 1, cs);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-alpha-operand1") == 0) {
|
||
EggTexture::CombineOperand co = EggTexture::string_combine_operand(strval);
|
||
if (co == EggTexture::CO_unspecified) {
|
||
eggyywarning("Unknown combine operand " + strval);
|
||
} else {
|
||
texture->set_combine_operand(EggTexture::CC_alpha, 1, co);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-alpha-source2") == 0) {
|
||
EggTexture::CombineSource cs = EggTexture::string_combine_source(strval);
|
||
if (cs == EggTexture::CS_unspecified) {
|
||
eggyywarning("Unknown combine source " + strval);
|
||
} else {
|
||
texture->set_combine_source(EggTexture::CC_alpha, 2, cs);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "combine-alpha-operand2") == 0) {
|
||
EggTexture::CombineOperand co = EggTexture::string_combine_operand(strval);
|
||
if (co == EggTexture::CO_unspecified) {
|
||
eggyywarning("Unknown combine operand " + strval);
|
||
} else {
|
||
texture->set_combine_operand(EggTexture::CC_alpha, 2, co);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "saved_result") == 0) {
|
||
texture->set_saved_result(((int)value) != 0);
|
||
|
||
} else if (cmp_nocase_uh(name, "tex_gen") == 0) {
|
||
EggTexture::TexGen tex_gen = EggTexture::string_tex_gen(strval);
|
||
if (tex_gen == EggTexture::TG_unspecified) {
|
||
eggyywarning("Unknown texture env type " + strval);
|
||
} else {
|
||
texture->set_tex_gen(tex_gen);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "stage_name") == 0) {
|
||
texture->set_stage_name(strval);
|
||
|
||
} else if (cmp_nocase_uh(name, "priority") == 0) {
|
||
texture->set_priority((int)value);
|
||
|
||
} else if (cmp_nocase_uh(name, "blendr") == 0) {
|
||
Colorf color = texture->get_color();
|
||
color[0] = value;
|
||
texture->set_color(color);
|
||
|
||
} else if (cmp_nocase_uh(name, "blendg") == 0) {
|
||
Colorf color = texture->get_color();
|
||
color[1] = value;
|
||
texture->set_color(color);
|
||
|
||
} else if (cmp_nocase_uh(name, "blendb") == 0) {
|
||
Colorf color = texture->get_color();
|
||
color[2] = value;
|
||
texture->set_color(color);
|
||
|
||
} else if (cmp_nocase_uh(name, "blenda") == 0) {
|
||
Colorf color = texture->get_color();
|
||
color[3] = value;
|
||
texture->set_color(color);
|
||
|
||
} else if (cmp_nocase_uh(name, "borderr") == 0) {
|
||
Colorf border_color = texture->get_border_color();
|
||
border_color[0] = value;
|
||
texture->set_border_color(border_color);
|
||
|
||
} else if (cmp_nocase_uh(name, "borderg") == 0) {
|
||
Colorf border_color = texture->get_border_color();
|
||
border_color[1] = value;
|
||
texture->set_border_color(border_color);
|
||
|
||
} else if (cmp_nocase_uh(name, "borderb") == 0) {
|
||
Colorf border_color = texture->get_border_color();
|
||
border_color[2] = value;
|
||
texture->set_border_color(border_color);
|
||
|
||
} else if (cmp_nocase_uh(name, "bordera") == 0) {
|
||
Colorf border_color = texture->get_border_color();
|
||
border_color[3] = value;
|
||
texture->set_border_color(border_color);
|
||
|
||
} else if (cmp_nocase_uh(name, "uv_name") == 0) {
|
||
texture->set_uv_name(strval);
|
||
|
||
} else if (cmp_nocase_uh(name, "rgb_scale") == 0) {
|
||
int int_value = (int)value;
|
||
if (int_value != 1 && int_value != 2 && int_value != 4) {
|
||
eggyyerror("Invalid rgb-scale value " + strval);
|
||
} else {
|
||
texture->set_rgb_scale(int_value);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "alpha_scale") == 0) {
|
||
int int_value = (int)value;
|
||
if (int_value != 1 && int_value != 2 && int_value != 4) {
|
||
eggyyerror("Invalid alpha-scale value " + strval);
|
||
} else {
|
||
texture->set_alpha_scale(int_value);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "alpha") == 0) {
|
||
EggRenderMode::AlphaMode a = EggRenderMode::string_alpha_mode(strval);
|
||
if (a == EggRenderMode::AM_unspecified) {
|
||
eggyywarning("Unknown alpha mode " + strval);
|
||
} else {
|
||
texture->set_alpha_mode(a);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "depth_write") == 0) {
|
||
EggRenderMode::DepthWriteMode m =
|
||
EggRenderMode::string_depth_write_mode(strval);
|
||
if (m == EggRenderMode::DWM_unspecified) {
|
||
eggyywarning("Unknown depth-write mode " + strval);
|
||
} else {
|
||
texture->set_depth_write_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "depth_test") == 0) {
|
||
EggRenderMode::DepthTestMode m =
|
||
EggRenderMode::string_depth_test_mode(strval);
|
||
if (m == EggRenderMode::DTM_unspecified) {
|
||
eggyywarning("Unknown depth-test mode " + strval);
|
||
} else {
|
||
texture->set_depth_test_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "visibility") == 0) {
|
||
EggRenderMode::VisibilityMode m =
|
||
EggRenderMode::string_visibility_mode(strval);
|
||
if (m == EggRenderMode::VM_unspecified) {
|
||
eggyywarning("Unknown visibility mode " + strval);
|
||
} else {
|
||
texture->set_visibility_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "draw_order") == 0) {
|
||
texture->set_draw_order((int)value);
|
||
|
||
} else if (cmp_nocase_uh(name, "bin") == 0) {
|
||
texture->set_bin(strval);
|
||
|
||
} else if (cmp_nocase_uh(name, "alpha_file") == 0) {
|
||
texture->set_alpha_filename(strval);
|
||
|
||
} else if (cmp_nocase_uh(name, "alpha_file_channel") == 0) {
|
||
texture->set_alpha_file_channel((int)value);
|
||
|
||
} else if (cmp_nocase_uh(name, "read_mipmaps") == 0) {
|
||
texture->set_read_mipmaps(((int)value) != 0);
|
||
|
||
} else {
|
||
eggyywarning("Unsupported texture scalar: " + name);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 32:
|
||
#line 676 "parser.yxx"
|
||
{
|
||
string mref_name = (yyvsp[(2) - (3)]._string);
|
||
EggMaterial *material = new EggMaterial(mref_name);
|
||
|
||
if (materials.find(mref_name) != materials.end()) {
|
||
eggyywarning("Duplicate material name " + mref_name);
|
||
}
|
||
materials[mref_name] = material;
|
||
|
||
egg_stack.push_back(material);
|
||
}
|
||
break;
|
||
|
||
case 33:
|
||
#line 688 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 35:
|
||
#line 704 "parser.yxx"
|
||
{
|
||
EggMaterial *material = DCAST(EggMaterial, egg_stack.back());
|
||
string name = (yyvsp[(3) - (6)]._string);
|
||
double value = (yyvsp[(5) - (6)]._number);
|
||
|
||
if (cmp_nocase_uh(name, "diffr") == 0) {
|
||
Colorf diff = material->get_diff();
|
||
diff[0] = value;
|
||
material->set_diff(diff);
|
||
} else if (cmp_nocase_uh(name, "diffg") == 0) {
|
||
Colorf diff = material->get_diff();
|
||
diff[1] = value;
|
||
material->set_diff(diff);
|
||
} else if (cmp_nocase_uh(name, "diffb") == 0) {
|
||
Colorf diff = material->get_diff();
|
||
diff[2] = value;
|
||
material->set_diff(diff);
|
||
} else if (cmp_nocase_uh(name, "diffa") == 0) {
|
||
Colorf diff = material->get_diff();
|
||
diff[3] = value;
|
||
material->set_diff(diff);
|
||
|
||
} else if (cmp_nocase_uh(name, "ambr") == 0) {
|
||
Colorf amb = material->get_amb();
|
||
amb[0] = value;
|
||
material->set_amb(amb);
|
||
} else if (cmp_nocase_uh(name, "ambg") == 0) {
|
||
Colorf amb = material->get_amb();
|
||
amb[1] = value;
|
||
material->set_amb(amb);
|
||
} else if (cmp_nocase_uh(name, "ambb") == 0) {
|
||
Colorf amb = material->get_amb();
|
||
amb[2] = value;
|
||
material->set_amb(amb);
|
||
} else if (cmp_nocase_uh(name, "amba") == 0) {
|
||
Colorf amb = material->get_amb();
|
||
amb[3] = value;
|
||
material->set_amb(amb);
|
||
|
||
} else if (cmp_nocase_uh(name, "emitr") == 0) {
|
||
Colorf emit = material->get_emit();
|
||
emit[0] = value;
|
||
material->set_emit(emit);
|
||
} else if (cmp_nocase_uh(name, "emitg") == 0) {
|
||
Colorf emit = material->get_emit();
|
||
emit[1] = value;
|
||
material->set_emit(emit);
|
||
} else if (cmp_nocase_uh(name, "emitb") == 0) {
|
||
Colorf emit = material->get_emit();
|
||
emit[2] = value;
|
||
material->set_emit(emit);
|
||
} else if (cmp_nocase_uh(name, "emita") == 0) {
|
||
Colorf emit = material->get_emit();
|
||
emit[3] = value;
|
||
material->set_emit(emit);
|
||
|
||
} else if (cmp_nocase_uh(name, "specr") == 0) {
|
||
Colorf spec = material->get_spec();
|
||
spec[0] = value;
|
||
material->set_spec(spec);
|
||
} else if (cmp_nocase_uh(name, "specg") == 0) {
|
||
Colorf spec = material->get_spec();
|
||
spec[1] = value;
|
||
material->set_spec(spec);
|
||
} else if (cmp_nocase_uh(name, "specb") == 0) {
|
||
Colorf spec = material->get_spec();
|
||
spec[2] = value;
|
||
material->set_spec(spec);
|
||
} else if (cmp_nocase_uh(name, "speca") == 0) {
|
||
Colorf spec = material->get_spec();
|
||
spec[3] = value;
|
||
material->set_spec(spec);
|
||
|
||
} else if (cmp_nocase_uh(name, "shininess") == 0) {
|
||
material->set_shininess(value);
|
||
|
||
} else if (cmp_nocase_uh(name, "local") == 0) {
|
||
material->set_local(value != 0.0);
|
||
|
||
} else {
|
||
eggyywarning("Unsupported material scalar: " + name);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 36:
|
||
#line 799 "parser.yxx"
|
||
{
|
||
string node_name = (yyvsp[(2) - (5)]._string);
|
||
Filename filename = (yyvsp[(4) - (5)]._string);
|
||
EggExternalReference *ref = new EggExternalReference(node_name, filename);
|
||
(yyval._egg) = ref;
|
||
}
|
||
break;
|
||
|
||
case 37:
|
||
#line 806 "parser.yxx"
|
||
{
|
||
if (cmp_nocase_uh((yyvsp[(1) - (6)]._string), "group") != 0) {
|
||
eggyyerror("keyword 'group' expected");
|
||
}
|
||
string node_name = (yyvsp[(3) - (6)]._string);
|
||
Filename filename = (yyvsp[(5) - (6)]._string);
|
||
EggExternalReference *ref = new EggExternalReference(node_name, filename);
|
||
(yyval._egg) = ref;
|
||
}
|
||
break;
|
||
|
||
case 38:
|
||
#line 826 "parser.yxx"
|
||
{
|
||
string name = (yyvsp[(2) - (2)]._string);
|
||
EggVertexPool *pool = NULL;
|
||
|
||
VertexPools::const_iterator vpi = vertex_pools.find(name);
|
||
if (vpi != vertex_pools.end()) {
|
||
pool = (*vpi).second;
|
||
if (pool->has_defined_vertices()) {
|
||
eggyywarning("Duplicate vertex pool name " + name);
|
||
pool = new EggVertexPool(name);
|
||
// The egg syntax starts counting at 1 by convention.
|
||
pool->set_highest_index(0);
|
||
vertex_pools[name] = pool;
|
||
}
|
||
} else {
|
||
pool = new EggVertexPool(name);
|
||
// The egg syntax starts counting at 1 by convention.
|
||
pool->set_highest_index(0);
|
||
vertex_pools[name] = pool;
|
||
}
|
||
|
||
egg_stack.push_back(pool);
|
||
}
|
||
break;
|
||
|
||
case 39:
|
||
#line 850 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 42:
|
||
#line 878 "parser.yxx"
|
||
{
|
||
egg_stack.push_back(new EggVertex);
|
||
}
|
||
break;
|
||
|
||
case 43:
|
||
#line 882 "parser.yxx"
|
||
{
|
||
PT(EggVertex) vtx = DCAST(EggVertex, egg_stack.back());
|
||
egg_stack.pop_back();
|
||
|
||
DCAST(EggVertexPool, egg_stack.back())->add_vertex(vtx);
|
||
}
|
||
break;
|
||
|
||
case 44:
|
||
#line 889 "parser.yxx"
|
||
{
|
||
vertex_index = (int)(yyvsp[(2) - (2)]._number);
|
||
EggVertexPool *pool = DCAST(EggVertexPool, egg_stack.back());
|
||
|
||
if (vertex_index < 0) {
|
||
ostringstream errmsg;
|
||
errmsg << "Ignoring invalid vertex index " << vertex_index
|
||
<< " in vertex pool " << pool->get_name() << ends;
|
||
eggyywarning(errmsg);
|
||
vertex_index = -1;
|
||
|
||
} else if (pool->has_vertex(vertex_index)) {
|
||
ostringstream errmsg;
|
||
errmsg << "Ignoring duplicate vertex index " << vertex_index
|
||
<< " in vertex pool " << pool->get_name() << ends;
|
||
eggyywarning(errmsg);
|
||
vertex_index = -1;
|
||
}
|
||
|
||
// Even if we didn't like the vertex index number, we still need to
|
||
// go ahead and parse the vertex. We just won't save it.
|
||
|
||
egg_stack.push_back(new EggVertex);
|
||
}
|
||
break;
|
||
|
||
case 45:
|
||
#line 914 "parser.yxx"
|
||
{
|
||
PT(EggVertex) vtx = DCAST(EggVertex, egg_stack.back());
|
||
egg_stack.pop_back();
|
||
|
||
EggVertexPool *pool = DCAST(EggVertexPool, egg_stack.back());
|
||
if (vertex_index != -1) {
|
||
pool->add_vertex(vtx, vertex_index);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 46:
|
||
#line 935 "parser.yxx"
|
||
{
|
||
DCAST(EggVertex, egg_stack.back())->set_pos((yyvsp[(1) - (1)]._number));
|
||
}
|
||
break;
|
||
|
||
case 47:
|
||
#line 939 "parser.yxx"
|
||
{
|
||
DCAST(EggVertex, egg_stack.back())->set_pos(LPoint2d((yyvsp[(1) - (2)]._number), (yyvsp[(2) - (2)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 48:
|
||
#line 943 "parser.yxx"
|
||
{
|
||
DCAST(EggVertex, egg_stack.back())->set_pos(LPoint3d((yyvsp[(1) - (3)]._number), (yyvsp[(2) - (3)]._number), (yyvsp[(3) - (3)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 49:
|
||
#line 947 "parser.yxx"
|
||
{
|
||
DCAST(EggVertex, egg_stack.back())->set_pos(LPoint4d((yyvsp[(1) - (4)]._number), (yyvsp[(2) - (4)]._number), (yyvsp[(3) - (4)]._number), (yyvsp[(4) - (4)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 50:
|
||
#line 951 "parser.yxx"
|
||
{
|
||
EggVertex *vertex = DCAST(EggVertex, egg_stack.back());
|
||
EggVertexUV *uv = new EggVertexUV((yyvsp[(3) - (4)]._string), TexCoordd::zero());
|
||
egg_stack.push_back(uv);
|
||
if (vertex->has_uv((yyvsp[(3) - (4)]._string))) {
|
||
eggyywarning("Ignoring repeated UV name " + (yyvsp[(3) - (4)]._string));
|
||
} else {
|
||
vertex->set_uv_obj(uv);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 51:
|
||
#line 962 "parser.yxx"
|
||
{
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 54:
|
||
#line 968 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggVertex, egg_stack.back())->_dxyzs.
|
||
insert(EggMorphVertex((yyvsp[(3) - (8)]._string), LVector3d((yyvsp[(5) - (8)]._number), (yyvsp[(6) - (8)]._number), (yyvsp[(7) - (8)]._number)))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(3) - (8)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 55:
|
||
#line 976 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggVertex, egg_stack.back())->_dxyzs.
|
||
insert(EggMorphVertex((yyvsp[(4) - (8)]._string), LVector3d((yyvsp[(5) - (8)]._number), (yyvsp[(6) - (8)]._number), (yyvsp[(7) - (8)]._number)))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(4) - (8)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 56:
|
||
#line 995 "parser.yxx"
|
||
{
|
||
DCAST(EggVertexUV, egg_stack.back())->set_uv(TexCoordd((yyvsp[(1) - (2)]._number), (yyvsp[(2) - (2)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 57:
|
||
#line 999 "parser.yxx"
|
||
{
|
||
DCAST(EggVertexUV, egg_stack.back())->set_uvw(LVecBase3d((yyvsp[(1) - (3)]._number), (yyvsp[(2) - (3)]._number), (yyvsp[(3) - (3)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 58:
|
||
#line 1003 "parser.yxx"
|
||
{
|
||
if (DCAST(EggVertexUV, egg_stack.back())->has_tangent()) {
|
||
eggyywarning("Ignoring repeated tangent");
|
||
} else {
|
||
DCAST(EggVertexUV, egg_stack.back())->set_tangent(Normald((yyvsp[(4) - (7)]._number), (yyvsp[(5) - (7)]._number), (yyvsp[(6) - (7)]._number)));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 59:
|
||
#line 1011 "parser.yxx"
|
||
{
|
||
if (DCAST(EggVertexUV, egg_stack.back())->has_binormal()) {
|
||
eggyywarning("Ignoring repeated binormal");
|
||
} else {
|
||
DCAST(EggVertexUV, egg_stack.back())->set_binormal(Normald((yyvsp[(4) - (7)]._number), (yyvsp[(5) - (7)]._number), (yyvsp[(6) - (7)]._number)));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 60:
|
||
#line 1019 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggVertexUV, egg_stack.back())->_duvs.
|
||
insert(EggMorphTexCoord((yyvsp[(3) - (7)]._string), LVector3d((yyvsp[(5) - (7)]._number), (yyvsp[(6) - (7)]._number), 0.0))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(3) - (7)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 61:
|
||
#line 1027 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggVertexUV, egg_stack.back())->_duvs.
|
||
insert(EggMorphTexCoord((yyvsp[(3) - (8)]._string), LVector3d((yyvsp[(5) - (8)]._number), (yyvsp[(6) - (8)]._number), (yyvsp[(7) - (8)]._number)))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(3) - (8)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 62:
|
||
#line 1035 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggVertexUV, egg_stack.back())->_duvs.
|
||
insert(EggMorphTexCoord((yyvsp[(4) - (7)]._string), LVector3d((yyvsp[(5) - (7)]._number), (yyvsp[(6) - (7)]._number), 0.0))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(4) - (7)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 63:
|
||
#line 1043 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggVertexUV, egg_stack.back())->_duvs.
|
||
insert(EggMorphTexCoord((yyvsp[(4) - (8)]._string), LVector3d((yyvsp[(5) - (8)]._number), (yyvsp[(6) - (8)]._number), (yyvsp[(7) - (8)]._number)))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(4) - (8)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 64:
|
||
#line 1061 "parser.yxx"
|
||
{
|
||
DCAST(EggVertex, egg_stack.back())->set_normal(Normald((yyvsp[(1) - (3)]._number), (yyvsp[(2) - (3)]._number), (yyvsp[(3) - (3)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 65:
|
||
#line 1065 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggVertex, egg_stack.back())->_dnormals.
|
||
insert(EggMorphNormal((yyvsp[(3) - (8)]._string), LVector3d((yyvsp[(5) - (8)]._number), (yyvsp[(6) - (8)]._number), (yyvsp[(7) - (8)]._number)))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(3) - (8)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 66:
|
||
#line 1073 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggVertex, egg_stack.back())->_dnormals.
|
||
insert(EggMorphNormal((yyvsp[(4) - (8)]._string), LVector3d((yyvsp[(5) - (8)]._number), (yyvsp[(6) - (8)]._number), (yyvsp[(7) - (8)]._number)))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(4) - (8)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 67:
|
||
#line 1091 "parser.yxx"
|
||
{
|
||
DCAST(EggVertex, egg_stack.back())->set_color(Colorf((yyvsp[(1) - (4)]._number), (yyvsp[(2) - (4)]._number), (yyvsp[(3) - (4)]._number), (yyvsp[(4) - (4)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 68:
|
||
#line 1095 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggVertex, egg_stack.back())->_drgbas.
|
||
insert(EggMorphColor((yyvsp[(3) - (9)]._string), LVector4f((yyvsp[(5) - (9)]._number), (yyvsp[(6) - (9)]._number), (yyvsp[(7) - (9)]._number), (yyvsp[(8) - (9)]._number)))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(3) - (9)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 69:
|
||
#line 1103 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggVertex, egg_stack.back())->_drgbas.
|
||
insert(EggMorphColor((yyvsp[(4) - (9)]._string), LVector4f((yyvsp[(5) - (9)]._number), (yyvsp[(6) - (9)]._number), (yyvsp[(7) - (9)]._number), (yyvsp[(8) - (9)]._number)))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(4) - (9)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 70:
|
||
#line 1121 "parser.yxx"
|
||
{
|
||
EggGroup *group = new EggGroup((yyvsp[(2) - (2)]._string));
|
||
egg_stack.push_back(group);
|
||
}
|
||
break;
|
||
|
||
case 71:
|
||
#line 1126 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 72:
|
||
#line 1141 "parser.yxx"
|
||
{
|
||
EggGroup *group = new EggGroup((yyvsp[(2) - (2)]._string));
|
||
group->set_group_type(EggGroup::GT_joint);
|
||
egg_stack.push_back(group);
|
||
}
|
||
break;
|
||
|
||
case 73:
|
||
#line 1147 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 74:
|
||
#line 1162 "parser.yxx"
|
||
{
|
||
EggGroup *group = new EggGroup((yyvsp[(2) - (2)]._string));
|
||
group->set_group_type(EggGroup::GT_instance);
|
||
egg_stack.push_back(group);
|
||
}
|
||
break;
|
||
|
||
case 75:
|
||
#line 1168 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 77:
|
||
#line 1184 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
string name = (yyvsp[(3) - (6)]._string);
|
||
double value = (yyvsp[(5) - (6)]._number);
|
||
unsigned long ulong_value = (yyvsp[(5) - (6)]._ulong);
|
||
string strval = (yyvsp[(5) - (6)]._string);
|
||
|
||
if (cmp_nocase_uh(name, "fps") == 0) {
|
||
group->set_switch_fps(value);
|
||
|
||
} else if (cmp_nocase_uh(name, "no_fog") == 0) {
|
||
group->set_nofog_flag(value != 0);
|
||
|
||
} else if (cmp_nocase_uh(name, "decal") == 0) {
|
||
group->set_decal_flag(value != 0);
|
||
|
||
} else if (cmp_nocase_uh(name, "direct") == 0) {
|
||
group->set_direct_flag(value != 0);
|
||
|
||
} else if (cmp_nocase_uh(name, "alpha") == 0) {
|
||
EggRenderMode::AlphaMode a = EggRenderMode::string_alpha_mode(strval);
|
||
if (a == EggRenderMode::AM_unspecified) {
|
||
eggyywarning("Unknown alpha mode " + strval);
|
||
} else {
|
||
group->set_alpha_mode(a);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "depth_write") == 0) {
|
||
EggRenderMode::DepthWriteMode m =
|
||
EggRenderMode::string_depth_write_mode(strval);
|
||
if (m == EggRenderMode::DWM_unspecified) {
|
||
eggyywarning("Unknown depth-write mode " + strval);
|
||
} else {
|
||
group->set_depth_write_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "depth_test") == 0) {
|
||
EggRenderMode::DepthTestMode m =
|
||
EggRenderMode::string_depth_test_mode(strval);
|
||
if (m == EggRenderMode::DTM_unspecified) {
|
||
eggyywarning("Unknown depth-test mode " + strval);
|
||
} else {
|
||
group->set_depth_test_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "visibility") == 0) {
|
||
EggRenderMode::VisibilityMode m =
|
||
EggRenderMode::string_visibility_mode(strval);
|
||
if (m == EggRenderMode::VM_unspecified) {
|
||
eggyywarning("Unknown visibility mode " + strval);
|
||
} else {
|
||
group->set_visibility_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "draw_order") == 0) {
|
||
group->set_draw_order(ulong_value);
|
||
|
||
} else if (cmp_nocase_uh(name, "bin") == 0) {
|
||
group->set_bin(strval);
|
||
|
||
} else if (cmp_nocase_uh(name, "collide_mask") == 0) {
|
||
group->set_collide_mask(group->get_collide_mask() | ulong_value);
|
||
|
||
} else if (cmp_nocase_uh(name, "from_collide_mask") == 0) {
|
||
group->set_from_collide_mask(group->get_from_collide_mask() | ulong_value);
|
||
|
||
} else if (cmp_nocase_uh(name, "into_collide_mask") == 0) {
|
||
group->set_into_collide_mask(group->get_into_collide_mask() | ulong_value);
|
||
|
||
} else if (cmp_nocase_uh(name, "portal") == 0) {
|
||
group->set_portal_flag(value != 0);
|
||
|
||
} else if (cmp_nocase_uh(name, "polylight") == 0) {
|
||
group->set_polylight_flag(value != 0);
|
||
|
||
} else if (cmp_nocase_uh(name, "indexed") == 0) {
|
||
group->set_indexed_flag(value != 0);
|
||
|
||
} else if (cmp_nocase_uh(name, "blend") == 0) {
|
||
EggGroup::BlendMode blend_mode =
|
||
EggGroup::string_blend_mode(strval);
|
||
if (blend_mode == EggGroup::BM_unspecified) {
|
||
eggyywarning("Unknown blend mode " + strval);
|
||
} else {
|
||
group->set_blend_mode(blend_mode);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "blendop_a") == 0) {
|
||
EggGroup::BlendOperand blend_operand =
|
||
EggGroup::string_blend_operand(strval);
|
||
if (blend_operand == EggGroup::BO_unspecified) {
|
||
eggyywarning("Unknown blend operand " + strval);
|
||
} else {
|
||
group->set_blend_operand_a(blend_operand);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "blendop_b") == 0) {
|
||
EggGroup::BlendOperand blend_operand =
|
||
EggGroup::string_blend_operand(strval);
|
||
if (blend_operand == EggGroup::BO_unspecified) {
|
||
eggyywarning("Unknown blend operand " + strval);
|
||
} else {
|
||
group->set_blend_operand_b(blend_operand);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "blendr") == 0) {
|
||
Colorf color = group->get_blend_color();
|
||
color[0] = value;
|
||
group->set_blend_color(color);
|
||
|
||
} else if (cmp_nocase_uh(name, "blendg") == 0) {
|
||
Colorf color = group->get_blend_color();
|
||
color[1] = value;
|
||
group->set_blend_color(color);
|
||
|
||
} else if (cmp_nocase_uh(name, "blendb") == 0) {
|
||
Colorf color = group->get_blend_color();
|
||
color[2] = value;
|
||
group->set_blend_color(color);
|
||
|
||
} else if (cmp_nocase_uh(name, "blenda") == 0) {
|
||
Colorf color = group->get_blend_color();
|
||
color[3] = value;
|
||
group->set_blend_color(color);
|
||
|
||
} else {
|
||
eggyywarning("Unknown group scalar " + name);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 78:
|
||
#line 1314 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
string strval = (yyvsp[(4) - (5)]._string);
|
||
|
||
EggGroup::BillboardType f = EggGroup::string_billboard_type(strval);
|
||
if (f == EggGroup::BT_none) {
|
||
eggyywarning("Unknown billboard type " + strval);
|
||
} else {
|
||
group->set_billboard_type(f);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 79:
|
||
#line 1326 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
group->set_billboard_center(LPoint3d((yyvsp[(4) - (7)]._number), (yyvsp[(5) - (7)]._number), (yyvsp[(6) - (7)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 80:
|
||
#line 1331 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
string name = (yyvsp[(3) - (7)]._string);
|
||
|
||
group->set_collision_name(name);
|
||
}
|
||
break;
|
||
|
||
case 81:
|
||
#line 1338 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
int value = (int)(yyvsp[(4) - (5)]._number);
|
||
group->set_dcs_type(value!=0 ? EggGroup::DC_default : EggGroup::DC_none);
|
||
}
|
||
break;
|
||
|
||
case 82:
|
||
#line 1344 "parser.yxx"
|
||
{
|
||
// The special flavor of DCS, with { sync } or { nosync }.
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
string strval = (yyvsp[(4) - (5)]._string);
|
||
|
||
EggGroup::DCSType f = EggGroup::string_dcs_type(strval);
|
||
if (f == EggGroup::DC_unspecified) {
|
||
eggyywarning("Unknown DCS type " + strval);
|
||
} else {
|
||
group->set_dcs_type(f);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 83:
|
||
#line 1357 "parser.yxx"
|
||
{
|
||
// The traditional flavor of DART, with { 0 } or { 1 }.
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
int value = (int)(yyvsp[(4) - (5)]._number);
|
||
group->set_dart_type(value!=0 ? EggGroup::DT_default : EggGroup::DT_none);
|
||
}
|
||
break;
|
||
|
||
case 84:
|
||
#line 1364 "parser.yxx"
|
||
{
|
||
// The special flavor of DART, with { sync } or { nosync }.
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
string strval = (yyvsp[(4) - (5)]._string);
|
||
|
||
EggGroup::DartType f = EggGroup::string_dart_type(strval);
|
||
if (f == EggGroup::DT_none) {
|
||
eggyywarning("Unknown dart type " + strval);
|
||
} else {
|
||
group->set_dart_type(f);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 85:
|
||
#line 1377 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
int value = (int)(yyvsp[(4) - (5)]._number);
|
||
group->set_switch_flag(value!=0);
|
||
}
|
||
break;
|
||
|
||
case 86:
|
||
#line 1383 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
string type = (yyvsp[(4) - (5)]._string);
|
||
group->add_object_type(type);
|
||
}
|
||
break;
|
||
|
||
case 87:
|
||
#line 1389 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
int value = (int)(yyvsp[(4) - (5)]._number);
|
||
group->set_model_flag(value!=0);
|
||
}
|
||
break;
|
||
|
||
case 88:
|
||
#line 1395 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
group->set_tag((yyvsp[(3) - (6)]._string), (yyvsp[(5) - (6)]._string));
|
||
}
|
||
break;
|
||
|
||
case 89:
|
||
#line 1400 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
int value = (int)(yyvsp[(4) - (5)]._number);
|
||
group->set_texlist_flag(value!=0);
|
||
}
|
||
break;
|
||
|
||
case 93:
|
||
#line 1409 "parser.yxx"
|
||
{
|
||
DCAST(EggGroup, egg_stack.back())->add_child(DCAST(EggNode, (yyvsp[(2) - (2)]._egg)));
|
||
}
|
||
break;
|
||
|
||
case 94:
|
||
#line 1423 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
string strval = (yyvsp[(1) - (1)]._string);
|
||
|
||
EggGroup::CollisionSolidType f = EggGroup::string_cs_type(strval);
|
||
if (f == EggGroup::CST_none) {
|
||
eggyywarning("Unknown collision solid type " + strval);
|
||
} else {
|
||
if (f == EggGroup::CST_polyset && group->get_cs_type() != EggGroup::CST_none) {
|
||
// By convention, a CST_polyset doesn't replace any existing
|
||
// contradictory type, so ignore it if this happens. This
|
||
// allows the artist to place, for instance, <ObjectType> {
|
||
// sphere } and <ObjectType> { trigger } together.
|
||
|
||
} else {
|
||
group->set_cs_type(f);
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 96:
|
||
#line 1454 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
string strval = (yyvsp[(2) - (2)]._string);
|
||
|
||
EggGroup::CollideFlags f = EggGroup::string_collide_flags(strval);
|
||
if (f == EggGroup::CF_none) {
|
||
eggyywarning("Unknown collision flag " + strval);
|
||
} else {
|
||
group->set_collide_flags(group->get_collide_flags() | f);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 97:
|
||
#line 1476 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->clear_transform();
|
||
}
|
||
break;
|
||
|
||
case 112:
|
||
#line 1508 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->add_translate2d(LVector2d((yyvsp[(3) - (5)]._number), (yyvsp[(4) - (5)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 113:
|
||
#line 1515 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->add_translate3d(LVector3d((yyvsp[(3) - (6)]._number), (yyvsp[(4) - (6)]._number), (yyvsp[(5) - (6)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 114:
|
||
#line 1522 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->add_rotate2d((yyvsp[(3) - (4)]._number));
|
||
}
|
||
break;
|
||
|
||
case 115:
|
||
#line 1529 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->add_rotx((yyvsp[(3) - (4)]._number));
|
||
}
|
||
break;
|
||
|
||
case 116:
|
||
#line 1536 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->add_roty((yyvsp[(3) - (4)]._number));
|
||
}
|
||
break;
|
||
|
||
case 117:
|
||
#line 1543 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->add_rotz((yyvsp[(3) - (4)]._number));
|
||
}
|
||
break;
|
||
|
||
case 118:
|
||
#line 1550 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->add_rotate3d((yyvsp[(3) - (7)]._number), LVector3d((yyvsp[(4) - (7)]._number), (yyvsp[(5) - (7)]._number), (yyvsp[(6) - (7)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 119:
|
||
#line 1557 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->add_scale2d(LVecBase2d((yyvsp[(3) - (5)]._number), (yyvsp[(4) - (5)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 120:
|
||
#line 1564 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->add_scale3d(LVecBase3d((yyvsp[(3) - (6)]._number), (yyvsp[(4) - (6)]._number), (yyvsp[(5) - (6)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 121:
|
||
#line 1571 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->add_uniform_scale((yyvsp[(3) - (4)]._number));
|
||
}
|
||
break;
|
||
|
||
case 124:
|
||
#line 1585 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->add_matrix3
|
||
(LMatrix3d((yyvsp[(1) - (9)]._number), (yyvsp[(2) - (9)]._number), (yyvsp[(3) - (9)]._number),
|
||
(yyvsp[(4) - (9)]._number), (yyvsp[(5) - (9)]._number), (yyvsp[(6) - (9)]._number),
|
||
(yyvsp[(7) - (9)]._number), (yyvsp[(8) - (9)]._number), (yyvsp[(9) - (9)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 127:
|
||
#line 1603 "parser.yxx"
|
||
{
|
||
egg_stack.back()->as_transform()->add_matrix4
|
||
(LMatrix4d((yyvsp[(1) - (16)]._number), (yyvsp[(2) - (16)]._number), (yyvsp[(3) - (16)]._number), (yyvsp[(4) - (16)]._number),
|
||
(yyvsp[(5) - (16)]._number), (yyvsp[(6) - (16)]._number), (yyvsp[(7) - (16)]._number), (yyvsp[(8) - (16)]._number),
|
||
(yyvsp[(9) - (16)]._number), (yyvsp[(10) - (16)]._number), (yyvsp[(11) - (16)]._number), (yyvsp[(12) - (16)]._number),
|
||
(yyvsp[(13) - (16)]._number), (yyvsp[(14) - (16)]._number), (yyvsp[(15) - (16)]._number), (yyvsp[(16) - (16)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 128:
|
||
#line 1622 "parser.yxx"
|
||
{
|
||
if ((yyvsp[(7) - (9)]._egg) != (EggVertexPool *)NULL) {
|
||
EggVertexPool *pool = DCAST(EggVertexPool, (yyvsp[(7) - (9)]._egg));
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
PTA_double nums = (yyvsp[(3) - (9)]._number_list);
|
||
double membership = (yyvsp[(4) - (9)]._number);
|
||
|
||
for (int i = 0; i < (int)nums.size(); i++) {
|
||
int index = (int)nums[i];
|
||
EggVertex *vertex = pool->get_forward_vertex(index);
|
||
if (vertex == NULL) {
|
||
ostringstream errmsg;
|
||
errmsg << "No vertex " << index << " in pool " << pool->get_name()
|
||
<< ends;
|
||
eggyyerror(errmsg);
|
||
} else {
|
||
group->ref_vertex(vertex, membership);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 129:
|
||
#line 1655 "parser.yxx"
|
||
{
|
||
(yyval._number) = 1.0;
|
||
}
|
||
break;
|
||
|
||
case 130:
|
||
#line 1659 "parser.yxx"
|
||
{
|
||
string name = (yyvsp[(3) - (6)]._string);
|
||
double value = (yyvsp[(5) - (6)]._number);
|
||
double result = (yyvsp[(1) - (6)]._number);
|
||
|
||
if (cmp_nocase_uh(name, "membership") == 0) {
|
||
result = value;
|
||
} else {
|
||
eggyywarning("Unknown group vertex scalar " + name);
|
||
}
|
||
|
||
(yyval._number) = result;
|
||
}
|
||
break;
|
||
|
||
case 132:
|
||
#line 1696 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
group->set_lod(EggSwitchConditionDistance((yyvsp[(3) - (11)]._number), (yyvsp[(4) - (11)]._number), LPoint3d((yyvsp[(7) - (11)]._number), (yyvsp[(8) - (11)]._number), (yyvsp[(9) - (11)]._number))));
|
||
}
|
||
break;
|
||
|
||
case 133:
|
||
#line 1701 "parser.yxx"
|
||
{
|
||
EggGroup *group = DCAST(EggGroup, egg_stack.back());
|
||
group->set_lod(EggSwitchConditionDistance((yyvsp[(3) - (12)]._number), (yyvsp[(4) - (12)]._number), LPoint3d((yyvsp[(8) - (12)]._number), (yyvsp[(9) - (12)]._number), (yyvsp[(10) - (12)]._number)), (yyvsp[(5) - (12)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 134:
|
||
#line 1718 "parser.yxx"
|
||
{
|
||
egg_stack.push_back(new EggPolygon((yyvsp[(2) - (2)]._string)));
|
||
}
|
||
break;
|
||
|
||
case 135:
|
||
#line 1722 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 136:
|
||
#line 1737 "parser.yxx"
|
||
{
|
||
egg_stack.push_back(new EggTriangleFan((yyvsp[(2) - (2)]._string)));
|
||
}
|
||
break;
|
||
|
||
case 137:
|
||
#line 1741 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 138:
|
||
#line 1756 "parser.yxx"
|
||
{
|
||
egg_stack.push_back(new EggTriangleStrip((yyvsp[(2) - (2)]._string)));
|
||
}
|
||
break;
|
||
|
||
case 139:
|
||
#line 1760 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 140:
|
||
#line 1775 "parser.yxx"
|
||
{
|
||
egg_stack.push_back(new EggPoint((yyvsp[(2) - (2)]._string)));
|
||
}
|
||
break;
|
||
|
||
case 141:
|
||
#line 1779 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 142:
|
||
#line 1794 "parser.yxx"
|
||
{
|
||
egg_stack.push_back(new EggLine((yyvsp[(2) - (2)]._string)));
|
||
}
|
||
break;
|
||
|
||
case 143:
|
||
#line 1798 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 144:
|
||
#line 1813 "parser.yxx"
|
||
{
|
||
egg_stack.push_back(new EggNurbsSurface((yyvsp[(2) - (2)]._string)));
|
||
}
|
||
break;
|
||
|
||
case 145:
|
||
#line 1817 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 146:
|
||
#line 1832 "parser.yxx"
|
||
{
|
||
egg_stack.push_back(new EggNurbsCurve((yyvsp[(2) - (2)]._string)));
|
||
}
|
||
break;
|
||
|
||
case 147:
|
||
#line 1836 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 152:
|
||
#line 1866 "parser.yxx"
|
||
{
|
||
if (!egg_stack.back()->is_of_type(EggCompositePrimitive::get_class_type())) {
|
||
eggyyerror("Not a composite primitive; components are not allowed here.");
|
||
} else {
|
||
PT(EggCompositePrimitive) comp = DCAST(EggCompositePrimitive, egg_stack.back());
|
||
if ((yyvsp[(3) - (4)]._number) < 0 || (yyvsp[(3) - (4)]._number) >= comp->get_num_components()) {
|
||
eggyyerror("Invalid component number");
|
||
}
|
||
}
|
||
// We temporarily add an EggPolygon to the stack, just to receive
|
||
// the component attributes.
|
||
egg_stack.push_back(new EggPolygon);
|
||
}
|
||
break;
|
||
|
||
case 153:
|
||
#line 1880 "parser.yxx"
|
||
{
|
||
PT(EggPrimitive) prim = DCAST(EggPrimitive, egg_stack.back());
|
||
egg_stack.pop_back();
|
||
PT(EggCompositePrimitive) comp = DCAST(EggCompositePrimitive, egg_stack.back());
|
||
comp->set_component((int)(yyvsp[(3) - (7)]._number), prim);
|
||
}
|
||
break;
|
||
|
||
case 161:
|
||
#line 1894 "parser.yxx"
|
||
{
|
||
EggPrimitive *primitive = DCAST(EggPrimitive, egg_stack.back());
|
||
string name = (yyvsp[(3) - (6)]._string);
|
||
double value = (yyvsp[(5) - (6)]._number);
|
||
string strval = (yyvsp[(5) - (6)]._string);
|
||
|
||
if (cmp_nocase_uh(name, "alpha") == 0) {
|
||
EggRenderMode::AlphaMode a = EggRenderMode::string_alpha_mode(strval);
|
||
if (a == EggRenderMode::AM_unspecified) {
|
||
eggyywarning("Unknown alpha mode " + strval);
|
||
} else {
|
||
primitive->set_alpha_mode(a);
|
||
}
|
||
} else if (cmp_nocase_uh(name, "depth_write") == 0) {
|
||
EggRenderMode::DepthWriteMode m =
|
||
EggRenderMode::string_depth_write_mode(strval);
|
||
if (m == EggRenderMode::DWM_unspecified) {
|
||
eggyywarning("Unknown depth-write mode " + strval);
|
||
} else {
|
||
primitive->set_depth_write_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "depth_test") == 0) {
|
||
EggRenderMode::DepthTestMode m =
|
||
EggRenderMode::string_depth_test_mode(strval);
|
||
if (m == EggRenderMode::DTM_unspecified) {
|
||
eggyywarning("Unknown depth-test mode " + strval);
|
||
} else {
|
||
primitive->set_depth_test_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "visibility") == 0) {
|
||
EggRenderMode::VisibilityMode m =
|
||
EggRenderMode::string_visibility_mode(strval);
|
||
if (m == EggRenderMode::VM_unspecified) {
|
||
eggyywarning("Unknown visibility mode " + strval);
|
||
} else {
|
||
primitive->set_visibility_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "draw_order") == 0) {
|
||
primitive->set_draw_order((int)value);
|
||
} else if (cmp_nocase_uh(name, "bin") == 0) {
|
||
primitive->set_bin(strval);
|
||
} else if (cmp_nocase_uh(name, "thick") == 0) {
|
||
if (primitive->is_of_type(EggLine::get_class_type())) {
|
||
DCAST(EggLine, primitive)->set_thick(value);
|
||
} else if (primitive->is_of_type(EggPoint::get_class_type())) {
|
||
DCAST(EggPoint, primitive)->set_thick(value);
|
||
} else {
|
||
eggyywarning("scalar thick is only meaningful for points and lines.");
|
||
}
|
||
} else if (cmp_nocase_uh(name, "perspective") == 0) {
|
||
if (primitive->is_of_type(EggPoint::get_class_type())) {
|
||
DCAST(EggPoint, primitive)->set_perspective(value != 0);
|
||
} else {
|
||
eggyywarning("scalar perspective is only meaningful for points.");
|
||
}
|
||
} else {
|
||
eggyywarning("Unknown scalar " + name);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 173:
|
||
#line 1978 "parser.yxx"
|
||
{
|
||
EggNurbsCurve *curve = DCAST(EggNurbsCurve, (yyvsp[(2) - (2)]._egg));
|
||
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
|
||
nurbs->_curves_on_surface.push_back(curve);
|
||
}
|
||
break;
|
||
|
||
case 175:
|
||
#line 1985 "parser.yxx"
|
||
{
|
||
EggNurbsSurface *primitive = DCAST(EggNurbsSurface, egg_stack.back());
|
||
string name = (yyvsp[(3) - (6)]._string);
|
||
double value = (yyvsp[(5) - (6)]._number);
|
||
string strval = (yyvsp[(5) - (6)]._string);
|
||
|
||
if (cmp_nocase_uh(name, "alpha") == 0) {
|
||
EggRenderMode::AlphaMode a = EggRenderMode::string_alpha_mode(strval);
|
||
if (a == EggRenderMode::AM_unspecified) {
|
||
eggyywarning("Unknown alpha mode " + strval);
|
||
} else {
|
||
primitive->set_alpha_mode(a);
|
||
}
|
||
} else if (cmp_nocase_uh(name, "depth_write") == 0) {
|
||
EggRenderMode::DepthWriteMode m =
|
||
EggRenderMode::string_depth_write_mode(strval);
|
||
if (m == EggRenderMode::DWM_unspecified) {
|
||
eggyywarning("Unknown depth-write mode " + strval);
|
||
} else {
|
||
primitive->set_depth_write_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "depth_test") == 0) {
|
||
EggRenderMode::DepthTestMode m =
|
||
EggRenderMode::string_depth_test_mode(strval);
|
||
if (m == EggRenderMode::DTM_unspecified) {
|
||
eggyywarning("Unknown depth-test mode " + strval);
|
||
} else {
|
||
primitive->set_depth_test_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "visibility") == 0) {
|
||
EggRenderMode::VisibilityMode m =
|
||
EggRenderMode::string_visibility_mode(strval);
|
||
if (m == EggRenderMode::VM_unspecified) {
|
||
eggyywarning("Unknown visibility mode " + strval);
|
||
} else {
|
||
primitive->set_visibility_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "draw_order") == 0) {
|
||
primitive->set_draw_order((int)value);
|
||
} else if (cmp_nocase_uh(name, "bin") == 0) {
|
||
primitive->set_bin(strval);
|
||
} else if (cmp_nocase_uh(name, "u_subdiv") == 0) {
|
||
primitive->set_u_subdiv((int)value);
|
||
} else if (cmp_nocase_uh(name, "v_subdiv") == 0) {
|
||
primitive->set_v_subdiv((int)value);
|
||
} else {
|
||
eggyywarning("Unknown scalar " + name);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 186:
|
||
#line 2059 "parser.yxx"
|
||
{
|
||
EggNurbsCurve *primitive = DCAST(EggNurbsCurve, egg_stack.back());
|
||
string name = (yyvsp[(3) - (6)]._string);
|
||
double value = (yyvsp[(5) - (6)]._number);
|
||
string strval = (yyvsp[(5) - (6)]._string);
|
||
|
||
if (cmp_nocase_uh(name, "alpha") == 0) {
|
||
EggRenderMode::AlphaMode a = EggRenderMode::string_alpha_mode(strval);
|
||
if (a == EggRenderMode::AM_unspecified) {
|
||
eggyywarning("Unknown alpha mode " + strval);
|
||
} else {
|
||
primitive->set_alpha_mode(a);
|
||
}
|
||
} else if (cmp_nocase_uh(name, "depth_write") == 0) {
|
||
EggRenderMode::DepthWriteMode m =
|
||
EggRenderMode::string_depth_write_mode(strval);
|
||
if (m == EggRenderMode::DWM_unspecified) {
|
||
eggyywarning("Unknown depth-write mode " + strval);
|
||
} else {
|
||
primitive->set_depth_write_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "depth_test") == 0) {
|
||
EggRenderMode::DepthTestMode m =
|
||
EggRenderMode::string_depth_test_mode(strval);
|
||
if (m == EggRenderMode::DTM_unspecified) {
|
||
eggyywarning("Unknown depth-test mode " + strval);
|
||
} else {
|
||
primitive->set_depth_test_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "visibility") == 0) {
|
||
EggRenderMode::VisibilityMode m =
|
||
EggRenderMode::string_visibility_mode(strval);
|
||
if (m == EggRenderMode::VM_unspecified) {
|
||
eggyywarning("Unknown visibility mode " + strval);
|
||
} else {
|
||
primitive->set_visibility_mode(m);
|
||
}
|
||
|
||
} else if (cmp_nocase_uh(name, "draw_order") == 0) {
|
||
primitive->set_draw_order((int)value);
|
||
} else if (cmp_nocase_uh(name, "bin") == 0) {
|
||
primitive->set_bin(strval);
|
||
} else if (cmp_nocase_uh(name, "subdiv") == 0) {
|
||
primitive->set_subdiv((int)value);
|
||
} else if (cmp_nocase_uh(name, "type") == 0) {
|
||
EggCurve::CurveType a = EggCurve::string_curve_type(strval);
|
||
if (a == EggCurve::CT_none) {
|
||
eggyywarning("Unknown curve type " + strval);
|
||
} else {
|
||
primitive->set_curve_type(a);
|
||
}
|
||
|
||
} else {
|
||
eggyywarning("Unknown scalar " + name);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 187:
|
||
#line 2128 "parser.yxx"
|
||
{
|
||
if ((yyvsp[(1) - (1)]._egg) != (EggTexture *)NULL) {
|
||
EggTexture *texture = DCAST(EggTexture, (yyvsp[(1) - (1)]._egg));
|
||
DCAST(EggPrimitive, egg_stack.back())->add_texture(texture);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 188:
|
||
#line 2145 "parser.yxx"
|
||
{
|
||
EggTexture *texture = NULL;
|
||
|
||
// Defining a texture on-the-fly.
|
||
Filename filename = (yyvsp[(1) - (1)]._string);
|
||
string tref_name = filename.get_basename();
|
||
|
||
Textures::iterator vpi = textures.find(tref_name);
|
||
if (vpi == textures.end()) {
|
||
// The texture was not yet defined. Define it.
|
||
texture = new EggTexture(tref_name, filename);
|
||
textures[tref_name] = texture;
|
||
|
||
if (egg_top_node != NULL) {
|
||
egg_top_node->add_child(texture);
|
||
}
|
||
|
||
} else {
|
||
// The texture already existed. Use it.
|
||
texture = (*vpi).second;
|
||
if (filename != texture->get_filename()) {
|
||
eggyywarning(string("Using previous path: ") +
|
||
texture->get_filename().get_fullpath());
|
||
}
|
||
}
|
||
|
||
nassertr(texture != NULL, 0);
|
||
DCAST(EggPrimitive, egg_stack.back())->add_texture(texture);
|
||
}
|
||
break;
|
||
|
||
case 189:
|
||
#line 2185 "parser.yxx"
|
||
{
|
||
if ((yyvsp[(1) - (1)]._egg) != (EggMaterial *)NULL) {
|
||
EggMaterial *material = DCAST(EggMaterial, (yyvsp[(1) - (1)]._egg));
|
||
DCAST(EggPrimitive, egg_stack.back())->set_material(material);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 190:
|
||
#line 2202 "parser.yxx"
|
||
{
|
||
DCAST(EggPrimitive, egg_stack.back())->set_normal(Normald((yyvsp[(1) - (3)]._number), (yyvsp[(2) - (3)]._number), (yyvsp[(3) - (3)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 191:
|
||
#line 2206 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggPrimitive, egg_stack.back())->_dnormals.
|
||
insert(EggMorphNormal((yyvsp[(3) - (8)]._string), LVector3d((yyvsp[(5) - (8)]._number), (yyvsp[(6) - (8)]._number), (yyvsp[(7) - (8)]._number)))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(3) - (8)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 192:
|
||
#line 2214 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggPrimitive, egg_stack.back())->_dnormals.
|
||
insert(EggMorphNormal((yyvsp[(4) - (8)]._string), LVector3d((yyvsp[(5) - (8)]._number), (yyvsp[(6) - (8)]._number), (yyvsp[(7) - (8)]._number)))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(4) - (8)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 193:
|
||
#line 2232 "parser.yxx"
|
||
{
|
||
DCAST(EggPrimitive, egg_stack.back())->set_color(Colorf((yyvsp[(1) - (4)]._number), (yyvsp[(2) - (4)]._number), (yyvsp[(3) - (4)]._number), (yyvsp[(4) - (4)]._number)));
|
||
}
|
||
break;
|
||
|
||
case 194:
|
||
#line 2236 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggPrimitive, egg_stack.back())->_drgbas.
|
||
insert(EggMorphColor((yyvsp[(3) - (9)]._string), LVector4f((yyvsp[(5) - (9)]._number), (yyvsp[(6) - (9)]._number), (yyvsp[(7) - (9)]._number), (yyvsp[(8) - (9)]._number)))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(3) - (9)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 195:
|
||
#line 2244 "parser.yxx"
|
||
{
|
||
bool inserted = DCAST(EggPrimitive, egg_stack.back())->_drgbas.
|
||
insert(EggMorphColor((yyvsp[(4) - (9)]._string), LVector4f((yyvsp[(5) - (9)]._number), (yyvsp[(6) - (9)]._number), (yyvsp[(7) - (9)]._number), (yyvsp[(8) - (9)]._number)))).second;
|
||
if (!inserted) {
|
||
eggyywarning("Ignoring repeated morph name " + (yyvsp[(4) - (9)]._string));
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 196:
|
||
#line 2262 "parser.yxx"
|
||
{
|
||
EggPrimitive *primitive = DCAST(EggPrimitive, egg_stack.back());
|
||
int value = (int)(yyvsp[(1) - (1)]._number);
|
||
primitive->set_bface_flag(value!=0);
|
||
}
|
||
break;
|
||
|
||
case 197:
|
||
#line 2278 "parser.yxx"
|
||
{
|
||
if ((yyvsp[(6) - (8)]._egg) != (EggVertexPool *)NULL) {
|
||
EggVertexPool *pool = DCAST(EggVertexPool, (yyvsp[(6) - (8)]._egg));
|
||
EggPrimitive *prim = DCAST(EggPrimitive, egg_stack.back());
|
||
PTA_double nums = (yyvsp[(3) - (8)]._number_list);
|
||
|
||
for (int i = 0; i < (int)nums.size(); i++) {
|
||
int index = (int)nums[i];
|
||
EggVertex *vertex = pool->get_forward_vertex(index);
|
||
if (vertex == NULL) {
|
||
ostringstream errmsg;
|
||
errmsg << "No vertex " << index << " in pool " << pool->get_name()
|
||
<< ends;
|
||
eggyyerror(errmsg);
|
||
} else {
|
||
prim->add_vertex(vertex);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 198:
|
||
#line 2309 "parser.yxx"
|
||
{
|
||
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
|
||
int u_order = (int)(yyvsp[(1) - (2)]._number);
|
||
int v_order = (int)(yyvsp[(2) - (2)]._number);
|
||
nurbs->set_u_order(u_order);
|
||
nurbs->set_v_order(v_order);
|
||
}
|
||
break;
|
||
|
||
case 199:
|
||
#line 2327 "parser.yxx"
|
||
{
|
||
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
|
||
PTA_double nums = (yyvsp[(1) - (1)]._number_list);
|
||
|
||
nurbs->set_num_u_knots(nums.size());
|
||
for (int i = 0; i < (int)nums.size(); i++) {
|
||
nurbs->set_u_knot(i, nums[i]);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 200:
|
||
#line 2347 "parser.yxx"
|
||
{
|
||
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
|
||
PTA_double nums = (yyvsp[(1) - (1)]._number_list);
|
||
|
||
nurbs->set_num_v_knots(nums.size());
|
||
for (int i = 0; i < (int)nums.size(); i++) {
|
||
nurbs->set_v_knot(i, nums[i]);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 201:
|
||
#line 2367 "parser.yxx"
|
||
{
|
||
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
|
||
nurbs->_trims.push_back(EggNurbsSurface::Trim());
|
||
}
|
||
break;
|
||
|
||
case 203:
|
||
#line 2383 "parser.yxx"
|
||
{
|
||
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
|
||
nassertr(!nurbs->_trims.empty(), 0);
|
||
nurbs->_trims.back().push_back(EggNurbsSurface::Loop());
|
||
}
|
||
break;
|
||
|
||
case 204:
|
||
#line 2389 "parser.yxx"
|
||
{
|
||
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
|
||
nassertr(!nurbs->_trims.empty(), 0);
|
||
nassertr(!nurbs->_trims.back().empty(), 0);
|
||
EggNurbsCurve *curve = DCAST(EggNurbsCurve, (yyvsp[(2) - (2)]._egg));
|
||
nurbs->_trims.back().back().push_back(curve);
|
||
}
|
||
break;
|
||
|
||
case 205:
|
||
#line 2408 "parser.yxx"
|
||
{
|
||
EggNurbsCurve *nurbs = DCAST(EggNurbsCurve, egg_stack.back());
|
||
int order = (int)(yyvsp[(1) - (1)]._number);
|
||
nurbs->set_order(order);
|
||
}
|
||
break;
|
||
|
||
case 206:
|
||
#line 2424 "parser.yxx"
|
||
{
|
||
EggNurbsCurve *nurbs = DCAST(EggNurbsCurve, egg_stack.back());
|
||
PTA_double nums = (yyvsp[(1) - (1)]._number_list);
|
||
|
||
nurbs->set_num_knots(nums.size());
|
||
for (int i = 0; i < (int)nums.size(); i++) {
|
||
nurbs->set_knot(i, nums[i]);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 207:
|
||
#line 2445 "parser.yxx"
|
||
{
|
||
EggTable *table = new EggTable((yyvsp[(2) - (2)]._string));
|
||
table->set_table_type(EggTable::TT_table);
|
||
egg_stack.push_back(table);
|
||
}
|
||
break;
|
||
|
||
case 208:
|
||
#line 2451 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 209:
|
||
#line 2467 "parser.yxx"
|
||
{
|
||
EggTable *table = new EggTable((yyvsp[(2) - (2)]._string));
|
||
table->set_table_type(EggTable::TT_bundle);
|
||
egg_stack.push_back(table);
|
||
}
|
||
break;
|
||
|
||
case 210:
|
||
#line 2473 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 212:
|
||
#line 2490 "parser.yxx"
|
||
{
|
||
DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, (yyvsp[(2) - (2)]._egg)));
|
||
}
|
||
break;
|
||
|
||
case 213:
|
||
#line 2494 "parser.yxx"
|
||
{
|
||
DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, (yyvsp[(2) - (2)]._egg)));
|
||
}
|
||
break;
|
||
|
||
case 214:
|
||
#line 2498 "parser.yxx"
|
||
{
|
||
DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, (yyvsp[(2) - (2)]._egg)));
|
||
}
|
||
break;
|
||
|
||
case 215:
|
||
#line 2502 "parser.yxx"
|
||
{
|
||
DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, (yyvsp[(2) - (2)]._egg)));
|
||
}
|
||
break;
|
||
|
||
case 216:
|
||
#line 2506 "parser.yxx"
|
||
{
|
||
DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, (yyvsp[(2) - (2)]._egg)));
|
||
}
|
||
break;
|
||
|
||
case 217:
|
||
#line 2521 "parser.yxx"
|
||
{
|
||
EggSAnimData *anim_data = new EggSAnimData((yyvsp[(2) - (2)]._string));
|
||
egg_stack.push_back(anim_data);
|
||
}
|
||
break;
|
||
|
||
case 218:
|
||
#line 2526 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 220:
|
||
#line 2543 "parser.yxx"
|
||
{
|
||
EggSAnimData *anim_data = DCAST(EggSAnimData, egg_stack.back());
|
||
string name = (yyvsp[(3) - (6)]._string);
|
||
double value = (yyvsp[(5) - (6)]._number);
|
||
|
||
if (cmp_nocase_uh(name, "fps") == 0) {
|
||
anim_data->set_fps(value);
|
||
} else {
|
||
eggyywarning("Unsupported S$Anim scalar: " + name);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 221:
|
||
#line 2555 "parser.yxx"
|
||
{
|
||
DCAST(EggSAnimData, egg_stack.back())->set_data((yyvsp[(4) - (5)]._number_list));
|
||
}
|
||
break;
|
||
|
||
case 222:
|
||
#line 2569 "parser.yxx"
|
||
{
|
||
EggXfmAnimData *anim_data = new EggXfmAnimData((yyvsp[(2) - (2)]._string));
|
||
egg_stack.push_back(anim_data);
|
||
}
|
||
break;
|
||
|
||
case 223:
|
||
#line 2574 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 225:
|
||
#line 2591 "parser.yxx"
|
||
{
|
||
EggXfmAnimData *anim_data = DCAST(EggXfmAnimData, egg_stack.back());
|
||
string name = (yyvsp[(3) - (6)]._string);
|
||
double value = (yyvsp[(5) - (6)]._number);
|
||
string strval = (yyvsp[(5) - (6)]._string);
|
||
|
||
if (cmp_nocase_uh(name, "fps") == 0) {
|
||
anim_data->set_fps(value);
|
||
} else if (cmp_nocase_uh(name, "order") == 0) {
|
||
anim_data->set_order(strval);
|
||
} else if (cmp_nocase_uh(name, "contents") == 0) {
|
||
anim_data->set_contents(strval);
|
||
} else {
|
||
eggyywarning("Unsupported Xfm$Anim scalar: " + name);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 226:
|
||
#line 2608 "parser.yxx"
|
||
{
|
||
DCAST(EggXfmAnimData, egg_stack.back())->set_data((yyvsp[(4) - (5)]._number_list));
|
||
}
|
||
break;
|
||
|
||
case 227:
|
||
#line 2622 "parser.yxx"
|
||
{
|
||
EggXfmSAnim *anim_group = new EggXfmSAnim((yyvsp[(2) - (2)]._string));
|
||
egg_stack.push_back(anim_group);
|
||
}
|
||
break;
|
||
|
||
case 228:
|
||
#line 2627 "parser.yxx"
|
||
{
|
||
(yyval._egg) = egg_stack.back();
|
||
egg_stack.pop_back();
|
||
}
|
||
break;
|
||
|
||
case 230:
|
||
#line 2644 "parser.yxx"
|
||
{
|
||
EggXfmSAnim *anim_group = DCAST(EggXfmSAnim, egg_stack.back());
|
||
string name = (yyvsp[(3) - (6)]._string);
|
||
double value = (yyvsp[(5) - (6)]._number);
|
||
string strval = (yyvsp[(5) - (6)]._string);
|
||
|
||
if (cmp_nocase_uh(name, "fps") == 0) {
|
||
anim_group->set_fps(value);
|
||
} else if (cmp_nocase_uh(name, "order") == 0) {
|
||
anim_group->set_order(strval);
|
||
} else {
|
||
eggyywarning("Unsupported Xfm$Anim_S$ scalar: " + name);
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 231:
|
||
#line 2659 "parser.yxx"
|
||
{
|
||
DCAST(EggXfmSAnim, egg_stack.back())->add_child(DCAST(EggNode, (yyvsp[(2) - (2)]._egg)));
|
||
}
|
||
break;
|
||
|
||
case 232:
|
||
#line 2674 "parser.yxx"
|
||
{
|
||
(yyval._number_list) = PTA_double::empty_array(0);
|
||
}
|
||
break;
|
||
|
||
case 233:
|
||
#line 2678 "parser.yxx"
|
||
{
|
||
(yyval._number_list).push_back((double)(yyvsp[(2) - (2)]._number));
|
||
}
|
||
break;
|
||
|
||
case 234:
|
||
#line 2692 "parser.yxx"
|
||
{
|
||
(yyval._number_list) = PTA_double::empty_array(0);
|
||
}
|
||
break;
|
||
|
||
case 235:
|
||
#line 2696 "parser.yxx"
|
||
{
|
||
(yyval._number_list).push_back((yyvsp[(2) - (2)]._number));
|
||
}
|
||
break;
|
||
|
||
case 236:
|
||
#line 2710 "parser.yxx"
|
||
{
|
||
string name = (yyvsp[(1) - (1)]._string);
|
||
Textures::iterator vpi = textures.find(name);
|
||
if (vpi == textures.end()) {
|
||
eggyyerror("Unknown texture " + name);
|
||
(yyval._egg) = PT(EggObject)();
|
||
} else {
|
||
(yyval._egg) = (*vpi).second;
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 237:
|
||
#line 2731 "parser.yxx"
|
||
{
|
||
string name = (yyvsp[(1) - (1)]._string);
|
||
Materials::iterator vpi = materials.find(name);
|
||
if (vpi == materials.end()) {
|
||
eggyyerror("Unknown material " + name);
|
||
(yyval._egg) = PT(EggObject)();
|
||
} else {
|
||
(yyval._egg) = (*vpi).second;
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 238:
|
||
#line 2752 "parser.yxx"
|
||
{
|
||
string name = (yyvsp[(1) - (1)]._string);
|
||
VertexPools::iterator vpi = vertex_pools.find(name);
|
||
if (vpi == vertex_pools.end()) {
|
||
// This will become a forward reference.
|
||
EggVertexPool *pool = new EggVertexPool(name);
|
||
// The egg syntax starts counting at 1 by convention.
|
||
pool->set_highest_index(0);
|
||
vertex_pools[name] = pool;
|
||
(yyval._egg) = pool;
|
||
} else {
|
||
(yyval._egg) = (*vpi).second;
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 239:
|
||
#line 2778 "parser.yxx"
|
||
{
|
||
eggyyerror("Name required.");
|
||
(yyval._string) = "";
|
||
}
|
||
break;
|
||
|
||
case 242:
|
||
#line 2807 "parser.yxx"
|
||
{
|
||
eggyyerror("String required.");
|
||
(yyval._string) = "";
|
||
}
|
||
break;
|
||
|
||
case 244:
|
||
#line 2823 "parser.yxx"
|
||
{
|
||
(yyval._string) = "";
|
||
}
|
||
break;
|
||
|
||
case 246:
|
||
#line 2841 "parser.yxx"
|
||
{
|
||
(yyval._string) = (yyvsp[(1) - (1)]._string);
|
||
}
|
||
break;
|
||
|
||
case 247:
|
||
#line 2845 "parser.yxx"
|
||
{
|
||
(yyval._string) = (yyvsp[(1) - (1)]._string);
|
||
}
|
||
break;
|
||
|
||
case 249:
|
||
#line 2862 "parser.yxx"
|
||
{
|
||
(yyval._string) = "";
|
||
}
|
||
break;
|
||
|
||
case 250:
|
||
#line 2866 "parser.yxx"
|
||
{
|
||
(yyval._string) = (yyvsp[(1) - (1)]._string);
|
||
}
|
||
break;
|
||
|
||
case 251:
|
||
#line 2882 "parser.yxx"
|
||
{
|
||
(yyval._string) = (yyvsp[(1) - (1)]._string);
|
||
}
|
||
break;
|
||
|
||
case 252:
|
||
#line 2886 "parser.yxx"
|
||
{
|
||
(yyval._string) = (yyvsp[(1) - (2)]._string) + "\n" + (yyvsp[(2) - (2)]._string);
|
||
}
|
||
break;
|
||
|
||
case 254:
|
||
#line 2901 "parser.yxx"
|
||
{
|
||
(yyval._number) = (yyvsp[(1) - (1)]._ulong);
|
||
}
|
||
break;
|
||
|
||
case 255:
|
||
#line 2916 "parser.yxx"
|
||
{
|
||
(yyval._number) = (yyvsp[(1) - (1)]._number);
|
||
(yyval._ulong) = (unsigned long)(yyvsp[(1) - (1)]._number);
|
||
(yyval._string) = (yyvsp[(1) - (1)]._string);
|
||
}
|
||
break;
|
||
|
||
case 256:
|
||
#line 2922 "parser.yxx"
|
||
{
|
||
(yyval._number) = (yyvsp[(1) - (1)]._ulong);
|
||
(yyval._ulong) = (yyvsp[(1) - (1)]._ulong);
|
||
(yyval._string) = (yyvsp[(1) - (1)]._string);
|
||
}
|
||
break;
|
||
|
||
case 257:
|
||
#line 2928 "parser.yxx"
|
||
{
|
||
(yyval._number) = 0.0;
|
||
(yyval._ulong) = 0;
|
||
(yyval._string) = (yyvsp[(1) - (1)]._string);
|
||
}
|
||
break;
|
||
|
||
case 258:
|
||
#line 2945 "parser.yxx"
|
||
{
|
||
int i = (int)(yyvsp[(1) - (1)]._number);
|
||
if ((double)i != (yyvsp[(1) - (1)]._number)) {
|
||
eggyywarning("Integer expected.");
|
||
(yyval._number) = (double)i;
|
||
}
|
||
}
|
||
break;
|
||
|
||
case 259:
|
||
#line 2953 "parser.yxx"
|
||
{
|
||
(yyval._number) = (yyvsp[(1) - (1)]._ulong);
|
||
}
|
||
break;
|
||
|
||
|
||
/* Line 1267 of yacc.c. */
|
||
#line 4667 "y.tab.c"
|
||
default: break;
|
||
}
|
||
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
||
|
||
YYPOPSTACK (yylen);
|
||
yylen = 0;
|
||
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
|
||
yyerror (YY_("syntax error"));
|
||
#else
|
||
{
|
||
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
|
||
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
|
||
{
|
||
YYSIZE_T yyalloc = 2 * yysize;
|
||
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
|
||
yyalloc = YYSTACK_ALLOC_MAXIMUM;
|
||
if (yymsg != yymsgbuf)
|
||
YYSTACK_FREE (yymsg);
|
||
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
|
||
if (yymsg)
|
||
yymsg_alloc = yyalloc;
|
||
else
|
||
{
|
||
yymsg = yymsgbuf;
|
||
yymsg_alloc = sizeof yymsgbuf;
|
||
}
|
||
}
|
||
|
||
if (0 < yysize && yysize <= yymsg_alloc)
|
||
{
|
||
(void) yysyntax_error (yymsg, yystate, yychar);
|
||
yyerror (yymsg);
|
||
}
|
||
else
|
||
{
|
||
yyerror (YY_("syntax error"));
|
||
if (yysize != 0)
|
||
goto yyexhaustedlab;
|
||
}
|
||
}
|
||
#endif
|
||
}
|
||
|
||
|
||
|
||
if (yyerrstatus == 3)
|
||
{
|
||
/* If just tried and failed to reuse look-ahead token after an
|
||
error, discard it. */
|
||
|
||
if (yychar <= YYEOF)
|
||
{
|
||
/* Return failure if at end of input. */
|
||
if (yychar == YYEOF)
|
||
YYABORT;
|
||
}
|
||
else
|
||
{
|
||
yydestruct ("Error: discarding",
|
||
yytoken, &yylval);
|
||
yychar = YYEMPTY;
|
||
}
|
||
}
|
||
|
||
/* Else will try to reuse look-ahead token after shifting the error
|
||
token. */
|
||
goto yyerrlab1;
|
||
|
||
|
||
/*---------------------------------------------------.
|
||
| yyerrorlab -- error raised explicitly by YYERROR. |
|
||
`---------------------------------------------------*/
|
||
yyerrorlab:
|
||
|
||
/* Pacify compilers like GCC when the user code never invokes
|
||
YYERROR and the label yyerrorlab therefore never appears in user
|
||
code. */
|
||
if (/*CONSTCOND*/ 0)
|
||
goto yyerrorlab;
|
||
|
||
/* Do not reclaim the symbols of the rule which action triggered
|
||
this YYERROR. */
|
||
YYPOPSTACK (yylen);
|
||
yylen = 0;
|
||
YY_STACK_PRINT (yyss, yyssp);
|
||
yystate = *yyssp;
|
||
goto yyerrlab1;
|
||
|
||
|
||
/*-------------------------------------------------------------.
|
||
| yyerrlab1 -- common code for both syntax error and YYERROR. |
|
||
`-------------------------------------------------------------*/
|
||
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;
|
||
|
||
|
||
yydestruct ("Error: popping",
|
||
yystos[yystate], yyvsp);
|
||
YYPOPSTACK (1);
|
||
yystate = *yyssp;
|
||
YY_STACK_PRINT (yyss, yyssp);
|
||
}
|
||
|
||
if (yyn == YYFINAL)
|
||
YYACCEPT;
|
||
|
||
*++yyvsp = yylval;
|
||
|
||
|
||
/* Shift the error token. */
|
||
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
|
||
|
||
yystate = yyn;
|
||
goto yynewstate;
|
||
|
||
|
||
/*-------------------------------------.
|
||
| yyacceptlab -- YYACCEPT comes here. |
|
||
`-------------------------------------*/
|
||
yyacceptlab:
|
||
yyresult = 0;
|
||
goto yyreturn;
|
||
|
||
/*-----------------------------------.
|
||
| yyabortlab -- YYABORT comes here. |
|
||
`-----------------------------------*/
|
||
yyabortlab:
|
||
yyresult = 1;
|
||
goto yyreturn;
|
||
|
||
#ifndef yyoverflow
|
||
/*-------------------------------------------------.
|
||
| yyexhaustedlab -- memory exhaustion comes here. |
|
||
`-------------------------------------------------*/
|
||
yyexhaustedlab:
|
||
yyerror (YY_("memory exhausted"));
|
||
yyresult = 2;
|
||
/* Fall through. */
|
||
#endif
|
||
|
||
yyreturn:
|
||
if (yychar != YYEOF && yychar != YYEMPTY)
|
||
yydestruct ("Cleanup: discarding lookahead",
|
||
yytoken, &yylval);
|
||
/* Do not reclaim the symbols of the rule which action triggered
|
||
this YYABORT or YYACCEPT. */
|
||
YYPOPSTACK (yylen);
|
||
YY_STACK_PRINT (yyss, yyssp);
|
||
while (yyssp != yyss)
|
||
{
|
||
yydestruct ("Cleanup: popping",
|
||
yystos[*yyssp], yyvsp);
|
||
YYPOPSTACK (1);
|
||
}
|
||
#ifndef yyoverflow
|
||
if (yyss != yyssa)
|
||
YYSTACK_FREE (yyss);
|
||
#endif
|
||
#if YYERROR_VERBOSE
|
||
if (yymsg != yymsgbuf)
|
||
YYSTACK_FREE (yymsg);
|
||
#endif
|
||
/* Make sure YYID is used. */
|
||
return YYID (yyresult);
|
||
}
|
||
|
||
|
||
|