open_toontown_panda3d/panda/src/egg/parser.cxx.prebuilt

3949 lines
130 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

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

/* A Bison parser, made by GNU Bison 1.875. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* Written by Richard Stallman by simplifying the original so called
``semantic'' parser. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
There are some unavoidable exceptions within include files to
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
/* Identify Bison output. */
#define YYBISON 1
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Pure parsers. */
#define YYPURE 0
/* Using locations. */
#define YYLSP_NEEDED 0
/* If NAME_PREFIX is specified substitute the variables and functions
names. */
#define yyparse 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 {
NUMBER = 258,
ULONG = 259,
STRING = 260,
BEZIERCURVE = 261,
BFACE = 262,
BILLBOARD = 263,
BILLBOARDCENTER = 264,
BUNDLE = 265,
CLOSED = 266,
COLLIDE = 267,
COMMENT = 268,
COORDSYSTEM = 269,
CV = 270,
DART = 271,
DNORMAL = 272,
DRGBA = 273,
DUV = 274,
DXYZ = 275,
DCS = 276,
DISTANCE = 277,
DTREF = 278,
DYNAMICVERTEXPOOL = 279,
EXTERNAL_FILE = 280,
FLIGHT = 281,
GROUP = 282,
HIP = 283,
INTANGENT = 284,
JOINT = 285,
KNOTS = 286,
INCLUDE = 287,
INSTANCE = 288,
LOOP = 289,
MATERIAL = 290,
MATRIX3 = 291,
MATRIX4 = 292,
MODEL = 293,
MREF = 294,
NORMAL = 295,
NURBSCURVE = 296,
NURBSSURFACE = 297,
OBJECTTYPE = 298,
ORDER = 299,
OUTTANGENT = 300,
POINTLIGHT = 301,
POLYGON = 302,
REF = 303,
RGBA = 304,
ROTATE = 305,
ROTX = 306,
ROTY = 307,
ROTZ = 308,
SANIM = 309,
SCALAR = 310,
SCALE = 311,
SEQUENCE = 312,
SHADING = 313,
SWITCH = 314,
SWITCHCONDITION = 315,
TABLE = 316,
TABLE_V = 317,
TAG = 318,
TEXLIST = 319,
TEXTURE = 320,
TLENGTHS = 321,
TRANSFORM = 322,
TRANSLATE = 323,
TREF = 324,
TRIM = 325,
TXT = 326,
UKNOTS = 327,
UV = 328,
VKNOTS = 329,
VERTEX = 330,
VERTEXANIM = 331,
VERTEXPOOL = 332,
VERTEXREF = 333,
XFMANIM = 334,
XFMSANIM = 335,
START_EGG = 336,
START_GROUP_BODY = 337,
START_TEXTURE_BODY = 338,
START_PRIMITIVE_BODY = 339
};
#endif
#define NUMBER 258
#define ULONG 259
#define STRING 260
#define BEZIERCURVE 261
#define BFACE 262
#define BILLBOARD 263
#define BILLBOARDCENTER 264
#define BUNDLE 265
#define CLOSED 266
#define COLLIDE 267
#define COMMENT 268
#define COORDSYSTEM 269
#define CV 270
#define DART 271
#define DNORMAL 272
#define DRGBA 273
#define DUV 274
#define DXYZ 275
#define DCS 276
#define DISTANCE 277
#define DTREF 278
#define DYNAMICVERTEXPOOL 279
#define EXTERNAL_FILE 280
#define FLIGHT 281
#define GROUP 282
#define HIP 283
#define INTANGENT 284
#define JOINT 285
#define KNOTS 286
#define INCLUDE 287
#define INSTANCE 288
#define LOOP 289
#define MATERIAL 290
#define MATRIX3 291
#define MATRIX4 292
#define MODEL 293
#define MREF 294
#define NORMAL 295
#define NURBSCURVE 296
#define NURBSSURFACE 297
#define OBJECTTYPE 298
#define ORDER 299
#define OUTTANGENT 300
#define POINTLIGHT 301
#define POLYGON 302
#define REF 303
#define RGBA 304
#define ROTATE 305
#define ROTX 306
#define ROTY 307
#define ROTZ 308
#define SANIM 309
#define SCALAR 310
#define SCALE 311
#define SEQUENCE 312
#define SHADING 313
#define SWITCH 314
#define SWITCHCONDITION 315
#define TABLE 316
#define TABLE_V 317
#define TAG 318
#define TEXLIST 319
#define TEXTURE 320
#define TLENGTHS 321
#define TRANSFORM 322
#define TRANSLATE 323
#define TREF 324
#define TRIM 325
#define TXT 326
#define UKNOTS 327
#define UV 328
#define VKNOTS 329
#define VERTEX 330
#define VERTEXANIM 331
#define VERTEXPOOL 332
#define VERTEXREF 333
#define XFMANIM 334
#define XFMSANIM 335
#define START_EGG 336
#define START_GROUP_BODY 337
#define START_TEXTURE_BODY 338
#define START_PRIMITIVE_BODY 339
/* Copy the first part of user declarations. */
#line 6 "parser.yxx"
#include <pandabase.h>
#include "parserDefs.h"
#include "lexerDefs.h"
#include "eggObject.h"
#include "eggGroup.h"
#include "eggVertex.h"
#include "eggVertexPool.h"
#include "eggPolygon.h"
#include "eggPoint.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() {
// 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
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
typedef int YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
/* Copy the second part of user declarations. */
/* Line 214 of yacc.c. */
#line 370 "y.tab.c"
#if ! defined (yyoverflow) || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
# if YYSTACK_USE_ALLOCA
# define YYSTACK_ALLOC alloca
# else
# ifndef YYSTACK_USE_ALLOCA
# if defined (alloca) || defined (_ALLOCA_H)
# define YYSTACK_ALLOC alloca
# else
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
/* Pacify GCC's `empty if-body' warning. */
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# else
# if defined (__STDC__) || defined (__cplusplus)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# endif
# define YYSTACK_ALLOC malloc
# define YYSTACK_FREE free
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
#if (! defined (yyoverflow) \
&& (! defined (__cplusplus) \
|| (YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
short yyss;
YYSTYPE yyvs;
};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
((N) * (sizeof (short) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
# if 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
register YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
while (0)
# endif
# endif
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
# define YYSTACK_RELOCATE(Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)
#endif
#if defined (__STDC__) || defined (__cplusplus)
typedef signed char yysigned_char;
#else
typedef short yysigned_char;
#endif
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 14
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 1252
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 87
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 110
/* YYNRULES -- Number of rules. */
#define YYNRULES 242
/* YYNRULES -- Number of states. */
#define YYNSTATES 683
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 339
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const unsigned char yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 85, 2, 86, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 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
};
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
static const unsigned short yyprhs[] =
{
0, 0, 3, 6, 9, 12, 15, 17, 20, 22,
24, 26, 28, 30, 32, 34, 36, 38, 40, 42,
44, 46, 48, 53, 59, 60, 68, 70, 77, 80,
81, 88, 90, 97, 103, 110, 111, 118, 120, 123,
124, 130, 131, 138, 140, 143, 147, 152, 158, 164,
170, 179, 188, 191, 199, 207, 211, 220, 229, 234,
244, 254, 255, 262, 263, 270, 271, 278, 280, 287,
293, 301, 309, 315, 321, 327, 333, 339, 345, 351,
358, 364, 367, 370, 373, 376, 378, 380, 383, 384,
390, 392, 395, 398, 401, 404, 407, 410, 413, 420,
425, 430, 435, 443, 450, 455, 460, 462, 479, 480,
486, 488, 491, 494, 497, 500, 506, 511, 517, 522,
524, 534, 544, 546, 553, 558, 570, 583, 584, 591,
592, 599, 600, 607, 608, 615, 617, 623, 629, 635,
638, 644, 650, 656, 663, 665, 671, 677, 683, 686,
692, 698, 704, 710, 716, 722, 725, 731, 738, 740,
746, 752, 758, 761, 767, 773, 779, 785, 791, 798,
800, 802, 804, 808, 817, 826, 831, 841, 851, 853,
862, 865, 867, 869, 871, 877, 879, 882, 884, 886,
887, 894, 895, 902, 904, 907, 910, 913, 916, 919,
920, 927, 929, 936, 942, 943, 950, 952, 959, 965,
966, 973, 975, 982, 985, 987, 990, 992, 995, 997,
999, 1001, 1003, 1005, 1007, 1009, 1011, 1013, 1015, 1017,
1019, 1021, 1023, 1025, 1027, 1030, 1032, 1034, 1036, 1038,
1040, 1042, 1044
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const short yyrhs[] =
{
88, 0, -1, 81, 89, -1, 82, 116, -1, 83,
95, -1, 84, 150, -1, 196, -1, 89, 90, -1,
91, -1, 92, -1, 93, -1, 96, -1, 99, -1,
100, -1, 110, -1, 112, -1, 114, -1, 142, -1,
144, -1, 146, -1, 148, -1, 167, -1, 14, 85,
188, 86, -1, 13, 187, 85, 191, 86, -1, -1,
65, 186, 85, 188, 94, 95, 86, -1, 196, -1,
95, 55, 186, 85, 194, 86, -1, 95, 130, -1,
-1, 35, 186, 85, 97, 98, 86, -1, 196, -1,
98, 55, 186, 85, 194, 86, -1, 25, 187, 85,
188, 86, -1, 190, 25, 187, 85, 188, 86, -1,
-1, 77, 186, 101, 85, 102, 86, -1, 196, -1,
102, 103, -1, -1, 75, 104, 85, 106, 86, -1,
-1, 75, 195, 105, 85, 106, 86, -1, 193, -1,
193, 193, -1, 193, 193, 193, -1, 193, 193, 193,
193, -1, 106, 73, 85, 107, 86, -1, 106, 40,
85, 108, 86, -1, 106, 49, 85, 109, 86, -1,
106, 20, 190, 85, 193, 193, 193, 86, -1, 106,
20, 85, 190, 193, 193, 193, 86, -1, 193, 193,
-1, 107, 19, 190, 85, 193, 193, 86, -1, 107,
19, 85, 190, 193, 193, 86, -1, 193, 193, 193,
-1, 108, 17, 190, 85, 193, 193, 193, 86, -1,
108, 17, 85, 190, 193, 193, 193, 86, -1, 193,
193, 193, 193, -1, 109, 18, 190, 85, 193, 193,
193, 193, 86, -1, 109, 18, 85, 190, 193, 193,
193, 193, 86, -1, -1, 27, 187, 111, 85, 116,
86, -1, -1, 30, 187, 113, 85, 116, 86, -1,
-1, 33, 187, 115, 85, 116, 86, -1, 196, -1,
116, 55, 186, 85, 194, 86, -1, 116, 8, 85,
190, 86, -1, 116, 9, 85, 193, 193, 193, 86,
-1, 116, 12, 187, 85, 117, 118, 86, -1, 116,
21, 85, 195, 86, -1, 116, 21, 85, 5, 86,
-1, 116, 16, 85, 195, 86, -1, 116, 16, 85,
5, 86, -1, 116, 59, 85, 195, 86, -1, 116,
43, 85, 188, 86, -1, 116, 38, 85, 195, 86,
-1, 116, 63, 187, 85, 191, 86, -1, 116, 64,
85, 195, 86, -1, 116, 119, -1, 116, 138, -1,
116, 140, -1, 116, 90, -1, 190, -1, 196, -1,
118, 190, -1, -1, 67, 120, 85, 121, 86, -1,
196, -1, 121, 122, -1, 121, 123, -1, 121, 124,
-1, 121, 125, -1, 121, 126, -1, 121, 127, -1,
121, 128, -1, 68, 85, 193, 193, 193, 86, -1,
51, 85, 193, 86, -1, 52, 85, 193, 86, -1,
53, 85, 193, 86, -1, 50, 85, 193, 193, 193,
193, 86, -1, 56, 85, 193, 193, 193, 86, -1,
56, 85, 193, 86, -1, 37, 85, 129, 86, -1,
196, -1, 193, 193, 193, 193, 193, 193, 193, 193,
193, 193, 193, 193, 193, 193, 193, 193, -1, -1,
67, 131, 85, 132, 86, -1, 196, -1, 132, 136,
-1, 132, 133, -1, 132, 134, -1, 132, 135, -1,
68, 85, 193, 193, 86, -1, 50, 85, 193, 86,
-1, 56, 85, 193, 193, 86, -1, 36, 85, 137,
86, -1, 196, -1, 193, 193, 193, 193, 193, 193,
193, 193, 193, -1, 78, 85, 181, 139, 48, 85,
185, 86, 86, -1, 196, -1, 139, 55, 186, 85,
194, 86, -1, 60, 85, 141, 86, -1, 22, 85,
193, 193, 75, 85, 193, 193, 193, 86, 86, -1,
22, 85, 193, 193, 193, 75, 85, 193, 193, 193,
86, 86, -1, -1, 47, 187, 143, 85, 150, 86,
-1, -1, 46, 187, 145, 85, 150, 86, -1, -1,
42, 187, 147, 85, 151, 86, -1, -1, 41, 187,
149, 85, 152, 86, -1, 196, -1, 150, 69, 85,
153, 86, -1, 150, 65, 85, 154, 86, -1, 150,
39, 85, 155, 86, -1, 150, 159, -1, 150, 40,
85, 156, 86, -1, 150, 49, 85, 157, 86, -1,
150, 7, 85, 158, 86, -1, 150, 55, 186, 85,
194, 86, -1, 196, -1, 151, 69, 85, 153, 86,
-1, 151, 65, 85, 154, 86, -1, 151, 39, 85,
155, 86, -1, 151, 159, -1, 151, 40, 85, 156,
86, -1, 151, 49, 85, 157, 86, -1, 151, 7,
85, 158, 86, -1, 151, 44, 85, 160, 86, -1,
151, 72, 85, 161, 86, -1, 151, 74, 85, 162,
86, -1, 151, 148, -1, 151, 70, 85, 163, 86,
-1, 151, 55, 186, 85, 194, 86, -1, 196, -1,
152, 69, 85, 153, 86, -1, 152, 65, 85, 154,
86, -1, 152, 39, 85, 155, 86, -1, 152, 159,
-1, 152, 40, 85, 156, 86, -1, 152, 49, 85,
157, 86, -1, 152, 7, 85, 158, 86, -1, 152,
44, 85, 165, 86, -1, 152, 31, 85, 166, 86,
-1, 152, 55, 186, 85, 194, 86, -1, 183, -1,
186, -1, 184, -1, 193, 193, 193, -1, 156, 17,
190, 85, 193, 193, 193, 86, -1, 156, 17, 85,
190, 193, 193, 193, 86, -1, 193, 193, 193, 193,
-1, 157, 18, 190, 85, 193, 193, 193, 193, 86,
-1, 157, 18, 85, 190, 193, 193, 193, 193, 86,
-1, 195, -1, 78, 85, 181, 48, 85, 185, 86,
86, -1, 195, 195, -1, 182, -1, 182, -1, 196,
-1, 163, 34, 85, 164, 86, -1, 196, -1, 164,
148, -1, 195, -1, 182, -1, -1, 61, 187, 168,
85, 171, 86, -1, -1, 10, 187, 170, 85, 171,
86, -1, 196, -1, 171, 167, -1, 171, 169, -1,
171, 172, -1, 171, 175, -1, 171, 178, -1, -1,
54, 187, 173, 85, 174, 86, -1, 196, -1, 174,
55, 186, 85, 194, 86, -1, 174, 62, 85, 182,
86, -1, -1, 79, 187, 176, 85, 177, 86, -1,
196, -1, 177, 55, 186, 85, 194, 86, -1, 177,
62, 85, 182, 86, -1, -1, 80, 187, 179, 85,
180, 86, -1, 196, -1, 180, 55, 186, 85, 194,
86, -1, 180, 172, -1, 196, -1, 181, 195, -1,
196, -1, 182, 193, -1, 186, -1, 186, -1, 186,
-1, 196, -1, 190, -1, 189, -1, 196, -1, 190,
-1, 196, -1, 190, -1, 3, -1, 4, -1, 5,
-1, 196, -1, 192, -1, 190, -1, 192, 190, -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 unsigned short yyrline[] =
{
0, 180, 180, 181, 182, 183, 194, 195, 210, 211,
212, 213, 214, 215, 216, 217, 218, 219, 220, 221,
222, 223, 234, 257, 272, 271, 299, 300, 407, 419,
418, 445, 446, 541, 548, 569, 568, 596, 597, 609,
608, 620, 619, 665, 669, 673, 677, 681, 682, 683,
684, 692, 711, 715, 723, 741, 745, 753, 771, 775,
783, 802, 801, 822, 821, 843, 842, 863, 864, 918,
930, 935, 942, 948, 961, 968, 981, 987, 993, 999,
1004, 1010, 1011, 1012, 1013, 1027, 1049, 1050, 1073, 1072,
1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1098, 1104,
1110, 1116, 1122, 1128, 1132, 1139, 1143, 1144, 1167, 1166,
1185, 1186, 1187, 1188, 1189, 1192, 1198, 1204, 1210, 1214,
1215, 1234, 1267, 1271, 1296, 1308, 1313, 1331, 1330, 1350,
1349, 1369, 1368, 1388, 1387, 1407, 1408, 1409, 1410, 1411,
1412, 1413, 1414, 1415, 1464, 1465, 1466, 1467, 1468, 1469,
1470, 1471, 1472, 1473, 1474, 1475, 1481, 1482, 1536, 1537,
1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1605,
1622, 1662, 1679, 1683, 1691, 1709, 1713, 1721, 1739, 1755,
1786, 1804, 1824, 1844, 1849, 1860, 1866, 1885, 1901, 1923,
1922, 1945, 1944, 1966, 1967, 1971, 1975, 1979, 1983, 1999,
1998, 2019, 2020, 2032, 2047, 2046, 2067, 2068, 2085, 2100,
2099, 2120, 2121, 2136, 2151, 2155, 2169, 2173, 2187, 2208,
2229, 2251, 2256, 2268, 2280, 2285, 2296, 2300, 2314, 2318,
2322, 2335, 2339, 2355, 2359, 2373, 2374, 2389, 2395, 2401,
2418, 2426, 2432
};
#endif
#if YYDEBUG || YYERROR_VERBOSE
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "NUMBER", "ULONG", "STRING", "BEZIERCURVE",
"BFACE", "BILLBOARD", "BILLBOARDCENTER", "BUNDLE", "CLOSED", "COLLIDE",
"COMMENT", "COORDSYSTEM", "CV", "DART", "DNORMAL", "DRGBA", "DUV",
"DXYZ", "DCS", "DISTANCE", "DTREF", "DYNAMICVERTEXPOOL",
"EXTERNAL_FILE", "FLIGHT", "GROUP", "HIP", "INTANGENT", "JOINT",
"KNOTS", "INCLUDE", "INSTANCE", "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", "TEXLIST", "TEXTURE", "TLENGTHS", "TRANSFORM", "TRANSLATE",
"TREF", "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", "vertex_uv_body", "vertex_normal_body",
"vertex_color_body", "group", "@6", "joint", "@7", "instance", "@8",
"group_body", "cs_type", "collide_flags", "transform_3d", "@9",
"transform_3d_body", "translate_3d", "rotx_3d", "roty_3d", "rotz_3d",
"rotate_3d", "scale_3d", "matrix4_3d", "matrix4_3d_body",
"transform_2d", "@10", "transform_2d_body", "translate_2d", "rotate_2d",
"scale_2d", "matrix3_2d", "matrix3_2d_body", "group_vertex_ref",
"group_vertex_membership", "switchcondition", "switchcondition_body",
"polygon", "@11", "point_light", "@12", "nurbs_surface", "@13",
"nurbs_curve", "@14", "primitive_body", "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", "@15", "bundle", "@16", "table_body",
"sanim", "@17", "sanim_body", "xfmanim", "@18", "xfmanim_body",
"xfm_s_anim", "@19", "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 unsigned short yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
295, 296, 297, 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, 123, 125
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const unsigned char yyr1[] =
{
0, 87, 88, 88, 88, 88, 89, 89, 90, 90,
90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
90, 90, 91, 92, 94, 93, 95, 95, 95, 97,
96, 98, 98, 99, 99, 101, 100, 102, 102, 104,
103, 105, 103, 106, 106, 106, 106, 106, 106, 106,
106, 106, 107, 107, 107, 108, 108, 108, 109, 109,
109, 111, 110, 113, 112, 115, 114, 116, 116, 116,
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
116, 116, 116, 116, 116, 117, 118, 118, 120, 119,
121, 121, 121, 121, 121, 121, 121, 121, 122, 123,
124, 125, 126, 127, 127, 128, 129, 129, 131, 130,
132, 132, 132, 132, 132, 133, 134, 135, 136, 137,
137, 138, 139, 139, 140, 141, 141, 143, 142, 145,
144, 147, 146, 149, 148, 150, 150, 150, 150, 150,
150, 150, 150, 150, 151, 151, 151, 151, 151, 151,
151, 151, 151, 151, 151, 151, 151, 151, 152, 152,
152, 152, 152, 152, 152, 152, 152, 152, 152, 153,
154, 155, 156, 156, 156, 157, 157, 157, 158, 159,
160, 161, 162, 163, 163, 164, 164, 165, 166, 168,
167, 170, 169, 171, 171, 171, 171, 171, 171, 173,
172, 174, 174, 174, 176, 175, 177, 177, 177, 179,
178, 180, 180, 180, 181, 181, 182, 182, 183, 184,
185, 186, 186, 187, 188, 188, 189, 189, 190, 190,
190, 191, 191, 192, 192, 193, 193, 194, 194, 194,
195, 195, 196
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const unsigned char yyr2[] =
{
0, 2, 2, 2, 2, 2, 1, 2, 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, 5, 5, 5,
8, 8, 2, 7, 7, 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, 6, 4,
4, 4, 7, 6, 4, 4, 1, 16, 0, 5,
1, 2, 2, 2, 2, 5, 4, 5, 4, 1,
9, 9, 1, 6, 4, 11, 12, 0, 6, 0,
6, 0, 6, 0, 6, 1, 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 unsigned char yydefact[] =
{
0, 242, 242, 242, 242, 0, 2, 6, 3, 67,
4, 26, 5, 135, 1, 228, 229, 230, 242, 0,
242, 242, 242, 242, 242, 242, 242, 242, 242, 242,
242, 242, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 0, 0, 0,
242, 0, 0, 0, 0, 242, 0, 0, 242, 0,
88, 0, 84, 81, 82, 83, 242, 108, 28, 0,
0, 0, 0, 242, 0, 0, 0, 139, 0, 223,
227, 226, 242, 0, 61, 63, 65, 0, 222, 221,
133, 131, 129, 127, 189, 0, 35, 242, 0, 0,
0, 0, 0, 0, 242, 0, 0, 0, 0, 0,
0, 242, 0, 0, 0, 242, 0, 0, 0, 242,
242, 242, 242, 0, 225, 224, 242, 0, 0, 0,
29, 0, 0, 0, 0, 0, 242, 0, 0, 0,
235, 236, 0, 0, 240, 241, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 242, 0, 242, 242,
214, 0, 242, 0, 178, 0, 171, 219, 0, 0,
0, 0, 0, 0, 170, 0, 169, 218, 0, 233,
0, 232, 231, 22, 0, 242, 242, 242, 242, 242,
242, 242, 242, 242, 24, 242, 242, 69, 0, 242,
85, 75, 74, 73, 72, 78, 77, 237, 238, 239,
0, 76, 0, 124, 0, 80, 0, 90, 0, 215,
122, 0, 0, 110, 142, 138, 0, 140, 0, 0,
141, 0, 0, 137, 136, 0, 23, 234, 33, 0,
0, 0, 0, 31, 0, 158, 0, 144, 0, 0,
0, 193, 242, 0, 37, 0, 0, 0, 86, 68,
0, 79, 0, 0, 0, 0, 0, 0, 0, 89,
91, 92, 93, 94, 95, 96, 97, 0, 242, 27,
0, 0, 0, 0, 109, 112, 113, 114, 111, 0,
0, 172, 0, 0, 0, 143, 242, 62, 64, 66,
242, 30, 0, 0, 0, 0, 0, 0, 242, 0,
0, 134, 162, 0, 0, 0, 0, 0, 242, 0,
0, 0, 0, 0, 132, 155, 148, 130, 128, 242,
242, 242, 242, 190, 194, 195, 196, 197, 198, 0,
39, 36, 38, 34, 70, 71, 87, 0, 242, 0,
0, 0, 0, 0, 0, 242, 0, 242, 0, 0,
0, 0, 0, 0, 0, 175, 0, 220, 0, 0,
242, 242, 0, 0, 0, 0, 242, 242, 0, 242,
0, 0, 0, 0, 242, 242, 242, 242, 242, 191,
199, 204, 209, 25, 0, 41, 0, 0, 0, 0,
106, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 119, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 188, 216, 0, 0, 0, 187, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 183, 0, 181, 0, 182, 0, 0,
0, 0, 0, 0, 0, 0, 105, 0, 0, 99,
100, 101, 104, 0, 0, 0, 0, 118, 0, 116,
0, 0, 0, 0, 0, 0, 179, 0, 165, 167,
217, 161, 163, 166, 164, 0, 160, 159, 151, 147,
149, 152, 180, 150, 0, 146, 145, 0, 156, 153,
154, 242, 242, 242, 242, 0, 43, 0, 0, 0,
0, 0, 0, 0, 121, 123, 0, 117, 115, 0,
0, 0, 0, 32, 168, 157, 242, 0, 0, 201,
0, 206, 0, 211, 0, 0, 0, 0, 40, 44,
0, 0, 0, 0, 0, 103, 98, 0, 174, 173,
0, 0, 0, 185, 192, 242, 0, 200, 242, 0,
205, 242, 210, 213, 0, 0, 0, 0, 0, 45,
42, 0, 0, 0, 102, 0, 177, 176, 184, 186,
0, 242, 0, 242, 0, 0, 0, 0, 0, 0,
0, 0, 0, 46, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 48, 0, 0, 49,
0, 0, 47, 52, 125, 0, 0, 0, 0, 203,
0, 208, 0, 0, 0, 0, 0, 55, 0, 0,
0, 0, 0, 126, 0, 0, 202, 207, 212, 0,
0, 0, 0, 0, 0, 58, 0, 0, 0, 120,
51, 50, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
54, 53, 0, 57, 56, 0, 0, 0, 60, 59,
0, 0, 107
};
/* YYDEFGOTO[NTERM-NUM]. */
static const short yydefgoto[] =
{
-1, 5, 6, 62, 33, 34, 35, 252, 10, 36,
188, 242, 37, 38, 137, 253, 342, 394, 453, 505,
591, 587, 589, 39, 127, 40, 128, 41, 129, 8,
199, 257, 63, 110, 216, 270, 271, 272, 273, 274,
275, 276, 398, 68, 113, 222, 285, 286, 287, 288,
409, 64, 218, 65, 155, 42, 134, 43, 133, 44,
132, 45, 131, 12, 246, 244, 175, 173, 165, 168,
170, 163, 77, 436, 444, 446, 442, 552, 427, 422,
46, 135, 335, 448, 250, 336, 449, 528, 337, 450,
530, 338, 451, 532, 159, 423, 176, 166, 366, 167,
78, 123, 79, 88, 180, 181, 480, 210, 164, 89
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -380
static const short yypact[] =
{
217, -380, -380, -380, -380, 102, 359, -380, 1171, -380,
109, -380, 253, -380, -380, -380, -380, -380, 259, 19,
259, 259, 259, 259, 259, 259, 259, 259, 259, 259,
259, 259, -380, -380, -380, -380, -380, -380, -380, -380,
-380, -380, -380, -380, -380, -380, -380, 111, 114, 121,
259, 126, 158, 161, 168, 259, 169, 173, 259, 181,
-380, 193, -380, -380, -380, -380, 259, -380, -380, 196,
197, 210, 227, 259, 228, 229, 230, -380, 231, -380,
-380, -380, 259, 232, -380, -380, -380, 235, -380, -380,
-380, -380, -380, -380, -380, 236, -380, 259, 259, 177,
242, 266, 285, 234, 259, 243, 234, 143, 244, 234,
245, -380, 247, 248, 234, 259, 177, 177, 249, 259,
259, -380, 259, 110, -380, -380, 259, 254, 255, 257,
-380, 258, 267, 268, 280, 281, 259, 282, 283, 189,
-380, -380, 177, 259, -380, -380, 233, 284, 288, 289,
290, 292, 301, 294, 296, 297, 259, 299, -380, 234,
-380, 301, -380, 302, -380, 304, -380, -380, 13, 177,
29, 177, 301, 305, -380, 307, -380, -380, 140, -380,
309, 259, -380, -380, 311, -380, -380, -380, -380, -380,
-380, -380, -380, -380, -380, -380, 259, -380, 177, -380,
-380, -380, -380, -380, -380, -380, -380, -380, -380, -380,
313, -380, 177, -380, 318, -380, 133, -380, -44, -380,
-380, 322, 211, -380, -380, -380, 50, -380, 177, 55,
-380, 177, 323, -380, -380, 331, -380, -380, -380, 867,
981, 1057, 31, -380, 187, -380, 138, -380, 83, 190,
14, -380, -380, 71, -380, 332, 333, 38, -380, -380,
177, -380, 336, 337, 338, 340, 341, 342, 343, -380,
-380, -380, -380, -380, -380, -380, -380, 344, 259, -380,
345, 346, 347, 348, -380, -380, -380, -380, -380, 259,
349, -380, 259, 350, 177, -380, 259, -380, -380, -380,
259, -380, 352, 353, 354, 355, 356, 357, 259, 358,
360, -380, -380, 362, 363, 365, 371, 372, 259, 373,
374, 378, 382, 383, -380, -380, -380, -380, -380, 259,
259, 259, 259, -380, -380, -380, -380, -380, -380, 105,
234, -380, -380, -380, -380, -380, -380, 80, 177, 177,
177, 177, 177, 177, 177, 259, 388, 177, 177, 177,
177, 177, 177, 177, 177, -380, 389, -380, 391, 234,
-380, 259, 177, 234, 177, 393, 259, 259, 234, 259,
177, 234, 177, 394, 259, 259, -380, -380, -380, -380,
-380, -380, -380, -380, 395, -380, 396, 221, 397, 177,
-380, 177, 398, 399, 400, 35, 177, 401, 301, 403,
177, -380, 404, 177, 177, 177, 177, 177, 177, 405,
301, 406, 407, 177, -380, 408, 20, 410, -380, 33,
301, 411, 412, 413, 414, 63, 415, 234, 43, 301,
416, 423, 77, -380, 424, 177, 425, 177, 427, 429,
430, 431, 177, 432, 177, 435, -380, 177, 177, -380,
-380, -380, -380, 177, 177, 436, 437, -380, 177, -380,
438, 439, 177, 177, 177, 177, -380, 440, -380, -380,
-380, -380, -380, -380, -380, 441, -380, -380, -380, -380,
-380, -380, -380, -380, 443, -380, -380, 445, -380, -380,
-380, -380, -380, -380, -380, 85, 177, 177, 177, 177,
177, 177, 446, 447, -380, -380, 177, -380, -380, 448,
449, 177, 177, -380, -380, -380, -380, 47, 26, -380,
112, -380, 87, -380, 62, 452, 458, 460, -380, 177,
201, 177, 177, 177, 461, -380, -380, 177, -380, -380,
462, 463, 21, -380, -380, 259, 465, -380, 259, 466,
-380, 259, -380, -380, 259, 467, 177, 177, 177, 177,
-380, 468, 177, 177, -380, 177, -380, -380, -380, -380,
470, -380, 471, -380, 472, 177, 177, 70, 177, 67,
177, 76, 177, -380, 473, 474, 177, 177, 301, 42,
301, 45, 301, 177, 177, 66, -380, 177, 69, -380,
177, 74, -380, -380, -380, 475, 177, 177, 476, -380,
481, -380, 482, 177, 177, 259, 486, -380, 259, 488,
177, 259, 489, -380, 177, 177, -380, -380, -380, 490,
491, 177, 177, 177, 177, -380, 177, 177, 177, -380,
-380, -380, 177, 177, 177, 177, 177, 177, 177, 177,
177, 177, 177, 492, 493, 177, 494, 495, 177, 177,
-380, -380, 177, -380, -380, 498, 500, 177, -380, -380,
177, 177, -380
};
/* YYPGOTO[NTERM-NUM]. */
static const short yypgoto[] =
{
-380, -380, -380, 376, -380, -380, -380, -380, 135, -380,
-380, -380, -380, -380, -380, -380, -380, -380, -380, -90,
-380, -380, -380, -380, -380, -380, -380, -380, -380, 124,
-380, -380, -380, -380, -380, -380, -380, -380, -380, -380,
-380, -380, -380, -380, -380, -380, -380, -380, -380, -380,
-380, -380, -380, -380, -380, -380, -380, -380, -380, -380,
-380, -245, -380, 57, -380, -380, -288, -184, -166, -158,
-142, -260, -29, -380, -380, -380, -380, -380, -380, -380,
-247, -380, -380, -380, -57, -58, -380, -380, -380, -380,
-380, -380, -380, -380, 361, -379, -380, -380, 166, 422,
6, -86, -380, -6, 375, -380, -3, -136, -96, 669
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -1
static const unsigned short yytable[] =
{
47, 325, 47, 334, 277, 147, 149, 150, 445, 447,
153, 278, 80, 157, 80, 80, 80, 80, 151, 80,
80, 80, 80, 80, 329, 221, 83, 84, 85, 86,
226, 90, 91, 92, 93, 94, 232, 226, 140, 141,
184, 15, 16, 17, 80, 140, 141, 229, 140, 141,
194, 229, 80, 15, 16, 17, 100, 329, 15, 16,
17, 229, 25, 219, 108, 15, 16, 17, 330, 15,
16, 17, 15, 16, 17, 29, 124, 15, 16, 17,
226, 555, 219, 140, 141, 608, 300, 605, 556, 432,
69, 80, 139, 331, 332, 611, 142, 441, 124, 227,
333, 330, 14, 138, 82, 534, 482, 578, 29, 421,
255, 497, 557, 169, 171, 230, 179, 301, 433, 484,
124, 462, 70, 71, 345, 535, 331, 332, 619, 493,
124, 621, 72, 554, 536, 289, 97, 200, 73, 198,
292, 330, 561, 144, 145, 313, 340, 564, 74, 490,
179, 625, 75, 609, 628, 396, 606, 341, 537, 631,
66, 76, 612, 498, 66, 154, 228, 558, 231, 327,
262, 538, 67, 562, 559, 237, 67, 314, 315, 25,
140, 141, 316, 263, 264, 265, 266, 317, 235, 267,
124, 393, 431, 318, 302, 256, 183, 69, 560, 98,
440, 268, 599, 319, 601, 425, 99, 320, 321, 260,
322, 101, 323, 434, 426, 312, 76, 326, 303, 269,
290, 534, 435, 293, 324, 291, 304, 305, 294, 70,
71, 306, 429, 47, 47, 47, 307, 144, 145, 72,
438, 535, 308, 102, 395, 73, 103, 280, 248, 249,
536, 346, 309, 104, 106, 74, 310, 347, 107, 75,
69, 281, 15, 16, 17, 76, 109, 282, 76, 144,
145, 146, 466, 311, 537, 197, 328, 428, 111, 283,
334, 114, 115, 361, 477, 437, 363, 570, 144, 145,
148, 365, 70, 71, 485, 116, 455, 284, 1, 2,
3, 4, 72, 494, 207, 208, 209, 579, 73, 239,
240, 241, 117, 119, 120, 121, 122, 126, 74, 201,
130, 136, 75, 80, 80, 80, 80, 143, 152, 156,
158, 76, 161, 162, 172, 389, 390, 391, 392, 185,
186, 492, 187, 189, 397, 399, 401, 402, 403, 404,
405, 406, 190, 191, 410, 412, 413, 414, 415, 416,
417, 418, 15, 16, 17, 192, 193, 195, 196, 169,
202, 171, 18, 19, 203, 204, 205, 169, 206, 171,
211, 212, 32, 213, 20, 215, 21, 339, 224, 22,
225, 233, 23, 234, 24, 236, 457, 238, 458, 259,
25, 26, 463, 464, 261, 27, 28, 468, 279, 295,
470, 471, 472, 473, 474, 475, 296, 540, 343, 344,
29, 348, 349, 350, 30, 351, 352, 353, 354, 355,
357, 358, 359, 360, 362, 364, 31, 369, 370, 371,
372, 373, 374, 376, 527, 377, 87, 378, 379, 506,
380, 508, 95, 96, 510, 511, 381, 382, 384, 385,
512, 513, 618, 386, 620, 516, 622, 387, 388, 519,
520, 521, 522, 408, 563, 419, 420, 105, 430, 439,
452, 454, 178, 456, 459, 460, 461, 465, 112, 467,
469, 476, 478, 479, 481, 118, 483, 486, 487, 488,
489, 491, 495, 539, 506, 541, 542, 543, 544, 496,
499, 500, 501, 547, 502, 503, 504, 507, 550, 551,
509, 407, 514, 515, 517, 518, 523, 524, 565, 525,
526, 214, 545, 546, 548, 549, 569, 566, 571, 572,
573, 174, 177, 567, 575, 568, 0, 574, 576, 577,
581, 583, 586, 0, 594, 598, 600, 602, 585, 614,
615, 633, 636, 588, 590, 592, 593, 637, 638, 595,
596, 642, 597, 644, 647, 0, 650, 651, 670, 671,
673, 674, 603, 604, 678, 607, 679, 610, 0, 613,
0, 0, 0, 616, 617, 0, 0, 0, 0, 626,
623, 624, 629, 0, 627, 632, 0, 630, 0, 0,
0, 0, 0, 634, 635, 0, 0, 0, 0, 641,
639, 640, 643, 0, 0, 646, 0, 645, 0, 0,
0, 648, 649, 0, 0, 0, 0, 0, 652, 653,
654, 655, 0, 656, 657, 658, 0, 0, 0, 659,
660, 661, 662, 663, 664, 665, 666, 667, 668, 669,
0, 0, 672, 0, 0, 675, 676, 0, 0, 677,
7, 9, 11, 13, 680, 0, 0, 681, 682, 0,
0, 0, 0, 0, 0, 0, 0, 81, 0, 81,
81, 81, 81, 0, 81, 81, 81, 81, 81, 0,
356, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 367, 81,
0, 0, 368, 0, 0, 0, 0, 81, 0, 0,
375, 0, 0, 0, 0, 0, 0, 0, 0, 0,
383, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 125, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 81, 0, 0, 0,
0, 0, 0, 125, 0, 0, 0, 367, 0, 0,
160, 0, 0, 0, 0, 0, 0, 0, 0, 0,
160, 182, 0, 0, 0, 125, 0, 0, 174, 177,
0, 0, 0, 0, 0, 125, 174, 177, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 182, 0, 217, 220, 0,
0, 223, 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, 243, 245, 247,
13, 13, 251, 0, 254, 125, 0, 0, 258, 0,
15, 16, 17, 0, 0, 48, 49, 0, 0, 50,
18, 19, 0, 51, 0, 0, 0, 0, 52, 0,
0, 0, 20, 0, 21, 0, 0, 22, 0, 0,
23, 0, 24, 0, 0, 53, 0, 0, 25, 26,
54, 0, 0, 27, 28, 0, 0, 0, 0, 0,
0, 11, 55, 0, 0, 0, 56, 57, 29, 0,
58, 59, 30, 0, 60, 0, 0, 0, 0, 0,
0, 0, 0, 0, 31, 61, 0, 0, 0, 0,
0, 0, 0, 297, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 580, 0, 0,
582, 0, 0, 584, 15, 16, 17, 0, 0, 48,
49, 0, 0, 50, 18, 19, 0, 51, 81, 81,
81, 81, 52, 0, 0, 0, 20, 0, 21, 0,
0, 22, 0, 0, 23, 0, 24, 400, 0, 53,
0, 0, 25, 26, 54, 0, 411, 27, 28, 0,
0, 0, 0, 0, 0, 0, 55, 0, 0, 424,
56, 57, 29, 0, 58, 59, 30, 0, 60, 0,
0, 0, 0, 0, 0, 443, 424, 424, 31, 61,
15, 16, 17, 0, 0, 48, 49, 298, 0, 50,
18, 19, 0, 51, 0, 0, 0, 0, 52, 0,
0, 0, 20, 0, 21, 0, 0, 22, 0, 0,
23, 0, 24, 0, 0, 53, 0, 0, 25, 26,
54, 0, 0, 27, 28, 0, 0, 0, 0, 0,
0, 0, 55, 0, 0, 0, 56, 57, 29, 0,
58, 59, 30, 0, 60, 0, 0, 0, 0, 0,
0, 0, 0, 0, 31, 61, 0, 0, 0, 0,
0, 0, 0, 299, 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, 0,
251, 529, 531, 533, 15, 16, 17, 0, 0, 48,
49, 0, 0, 50, 18, 19, 0, 51, 0, 0,
0, 0, 52, 0, 0, 553, 20, 0, 21, 0,
0, 22, 0, 0, 23, 0, 24, 0, 0, 53,
0, 0, 25, 26, 54, 0, 0, 27, 28, 0,
0, 0, 0, 0, 0, 0, 55, 0, 0, 0,
56, 57, 29, 0, 58, 59, 30, 0, 60, 0,
0, 0, 0, 0, 0, 0, 0, 0, 31, 61,
424, 0, 424
};
static const short yycheck[] =
{
6, 246, 8, 250, 48, 101, 102, 103, 387, 388,
106, 55, 18, 109, 20, 21, 22, 23, 104, 25,
26, 27, 28, 29, 10, 161, 20, 21, 22, 23,
17, 25, 26, 27, 28, 29, 172, 17, 3, 4,
126, 3, 4, 5, 50, 3, 4, 18, 3, 4,
136, 18, 58, 3, 4, 5, 50, 10, 3, 4,
5, 18, 41, 159, 58, 3, 4, 5, 54, 3,
4, 5, 3, 4, 5, 61, 82, 3, 4, 5,
17, 55, 178, 3, 4, 18, 55, 17, 62, 377,
7, 97, 98, 79, 80, 19, 99, 385, 104, 86,
86, 54, 0, 97, 85, 20, 86, 86, 61, 369,
196, 34, 86, 116, 117, 86, 122, 86, 378, 86,
126, 86, 39, 40, 86, 40, 79, 80, 86, 86,
136, 86, 49, 86, 49, 85, 25, 143, 55, 142,
85, 54, 55, 3, 4, 7, 75, 85, 65, 86,
156, 85, 69, 86, 85, 75, 86, 86, 73, 85,
55, 78, 86, 86, 55, 22, 169, 55, 171, 86,
37, 86, 67, 86, 62, 181, 67, 39, 40, 41,
3, 4, 44, 50, 51, 52, 53, 49, 48, 56,
196, 86, 376, 55, 7, 198, 86, 7, 86, 85,
384, 68, 581, 65, 583, 371, 85, 69, 70, 212,
72, 85, 74, 379, 372, 244, 78, 246, 31, 86,
226, 20, 380, 229, 86, 228, 39, 40, 231, 39,
40, 44, 374, 239, 240, 241, 49, 3, 4, 49,
382, 40, 55, 85, 340, 55, 85, 36, 191, 192,
49, 257, 65, 85, 85, 65, 69, 260, 85, 69,
7, 50, 3, 4, 5, 78, 85, 56, 78, 3,
4, 5, 408, 86, 73, 86, 86, 373, 85, 68,
527, 85, 85, 289, 420, 381, 292, 86, 3, 4,
5, 294, 39, 40, 430, 85, 75, 86, 81, 82,
83, 84, 49, 439, 3, 4, 5, 552, 55, 185,
186, 187, 85, 85, 85, 85, 85, 85, 65, 86,
85, 85, 69, 329, 330, 331, 332, 85, 85, 85,
85, 78, 85, 85, 85, 329, 330, 331, 332, 85,
85, 437, 85, 85, 347, 348, 349, 350, 351, 352,
353, 354, 85, 85, 357, 358, 359, 360, 361, 362,
363, 364, 3, 4, 5, 85, 85, 85, 85, 372,
86, 374, 13, 14, 86, 86, 86, 380, 86, 382,
86, 85, 6, 86, 25, 86, 27, 252, 86, 30,
86, 86, 33, 86, 35, 86, 399, 86, 401, 86,
41, 42, 405, 406, 86, 46, 47, 410, 86, 86,
413, 414, 415, 416, 417, 418, 85, 507, 86, 86,
61, 85, 85, 85, 65, 85, 85, 85, 85, 85,
85, 85, 85, 85, 85, 85, 77, 85, 85, 85,
85, 85, 85, 85, 501, 85, 24, 85, 85, 452,
85, 454, 30, 31, 457, 458, 85, 85, 85, 85,
463, 464, 598, 85, 600, 468, 602, 85, 85, 472,
473, 474, 475, 85, 532, 86, 85, 55, 85, 85,
85, 85, 121, 86, 86, 86, 86, 86, 66, 86,
86, 86, 86, 86, 86, 73, 86, 86, 86, 86,
86, 86, 86, 506, 507, 508, 509, 510, 511, 86,
86, 86, 85, 516, 85, 85, 85, 85, 521, 522,
85, 355, 86, 86, 86, 86, 86, 86, 534, 86,
85, 156, 86, 86, 86, 86, 539, 85, 541, 542,
543, 119, 120, 85, 547, 85, -1, 86, 86, 86,
85, 85, 85, -1, 86, 85, 85, 85, 564, 86,
86, 86, 86, 566, 567, 568, 569, 86, 86, 572,
573, 85, 575, 85, 85, -1, 86, 86, 86, 86,
86, 86, 585, 586, 86, 588, 86, 590, -1, 592,
-1, -1, -1, 596, 597, -1, -1, -1, -1, 605,
603, 604, 608, -1, 607, 611, -1, 610, -1, -1,
-1, -1, -1, 616, 617, -1, -1, -1, -1, 625,
623, 624, 628, -1, -1, 631, -1, 630, -1, -1,
-1, 634, 635, -1, -1, -1, -1, -1, 641, 642,
643, 644, -1, 646, 647, 648, -1, -1, -1, 652,
653, 654, 655, 656, 657, 658, 659, 660, 661, 662,
-1, -1, 665, -1, -1, 668, 669, -1, -1, 672,
1, 2, 3, 4, 677, -1, -1, 680, 681, -1,
-1, -1, -1, -1, -1, -1, -1, 18, -1, 20,
21, 22, 23, -1, 25, 26, 27, 28, 29, -1,
278, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 296, 50,
-1, -1, 300, -1, -1, -1, -1, 58, -1, -1,
308, -1, -1, -1, -1, -1, -1, -1, -1, -1,
318, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 82, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 97, -1, -1, -1,
-1, -1, -1, 104, -1, -1, -1, 355, -1, -1,
111, -1, -1, -1, -1, -1, -1, -1, -1, -1,
121, 122, -1, -1, -1, 126, -1, -1, 376, 377,
-1, -1, -1, -1, -1, 136, 384, 385, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 156, -1, 158, 159, -1,
-1, 162, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 185, 186, 187, 188, 189, 190,
191, 192, 193, -1, 195, 196, -1, -1, 199, -1,
3, 4, 5, -1, -1, 8, 9, -1, -1, 12,
13, 14, -1, 16, -1, -1, -1, -1, 21, -1,
-1, -1, 25, -1, 27, -1, -1, 30, -1, -1,
33, -1, 35, -1, -1, 38, -1, -1, 41, 42,
43, -1, -1, 46, 47, -1, -1, -1, -1, -1,
-1, 252, 55, -1, -1, -1, 59, 60, 61, -1,
63, 64, 65, -1, 67, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 77, 78, -1, -1, -1, -1,
-1, -1, -1, 86, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 555, -1, -1,
558, -1, -1, 561, 3, 4, 5, -1, -1, 8,
9, -1, -1, 12, 13, 14, -1, 16, 329, 330,
331, 332, 21, -1, -1, -1, 25, -1, 27, -1,
-1, 30, -1, -1, 33, -1, 35, 348, -1, 38,
-1, -1, 41, 42, 43, -1, 357, 46, 47, -1,
-1, -1, -1, -1, -1, -1, 55, -1, -1, 370,
59, 60, 61, -1, 63, 64, 65, -1, 67, -1,
-1, -1, -1, -1, -1, 386, 387, 388, 77, 78,
3, 4, 5, -1, -1, 8, 9, 86, -1, 12,
13, 14, -1, 16, -1, -1, -1, -1, 21, -1,
-1, -1, 25, -1, 27, -1, -1, 30, -1, -1,
33, -1, 35, -1, -1, 38, -1, -1, 41, 42,
43, -1, -1, 46, 47, -1, -1, -1, -1, -1,
-1, -1, 55, -1, -1, -1, 59, 60, 61, -1,
63, 64, 65, -1, 67, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 77, 78, -1, -1, -1, -1,
-1, -1, -1, 86, -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, -1,
501, 502, 503, 504, 3, 4, 5, -1, -1, 8,
9, -1, -1, 12, 13, 14, -1, 16, -1, -1,
-1, -1, 21, -1, -1, 526, 25, -1, 27, -1,
-1, 30, -1, -1, 33, -1, 35, -1, -1, 38,
-1, -1, 41, 42, 43, -1, -1, 46, 47, -1,
-1, -1, -1, -1, -1, -1, 55, -1, -1, -1,
59, 60, 61, -1, 63, 64, 65, -1, 67, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 77, 78,
581, -1, 583
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const unsigned char yystos[] =
{
0, 81, 82, 83, 84, 88, 89, 196, 116, 196,
95, 196, 150, 196, 0, 3, 4, 5, 13, 14,
25, 27, 30, 33, 35, 41, 42, 46, 47, 61,
65, 77, 90, 91, 92, 93, 96, 99, 100, 110,
112, 114, 142, 144, 146, 148, 167, 190, 8, 9,
12, 16, 21, 38, 43, 55, 59, 60, 63, 64,
67, 78, 90, 119, 138, 140, 55, 67, 130, 7,
39, 40, 49, 55, 65, 69, 78, 159, 187, 189,
190, 196, 85, 187, 187, 187, 187, 186, 190, 196,
187, 187, 187, 187, 187, 186, 186, 25, 85, 85,
187, 85, 85, 85, 85, 186, 85, 85, 187, 85,
120, 85, 186, 131, 85, 85, 85, 85, 186, 85,
85, 85, 85, 188, 190, 196, 85, 111, 113, 115,
85, 149, 147, 145, 143, 168, 85, 101, 187, 190,
3, 4, 193, 85, 3, 4, 5, 195, 5, 195,
195, 188, 85, 195, 22, 141, 85, 195, 85, 181,
196, 85, 85, 158, 195, 155, 184, 186, 156, 193,
157, 193, 85, 154, 186, 153, 183, 186, 181, 190,
191, 192, 196, 86, 188, 85, 85, 85, 97, 85,
85, 85, 85, 85, 188, 85, 85, 86, 193, 117,
190, 86, 86, 86, 86, 86, 86, 3, 4, 5,
194, 86, 85, 86, 191, 86, 121, 196, 139, 195,
196, 194, 132, 196, 86, 86, 17, 86, 193, 18,
86, 193, 194, 86, 86, 48, 86, 190, 86, 116,
116, 116, 98, 196, 152, 196, 151, 196, 150, 150,
171, 196, 94, 102, 196, 188, 193, 118, 196, 86,
193, 86, 37, 50, 51, 52, 53, 56, 68, 86,
122, 123, 124, 125, 126, 127, 128, 48, 55, 86,
36, 50, 56, 68, 86, 133, 134, 135, 136, 85,
190, 193, 85, 190, 193, 86, 85, 86, 86, 86,
55, 86, 7, 31, 39, 40, 44, 49, 55, 65,
69, 86, 159, 7, 39, 40, 44, 49, 55, 65,
69, 70, 72, 74, 86, 148, 159, 86, 86, 10,
54, 79, 80, 86, 167, 169, 172, 175, 178, 95,
75, 86, 103, 86, 86, 86, 190, 193, 85, 85,
85, 85, 85, 85, 85, 85, 186, 85, 85, 85,
85, 190, 85, 190, 85, 193, 185, 186, 186, 85,
85, 85, 85, 85, 85, 186, 85, 85, 85, 85,
85, 85, 85, 186, 85, 85, 85, 85, 85, 187,
187, 187, 187, 86, 104, 195, 75, 193, 129, 193,
196, 193, 193, 193, 193, 193, 193, 185, 85, 137,
193, 196, 193, 193, 193, 193, 193, 193, 193, 86,
85, 158, 166, 182, 196, 155, 156, 165, 195, 157,
85, 154, 153, 158, 155, 156, 160, 195, 157, 85,
154, 153, 163, 196, 161, 182, 162, 182, 170, 173,
176, 179, 85, 105, 85, 75, 86, 193, 193, 86,
86, 86, 86, 193, 193, 86, 194, 86, 193, 86,
193, 193, 193, 193, 193, 193, 86, 194, 86, 86,
193, 86, 86, 86, 86, 194, 86, 86, 86, 86,
86, 86, 195, 86, 194, 86, 86, 34, 86, 86,
86, 85, 85, 85, 85, 106, 193, 85, 193, 85,
193, 193, 193, 193, 86, 86, 193, 86, 86, 193,
193, 193, 193, 86, 86, 86, 85, 171, 174, 196,
177, 196, 180, 196, 20, 40, 49, 73, 86, 193,
106, 193, 193, 193, 193, 86, 86, 193, 86, 86,
193, 193, 164, 196, 86, 55, 62, 86, 55, 62,
86, 55, 86, 172, 85, 190, 85, 85, 85, 193,
86, 193, 193, 193, 86, 193, 86, 86, 86, 148,
186, 85, 186, 85, 186, 190, 85, 108, 193, 109,
193, 107, 193, 193, 86, 193, 193, 193, 85, 182,
85, 182, 85, 193, 193, 17, 86, 193, 18, 86,
193, 19, 86, 193, 86, 86, 193, 193, 194, 86,
194, 86, 194, 193, 193, 85, 190, 193, 85, 190,
193, 85, 190, 86, 193, 193, 86, 86, 86, 193,
193, 190, 85, 190, 85, 193, 190, 85, 193, 193,
86, 86, 193, 193, 193, 193, 193, 193, 193, 193,
193, 193, 193, 193, 193, 193, 193, 193, 193, 193,
86, 86, 193, 86, 86, 193, 193, 193, 86, 86,
193, 193, 193
};
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
#endif
#if ! defined (YYSIZE_T) && defined (size_t)
# define YYSIZE_T size_t
#endif
#if ! defined (YYSIZE_T)
# if defined (__STDC__) || defined (__cplusplus)
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# endif
#endif
#if ! defined (YYSIZE_T)
# define YYSIZE_T unsigned int
#endif
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY (-2)
#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(Token, Value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
{ \
yychar = (Token); \
yylval = (Value); \
yytoken = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ \
yyerror ("syntax error: cannot back up");\
YYERROR; \
} \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
/* YYLLOC_DEFAULT -- Compute the default location (before the actions
are run). */
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
Current.first_line = Rhs[1].first_line; \
Current.first_column = Rhs[1].first_column; \
Current.last_line = Rhs[N].last_line; \
Current.last_column = Rhs[N].last_column;
#endif
/* YYLEX -- calling `yylex' with the right arguments. */
#ifdef YYLEX_PARAM
# define YYLEX yylex (YYLEX_PARAM)
#else
# define YYLEX yylex ()
#endif
/* Enable debugging if requested. */
#if YYDEBUG
# ifndef YYFPRINTF
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
# define YYFPRINTF fprintf
# endif
# define YYDPRINTF(Args) \
do { \
if (yydebug) \
YYFPRINTF Args; \
} while (0)
# define YYDSYMPRINT(Args) \
do { \
if (yydebug) \
yysymprint Args; \
} while (0)
# define YYDSYMPRINTF(Title, Token, Value, Location) \
do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yysymprint (stderr, \
Token, Value); \
YYFPRINTF (stderr, "\n"); \
} \
} while (0)
/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (cinluded). |
`------------------------------------------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
static void
yy_stack_print (short *bottom, short *top)
#else
static void
yy_stack_print (bottom, top)
short *bottom;
short *top;
#endif
{
YYFPRINTF (stderr, "Stack now");
for (/* Nothing. */; bottom <= top; ++bottom)
YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
# define YY_STACK_PRINT(Bottom, Top) \
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
} while (0)
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
static void
yy_reduce_print (int yyrule)
#else
static void
yy_reduce_print (yyrule)
int yyrule;
#endif
{
int yyi;
unsigned int yylineno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
yyrule - 1, yylineno);
/* Print the symbols being reduced, and their result. */
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
}
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
yy_reduce_print (Rule); \
} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
# define YYDSYMPRINT(Args)
# define YYDSYMPRINTF(Title, Token, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
/* YYINITDEPTH -- initial size of the parser's stacks. */
#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
if the built-in stack extension method is used).
Do not make this value too large; the results are undefined if
SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */
#if YYMAXDEPTH == 0
# undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif
#if YYERROR_VERBOSE
# ifndef yystrlen
# if defined (__GLIBC__) && defined (_STRING_H)
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
static YYSIZE_T
# if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
# else
yystrlen (yystr)
const char *yystr;
# endif
{
register const char *yys = yystr;
while (*yys++ != '\0')
continue;
return yys - yystr - 1;
}
# endif
# endif
# ifndef yystpcpy
# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
static char *
# if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
# else
yystpcpy (yydest, yysrc)
char *yydest;
const char *yysrc;
# endif
{
register char *yyd = yydest;
register const char *yys = yysrc;
while ((*yyd++ = *yys++) != '\0')
continue;
return yyd - 1;
}
# endif
# endif
#endif /* !YYERROR_VERBOSE */
#if YYDEBUG
/*--------------------------------.
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
static void
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
#else
static void
yysymprint (yyoutput, yytype, yyvaluep)
FILE *yyoutput;
int yytype;
YYSTYPE *yyvaluep;
#endif
{
/* Pacify ``unused variable'' warnings. */
(void) yyvaluep;
if (yytype < YYNTOKENS)
{
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
# ifdef YYPRINT
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# endif
}
else
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
switch (yytype)
{
default:
break;
}
YYFPRINTF (yyoutput, ")");
}
#endif /* ! YYDEBUG */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
#if defined (__STDC__) || defined (__cplusplus)
static void
yydestruct (int yytype, YYSTYPE *yyvaluep)
#else
static void
yydestruct (yytype, yyvaluep)
int yytype;
YYSTYPE *yyvaluep;
#endif
{
/* Pacify ``unused variable'' warnings. */
(void) yyvaluep;
switch (yytype)
{
default:
break;
}
}
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM);
# else
int yyparse ();
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
/* The lookahead symbol. */
int yychar;
/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
/* Number of syntax errors so far. */
int yynerrs;
/*----------.
| yyparse. |
`----------*/
#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM)
# else
int yyparse (YYPARSE_PARAM)
void *YYPARSE_PARAM;
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
int
yyparse (void)
#else
int
yyparse ()
#endif
#endif
{
register int yystate;
register int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
/* Lookahead token as an internal (translated) token number. */
int yytoken = 0;
/* Three stacks and their tools:
`yyss': related to states,
`yyvs': related to semantic values,
`yyls': related to locations.
Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
short yyssa[YYINITDEPTH];
short *yyss = yyssa;
register short *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
register YYSTYPE *yyvsp;
#define YYPOPSTACK (yyvsp--, yyssp--)
YYSIZE_T yystacksize = YYINITDEPTH;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
/* When reducing, the number of symbols on the RHS of the reduced
rule. */
int yylen;
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss;
yyvsp = yyvs;
goto yysetstate;
/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate. |
`------------------------------------------------------------*/
yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. so pushing a state here evens the stacks.
*/
yyssp++;
yysetstate:
*yyssp = yystate;
if (yyss + yystacksize - 1 <= yyssp)
{
/* Get the current used size of the three stacks, in elements. */
YYSIZE_T yysize = yyssp - yyss + 1;
#ifdef yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
YYSTYPE *yyvs1 = yyvs;
short *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow ("parser stack overflow",
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
yyss = yyss1;
yyvs = yyvs1;
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
goto yyoverflowlab;
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyoverflowlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH;
{
short *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyoverflowlab;
YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
goto yybackup;
/*-----------.
| yybackup. |
`-----------*/
yybackup:
/* Do appropriate processing given the current state. */
/* Read a lookahead token if we need one and don't already have one. */
/* yyresume: */
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
/* Not known => get a lookahead token if don't already have one. */
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
yychar = YYLEX;
}
if (yychar <= YYEOF)
{
yychar = yytoken = YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
else
{
yytoken = YYTRANSLATE (yychar);
YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
}
/* If the proper action on seeing token YYTOKEN is to reduce or to
detect an error, take that action. */
yyn += yytoken;
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
goto yydefault;
yyn = yytable[yyn];
if (yyn <= 0)
{
if (yyn == 0 || yyn == YYTABLE_NINF)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
if (yyn == YYFINAL)
YYACCEPT;
/* Shift the lookahead token. */
YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
yystate = yyn;
goto yynewstate;
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
goto yyreduce;
/*-----------------------------.
| yyreduce -- Do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
`$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
users should not rely upon it. Assigning to YYVAL
unconditionally makes the parser a bit smaller, and it avoids a
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
case 7:
#line 196 "parser.yxx"
{
DCAST(EggData, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
break;
case 22:
#line 235 "parser.yxx"
{
string strval = yyvsp[-1]._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 23:
#line 258 "parser.yxx"
{
yyval._egg = new EggComment(yyvsp[-3]._string, yyvsp[-1]._string);
}
break;
case 24:
#line 272 "parser.yxx"
{
string tref_name = yyvsp[-2]._string;
Filename filename = yyvsp[0]._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 25:
#line 285 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 27:
#line 301 "parser.yxx"
{
EggTexture *texture = DCAST(EggTexture, egg_stack.back());
string name = yyvsp[-3]._string;
double value = yyvsp[-1]._number;
string strval = yyvsp[-1]._string;
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, "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, "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, "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 {
eggyywarning("Unsupported texture scalar: " + name);
}
}
break;
case 29:
#line 419 "parser.yxx"
{
string mref_name = yyvsp[-1]._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 30:
#line 431 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 32:
#line 447 "parser.yxx"
{
EggMaterial *material = DCAST(EggMaterial, egg_stack.back());
string name = yyvsp[-3]._string;
double value = yyvsp[-1]._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 33:
#line 542 "parser.yxx"
{
string node_name = yyvsp[-3]._string;
Filename filename = yyvsp[-1]._string;
EggExternalReference *ref = new EggExternalReference(node_name, filename);
yyval._egg = ref;
}
break;
case 34:
#line 549 "parser.yxx"
{
if (cmp_nocase_uh(yyvsp[-5]._string, "group") != 0) {
eggyyerror("keyword 'group' expected");
}
string node_name = yyvsp[-3]._string;
Filename filename = yyvsp[-1]._string;
EggExternalReference *ref = new EggExternalReference(node_name, filename);
yyval._egg = ref;
}
break;
case 35:
#line 569 "parser.yxx"
{
string name = yyvsp[0]._string;
EggVertexPool *pool = new EggVertexPool(name);
if (vertex_pools.find(name) != vertex_pools.end()) {
eggyywarning("Duplicate vertex pool name " + name);
}
vertex_pools[name] = pool;
egg_stack.push_back(pool);
}
break;
case 36:
#line 581 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 39:
#line 609 "parser.yxx"
{
egg_stack.push_back(new EggVertex);
}
break;
case 40:
#line 613 "parser.yxx"
{
PT(EggVertex) vtx = DCAST(EggVertex, egg_stack.back());
egg_stack.pop_back();
DCAST(EggVertexPool, egg_stack.back())->add_vertex(vtx);
}
break;
case 41:
#line 620 "parser.yxx"
{
vertex_index = (int)yyvsp[0]._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->get_vertex(vertex_index) != NULL) {
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 42:
#line 645 "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 43:
#line 666 "parser.yxx"
{
DCAST(EggVertex, egg_stack.back())->set_pos(yyvsp[0]._number);
}
break;
case 44:
#line 670 "parser.yxx"
{
DCAST(EggVertex, egg_stack.back())->set_pos(LPoint2d(yyvsp[-1]._number, yyvsp[0]._number));
}
break;
case 45:
#line 674 "parser.yxx"
{
DCAST(EggVertex, egg_stack.back())->set_pos(LPoint3d(yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
break;
case 46:
#line 678 "parser.yxx"
{
DCAST(EggVertex, egg_stack.back())->set_pos(LPoint4d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
break;
case 50:
#line 685 "parser.yxx"
{
bool inserted = DCAST(EggVertex, egg_stack.back())->_dxyzs.
insert(EggMorphVertex(yyvsp[-5]._string, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second;
if (!inserted) {
eggyywarning("Ignoring repeated morph name " + yyvsp[-5]._string);
}
}
break;
case 51:
#line 693 "parser.yxx"
{
bool inserted = DCAST(EggVertex, egg_stack.back())->_dxyzs.
insert(EggMorphVertex(yyvsp[-4]._string, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second;
if (!inserted) {
eggyywarning("Ignoring repeated morph name " + yyvsp[-4]._string);
}
}
break;
case 52:
#line 712 "parser.yxx"
{
DCAST(EggVertex, egg_stack.back())->set_uv(TexCoordd(yyvsp[-1]._number, yyvsp[0]._number));
}
break;
case 53:
#line 716 "parser.yxx"
{
bool inserted = DCAST(EggVertex, egg_stack.back())->_duvs.
insert(EggMorphTexCoord(yyvsp[-4]._string, LVector2d(yyvsp[-2]._number, yyvsp[-1]._number))).second;
if (!inserted) {
eggyywarning("Ignoring repeated morph name " + yyvsp[-4]._string);
}
}
break;
case 54:
#line 724 "parser.yxx"
{
bool inserted = DCAST(EggVertex, egg_stack.back())->_duvs.
insert(EggMorphTexCoord(yyvsp[-3]._string, LVector2d(yyvsp[-2]._number, yyvsp[-1]._number))).second;
if (!inserted) {
eggyywarning("Ignoring repeated morph name " + yyvsp[-3]._string);
}
}
break;
case 55:
#line 742 "parser.yxx"
{
DCAST(EggVertex, egg_stack.back())->set_normal(Normald(yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
break;
case 56:
#line 746 "parser.yxx"
{
bool inserted = DCAST(EggVertex, egg_stack.back())->_dnormals.
insert(EggMorphNormal(yyvsp[-5]._string, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second;
if (!inserted) {
eggyywarning("Ignoring repeated morph name " + yyvsp[-5]._string);
}
}
break;
case 57:
#line 754 "parser.yxx"
{
bool inserted = DCAST(EggVertex, egg_stack.back())->_dnormals.
insert(EggMorphNormal(yyvsp[-4]._string, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second;
if (!inserted) {
eggyywarning("Ignoring repeated morph name " + yyvsp[-4]._string);
}
}
break;
case 58:
#line 772 "parser.yxx"
{
DCAST(EggVertex, egg_stack.back())->set_color(Colorf(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
break;
case 59:
#line 776 "parser.yxx"
{
bool inserted = DCAST(EggVertex, egg_stack.back())->_drgbas.
insert(EggMorphColor(yyvsp[-6]._string, LVector4f(yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second;
if (!inserted) {
eggyywarning("Ignoring repeated morph name " + yyvsp[-6]._string);
}
}
break;
case 60:
#line 784 "parser.yxx"
{
bool inserted = DCAST(EggVertex, egg_stack.back())->_drgbas.
insert(EggMorphColor(yyvsp[-5]._string, LVector4f(yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second;
if (!inserted) {
eggyywarning("Ignoring repeated morph name " + yyvsp[-5]._string);
}
}
break;
case 61:
#line 802 "parser.yxx"
{
EggGroup *group = new EggGroup(yyvsp[0]._string);
egg_stack.push_back(group);
}
break;
case 62:
#line 807 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 63:
#line 822 "parser.yxx"
{
EggGroup *group = new EggGroup(yyvsp[0]._string);
group->set_group_type(EggGroup::GT_joint);
egg_stack.push_back(group);
}
break;
case 64:
#line 828 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 65:
#line 843 "parser.yxx"
{
EggGroup *group = new EggGroup(yyvsp[0]._string);
group->set_group_type(EggGroup::GT_instance);
egg_stack.push_back(group);
}
break;
case 66:
#line 849 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 68:
#line 865 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
string name = yyvsp[-3]._string;
double value = yyvsp[-1]._number;
unsigned long ulong_value = yyvsp[-1]._ulong;
string strval = yyvsp[-1]._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, "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 {
eggyywarning("Unknown group scalar " + name);
}
}
break;
case 69:
#line 919 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
string strval = yyvsp[-1]._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 70:
#line 931 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
group->set_billboard_center(LPoint3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number));
}
break;
case 71:
#line 936 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
string name = yyvsp[-4]._string;
group->set_collision_name(name);
}
break;
case 72:
#line 943 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
int value = (int)yyvsp[-1]._number;
group->set_dcs_type(value!=0 ? EggGroup::DC_default : EggGroup::DC_none);
}
break;
case 73:
#line 949 "parser.yxx"
{
// The special flavor of DCS, with { sync } or { nosync }.
EggGroup *group = DCAST(EggGroup, egg_stack.back());
string strval = yyvsp[-1]._string;
EggGroup::DCSType f = EggGroup::string_dcs_type(strval);
if (f == EggGroup::DC_none) {
eggyywarning("Unknown DCS type " + strval);
} else {
group->set_dcs_type(f);
}
}
break;
case 74:
#line 962 "parser.yxx"
{
// The traditional flavor of DART, with { 0 } or { 1 }.
EggGroup *group = DCAST(EggGroup, egg_stack.back());
int value = (int)yyvsp[-1]._number;
group->set_dart_type(value!=0 ? EggGroup::DT_default : EggGroup::DT_none);
}
break;
case 75:
#line 969 "parser.yxx"
{
// The special flavor of DART, with { sync } or { nosync }.
EggGroup *group = DCAST(EggGroup, egg_stack.back());
string strval = yyvsp[-1]._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 76:
#line 982 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
int value = (int)yyvsp[-1]._number;
group->set_switch_flag(value!=0);
}
break;
case 77:
#line 988 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
string type = yyvsp[-1]._string;
group->add_object_type(type);
}
break;
case 78:
#line 994 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
int value = (int)yyvsp[-1]._number;
group->set_model_flag(value!=0);
}
break;
case 79:
#line 1000 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
group->set_tag(yyvsp[-3]._string, yyvsp[-1]._string);
}
break;
case 80:
#line 1005 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
int value = (int)yyvsp[-1]._number;
group->set_texlist_flag(value!=0);
}
break;
case 84:
#line 1014 "parser.yxx"
{
DCAST(EggGroup, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
break;
case 85:
#line 1028 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
string strval = yyvsp[0]._string;
EggGroup::CollisionSolidType f = EggGroup::string_cs_type(strval);
if (f == EggGroup::CST_none) {
eggyywarning("Unknown collision solid type " + strval);
} else {
group->set_cs_type(f);
}
}
break;
case 87:
#line 1051 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
string strval = yyvsp[0]._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 88:
#line 1073 "parser.yxx"
{
DCAST(EggGroup, egg_stack.back())->clear_transform();
}
break;
case 98:
#line 1099 "parser.yxx"
{
DCAST(EggGroup, egg_stack.back())->add_translate(LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number));
}
break;
case 99:
#line 1105 "parser.yxx"
{
DCAST(EggGroup, egg_stack.back())->add_rotx(yyvsp[-1]._number);
}
break;
case 100:
#line 1111 "parser.yxx"
{
DCAST(EggGroup, egg_stack.back())->add_roty(yyvsp[-1]._number);
}
break;
case 101:
#line 1117 "parser.yxx"
{
DCAST(EggGroup, egg_stack.back())->add_rotz(yyvsp[-1]._number);
}
break;
case 102:
#line 1123 "parser.yxx"
{
DCAST(EggGroup, egg_stack.back())->add_rotate(yyvsp[-4]._number, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number));
}
break;
case 103:
#line 1129 "parser.yxx"
{
DCAST(EggGroup, egg_stack.back())->add_scale(LVecBase3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number));
}
break;
case 104:
#line 1133 "parser.yxx"
{
DCAST(EggGroup, egg_stack.back())->add_uniform_scale(yyvsp[-1]._number);
}
break;
case 107:
#line 1148 "parser.yxx"
{
DCAST(EggGroup, egg_stack.back())->add_matrix
(LMatrix4d(yyvsp[-15]._number, yyvsp[-14]._number, yyvsp[-13]._number, yyvsp[-12]._number,
yyvsp[-11]._number, yyvsp[-10]._number, yyvsp[-9]._number, yyvsp[-8]._number,
yyvsp[-7]._number, yyvsp[-6]._number, yyvsp[-5]._number, yyvsp[-4]._number,
yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
break;
case 108:
#line 1167 "parser.yxx"
{
matrix_2d = LMatrix3d::ident_mat();
}
break;
case 109:
#line 1171 "parser.yxx"
{
DCAST(EggTexture, egg_stack.back())->set_transform(matrix_2d);
}
break;
case 115:
#line 1193 "parser.yxx"
{
matrix_2d *= LMatrix3d::translate_mat(yyvsp[-2]._number, yyvsp[-1]._number);
}
break;
case 116:
#line 1199 "parser.yxx"
{
matrix_2d *= LMatrix3d::rotate_mat(yyvsp[-1]._number);
}
break;
case 117:
#line 1205 "parser.yxx"
{
matrix_2d *= LMatrix3d::scale_mat(yyvsp[-2]._number, yyvsp[-1]._number);
}
break;
case 120:
#line 1218 "parser.yxx"
{
matrix_2d *= LMatrix3d(yyvsp[-8]._number, yyvsp[-7]._number, yyvsp[-6]._number,
yyvsp[-5]._number, yyvsp[-4]._number, yyvsp[-3]._number,
yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number);
}
break;
case 121:
#line 1235 "parser.yxx"
{
if (yyvsp[-2]._egg != (EggVertexPool *)NULL) {
EggVertexPool *pool = DCAST(EggVertexPool, yyvsp[-2]._egg);
EggGroup *group = DCAST(EggGroup, egg_stack.back());
PTA_double nums = yyvsp[-6]._number_list;
double membership = yyvsp[-5]._number;
for (int i = 0; i < (int)nums.size(); i++) {
int index = (int)nums[i];
EggVertex *vertex = pool->get_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 122:
#line 1268 "parser.yxx"
{
yyval._number = 1.0;
}
break;
case 123:
#line 1272 "parser.yxx"
{
string name = yyvsp[-3]._string;
double value = yyvsp[-1]._number;
double result = yyvsp[-5]._number;
if (cmp_nocase_uh(name, "membership") == 0) {
result = value;
} else {
eggyywarning("Unknown group vertex scalar " + name);
}
yyval._number = result;
}
break;
case 125:
#line 1309 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
group->set_lod(EggSwitchConditionDistance(yyvsp[-8]._number, yyvsp[-7]._number, LPoint3d(yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number)));
}
break;
case 126:
#line 1314 "parser.yxx"
{
EggGroup *group = DCAST(EggGroup, egg_stack.back());
group->set_lod(EggSwitchConditionDistance(yyvsp[-9]._number, yyvsp[-8]._number, LPoint3d(yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number), yyvsp[-7]._number));
}
break;
case 127:
#line 1331 "parser.yxx"
{
egg_stack.push_back(new EggPolygon(yyvsp[0]._string));
}
break;
case 128:
#line 1335 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 129:
#line 1350 "parser.yxx"
{
egg_stack.push_back(new EggPoint(yyvsp[0]._string));
}
break;
case 130:
#line 1354 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 131:
#line 1369 "parser.yxx"
{
egg_stack.push_back(new EggNurbsSurface(yyvsp[0]._string));
}
break;
case 132:
#line 1373 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 133:
#line 1388 "parser.yxx"
{
egg_stack.push_back(new EggNurbsCurve(yyvsp[0]._string));
}
break;
case 134:
#line 1392 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 143:
#line 1416 "parser.yxx"
{
EggPrimitive *primitive = DCAST(EggPrimitive, egg_stack.back());
string name = yyvsp[-3]._string;
double value = yyvsp[-1]._number;
string strval = yyvsp[-1]._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, "draw_order") == 0) {
primitive->set_draw_order((int)value);
} else if (cmp_nocase_uh(name, "bin") == 0) {
primitive->set_bin(strval);
} else {
eggyywarning("Unknown scalar " + name);
}
}
break;
case 155:
#line 1476 "parser.yxx"
{
EggNurbsCurve *curve = DCAST(EggNurbsCurve, yyvsp[0]._egg);
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
nurbs->_curves_on_surface.push_back(curve);
}
break;
case 157:
#line 1483 "parser.yxx"
{
EggNurbsSurface *primitive = DCAST(EggNurbsSurface, egg_stack.back());
string name = yyvsp[-3]._string;
double value = yyvsp[-1]._number;
string strval = yyvsp[-1]._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, "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 168:
#line 1547 "parser.yxx"
{
EggNurbsCurve *primitive = DCAST(EggNurbsCurve, egg_stack.back());
string name = yyvsp[-3]._string;
double value = yyvsp[-1]._number;
string strval = yyvsp[-1]._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, "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 169:
#line 1606 "parser.yxx"
{
if (yyvsp[0]._egg != (EggTexture *)NULL) {
EggTexture *texture = DCAST(EggTexture, yyvsp[0]._egg);
DCAST(EggPrimitive, egg_stack.back())->set_texture(texture);
}
}
break;
case 170:
#line 1623 "parser.yxx"
{
EggTexture *texture = NULL;
// Defining a texture on-the-fly.
Filename filename = yyvsp[0]._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())->set_texture(texture);
}
break;
case 171:
#line 1663 "parser.yxx"
{
if (yyvsp[0]._egg != (EggMaterial *)NULL) {
EggMaterial *material = DCAST(EggMaterial, yyvsp[0]._egg);
DCAST(EggPrimitive, egg_stack.back())->set_material(material);
}
}
break;
case 172:
#line 1680 "parser.yxx"
{
DCAST(EggPrimitive, egg_stack.back())->set_normal(Normald(yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
break;
case 173:
#line 1684 "parser.yxx"
{
bool inserted = DCAST(EggPrimitive, egg_stack.back())->_dnormals.
insert(EggMorphNormal(yyvsp[-5]._string, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second;
if (!inserted) {
eggyywarning("Ignoring repeated morph name " + yyvsp[-5]._string);
}
}
break;
case 174:
#line 1692 "parser.yxx"
{
bool inserted = DCAST(EggPrimitive, egg_stack.back())->_dnormals.
insert(EggMorphNormal(yyvsp[-4]._string, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second;
if (!inserted) {
eggyywarning("Ignoring repeated morph name " + yyvsp[-4]._string);
}
}
break;
case 175:
#line 1710 "parser.yxx"
{
DCAST(EggPrimitive, egg_stack.back())->set_color(Colorf(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
break;
case 176:
#line 1714 "parser.yxx"
{
bool inserted = DCAST(EggPrimitive, egg_stack.back())->_drgbas.
insert(EggMorphColor(yyvsp[-6]._string, LVector4f(yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second;
if (!inserted) {
eggyywarning("Ignoring repeated morph name " + yyvsp[-6]._string);
}
}
break;
case 177:
#line 1722 "parser.yxx"
{
bool inserted = DCAST(EggPrimitive, egg_stack.back())->_drgbas.
insert(EggMorphColor(yyvsp[-5]._string, LVector4f(yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second;
if (!inserted) {
eggyywarning("Ignoring repeated morph name " + yyvsp[-5]._string);
}
}
break;
case 178:
#line 1740 "parser.yxx"
{
EggPrimitive *primitive = DCAST(EggPrimitive, egg_stack.back());
int value = (int)yyvsp[0]._number;
primitive->set_bface_flag(value!=0);
}
break;
case 179:
#line 1756 "parser.yxx"
{
if (yyvsp[-2]._egg != (EggVertexPool *)NULL) {
EggVertexPool *pool = DCAST(EggVertexPool, yyvsp[-2]._egg);
EggPrimitive *prim = DCAST(EggPrimitive, egg_stack.back());
PTA_double nums = yyvsp[-5]._number_list;
for (int i = 0; i < (int)nums.size(); i++) {
int index = (int)nums[i];
EggVertex *vertex = pool->get_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 180:
#line 1787 "parser.yxx"
{
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
int u_order = (int)yyvsp[-1]._number;
int v_order = (int)yyvsp[0]._number;
nurbs->set_u_order(u_order);
nurbs->set_v_order(v_order);
}
break;
case 181:
#line 1805 "parser.yxx"
{
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
PTA_double nums = yyvsp[0]._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 182:
#line 1825 "parser.yxx"
{
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
PTA_double nums = yyvsp[0]._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 183:
#line 1845 "parser.yxx"
{
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
nurbs->_trims.push_back(EggNurbsSurface::Trim());
}
break;
case 185:
#line 1861 "parser.yxx"
{
EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
nassertr(!nurbs->_trims.empty(), 0);
nurbs->_trims.back().push_back(EggNurbsSurface::Loop());
}
break;
case 186:
#line 1867 "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[0]._egg);
nurbs->_trims.back().back().push_back(curve);
}
break;
case 187:
#line 1886 "parser.yxx"
{
EggNurbsCurve *nurbs = DCAST(EggNurbsCurve, egg_stack.back());
int order = (int)yyvsp[0]._number;
nurbs->set_order(order);
}
break;
case 188:
#line 1902 "parser.yxx"
{
EggNurbsCurve *nurbs = DCAST(EggNurbsCurve, egg_stack.back());
PTA_double nums = yyvsp[0]._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 189:
#line 1923 "parser.yxx"
{
EggTable *table = new EggTable(yyvsp[0]._string);
table->set_table_type(EggTable::TT_table);
egg_stack.push_back(table);
}
break;
case 190:
#line 1929 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 191:
#line 1945 "parser.yxx"
{
EggTable *table = new EggTable(yyvsp[0]._string);
table->set_table_type(EggTable::TT_bundle);
egg_stack.push_back(table);
}
break;
case 192:
#line 1951 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 194:
#line 1968 "parser.yxx"
{
DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
break;
case 195:
#line 1972 "parser.yxx"
{
DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
break;
case 196:
#line 1976 "parser.yxx"
{
DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
break;
case 197:
#line 1980 "parser.yxx"
{
DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
break;
case 198:
#line 1984 "parser.yxx"
{
DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
break;
case 199:
#line 1999 "parser.yxx"
{
EggSAnimData *anim_data = new EggSAnimData(yyvsp[0]._string);
egg_stack.push_back(anim_data);
}
break;
case 200:
#line 2004 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 202:
#line 2021 "parser.yxx"
{
EggSAnimData *anim_data = DCAST(EggSAnimData, egg_stack.back());
string name = yyvsp[-3]._string;
double value = yyvsp[-1]._number;
if (cmp_nocase_uh(name, "fps") == 0) {
anim_data->set_fps(value);
} else {
eggyywarning("Unsupported S$Anim scalar: " + name);
}
}
break;
case 203:
#line 2033 "parser.yxx"
{
DCAST(EggSAnimData, egg_stack.back())->set_data(yyvsp[-1]._number_list);
}
break;
case 204:
#line 2047 "parser.yxx"
{
EggXfmAnimData *anim_data = new EggXfmAnimData(yyvsp[0]._string);
egg_stack.push_back(anim_data);
}
break;
case 205:
#line 2052 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 207:
#line 2069 "parser.yxx"
{
EggXfmAnimData *anim_data = DCAST(EggXfmAnimData, egg_stack.back());
string name = yyvsp[-3]._string;
double value = yyvsp[-1]._number;
string strval = yyvsp[-1]._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 208:
#line 2086 "parser.yxx"
{
DCAST(EggXfmAnimData, egg_stack.back())->set_data(yyvsp[-1]._number_list);
}
break;
case 209:
#line 2100 "parser.yxx"
{
EggXfmSAnim *anim_group = new EggXfmSAnim(yyvsp[0]._string);
egg_stack.push_back(anim_group);
}
break;
case 210:
#line 2105 "parser.yxx"
{
yyval._egg = egg_stack.back();
egg_stack.pop_back();
}
break;
case 212:
#line 2122 "parser.yxx"
{
EggXfmSAnim *anim_group = DCAST(EggXfmSAnim, egg_stack.back());
string name = yyvsp[-3]._string;
double value = yyvsp[-1]._number;
string strval = yyvsp[-1]._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 213:
#line 2137 "parser.yxx"
{
DCAST(EggXfmSAnim, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
break;
case 214:
#line 2152 "parser.yxx"
{
yyval._number_list = PTA_double::empty_array(0);
}
break;
case 215:
#line 2156 "parser.yxx"
{
yyval._number_list.push_back((double)yyvsp[0]._number);
}
break;
case 216:
#line 2170 "parser.yxx"
{
yyval._number_list = PTA_double::empty_array(0);
}
break;
case 217:
#line 2174 "parser.yxx"
{
yyval._number_list.push_back(yyvsp[0]._number);
}
break;
case 218:
#line 2188 "parser.yxx"
{
string name = yyvsp[0]._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 219:
#line 2209 "parser.yxx"
{
string name = yyvsp[0]._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 220:
#line 2230 "parser.yxx"
{
string name = yyvsp[0]._string;
VertexPools::iterator vpi = vertex_pools.find(name);
if (vpi == vertex_pools.end()) {
eggyyerror("Unknown vertex pool " + name);
yyval._egg = PT(EggObject)();
} else {
yyval._egg = (*vpi).second;
}
}
break;
case 221:
#line 2252 "parser.yxx"
{
eggyyerror("Name required.");
yyval._string = "";
}
break;
case 224:
#line 2281 "parser.yxx"
{
eggyyerror("String required.");
yyval._string = "";
}
break;
case 226:
#line 2297 "parser.yxx"
{
yyval._string = "";
}
break;
case 228:
#line 2315 "parser.yxx"
{
yyval._string = yyvsp[0]._string;
}
break;
case 229:
#line 2319 "parser.yxx"
{
yyval._string = yyvsp[0]._string;
}
break;
case 231:
#line 2336 "parser.yxx"
{
yyval._string = "";
}
break;
case 232:
#line 2340 "parser.yxx"
{
yyval._string = yyvsp[0]._string;
}
break;
case 233:
#line 2356 "parser.yxx"
{
yyval._string = yyvsp[0]._string;
}
break;
case 234:
#line 2360 "parser.yxx"
{
yyval._string = yyvsp[-1]._string + "\n" + yyvsp[0]._string;
}
break;
case 236:
#line 2375 "parser.yxx"
{
yyval._number = yyvsp[0]._ulong;
}
break;
case 237:
#line 2390 "parser.yxx"
{
yyval._number = yyvsp[0]._number;
yyval._ulong = (unsigned long)yyvsp[0]._number;
yyval._string = yyvsp[0]._string;
}
break;
case 238:
#line 2396 "parser.yxx"
{
yyval._number = yyvsp[0]._ulong;
yyval._ulong = yyvsp[0]._ulong;
yyval._string = yyvsp[0]._string;
}
break;
case 239:
#line 2402 "parser.yxx"
{
yyval._number = 0.0;
yyval._ulong = 0;
yyval._string = yyvsp[0]._string;
}
break;
case 240:
#line 2419 "parser.yxx"
{
int i = (int)yyvsp[0]._number;
if ((double)i != yyvsp[0]._number) {
eggyywarning("Integer expected.");
yyval._number = (double)i;
}
}
break;
case 241:
#line 2427 "parser.yxx"
{
yyval._number = yyvsp[0]._ulong;
}
break;
}
/* Line 991 of yacc.c. */
#line 3739 "y.tab.c"
yyvsp -= yylen;
yyssp -= yylen;
YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
/* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTOKENS];
goto yynewstate;
/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
#if YYERROR_VERBOSE
yyn = yypact[yystate];
if (YYPACT_NINF < yyn && yyn < YYLAST)
{
YYSIZE_T yysize = 0;
int yytype = YYTRANSLATE (yychar);
char *yymsg;
int yyx, yycount;
yycount = 0;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
for (yyx = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
yysize += yystrlen (yytname[yyx]) + 15, yycount++;
yysize += yystrlen ("syntax error, unexpected ") + 1;
yysize += yystrlen (yytname[yytype]);
yymsg = (char *) YYSTACK_ALLOC (yysize);
if (yymsg != 0)
{
char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
yyp = yystpcpy (yyp, yytname[yytype]);
if (yycount < 5)
{
yycount = 0;
for (yyx = yyn < 0 ? -yyn : 0;
yyx < (int) (sizeof (yytname) / sizeof (char *));
yyx++)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
const char *yyq = ! yycount ? ", expecting " : " or ";
yyp = yystpcpy (yyp, yyq);
yyp = yystpcpy (yyp, yytname[yyx]);
yycount++;
}
}
yyerror (yymsg);
YYSTACK_FREE (yymsg);
}
else
yyerror ("syntax error; also virtual memory exhausted");
}
else
#endif /* YYERROR_VERBOSE */
yyerror ("syntax error");
}
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse lookahead token after an
error, discard it. */
/* Return failure if at end of input. */
if (yychar == YYEOF)
{
/* Pop the error token. */
YYPOPSTACK;
/* Pop the rest of the stack. */
while (yyss < yyssp)
{
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
yydestruct (yystos[*yyssp], yyvsp);
YYPOPSTACK;
}
YYABORT;
}
YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
yydestruct (yytoken, &yylval);
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token after shifting the error
token. */
goto yyerrlab2;
/*----------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action. |
`----------------------------------------------------*/
yyerrlab1:
/* Suppress GCC warning that yyerrlab1 is unused when no action
invokes YYERROR. */
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
__attribute__ ((__unused__))
#endif
goto yyerrlab2;
/*---------------------------------------------------------------.
| yyerrlab2 -- pop states until the error token can be shifted. |
`---------------------------------------------------------------*/
yyerrlab2:
yyerrstatus = 3; /* Each real token shifted decrements this. */
for (;;)
{
yyn = yypact[yystate];
if (yyn != YYPACT_NINF)
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
{
yyn = yytable[yyn];
if (0 < yyn)
break;
}
}
/* Pop the current state because it cannot handle the error token. */
if (yyssp == yyss)
YYABORT;
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
yydestruct (yystos[yystate], yyvsp);
yyvsp--;
yystate = *--yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
if (yyn == YYFINAL)
YYACCEPT;
YYDPRINTF ((stderr, "Shifting error token, "));
*++yyvsp = yylval;
yystate = yyn;
goto yynewstate;
/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here. |
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
goto yyreturn;
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
goto yyreturn;
#ifndef yyoverflow
/*----------------------------------------------.
| yyoverflowlab -- parser overflow comes here. |
`----------------------------------------------*/
yyoverflowlab:
yyerror ("parser stack overflow");
yyresult = 2;
/* Fall through. */
#endif
yyreturn:
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
return yyresult;
}