/* A Bison parser, made from parser.yxx
   by GNU bison 1.35.  */

#define YYBISON 1  /* Identify Bison output.  */

#define yyparse eggyyparse
#define yylex eggyylex
#define yyerror eggyyerror
#define yylval eggyylval
#define yychar eggyychar
#define yydebug eggyydebug
#define yynerrs eggyynerrs
# define	NUMBER	257
# define	ULONG	258
# define	STRING	259
# define	BEZIERCURVE	260
# define	BFACE	261
# define	BILLBOARD	262
# define	BILLBOARDCENTER	263
# define	BUNDLE	264
# define	CLOSED	265
# define	COLLIDE	266
# define	COMMENT	267
# define	COORDSYSTEM	268
# define	CV	269
# define	DART	270
# define	DNORMAL	271
# define	DRGBA	272
# define	DUV	273
# define	DXYZ	274
# define	DCS	275
# define	DISTANCE	276
# define	DTREF	277
# define	DYNAMICVERTEXPOOL	278
# define	EXTERNAL_FILE	279
# define	FLIGHT	280
# define	GROUP	281
# define	HIP	282
# define	INTANGENT	283
# define	JOINT	284
# define	KNOTS	285
# define	INCLUDE	286
# define	INSTANCE	287
# define	LINE	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

#line 6 "parser.yxx"


#include "pandabase.h"
#include "config_egg.h"
#include "parserDefs.h"
#include "lexerDefs.h"
#include "eggObject.h"
#include "eggGroup.h"
#include "eggVertex.h"
#include "eggVertexPool.h"
#include "eggVertexUV.h"
#include "eggPolygon.h"
#include "eggPoint.h"
#include "eggLine.h"
#include "eggNurbsSurface.h"
#include "eggNurbsCurve.h"
#include "eggTable.h"
#include "eggSAnimData.h"
#include "eggXfmSAnim.h"
#include "eggXfmAnimData.h"
#include "eggTexture.h"
#include "eggMaterial.h"
#include "eggComment.h"
#include "eggCoordinateSystem.h"
#include "eggExternalReference.h"
#include "eggData.h"
#include "pt_EggTexture.h"
#include "pt_EggMaterial.h"

#include "string_utils.h"
#include "filename.h"
#include "luse.h"
#include "lmatrix.h"
#include "coordinateSystem.h"
#include "pvector.h"
#include "dcast.h"

// Because our token type contains objects of type string, which
// require correct copy construction (and not simply memcpying), we
// cannot use bison's built-in auto-stack-grow feature.  As an easy
// solution, we ensure here that we have enough yacc stack to start
// with, and that it doesn't ever try to grow.
#define YYINITDEPTH 1000
#define YYMAXDEPTH 1000

// We need a stack of EggObject pointers.  Each time we encounter a
// nested EggObject of some kind, we'll allocate a new one of these
// and push it onto the stack.  At any given time, the top of the
// stack is the EggObject we are currently scanning.

typedef pvector< PT(EggObject) > EggStack;
static EggStack egg_stack;

// There's one "top-level" egg node, which is where we should parent
// things (e.g. implicit textures) encountered in the egg file that
// don't have an explicit place in the tree.  If this is NULL, such
// things won't be parented anywhere.
static EggGroupNode *egg_top_node;

// We need a table mapping vertex pool names to vertex pools.
typedef pmap<string,  PT(EggVertexPool) > VertexPools;
static VertexPools vertex_pools;

// And another one mapping texture names to textures.
typedef pmap<string,  PT_EggTexture > Textures;
static Textures textures;

// And again for material names to materials.
typedef pmap<string,  PT_EggMaterial > Materials;
static Materials materials;

// We need to be able to save the index number requested for a vertex
// temporarily.
static int vertex_index;

// We need to hold a matrix for a little bit while parsing the
// <Transform> entries.
static LMatrix3d matrix_2d;


////////////////////////////////////////////////////////////////////
// Defining the interface to the parser.
////////////////////////////////////////////////////////////////////

void
egg_init_parser(istream &in, const string &filename,
                EggObject *tos, EggGroupNode *top_node) {
  egg_init_lexer(in, filename);

  egg_stack.clear();
  vertex_pools.clear();
  textures.clear();
  materials.clear();

  egg_stack.push_back(tos);
  egg_top_node = top_node;
}

void
egg_cleanup_parser() {
  // Check for undefined vertex pools.
  VertexPools::const_iterator vpi;
  for (vpi = vertex_pools.begin(); vpi != vertex_pools.end(); ++vpi) {
    EggVertexPool *pool = (*vpi).second;
    if (pool->has_forward_vertices()) {
      if (!pool->has_defined_vertices()) {
        eggyyerror("Undefined vertex pool " + pool->get_name());
      } else {
        eggyyerror("Undefined vertices in pool " + pool->get_name());
        
        egg_cat.error(false)
          << "Undefined vertex index numbers:";
        EggVertexPool::const_iterator vi;
        for (vi = pool->begin(); vi != pool->end(); ++vi) {
          EggVertex *vertex = (*vi);
          if (vertex->is_forward_reference()) {
            egg_cat.error(false)
              << " " << vertex->get_index();
          }
        }
        egg_cat.error(false) 
          << "\n";
      }
    }
  }

  // Clean these out after we're done, so we don't keep big memory
  // structures around needlessly.
  egg_stack.clear();
  vertex_pools.clear();
  textures.clear();
  materials.clear();
}

#ifndef YYDEBUG
# define YYDEBUG 0
#endif



#define	YYFINAL		692
#define	YYFLAG		-32768
#define	YYNTBASE	88

/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
#define YYTRANSLATE(x) ((unsigned)(x) <= 339 ? yytranslate[x] : 200)

/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
static const char yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,    86,     2,    87,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     3,     4,     5,
       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
      16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
      26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
      36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
      46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
      56,    57,    58,    59,    60,    61,    62,    63,    64,    65,
      66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
      76,    77,    78,    79,    80,    81,    82,    83,    84,    85
};

#if YYDEBUG
static const short yyprhs[] =
{
       0,     0,     3,     6,     9,    12,    14,    17,    19,    21,
      23,    25,    27,    29,    31,    33,    35,    37,    39,    41,
      43,    45,    47,    52,    58,    59,    67,    69,    76,    79,
      80,    87,    89,    96,   102,   109,   110,   117,   119,   122,
     123,   129,   130,   137,   139,   142,   146,   151,   152,   160,
     166,   172,   181,   190,   193,   201,   209,   213,   222,   231,
     236,   246,   256,   257,   264,   265,   272,   273,   280,   282,
     289,   295,   303,   311,   317,   323,   329,   335,   341,   347,
     353,   360,   366,   369,   372,   375,   378,   380,   382,   385,
     386,   392,   394,   397,   400,   403,   406,   409,   412,   415,
     422,   427,   432,   437,   445,   452,   457,   462,   464,   481,
     482,   488,   490,   493,   496,   499,   502,   508,   513,   519,
     524,   526,   536,   546,   548,   555,   560,   572,   585,   586,
     593,   594,   601,   602,   609,   610,   617,   618,   625,   627,
     633,   639,   645,   648,   654,   660,   666,   673,   675,   681,
     687,   693,   696,   702,   708,   714,   720,   726,   732,   735,
     741,   748,   750,   756,   762,   768,   771,   777,   783,   789,
     795,   801,   808,   810,   812,   814,   818,   827,   836,   841,
     851,   861,   863,   872,   875,   877,   879,   881,   887,   889,
     892,   894,   896,   897,   904,   905,   912,   914,   917,   920,
     923,   926,   929,   930,   937,   939,   946,   952,   953,   960,
     962,   969,   975,   976,   983,   985,   992,   995,   997,  1000,
    1002,  1005,  1007,  1009,  1011,  1013,  1015,  1017,  1019,  1021,
    1023,  1025,  1027,  1029,  1031,  1033,  1035,  1037,  1040,  1042,
    1044,  1046,  1048,  1050,  1052,  1054
};
static const short yyrhs[] =
{
      82,    89,     0,    83,   117,     0,    84,    95,     0,    85,
     153,     0,   199,     0,    89,    90,     0,    91,     0,    92,
       0,    93,     0,    96,     0,    99,     0,   100,     0,   111,
       0,   113,     0,   115,     0,   143,     0,   145,     0,   147,
       0,   149,     0,   151,     0,   170,     0,    14,    86,   191,
      87,     0,    13,   190,    86,   194,    87,     0,     0,    66,
     189,    86,   191,    94,    95,    87,     0,   199,     0,    95,
      56,   189,    86,   197,    87,     0,    95,   131,     0,     0,
      36,   189,    86,    97,    98,    87,     0,   199,     0,    98,
      56,   189,    86,   197,    87,     0,    25,   190,    86,   191,
      87,     0,   193,    25,   190,    86,   191,    87,     0,     0,
      78,   189,   101,    86,   102,    87,     0,   199,     0,   102,
     103,     0,     0,    76,   104,    86,   106,    87,     0,     0,
      76,   198,   105,    86,   106,    87,     0,   196,     0,   196,
     196,     0,   196,   196,   196,     0,   196,   196,   196,   196,
       0,     0,   106,    74,   190,    86,   107,   108,    87,     0,
     106,    41,    86,   109,    87,     0,   106,    50,    86,   110,
      87,     0,   106,    20,   193,    86,   196,   196,   196,    87,
       0,   106,    20,    86,   193,   196,   196,   196,    87,     0,
     196,   196,     0,   108,    19,   193,    86,   196,   196,    87,
       0,   108,    19,    86,   193,   196,   196,    87,     0,   196,
     196,   196,     0,   109,    17,   193,    86,   196,   196,   196,
      87,     0,   109,    17,    86,   193,   196,   196,   196,    87,
       0,   196,   196,   196,   196,     0,   110,    18,   193,    86,
     196,   196,   196,   196,    87,     0,   110,    18,    86,   193,
     196,   196,   196,   196,    87,     0,     0,    27,   190,   112,
      86,   117,    87,     0,     0,    30,   190,   114,    86,   117,
      87,     0,     0,    33,   190,   116,    86,   117,    87,     0,
     199,     0,   117,    56,   189,    86,   197,    87,     0,   117,
       8,    86,   193,    87,     0,   117,     9,    86,   196,   196,
     196,    87,     0,   117,    12,   190,    86,   118,   119,    87,
       0,   117,    21,    86,   198,    87,     0,   117,    21,    86,
       5,    87,     0,   117,    16,    86,   198,    87,     0,   117,
      16,    86,     5,    87,     0,   117,    60,    86,   198,    87,
       0,   117,    44,    86,   191,    87,     0,   117,    39,    86,
     198,    87,     0,   117,    64,   190,    86,   194,    87,     0,
     117,    65,    86,   198,    87,     0,   117,   120,     0,   117,
     139,     0,   117,   141,     0,   117,    90,     0,   193,     0,
     199,     0,   119,   193,     0,     0,    68,   121,    86,   122,
      87,     0,   199,     0,   122,   123,     0,   122,   124,     0,
     122,   125,     0,   122,   126,     0,   122,   127,     0,   122,
     128,     0,   122,   129,     0,    69,    86,   196,   196,   196,
      87,     0,    52,    86,   196,    87,     0,    53,    86,   196,
      87,     0,    54,    86,   196,    87,     0,    51,    86,   196,
     196,   196,   196,    87,     0,    57,    86,   196,   196,   196,
      87,     0,    57,    86,   196,    87,     0,    38,    86,   130,
      87,     0,   199,     0,   196,   196,   196,   196,   196,   196,
     196,   196,   196,   196,   196,   196,   196,   196,   196,   196,
       0,     0,    68,   132,    86,   133,    87,     0,   199,     0,
     133,   137,     0,   133,   134,     0,   133,   135,     0,   133,
     136,     0,    69,    86,   196,   196,    87,     0,    51,    86,
     196,    87,     0,    57,    86,   196,   196,    87,     0,    37,
      86,   138,    87,     0,   199,     0,   196,   196,   196,   196,
     196,   196,   196,   196,   196,     0,    79,    86,   184,   140,
      49,    86,   188,    87,    87,     0,   199,     0,   140,    56,
     189,    86,   197,    87,     0,    61,    86,   142,    87,     0,
      22,    86,   196,   196,    76,    86,   196,   196,   196,    87,
      87,     0,    22,    86,   196,   196,   196,    76,    86,   196,
     196,   196,    87,    87,     0,     0,    48,   190,   144,    86,
     153,    87,     0,     0,    47,   190,   146,    86,   153,    87,
       0,     0,    34,   190,   148,    86,   153,    87,     0,     0,
      43,   190,   150,    86,   154,    87,     0,     0,    42,   190,
     152,    86,   155,    87,     0,   199,     0,   153,    70,    86,
     156,    87,     0,   153,    66,    86,   157,    87,     0,   153,
      40,    86,   158,    87,     0,   153,   162,     0,   153,    41,
      86,   159,    87,     0,   153,    50,    86,   160,    87,     0,
     153,     7,    86,   161,    87,     0,   153,    56,   189,    86,
     197,    87,     0,   199,     0,   154,    70,    86,   156,    87,
       0,   154,    66,    86,   157,    87,     0,   154,    40,    86,
     158,    87,     0,   154,   162,     0,   154,    41,    86,   159,
      87,     0,   154,    50,    86,   160,    87,     0,   154,     7,
      86,   161,    87,     0,   154,    45,    86,   163,    87,     0,
     154,    73,    86,   164,    87,     0,   154,    75,    86,   165,
      87,     0,   154,   151,     0,   154,    71,    86,   166,    87,
       0,   154,    56,   189,    86,   197,    87,     0,   199,     0,
     155,    70,    86,   156,    87,     0,   155,    66,    86,   157,
      87,     0,   155,    40,    86,   158,    87,     0,   155,   162,
       0,   155,    41,    86,   159,    87,     0,   155,    50,    86,
     160,    87,     0,   155,     7,    86,   161,    87,     0,   155,
      45,    86,   168,    87,     0,   155,    31,    86,   169,    87,
       0,   155,    56,   189,    86,   197,    87,     0,   186,     0,
     189,     0,   187,     0,   196,   196,   196,     0,   159,    17,
     193,    86,   196,   196,   196,    87,     0,   159,    17,    86,
     193,   196,   196,   196,    87,     0,   196,   196,   196,   196,
       0,   160,    18,   193,    86,   196,   196,   196,   196,    87,
       0,   160,    18,    86,   193,   196,   196,   196,   196,    87,
       0,   198,     0,    79,    86,   184,    49,    86,   188,    87,
      87,     0,   198,   198,     0,   185,     0,   185,     0,   199,
       0,   166,    35,    86,   167,    87,     0,   199,     0,   167,
     151,     0,   198,     0,   185,     0,     0,    62,   190,   171,
      86,   174,    87,     0,     0,    10,   190,   173,    86,   174,
      87,     0,   199,     0,   174,   170,     0,   174,   172,     0,
     174,   175,     0,   174,   178,     0,   174,   181,     0,     0,
      55,   190,   176,    86,   177,    87,     0,   199,     0,   177,
      56,   189,    86,   197,    87,     0,   177,    63,    86,   185,
      87,     0,     0,    80,   190,   179,    86,   180,    87,     0,
     199,     0,   180,    56,   189,    86,   197,    87,     0,   180,
      63,    86,   185,    87,     0,     0,    81,   190,   182,    86,
     183,    87,     0,   199,     0,   183,    56,   189,    86,   197,
      87,     0,   183,   175,     0,   199,     0,   184,   198,     0,
     199,     0,   185,   196,     0,   189,     0,   189,     0,   189,
       0,   199,     0,   193,     0,   192,     0,   199,     0,   193,
       0,   199,     0,   193,     0,     3,     0,     4,     0,     5,
       0,   199,     0,   195,     0,   193,     0,   195,   193,     0,
       3,     0,     4,     0,     3,     0,     4,     0,     5,     0,
       3,     0,     4,     0,     0
};

#endif

#if YYDEBUG
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const short yyrline[] =
{
       0,   209,   211,   212,   213,   223,   225,   239,   241,   242,
     243,   244,   245,   246,   247,   248,   249,   250,   251,   252,
     253,   254,   264,   287,   301,   301,   329,   331,   613,   623,
     623,   650,   652,   746,   754,   773,   773,   809,   811,   821,
     821,   833,   833,   878,   883,   887,   891,   895,   895,   910,
     911,   912,   920,   938,   943,   951,   968,   973,   981,   998,
    1003,  1011,  1028,  1028,  1048,  1048,  1069,  1069,  1090,  1092,
    1162,  1174,  1179,  1186,  1192,  1205,  1212,  1225,  1231,  1237,
    1243,  1248,  1254,  1255,  1256,  1257,  1270,  1300,  1302,  1323,
    1323,  1339,  1341,  1342,  1343,  1344,  1345,  1346,  1347,  1350,
    1356,  1362,  1368,  1374,  1380,  1384,  1390,  1394,  1396,  1417,
    1417,  1436,  1438,  1439,  1440,  1441,  1444,  1450,  1456,  1462,
    1465,  1467,  1485,  1518,  1523,  1547,  1559,  1565,  1581,  1581,
    1600,  1600,  1619,  1619,  1638,  1638,  1657,  1657,  1677,  1679,
    1680,  1681,  1682,  1683,  1684,  1685,  1686,  1744,  1746,  1747,
    1748,  1749,  1750,  1751,  1752,  1753,  1754,  1755,  1756,  1762,
    1763,  1826,  1828,  1829,  1830,  1831,  1832,  1833,  1834,  1835,
    1836,  1837,  1905,  1922,  1962,  1979,  1984,  1992,  2009,  2014,
    2022,  2039,  2055,  2086,  2104,  2124,  2144,  2150,  2160,  2167,
    2185,  2201,  2222,  2222,  2244,  2244,  2266,  2268,  2272,  2276,
    2280,  2284,  2298,  2298,  2319,  2321,  2333,  2346,  2346,  2367,
    2369,  2386,  2399,  2399,  2420,  2422,  2437,  2451,  2456,  2469,
    2474,  2487,  2508,  2529,  2553,  2559,  2570,  2582,  2588,  2598,
    2603,  2616,  2621,  2625,  2637,  2642,  2657,  2662,  2675,  2677,
    2691,  2698,  2704,  2720,  2729,  2735
};
#endif


#if (YYDEBUG) || defined YYERROR_VERBOSE

/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
static const char *const yytname[] =
{
  "$", "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", "LINE", "LOOP", "MATERIAL", "MATRIX3", 
  "MATRIX4", "MODEL", "MREF", "NORMAL", "NURBSCURVE", "NURBSSURFACE", 
  "OBJECTTYPE", "ORDER", "OUTTANGENT", "POINTLIGHT", "POLYGON", "REF", 
  "RGBA", "ROTATE", "ROTX", "ROTY", "ROTZ", "SANIM", "SCALAR", "SCALE", 
  "SEQUENCE", "SHADING", "SWITCH", "SWITCHCONDITION", "TABLE", "TABLE_V", 
  "TAG", "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", "'{'", 
  "'}'", "grammar", "egg", "node", "coordsystem", "comment", "texture", 
  "@1", "texture_body", "material", "@2", "material_body", 
  "external_reference", "vertex_pool", "@3", "vertex_pool_body", "vertex", 
  "@4", "@5", "vertex_body", "@6", "vertex_uv_body", "vertex_normal_body", 
  "vertex_color_body", "group", "@7", "joint", "@8", "instance", "@9", 
  "group_body", "cs_type", "collide_flags", "transform_3d", "@10", 
  "transform_3d_body", "translate_3d", "rotx_3d", "roty_3d", "rotz_3d", 
  "rotate_3d", "scale_3d", "matrix4_3d", "matrix4_3d_body", 
  "transform_2d", "@11", "transform_2d_body", "translate_2d", "rotate_2d", 
  "scale_2d", "matrix3_2d", "matrix3_2d_body", "group_vertex_ref", 
  "group_vertex_membership", "switchcondition", "switchcondition_body", 
  "polygon", "@12", "point_light", "@13", "line", "@14", "nurbs_surface", 
  "@15", "nurbs_curve", "@16", "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", "@17", "bundle", "@18", "table_body", 
  "sanim", "@19", "sanim_body", "xfmanim", "@20", "xfmanim_body", 
  "xfm_s_anim", "@21", "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

/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const short yyr1[] =
{
       0,    88,    88,    88,    88,    89,    89,    90,    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,   107,   106,   106,
     106,   106,   106,   108,   108,   108,   109,   109,   109,   110,
     110,   110,   112,   111,   114,   113,   116,   115,   117,   117,
     117,   117,   117,   117,   117,   117,   117,   117,   117,   117,
     117,   117,   117,   117,   117,   117,   118,   119,   119,   121,
     120,   122,   122,   122,   122,   122,   122,   122,   122,   123,
     124,   125,   126,   127,   128,   128,   129,   130,   130,   132,
     131,   133,   133,   133,   133,   133,   134,   135,   136,   137,
     138,   138,   139,   140,   140,   141,   142,   142,   144,   143,
     146,   145,   148,   147,   150,   149,   152,   151,   153,   153,
     153,   153,   153,   153,   153,   153,   153,   154,   154,   154,
     154,   154,   154,   154,   154,   154,   154,   154,   154,   154,
     154,   155,   155,   155,   155,   155,   155,   155,   155,   155,
     155,   155,   156,   157,   158,   159,   159,   159,   160,   160,
     160,   161,   162,   163,   164,   165,   166,   166,   167,   167,
     168,   169,   171,   170,   173,   172,   174,   174,   174,   174,
     174,   174,   176,   175,   177,   177,   177,   179,   178,   180,
     180,   180,   182,   181,   183,   183,   183,   184,   184,   185,
     185,   186,   187,   188,   189,   189,   190,   191,   191,   192,
     192,   193,   193,   193,   194,   194,   195,   195,   196,   196,
     197,   197,   197,   198,   198,   199
};

/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const short yyr2[] =
{
       0,     2,     2,     2,     2,     1,     2,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     4,     5,     0,     7,     1,     6,     2,     0,
       6,     1,     6,     5,     6,     0,     6,     1,     2,     0,
       5,     0,     6,     1,     2,     3,     4,     0,     7,     5,
       5,     8,     8,     2,     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,     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[S] -- default rule to reduce with in state S when YYTABLE
   doesn't specify something else to do.  Zero means the default is an
   error. */
static const short yydefact[] =
{
       0,   245,   245,   245,   245,     1,     5,     2,    68,     3,
      26,     4,   138,   231,   232,   233,   245,     0,   245,   245,
     245,   245,   245,   245,   245,   245,   245,   245,   245,   245,
     245,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,     0,     0,     0,
     245,     0,     0,     0,     0,   245,     0,     0,   245,     0,
      89,     0,    85,    82,    83,    84,   245,   109,    28,     0,
       0,     0,     0,   245,     0,     0,     0,   142,     0,   226,
     230,   229,   245,     0,    62,    64,    66,   132,     0,   225,
     224,   136,   134,   130,   128,   192,     0,    35,   245,     0,
       0,     0,     0,     0,     0,   245,     0,     0,     0,     0,
       0,     0,   245,     0,     0,     0,   245,     0,     0,     0,
     245,   245,   245,   245,     0,   228,   227,   245,     0,     0,
       0,     0,    29,     0,     0,     0,     0,     0,   245,     0,
       0,     0,   238,   239,     0,     0,   243,   244,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   245,     0,
     245,   245,   217,     0,   245,     0,   181,     0,   174,   222,
       0,     0,     0,     0,     0,     0,   173,     0,   172,   221,
       0,   236,     0,   235,   234,    22,     0,   245,   245,   245,
     245,   245,   245,   245,   245,   245,   245,    24,   245,   245,
      70,     0,   245,    86,    76,    75,    74,    73,    79,    78,
     240,   241,   242,     0,    77,     0,   125,     0,    81,     0,
      91,     0,   218,   123,     0,     0,   111,   145,   141,     0,
     143,     0,     0,   144,     0,     0,   140,   139,     0,    23,
     237,    33,     0,     0,     0,     0,     0,    31,     0,   161,
       0,   147,     0,     0,     0,   196,   245,     0,    37,     0,
       0,     0,    87,    69,     0,    80,     0,     0,     0,     0,
       0,     0,     0,    90,    92,    93,    94,    95,    96,    97,
      98,     0,   245,    27,     0,     0,     0,     0,   110,   113,
     114,   115,   112,     0,     0,   175,     0,     0,     0,   146,
     245,    63,    65,    67,   133,   245,    30,     0,     0,     0,
       0,     0,     0,   245,     0,     0,   137,   165,     0,     0,
       0,     0,     0,   245,     0,     0,     0,     0,     0,   135,
     158,   151,   131,   129,   245,   245,   245,   245,   193,   197,
     198,   199,   200,   201,     0,    39,    36,    38,    34,    71,
      72,    88,     0,   245,     0,     0,     0,     0,     0,     0,
     245,     0,   245,     0,     0,     0,     0,     0,     0,     0,
     178,     0,   223,     0,     0,   245,   245,     0,     0,     0,
       0,   245,   245,     0,   245,     0,     0,     0,     0,   245,
     245,   245,   245,   245,   194,   202,   207,   212,    25,     0,
      41,     0,     0,     0,     0,   107,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   120,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   191,   219,
       0,     0,     0,   190,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   186,     0,
     184,     0,   185,     0,     0,     0,     0,     0,     0,     0,
       0,   106,     0,     0,   100,   101,   102,   105,     0,     0,
       0,     0,   119,     0,   117,     0,     0,     0,     0,     0,
       0,   182,     0,   168,   170,   220,   164,   166,   169,   167,
       0,   163,   162,   154,   150,   152,   155,   183,   153,     0,
     149,   148,     0,   159,   156,   157,   245,   245,   245,   245,
       0,    43,     0,     0,     0,     0,     0,     0,     0,   122,
     124,     0,   118,   116,     0,     0,     0,     0,    32,   171,
     160,   245,     0,     0,   204,     0,   209,     0,   214,     0,
       0,     0,   245,    40,    44,     0,     0,     0,     0,     0,
     104,    99,     0,   177,   176,     0,     0,     0,   188,   195,
     245,     0,   203,   245,     0,   208,   245,   213,   216,     0,
       0,     0,     0,     0,    45,    42,     0,     0,     0,   103,
       0,   180,   179,   187,   189,     0,   245,     0,   245,     0,
       0,     0,     0,     0,     0,     0,    47,    46,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
      49,     0,     0,    50,     0,     0,   126,     0,     0,     0,
       0,   206,     0,   211,     0,     0,     0,     0,     0,    56,
       0,     0,     0,     0,     0,   127,     0,     0,   205,   210,
     215,     0,     0,     0,     0,     0,     0,    59,     0,    48,
      53,     0,   121,    52,    51,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,    58,    57,     0,     0,
       0,     0,     0,    61,    60,    55,    54,     0,     0,   108,
       0,     0,     0
};

static const short yydefgoto[] =
{
     690,     5,    62,    32,    33,    34,   256,     9,    35,   191,
     246,    36,    37,   139,   257,   347,   399,   458,   510,   615,
     633,   592,   594,    38,   128,    39,   129,    40,   130,     7,
     202,   261,    63,   111,   219,   274,   275,   276,   277,   278,
     279,   280,   403,    68,   114,   225,   289,   290,   291,   292,
     414,    64,   221,    65,   157,    41,   136,    42,   135,    43,
     131,    44,   134,    45,   133,    11,   250,   248,   177,   175,
     167,   170,   172,   165,    77,   441,   449,   451,   447,   557,
     432,   427,    46,   137,   340,   453,   254,   341,   454,   533,
     342,   455,   535,   343,   456,   537,   161,   428,   178,   168,
     371,   169,    78,   124,    79,    89,   182,   183,   485,   213,
     166,    90
};

static const short yypact[] =
{
     253,-32768,-32768,-32768,-32768,   464,-32768,  1114,-32768,    57,
  -32768,   110,-32768,-32768,-32768,-32768,   256,   -82,   256,   256,
     256,   256,   256,   256,   256,   256,   256,   256,   256,   256,
     256,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,-32768,    23,   -21,    61,
     256,    66,    79,    85,    99,   256,   113,   122,   256,   133,
  -32768,   137,-32768,-32768,-32768,-32768,   256,-32768,-32768,   140,
     144,   154,   160,   256,   164,   171,   179,-32768,   188,-32768,
  -32768,-32768,   256,   189,-32768,-32768,-32768,-32768,   198,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,   203,-32768,   256,   256,
      48,   204,   275,   309,   102,   256,   207,   102,   146,   208,
     102,   211,-32768,   212,   215,   102,   256,    48,    48,   218,
     256,   256,-32768,   256,    41,-32768,-32768,   256,   221,   223,
     238,   241,-32768,   242,   247,   254,   260,   261,   256,   262,
     263,   235,-32768,-32768,    48,   256,-32768,-32768,   286,   287,
     288,   289,   290,   291,   315,   295,   276,   299,   256,   301,
  -32768,   102,-32768,   315,-32768,   303,-32768,   304,-32768,-32768,
       1,    48,    49,    48,   315,   308,-32768,   313,-32768,-32768,
     107,-32768,   314,   256,-32768,-32768,   316,-32768,-32768,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   256,
  -32768,    48,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  -32768,-32768,-32768,   317,-32768,    48,-32768,   318,-32768,   345,
  -32768,    93,-32768,-32768,   320,   230,-32768,-32768,-32768,    51,
  -32768,    48,    58,-32768,    48,   322,-32768,-32768,   324,-32768,
  -32768,-32768,   878,   959,  1046,   236,   106,-32768,   165,-32768,
     141,-32768,   255,   387,    54,-32768,-32768,    39,-32768,   328,
     329,     5,-32768,-32768,    48,-32768,   325,   332,   333,   340,
     343,   344,   347,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  -32768,   348,   256,-32768,   349,   352,   353,   355,-32768,-32768,
  -32768,-32768,-32768,   256,   359,-32768,   256,   360,    48,-32768,
     256,-32768,-32768,-32768,-32768,   256,-32768,   361,   362,   363,
     364,   365,   366,   256,   368,   369,-32768,-32768,   370,   372,
     374,   376,   377,   256,   386,   390,   397,   398,   399,-32768,
  -32768,-32768,-32768,-32768,   256,   256,   256,   256,-32768,-32768,
  -32768,-32768,-32768,-32768,   145,   102,-32768,-32768,-32768,-32768,
  -32768,-32768,    27,    48,    48,    48,    48,    48,    48,    48,
     256,   400,    48,    48,    48,    48,    48,    48,    48,    48,
  -32768,   401,-32768,   404,   102,-32768,   256,    48,   102,    48,
     406,   256,   256,   102,   256,    48,   102,    48,   407,   256,
     256,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   409,
  -32768,   410,   265,   412,    48,-32768,    48,   414,   415,   416,
      21,    48,   417,   315,   418,    48,-32768,   421,    48,    48,
      48,    48,    48,    48,   422,   315,   423,   432,    48,-32768,
     433,    40,   434,-32768,    52,   315,   435,   437,   438,   440,
      42,   444,   102,    71,   315,   445,   446,    56,-32768,   448,
      48,   449,    48,   452,   453,   454,   455,    48,   457,    48,
     458,-32768,    48,    48,-32768,-32768,-32768,-32768,    48,    48,
     460,   465,-32768,    48,-32768,   466,   468,    48,    48,    48,
      48,-32768,   469,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
     470,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   472,
  -32768,-32768,   459,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
     168,    48,    48,    48,    48,    48,    48,   473,   474,-32768,
  -32768,    48,-32768,-32768,   475,   478,    48,    48,-32768,-32768,
  -32768,-32768,   167,    12,-32768,    82,-32768,    76,-32768,    68,
     481,   482,   256,-32768,    48,   184,    48,    48,    48,   483,
  -32768,-32768,    48,-32768,-32768,   484,   485,     8,-32768,-32768,
     256,   489,-32768,   256,   491,-32768,   256,-32768,-32768,   256,
     492,    48,    48,   495,    48,-32768,   496,    48,    48,-32768,
      48,-32768,-32768,-32768,-32768,   498,-32768,   499,-32768,   500,
      48,    48,    70,    48,    72,    48,-32768,-32768,   501,   502,
      48,    48,   315,    25,   315,    43,   315,    48,    48,    75,
  -32768,    48,    78,-32768,    48,    48,-32768,   503,    48,    48,
     504,-32768,   507,-32768,   509,    48,    48,   256,   512,-32768,
     256,   513,    48,    20,    48,-32768,    48,    48,-32768,-32768,
  -32768,   514,   518,    48,    48,    48,    48,-32768,    81,-32768,
  -32768,    48,-32768,-32768,-32768,    48,    48,    48,    48,   256,
     520,    48,    48,    48,    48,    48,    48,    48,    48,   521,
     524,    48,    48,    48,    48,    48,-32768,-32768,   525,   527,
     528,   531,    48,-32768,-32768,-32768,-32768,    48,    48,-32768,
     431,   487,-32768
};

static const short yypgoto[] =
{
  -32768,-32768,   546,-32768,-32768,-32768,-32768,   217,-32768,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,    88,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   156,
  -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  -32768,-32768,-32768,  -247,-32768,    74,-32768,-32768,  -198,  -194,
    -186,  -136,  -134,  -204,    22,-32768,-32768,-32768,-32768,-32768,
  -32768,-32768,  -249,-32768,-32768,-32768,   117,    50,-32768,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,   497,  -386,-32768,-32768,
     264,     3,    16,   -78,-32768,    -5,   471,-32768,     2,  -162,
      -6,   677
};


#define	YYLAST		1265


static const short yytable[] =
{
      47,   224,    47,   330,    82,   339,   450,   452,    13,    14,
      15,    80,   235,    80,    80,    80,    80,    80,   229,    80,
      80,    80,    80,    80,   142,   143,    88,   153,   142,   143,
     142,   143,    96,    97,    83,    84,    85,    86,    87,   648,
      91,    92,    93,    94,    95,    80,   142,   143,    98,   186,
      24,   142,   143,    80,    13,    14,    15,   229,   106,   229,
     197,    13,    14,    15,   334,    99,   101,   232,   560,   113,
     232,    13,    14,    15,   109,   561,   119,   125,    13,    14,
      15,    13,    14,    15,    13,    14,    15,   609,   230,   232,
     612,   502,   350,    80,   141,   583,   149,   151,   152,   562,
     125,   155,   144,   401,   159,   146,   147,   649,   467,   335,
     146,   147,   621,    66,   140,   345,    28,    69,   181,   171,
     173,   259,   125,   176,   179,    67,   346,   487,   185,   495,
     623,   335,   566,   125,   336,   337,   233,   293,   563,   489,
     203,   338,   281,   503,   296,   564,   201,   100,   318,   282,
      70,    71,   102,   181,   569,   222,   238,   610,   498,   613,
      72,   627,   305,   567,   630,   103,    73,   659,   156,   565,
     426,   104,   307,   231,   222,   234,    74,   334,   240,   438,
      75,   319,   320,    24,   437,   105,   321,   436,   539,    76,
     430,   322,   446,   306,   125,   445,   308,   323,   439,   107,
     603,    66,   605,   260,   539,   309,   310,   324,   108,   540,
     311,   325,   326,    67,   327,   312,   328,   264,   541,   110,
      76,   313,   335,   112,   294,   540,   115,   297,   329,    28,
     116,   314,   398,   295,   541,   315,   298,    47,    47,    47,
     117,   431,   542,    69,    76,   434,   118,   336,   337,   440,
     120,   471,   316,   443,   559,   543,   351,   121,   542,    13,
      14,    15,    69,   482,   245,   122,   352,   284,   252,   253,
     317,   575,   331,   490,   123,   127,    70,    71,   146,   147,
     148,   285,   499,   339,   132,   361,    72,   286,   366,   138,
     145,   368,    73,   154,   158,    70,    71,   160,   163,   287,
     370,   164,    74,   372,   174,    72,    75,   187,   373,   188,
     584,    73,   146,   147,   150,    76,   380,   288,   210,   211,
     212,    74,   200,   304,   189,    75,   388,   190,   192,    80,
      80,    80,    80,   193,    76,     1,     2,     3,     4,   400,
     194,   460,   332,   242,   243,   244,   195,   196,   198,   199,
     394,   395,   396,   397,   402,   404,   406,   407,   408,   409,
     410,   411,   215,   372,   415,   417,   418,   419,   420,   421,
     422,   423,   433,   204,   205,   206,   207,   208,   209,   171,
     442,   173,   214,   266,   176,   179,   216,   171,   218,   173,
     227,   228,   176,   179,    69,   236,   267,   268,   269,   270,
     237,   239,   271,   241,   263,   265,   462,   283,   463,   299,
     300,   353,   468,   469,   272,   348,   349,   473,   354,   355,
     475,   476,   477,   478,   479,   480,   356,    70,    71,   357,
     358,   691,   273,   359,   360,   362,   497,    72,   363,   364,
     620,   365,   622,    73,   624,   367,   369,   374,   375,   376,
     377,   378,   379,    74,   381,   382,   383,    75,   384,   511,
     385,   513,   386,   387,   515,   516,    76,    13,    14,    15,
     517,   518,   389,   344,   333,   521,   390,    16,    17,   524,
     525,   526,   527,   391,   392,   393,   413,   692,   424,    18,
     425,    19,   435,   444,    20,   457,   459,    21,    22,   461,
      23,   464,   465,   466,   470,   472,    24,    25,   474,   481,
     483,    26,    27,   544,   511,   546,   547,   548,   549,   484,
     486,   488,   491,   552,   492,   493,    28,   494,   555,   556,
      29,   496,   500,   501,   570,   504,   505,    80,   506,   507,
     508,   509,    30,   512,   514,   531,   574,   519,   576,   577,
     578,    31,   520,   522,   580,   523,   528,   529,   573,   530,
     550,   551,   553,   585,   590,   554,   587,   571,   572,   589,
     579,   581,   582,   593,   595,   586,   597,   588,   591,   599,
     600,   596,   601,   598,   602,   604,   606,   568,   616,   617,
     635,   638,   607,   608,   639,   611,   640,   614,   644,   646,
     545,   653,   618,   619,   628,   654,   667,   631,   676,   625,
     626,   677,   683,   629,   684,   685,   632,   634,   686,   180,
     636,   637,   643,   532,   412,   645,     0,   641,   642,   217,
       0,     0,     0,     0,   647,     0,   650,     0,   651,   652,
       0,     0,     0,   660,     0,   655,   656,   657,   658,     0,
       0,     0,     0,   661,   666,     0,     0,   662,   663,   664,
     665,     0,     0,   668,   669,   670,   671,   672,   673,   674,
     675,     0,     0,   678,   679,   680,   681,   682,     6,     8,
      10,    12,     0,     0,   687,     0,     0,     0,     0,   688,
     689,     0,     0,    81,     0,    81,    81,    81,    81,    81,
       0,    81,    81,    81,    81,    81,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,    81,     0,     0,
       0,     0,     0,     0,     0,    81,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,   126,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,    81,     0,     0,     0,     0,
       0,     0,   126,     0,     0,     0,     0,     0,     0,   162,
       0,     0,     0,     0,     0,     0,     0,     0,     0,   162,
     184,     0,     0,     0,   126,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,   126,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,   184,     0,   220,   223,     0,
       0,   226,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     8,     8,     8,    12,   247,   249,
     251,    12,    12,   255,     0,   258,   126,     0,     0,   262,
       0,    13,    14,    15,     0,     0,    48,    49,     0,     0,
      50,    16,    17,     0,    51,     0,     0,     0,     0,    52,
       0,     0,     0,    18,     0,    19,     0,     0,    20,     0,
       0,    21,    22,     0,    23,     0,     0,    53,     0,     0,
      24,    25,    54,     0,     0,    26,    27,     0,     0,     0,
       0,     0,     0,    10,    55,     0,     0,     0,    56,    57,
      28,     0,    58,    59,    29,     0,    60,     0,     0,     0,
       0,     0,     0,     0,     0,     0,    30,    61,     0,     0,
       0,     0,    13,    14,    15,   301,     0,    48,    49,     0,
       0,    50,    16,    17,     0,    51,     0,     0,     0,     0,
      52,     0,     0,     0,    18,     0,    19,     0,     0,    20,
       0,     0,    21,    22,     0,    23,     0,     0,    53,     0,
       0,    24,    25,    54,     0,     0,    26,    27,     0,     0,
       0,    81,    81,    81,    81,    55,     0,     0,     0,    56,
      57,    28,     0,    58,    59,    29,     0,    60,     0,     0,
     405,     0,     0,     0,     0,     0,     0,    30,    61,   416,
       0,     0,     0,     0,     0,     0,   302,     0,     0,    13,
      14,    15,   429,     0,    48,    49,     0,     0,    50,    16,
      17,     0,    51,     0,     0,     0,     0,    52,   448,   429,
     429,    18,     0,    19,     0,     0,    20,     0,     0,    21,
      22,     0,    23,     0,     0,    53,     0,     0,    24,    25,
      54,     0,     0,    26,    27,     0,     0,     0,     0,     0,
       0,     0,    55,     0,     0,     0,    56,    57,    28,     0,
      58,    59,    29,     0,    60,     0,     0,    13,    14,    15,
       0,     0,    48,    49,    30,    61,    50,    16,    17,     0,
      51,     0,     0,   303,     0,    52,     0,     0,     0,    18,
       0,    19,     0,     0,    20,     0,     0,    21,    22,     0,
      23,     0,     0,    53,     0,     0,    24,    25,    54,     0,
       0,    26,    27,     0,     0,     0,     0,     0,     0,     0,
      55,     0,     0,     0,    56,    57,    28,     0,    58,    59,
      29,     0,    60,   255,   534,   536,   538,     0,     0,     0,
       0,     0,    30,    61,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   558,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,    81,
       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,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   429,     0,   429
};

static const short yycheck[] =
{
       5,   163,     7,   250,    86,   254,   392,   393,     3,     4,
       5,    16,   174,    18,    19,    20,    21,    22,    17,    24,
      25,    26,    27,    28,     3,     4,    23,   105,     3,     4,
       3,     4,    29,    30,    18,    19,    20,    21,    22,    19,
      24,    25,    26,    27,    28,    50,     3,     4,    25,   127,
      42,     3,     4,    58,     3,     4,     5,    17,    55,    17,
     138,     3,     4,     5,    10,    86,    50,    18,    56,    66,
      18,     3,     4,     5,    58,    63,    73,    82,     3,     4,
       5,     3,     4,     5,     3,     4,     5,    17,    87,    18,
      18,    35,    87,    98,    99,    87,   102,   103,   104,    87,
     105,   107,   100,    76,   110,     3,     4,    87,    87,    55,
       3,     4,    87,    56,    98,    76,    62,     7,   123,   117,
     118,   199,   127,   120,   121,    68,    87,    87,    87,    87,
      87,    55,    56,   138,    80,    81,    87,    86,    56,    87,
     145,    87,    49,    87,    86,    63,   144,    86,     7,    56,
      40,    41,    86,   158,    86,   161,    49,    87,    87,    87,
      50,    86,    56,    87,    86,    86,    56,    86,    22,    87,
     374,    86,     7,   171,   180,   173,    66,    10,   183,   383,
      70,    40,    41,    42,   382,    86,    45,   381,    20,    79,
     376,    50,   390,    87,   199,   389,    31,    56,   384,    86,
     586,    56,   588,   201,    20,    40,    41,    66,    86,    41,
      45,    70,    71,    68,    73,    50,    75,   215,    50,    86,
      79,    56,    55,    86,   229,    41,    86,   232,    87,    62,
      86,    66,    87,   231,    50,    70,   234,   242,   243,   244,
      86,   377,    74,     7,    79,   379,    86,    80,    81,   385,
      86,   413,    87,   387,    87,    87,   261,    86,    74,     3,
       4,     5,     7,   425,   190,    86,   264,    37,   194,   195,
     248,    87,   250,   435,    86,    86,    40,    41,     3,     4,
       5,    51,   444,   532,    86,   282,    50,    57,   293,    86,
      86,   296,    56,    86,    86,    40,    41,    86,    86,    69,
     298,    86,    66,   300,    86,    50,    70,    86,   305,    86,
     557,    56,     3,     4,     5,    79,   313,    87,     3,     4,
       5,    66,    87,    87,    86,    70,   323,    86,    86,   334,
     335,   336,   337,    86,    79,    82,    83,    84,    85,   345,
      86,    76,    87,   187,   188,   189,    86,    86,    86,    86,
     334,   335,   336,   337,   352,   353,   354,   355,   356,   357,
     358,   359,    86,   360,   362,   363,   364,   365,   366,   367,
     368,   369,   378,    87,    87,    87,    87,    87,    87,   377,
     386,   379,    87,    38,   381,   382,    87,   385,    87,   387,
      87,    87,   389,   390,     7,    87,    51,    52,    53,    54,
      87,    87,    57,    87,    87,    87,   404,    87,   406,    87,
      86,    86,   410,   411,    69,    87,    87,   415,    86,    86,
     418,   419,   420,   421,   422,   423,    86,    40,    41,    86,
      86,     0,    87,    86,    86,    86,   442,    50,    86,    86,
     602,    86,   604,    56,   606,    86,    86,    86,    86,    86,
      86,    86,    86,    66,    86,    86,    86,    70,    86,   457,
      86,   459,    86,    86,   462,   463,    79,     3,     4,     5,
     468,   469,    86,   256,    87,   473,    86,    13,    14,   477,
     478,   479,   480,    86,    86,    86,    86,     0,    87,    25,
      86,    27,    86,    86,    30,    86,    86,    33,    34,    87,
      36,    87,    87,    87,    87,    87,    42,    43,    87,    87,
      87,    47,    48,   511,   512,   513,   514,   515,   516,    87,
      87,    87,    87,   521,    87,    87,    62,    87,   526,   527,
      66,    87,    87,    87,   539,    87,    87,   542,    86,    86,
      86,    86,    78,    86,    86,    86,   544,    87,   546,   547,
     548,     5,    87,    87,   552,    87,    87,    87,   542,    87,
      87,    87,    87,   560,   569,    87,   563,    86,    86,   566,
      87,    87,    87,   571,   572,    86,   574,    86,    86,   577,
     578,    86,   580,    87,    86,    86,    86,   537,    87,    87,
      87,    87,   590,   591,    87,   593,    87,   595,    86,    86,
     512,    87,   600,   601,   609,    87,    86,   612,    87,   607,
     608,    87,    87,   611,    87,    87,   614,   615,    87,   122,
     618,   619,   627,   506,   360,   630,    -1,   625,   626,   158,
      -1,    -1,    -1,    -1,   632,    -1,   634,    -1,   636,   637,
      -1,    -1,    -1,   648,    -1,   643,   644,   645,   646,    -1,
      -1,    -1,    -1,   651,   659,    -1,    -1,   655,   656,   657,
     658,    -1,    -1,   661,   662,   663,   664,   665,   666,   667,
     668,    -1,    -1,   671,   672,   673,   674,   675,     1,     2,
       3,     4,    -1,    -1,   682,    -1,    -1,    -1,    -1,   687,
     688,    -1,    -1,    16,    -1,    18,    19,    20,    21,    22,
      -1,    24,    25,    26,    27,    28,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    50,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    58,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -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,    -1,    98,    -1,    -1,    -1,    -1,
      -1,    -1,   105,    -1,    -1,    -1,    -1,    -1,    -1,   112,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   122,
     123,    -1,    -1,    -1,   127,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   138,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   158,    -1,   160,   161,    -1,
      -1,   164,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   187,   188,   189,   190,   191,   192,
     193,   194,   195,   196,    -1,   198,   199,    -1,    -1,   202,
      -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,    34,    -1,    36,    -1,    -1,    39,    -1,    -1,
      42,    43,    44,    -1,    -1,    47,    48,    -1,    -1,    -1,
      -1,    -1,    -1,   256,    56,    -1,    -1,    -1,    60,    61,
      62,    -1,    64,    65,    66,    -1,    68,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    78,    79,    -1,    -1,
      -1,    -1,     3,     4,     5,    87,    -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,    34,    -1,    36,    -1,    -1,    39,    -1,
      -1,    42,    43,    44,    -1,    -1,    47,    48,    -1,    -1,
      -1,   334,   335,   336,   337,    56,    -1,    -1,    -1,    60,
      61,    62,    -1,    64,    65,    66,    -1,    68,    -1,    -1,
     353,    -1,    -1,    -1,    -1,    -1,    -1,    78,    79,   362,
      -1,    -1,    -1,    -1,    -1,    -1,    87,    -1,    -1,     3,
       4,     5,   375,    -1,     8,     9,    -1,    -1,    12,    13,
      14,    -1,    16,    -1,    -1,    -1,    -1,    21,   391,   392,
     393,    25,    -1,    27,    -1,    -1,    30,    -1,    -1,    33,
      34,    -1,    36,    -1,    -1,    39,    -1,    -1,    42,    43,
      44,    -1,    -1,    47,    48,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    56,    -1,    -1,    -1,    60,    61,    62,    -1,
      64,    65,    66,    -1,    68,    -1,    -1,     3,     4,     5,
      -1,    -1,     8,     9,    78,    79,    12,    13,    14,    -1,
      16,    -1,    -1,    87,    -1,    21,    -1,    -1,    -1,    25,
      -1,    27,    -1,    -1,    30,    -1,    -1,    33,    34,    -1,
      36,    -1,    -1,    39,    -1,    -1,    42,    43,    44,    -1,
      -1,    47,    48,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      56,    -1,    -1,    -1,    60,    61,    62,    -1,    64,    65,
      66,    -1,    68,   506,   507,   508,   509,    -1,    -1,    -1,
      -1,    -1,    78,    79,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   531,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   542,
      -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,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   586,    -1,   588
};
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
#line 3 "/usr/share/bison/bison.simple"

/* Skeleton output parser for bison,

   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
   Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

/* As a special exception, when this file is copied by Bison into a
   Bison output file, you may use that output file without restriction.
   This special exception was added by the Free Software Foundation
   in version 1.24 of Bison.  */

/* This is the parser code that is written into each bison parser when
   the %semantic_parser declaration is not specified in the grammar.
   It was written by Richard Stallman by simplifying the hairy parser
   used when %semantic_parser is specified.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# if YYSTACK_USE_ALLOCA
#  define YYSTACK_ALLOC alloca
# else
#  ifndef YYSTACK_USE_ALLOCA
#   if defined (alloca) || defined (_ALLOCA_H)
#    define YYSTACK_ALLOC alloca
#   else
#    ifdef __GNUC__
#     define YYSTACK_ALLOC __builtin_alloca
#    endif
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's `empty if-body' warning. */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# else
#  if defined (__STDC__) || defined (__cplusplus)
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   define YYSIZE_T size_t
#  endif
#  define YYSTACK_ALLOC malloc
#  define YYSTACK_FREE free
# endif
#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */


#if (! defined (yyoverflow) \
     && (! defined (__cplusplus) \
	 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  short yyss;
  YYSTYPE yyvs;
# if YYLSP_NEEDED
  YYLTYPE yyls;
# endif
};

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# if YYLSP_NEEDED
#  define YYSTACK_BYTES(N) \
     ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))	\
      + 2 * YYSTACK_GAP_MAX)
# else
#  define YYSTACK_BYTES(N) \
     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
      + YYSTACK_GAP_MAX)
# endif

/* Copy COUNT objects from FROM to TO.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if 1 < __GNUC__
#   define YYCOPY(To, From, Count) \
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
#  else
#   define YYCOPY(To, From, Count)		\
      do					\
	{					\
	  register YYSIZE_T yyi;		\
	  for (yyi = 0; yyi < (Count); yyi++)	\
	    (To)[yyi] = (From)[yyi];		\
	}					\
      while (0)
#  endif
# endif

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack)					\
    do									\
      {									\
	YYSIZE_T yynewbytes;						\
	YYCOPY (&yyptr->Stack, Stack, yysize);				\
	Stack = &yyptr->Stack;						\
	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;	\
	yyptr += yynewbytes / sizeof (*yyptr);				\
      }									\
    while (0)

#endif


#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
#endif
#if ! defined (YYSIZE_T) && defined (size_t)
# define YYSIZE_T size_t
#endif
#if ! defined (YYSIZE_T)
# if defined (__STDC__) || defined (__cplusplus)
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
# endif
#endif
#if ! defined (YYSIZE_T)
# define YYSIZE_T unsigned int
#endif

#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
#define YYEMPTY		-2
#define YYEOF		0
#define YYACCEPT	goto yyacceptlab
#define YYABORT 	goto yyabortlab
#define YYERROR		goto yyerrlab1
/* Like YYERROR except do call yyerror.  This remains here temporarily
   to ease the transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */
#define YYFAIL		goto yyerrlab
#define YYRECOVERING()  (!!yyerrstatus)
#define YYBACKUP(Token, Value)					\
do								\
  if (yychar == YYEMPTY && yylen == 1)				\
    {								\
      yychar = (Token);						\
      yylval = (Value);						\
      yychar1 = YYTRANSLATE (yychar);				\
      YYPOPSTACK;						\
      goto yybackup;						\
    }								\
  else								\
    { 								\
      yyerror ("syntax error: cannot back up");			\
      YYERROR;							\
    }								\
while (0)

#define YYTERROR	1
#define YYERRCODE	256


/* YYLLOC_DEFAULT -- Compute the default location (before the actions
   are run).

   When YYLLOC_DEFAULT is run, CURRENT is set the location of the
   first token.  By default, to implement support for ranges, extend
   its range to the last symbol.  */

#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N)       	\
   Current.last_line   = Rhs[N].last_line;	\
   Current.last_column = Rhs[N].last_column;
#endif


/* YYLEX -- calling `yylex' with the right arguments.  */

#if YYPURE
# if YYLSP_NEEDED
#  ifdef YYLEX_PARAM
#   define YYLEX		yylex (&yylval, &yylloc, YYLEX_PARAM)
#  else
#   define YYLEX		yylex (&yylval, &yylloc)
#  endif
# else /* !YYLSP_NEEDED */
#  ifdef YYLEX_PARAM
#   define YYLEX		yylex (&yylval, YYLEX_PARAM)
#  else
#   define YYLEX		yylex (&yylval)
#  endif
# endif /* !YYLSP_NEEDED */
#else /* !YYPURE */
# define YYLEX			yylex ()
#endif /* !YYPURE */


/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)			\
do {						\
  if (yydebug)					\
    YYFPRINTF Args;				\
} while (0)
/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
#endif /* !YYDEBUG */

/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef	YYINITDEPTH
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#if YYMAXDEPTH == 0
# undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif

#ifdef YYERROR_VERBOSE

# ifndef yystrlen
#  if defined (__GLIBC__) && defined (_STRING_H)
#   define yystrlen strlen
#  else
/* Return the length of YYSTR.  */
static YYSIZE_T
#   if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
#   else
yystrlen (yystr)
     const char *yystr;
#   endif
{
  register const char *yys = yystr;

  while (*yys++ != '\0')
    continue;

  return yys - yystr - 1;
}
#  endif
# endif

# ifndef yystpcpy
#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
#   define yystpcpy stpcpy
#  else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
   YYDEST.  */
static char *
#   if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
#   else
yystpcpy (yydest, yysrc)
     char *yydest;
     const char *yysrc;
#   endif
{
  register char *yyd = yydest;
  register const char *yys = yysrc;

  while ((*yyd++ = *yys++) != '\0')
    continue;

  return yyd - 1;
}
#  endif
# endif
#endif

#line 315 "/usr/share/bison/bison.simple"


/* The user can define YYPARSE_PARAM as the name of an argument to be passed
   into yyparse.  The argument should have type void *.
   It should actually point to an object.
   Grammar actions can access the variable by casting it
   to the proper pointer type.  */

#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
#  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
#  define YYPARSE_PARAM_DECL
# else
#  define YYPARSE_PARAM_ARG YYPARSE_PARAM
#  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
# endif
#else /* !YYPARSE_PARAM */
# define YYPARSE_PARAM_ARG
# define YYPARSE_PARAM_DECL
#endif /* !YYPARSE_PARAM */

/* Prevent warning if -Wstrict-prototypes.  */
#ifdef __GNUC__
# ifdef YYPARSE_PARAM
int yyparse (void *);
# else
int yyparse (void);
# endif
#endif

/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
   variables are global, or local to YYPARSE.  */

#define YY_DECL_NON_LSP_VARIABLES			\
/* The lookahead symbol.  */				\
int yychar;						\
							\
/* The semantic value of the lookahead symbol. */	\
YYSTYPE yylval;						\
							\
/* Number of parse errors so far.  */			\
int yynerrs;

#if YYLSP_NEEDED
# define YY_DECL_VARIABLES			\
YY_DECL_NON_LSP_VARIABLES			\
						\
/* Location data for the lookahead symbol.  */	\
YYLTYPE yylloc;
#else
# define YY_DECL_VARIABLES			\
YY_DECL_NON_LSP_VARIABLES
#endif


/* If nonreentrant, generate the variables here. */

#if !YYPURE
YY_DECL_VARIABLES
#endif  /* !YYPURE */

int
yyparse (YYPARSE_PARAM_ARG)
     YYPARSE_PARAM_DECL
{
  /* If reentrant, generate the variables here. */
#if YYPURE
  YY_DECL_VARIABLES
#endif  /* !YYPURE */

  register int yystate;
  register int yyn;
  int yyresult;
  /* Number of tokens to shift before error messages enabled.  */
  int yyerrstatus;
  /* Lookahead token as an internal (translated) token number.  */
  int yychar1 = 0;

  /* Three stacks and their tools:
     `yyss': related to states,
     `yyvs': related to semantic values,
     `yyls': related to locations.

     Refer to the stacks thru separate pointers, to allow yyoverflow
     to reallocate them elsewhere.  */

  /* The state stack. */
  short	yyssa[YYINITDEPTH];
  short *yyss = yyssa;
  register short *yyssp;

  /* The semantic value stack.  */
  YYSTYPE yyvsa[YYINITDEPTH];
  YYSTYPE *yyvs = yyvsa;
  register YYSTYPE *yyvsp;

#if YYLSP_NEEDED
  /* The location stack.  */
  YYLTYPE yylsa[YYINITDEPTH];
  YYLTYPE *yyls = yylsa;
  YYLTYPE *yylsp;
#endif

#if YYLSP_NEEDED
# define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
#else
# define YYPOPSTACK   (yyvsp--, yyssp--)
#endif

  YYSIZE_T yystacksize = YYINITDEPTH;


  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;
#if YYLSP_NEEDED
  YYLTYPE yyloc;
#endif

  /* When reducing, the number of symbols on the RHS of the reduced
     rule. */
  int yylen;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY;		/* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */

  yyssp = yyss;
  yyvsp = yyvs;
#if YYLSP_NEEDED
  yylsp = yyls;
#endif
  goto yysetstate;

/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
 yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed. so pushing a state here evens the stacks.
     */
  yyssp++;

 yysetstate:
  *yyssp = yystate;

  if (yyssp >= yyss + yystacksize - 1)
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYSIZE_T yysize = yyssp - yyss + 1;

#ifdef yyoverflow
      {
	/* Give user a chance to reallocate the stack. Use copies of
	   these so that the &'s don't force the real ones into
	   memory.  */
	YYSTYPE *yyvs1 = yyvs;
	short *yyss1 = yyss;

	/* Each stack pointer address is followed by the size of the
	   data in use in that stack, in bytes.  */
# if YYLSP_NEEDED
	YYLTYPE *yyls1 = yyls;
	/* This used to be a conditional around just the two extra args,
	   but that might be undefined if yyoverflow is a macro.  */
	yyoverflow ("parser stack overflow",
		    &yyss1, yysize * sizeof (*yyssp),
		    &yyvs1, yysize * sizeof (*yyvsp),
		    &yyls1, yysize * sizeof (*yylsp),
		    &yystacksize);
	yyls = yyls1;
# else
	yyoverflow ("parser stack overflow",
		    &yyss1, yysize * sizeof (*yyssp),
		    &yyvs1, yysize * sizeof (*yyvsp),
		    &yystacksize);
# endif
	yyss = yyss1;
	yyvs = yyvs1;
      }
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
      goto yyoverflowlab;
# else
      /* Extend the stack our own way.  */
      if (yystacksize >= YYMAXDEPTH)
	goto yyoverflowlab;
      yystacksize *= 2;
      if (yystacksize > YYMAXDEPTH)
	yystacksize = YYMAXDEPTH;

      {
	short *yyss1 = yyss;
	union yyalloc *yyptr =
	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
	if (! yyptr)
	  goto yyoverflowlab;
	YYSTACK_RELOCATE (yyss);
	YYSTACK_RELOCATE (yyvs);
# if YYLSP_NEEDED
	YYSTACK_RELOCATE (yyls);
# endif
# undef YYSTACK_RELOCATE
	if (yyss1 != yyssa)
	  YYSTACK_FREE (yyss1);
      }
# endif
#endif /* no yyoverflow */

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;
#if YYLSP_NEEDED
      yylsp = yyls + yysize - 1;
#endif

      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
		  (unsigned long int) yystacksize));

      if (yyssp >= yyss + yystacksize - 1)
	YYABORT;
    }

  YYDPRINTF ((stderr, "Entering state %d\n", yystate));

  goto yybackup;


/*-----------.
| yybackup.  |
`-----------*/
yybackup:

/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
/* yyresume: */

  /* First try to decide what to do without reference to lookahead token.  */

  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* yychar is either YYEMPTY or YYEOF
     or a valid token in external form.  */

  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token: "));
      yychar = YYLEX;
    }

  /* Convert token to internal form (in yychar1) for indexing tables with */

  if (yychar <= 0)		/* This means end of input. */
    {
      yychar1 = 0;
      yychar = YYEOF;		/* Don't call YYLEX any more */

      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else
    {
      yychar1 = YYTRANSLATE (yychar);

#if YYDEBUG
     /* We have to keep this `#if YYDEBUG', since we use variables
	which are defined only if `YYDEBUG' is set.  */
      if (yydebug)
	{
	  YYFPRINTF (stderr, "Next token is %d (%s",
		     yychar, yytname[yychar1]);
	  /* Give the individual parser a way to print the precise
	     meaning of a token, for further debugging info.  */
# ifdef YYPRINT
	  YYPRINT (stderr, yychar, yylval);
# endif
	  YYFPRINTF (stderr, ")\n");
	}
#endif
    }

  yyn += yychar1;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
    goto yydefault;

  yyn = yytable[yyn];

  /* yyn is what to do for this token type in this state.
     Negative => reduce, -yyn is rule number.
     Positive => shift, yyn is new state.
       New state is final state => don't bother to shift,
       just return success.
     0, or most negative number => error.  */

  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrlab;

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the lookahead token.  */
  YYDPRINTF ((stderr, "Shifting token %d (%s), ",
	      yychar, yytname[yychar1]));

  /* Discard the token being shifted unless it is eof.  */
  if (yychar != YYEOF)
    yychar = YYEMPTY;

  *++yyvsp = yylval;
#if YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  yystate = yyn;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- Do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     `$$ = $1'.

     Otherwise, the following line sets YYVAL to the semantic value of
     the lookahead token.  This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];

#if YYLSP_NEEDED
  /* Similarly for the default location.  Let the user run additional
     commands if for instance locations are ranges.  */
  yyloc = yylsp[1-yylen];
  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
#endif

#if YYDEBUG
  /* We have to keep this `#if YYDEBUG', since we use variables which
     are defined only if `YYDEBUG' is set.  */
  if (yydebug)
    {
      int yyi;

      YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
		 yyn, yyrline[yyn]);

      /* Print the symbols being reduced, and their result.  */
      for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
	YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
      YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
    }
#endif

  switch (yyn) {

case 6:
#line 226 "parser.yxx"
{
  DCAST(EggData, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
    break;
case 22:
#line 266 "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 289 "parser.yxx"
{
  yyval._egg = new EggComment(yyvsp[-3]._string, yyvsp[-1]._string);
}
    break;
case 24:
#line 303 "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 316 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 27:
#line 332 "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, "combine-rgb") == 0) {
    EggTexture::CombineMode cm = EggTexture::string_combine_mode(strval);
    if (cm == EggTexture::CM_unspecified) {
      eggyywarning("Unknown combine mode " + strval);
    } else {
      texture->set_combine_mode(EggTexture::CC_rgb, cm);
    }

  } else if (cmp_nocase_uh(name, "combine-rgb-source0") == 0) {
    EggTexture::CombineSource cs = EggTexture::string_combine_source(strval);
    if (cs == EggTexture::CS_unspecified) {
      eggyywarning("Unknown combine source " + strval);
    } else {
      texture->set_combine_source(EggTexture::CC_rgb, 0, cs);
    }

  } else if (cmp_nocase_uh(name, "combine-rgb-operand0") == 0) {
    EggTexture::CombineOperand co = EggTexture::string_combine_operand(strval);
    if (co == EggTexture::CO_unspecified) {
      eggyywarning("Unknown combine operand " + strval);
    } else {
      texture->set_combine_operand(EggTexture::CC_rgb, 0, co);
    }

  } else if (cmp_nocase_uh(name, "combine-rgb-source1") == 0) {
    EggTexture::CombineSource cs = EggTexture::string_combine_source(strval);
    if (cs == EggTexture::CS_unspecified) {
      eggyywarning("Unknown combine source " + strval);
    } else {
      texture->set_combine_source(EggTexture::CC_rgb, 1, cs);
    }

  } else if (cmp_nocase_uh(name, "combine-rgb-operand1") == 0) {
    EggTexture::CombineOperand co = EggTexture::string_combine_operand(strval);
    if (co == EggTexture::CO_unspecified) {
      eggyywarning("Unknown combine operand " + strval);
    } else {
      texture->set_combine_operand(EggTexture::CC_rgb, 1, co);
    }

  } else if (cmp_nocase_uh(name, "combine-rgb-source2") == 0) {
    EggTexture::CombineSource cs = EggTexture::string_combine_source(strval);
    if (cs == EggTexture::CS_unspecified) {
      eggyywarning("Unknown combine source " + strval);
    } else {
      texture->set_combine_source(EggTexture::CC_rgb, 2, cs);
    }

  } else if (cmp_nocase_uh(name, "combine-rgb-operand2") == 0) {
    EggTexture::CombineOperand co = EggTexture::string_combine_operand(strval);
    if (co == EggTexture::CO_unspecified) {
      eggyywarning("Unknown combine operand " + strval);
    } else {
      texture->set_combine_operand(EggTexture::CC_rgb, 2, co);
    }

  } else if (cmp_nocase_uh(name, "combine-alpha") == 0) {
    EggTexture::CombineMode cm = EggTexture::string_combine_mode(strval);
    if (cm == EggTexture::CM_unspecified) {
      eggyywarning("Unknown combine mode " + strval);
    } else {
      texture->set_combine_mode(EggTexture::CC_alpha, cm);
    }

  } else if (cmp_nocase_uh(name, "combine-alpha-source0") == 0) {
    EggTexture::CombineSource cs = EggTexture::string_combine_source(strval);
    if (cs == EggTexture::CS_unspecified) {
      eggyywarning("Unknown combine source " + strval);
    } else {
      texture->set_combine_source(EggTexture::CC_alpha, 0, cs);
    }

  } else if (cmp_nocase_uh(name, "combine-alpha-operand0") == 0) {
    EggTexture::CombineOperand co = EggTexture::string_combine_operand(strval);
    if (co == EggTexture::CO_unspecified) {
      eggyywarning("Unknown combine operand " + strval);
    } else {
      texture->set_combine_operand(EggTexture::CC_alpha, 0, co);
    }

  } else if (cmp_nocase_uh(name, "combine-alpha-source1") == 0) {
    EggTexture::CombineSource cs = EggTexture::string_combine_source(strval);
    if (cs == EggTexture::CS_unspecified) {
      eggyywarning("Unknown combine source " + strval);
    } else {
      texture->set_combine_source(EggTexture::CC_alpha, 1, cs);
    }

  } else if (cmp_nocase_uh(name, "combine-alpha-operand1") == 0) {
    EggTexture::CombineOperand co = EggTexture::string_combine_operand(strval);
    if (co == EggTexture::CO_unspecified) {
      eggyywarning("Unknown combine operand " + strval);
    } else {
      texture->set_combine_operand(EggTexture::CC_alpha, 1, co);
    }

  } else if (cmp_nocase_uh(name, "combine-alpha-source2") == 0) {
    EggTexture::CombineSource cs = EggTexture::string_combine_source(strval);
    if (cs == EggTexture::CS_unspecified) {
      eggyywarning("Unknown combine source " + strval);
    } else {
      texture->set_combine_source(EggTexture::CC_alpha, 2, cs);
    }

  } else if (cmp_nocase_uh(name, "combine-alpha-operand2") == 0) {
    EggTexture::CombineOperand co = EggTexture::string_combine_operand(strval);
    if (co == EggTexture::CO_unspecified) {
      eggyywarning("Unknown combine operand " + strval);
    } else {
      texture->set_combine_operand(EggTexture::CC_alpha, 2, co);
    }

  } else if (cmp_nocase_uh(name, "tex_gen") == 0) {
    EggTexture::TexGen tex_gen = EggTexture::string_tex_gen(strval);
    if (tex_gen == EggTexture::TG_unspecified) {
      eggyywarning("Unknown texture env type " + strval);
    } else {
      texture->set_tex_gen(tex_gen);
    }

  } else if (cmp_nocase_uh(name, "stage_name") == 0) {
    texture->set_stage_name(strval);

  } else if (cmp_nocase_uh(name, "priority") == 0) {
    texture->set_priority((int)value);

  } else if (cmp_nocase_uh(name, "blendr") == 0) {
    Colorf color = texture->get_color();
    color[0] = value;
    texture->set_color(color);

  } else if (cmp_nocase_uh(name, "blendg") == 0) {
    Colorf color = texture->get_color();
    color[1] = value;
    texture->set_color(color);

  } else if (cmp_nocase_uh(name, "blendb") == 0) {
    Colorf color = texture->get_color();
    color[2] = value;
    texture->set_color(color);

  } else if (cmp_nocase_uh(name, "blenda") == 0) {
    Colorf color = texture->get_color();
    color[3] = value;
    texture->set_color(color);

  } else if (cmp_nocase_uh(name, "uv_name") == 0) {
    texture->set_uv_name(strval);

  } else if (cmp_nocase_uh(name, "rgb_scale") == 0) {
    int int_value = (int)value;
    if (int_value != 1 && int_value != 2 && int_value != 4) {
      eggyyerror("Invalid rgb-scale value " + strval);
    } else {
      texture->set_rgb_scale(int_value);
    }

  } else if (cmp_nocase_uh(name, "alpha_scale") == 0) {
    int int_value = (int)value;
    if (int_value != 1 && int_value != 2 && int_value != 4) {
      eggyyerror("Invalid alpha-scale value " + strval);
    } else {
      texture->set_alpha_scale(int_value);
    }

  } else if (cmp_nocase_uh(name, "alpha") == 0) {
    EggRenderMode::AlphaMode a = EggRenderMode::string_alpha_mode(strval);
    if (a == EggRenderMode::AM_unspecified) {
      eggyywarning("Unknown alpha mode " + strval);
    } else {
      texture->set_alpha_mode(a);
    }

  } else if (cmp_nocase_uh(name, "depth_write") == 0) {
    EggRenderMode::DepthWriteMode m = 
      EggRenderMode::string_depth_write_mode(strval);
    if (m == EggRenderMode::DWM_unspecified) {
      eggyywarning("Unknown depth-write mode " + strval);
    } else {
      texture->set_depth_write_mode(m);
    }

  } else if (cmp_nocase_uh(name, "depth_test") == 0) {
    EggRenderMode::DepthTestMode m = 
      EggRenderMode::string_depth_test_mode(strval);
    if (m == EggRenderMode::DTM_unspecified) {
      eggyywarning("Unknown depth-test mode " + strval);
    } else {
      texture->set_depth_test_mode(m);
    }

  } else if (cmp_nocase_uh(name, "visibility") == 0) {
    EggRenderMode::VisibilityMode m = 
      EggRenderMode::string_visibility_mode(strval);
    if (m == EggRenderMode::VM_unspecified) {
      eggyywarning("Unknown visibility mode " + strval);
    } else {
      texture->set_visibility_mode(m);
    }

  } else if (cmp_nocase_uh(name, "draw_order") == 0) {
    texture->set_draw_order((int)value);

  } else if (cmp_nocase_uh(name, "bin") == 0) {
    texture->set_bin(strval);

  } else if (cmp_nocase_uh(name, "alpha_file") == 0) {
    texture->set_alpha_filename(strval);

  } else if (cmp_nocase_uh(name, "alpha_file_channel") == 0) {
    texture->set_alpha_file_channel((int)value);

  } else {
    eggyywarning("Unsupported texture scalar: " + name);
  }
}
    break;
case 29:
#line 625 "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 637 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 32:
#line 653 "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 748 "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 755 "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 775 "parser.yxx"
{
  string name = yyvsp[0]._string;
  EggVertexPool *pool = NULL;

  VertexPools::const_iterator vpi = vertex_pools.find(name);
  if (vpi != vertex_pools.end()) {
    pool = (*vpi).second;
    if (pool->has_defined_vertices()) {
      eggyywarning("Duplicate vertex pool name " + name);
      pool = new EggVertexPool(name);
      vertex_pools[name] = pool;
    }
  } else {
    pool = new EggVertexPool(name);
    vertex_pools[name] = pool;
  }

  egg_stack.push_back(pool);
}
    break;
case 36:
#line 795 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 39:
#line 823 "parser.yxx"
{
  egg_stack.push_back(new EggVertex);
}
    break;
case 40:
#line 827 "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 834 "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->has_vertex(vertex_index)) {
    ostringstream errmsg;
    errmsg << "Ignoring duplicate vertex index " << vertex_index
           << " in vertex pool " << pool->get_name() << ends;
    eggyywarning(errmsg);
    vertex_index = -1;
  }

  // Even if we didn't like the vertex index number, we still need to
  // go ahead and parse the vertex.  We just won't save it.

  egg_stack.push_back(new EggVertex);
}
    break;
case 42:
#line 859 "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 880 "parser.yxx"
{
  DCAST(EggVertex, egg_stack.back())->set_pos(yyvsp[0]._number);
}
    break;
case 44:
#line 884 "parser.yxx"
{
  DCAST(EggVertex, egg_stack.back())->set_pos(LPoint2d(yyvsp[-1]._number, yyvsp[0]._number));
}
    break;
case 45:
#line 888 "parser.yxx"
{
  DCAST(EggVertex, egg_stack.back())->set_pos(LPoint3d(yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
    break;
case 46:
#line 892 "parser.yxx"
{
  DCAST(EggVertex, egg_stack.back())->set_pos(LPoint4d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
    break;
case 47:
#line 896 "parser.yxx"
{
  EggVertex *vertex = DCAST(EggVertex, egg_stack.back());
  EggVertexUV *uv = new EggVertexUV(yyvsp[-1]._string, TexCoordd::zero());
  egg_stack.push_back(uv);
  if (vertex->has_uv(yyvsp[-1]._string)) {
    eggyywarning("Ignoring repeated UV name " + yyvsp[-1]._string);
  } else {
    vertex->set_uv_obj(uv);
  }
}
    break;
case 48:
#line 907 "parser.yxx"
{
  egg_stack.pop_back();
}
    break;
case 51:
#line 913 "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 52:
#line 921 "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 53:
#line 940 "parser.yxx"
{
  DCAST(EggVertexUV, egg_stack.back())->set_uv(TexCoordd(yyvsp[-1]._number, yyvsp[0]._number));
}
    break;
case 54:
#line 944 "parser.yxx"
{
  bool inserted = DCAST(EggVertexUV, 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 55:
#line 952 "parser.yxx"
{
  bool inserted = DCAST(EggVertexUV, 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 56:
#line 970 "parser.yxx"
{
  DCAST(EggVertex, egg_stack.back())->set_normal(Normald(yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
    break;
case 57:
#line 974 "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 58:
#line 982 "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 59:
#line 1000 "parser.yxx"
{
  DCAST(EggVertex, egg_stack.back())->set_color(Colorf(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
    break;
case 60:
#line 1004 "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 61:
#line 1012 "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 62:
#line 1030 "parser.yxx"
{
  EggGroup *group = new EggGroup(yyvsp[0]._string);
  egg_stack.push_back(group);
}
    break;
case 63:
#line 1035 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 64:
#line 1050 "parser.yxx"
{
  EggGroup *group = new EggGroup(yyvsp[0]._string);
  group->set_group_type(EggGroup::GT_joint);
  egg_stack.push_back(group);
}
    break;
case 65:
#line 1056 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 66:
#line 1071 "parser.yxx"
{
  EggGroup *group = new EggGroup(yyvsp[0]._string);
  group->set_group_type(EggGroup::GT_instance);
  egg_stack.push_back(group);
}
    break;
case 67:
#line 1077 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 69:
#line 1093 "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, "visibility") == 0) {
    EggRenderMode::VisibilityMode m = 
      EggRenderMode::string_visibility_mode(strval);
    if (m == EggRenderMode::VM_unspecified) {
      eggyywarning("Unknown visibility mode " + strval);
    } else {
      group->set_visibility_mode(m);
    }

  } else if (cmp_nocase_uh(name, "draw_order") == 0) {
    group->set_draw_order(ulong_value);
  } else if (cmp_nocase_uh(name, "bin") == 0) {
    group->set_bin(strval);
  } else if (cmp_nocase_uh(name, "collide_mask") == 0) {
    group->set_collide_mask(group->get_collide_mask() | ulong_value);
  } else if (cmp_nocase_uh(name, "from_collide_mask") == 0) {
    group->set_from_collide_mask(group->get_from_collide_mask() | ulong_value);
  } else if (cmp_nocase_uh(name, "into_collide_mask") == 0) {
    group->set_into_collide_mask(group->get_into_collide_mask() | ulong_value);
  } else if (cmp_nocase_uh(name, "portal") == 0) {
    group->set_portal_flag(value != 0);
  } else if (cmp_nocase_uh(name, "polylight") == 0) {
    group->set_polylight_flag(value != 0);
  } else if (cmp_nocase_uh(name, "indexed") == 0) {
    group->set_indexed_flag(value != 0);
  } else {
    eggyywarning("Unknown group scalar " + name);
  }
}
    break;
case 70:
#line 1163 "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 71:
#line 1175 "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 72:
#line 1180 "parser.yxx"
{
  EggGroup *group = DCAST(EggGroup, egg_stack.back());
  string name = yyvsp[-4]._string;

  group->set_collision_name(name);
}
    break;
case 73:
#line 1187 "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 74:
#line 1193 "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 75:
#line 1206 "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 76:
#line 1213 "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 77:
#line 1226 "parser.yxx"
{
  EggGroup *group = DCAST(EggGroup, egg_stack.back());
  int value = (int)yyvsp[-1]._number;
  group->set_switch_flag(value!=0);
}
    break;
case 78:
#line 1232 "parser.yxx"
{
  EggGroup *group = DCAST(EggGroup, egg_stack.back());
  string type = yyvsp[-1]._string;
  group->add_object_type(type);
}
    break;
case 79:
#line 1238 "parser.yxx"
{
  EggGroup *group = DCAST(EggGroup, egg_stack.back());
  int value = (int)yyvsp[-1]._number;
  group->set_model_flag(value!=0);
}
    break;
case 80:
#line 1244 "parser.yxx"
{
  EggGroup *group = DCAST(EggGroup, egg_stack.back());
  group->set_tag(yyvsp[-3]._string, yyvsp[-1]._string);
}
    break;
case 81:
#line 1249 "parser.yxx"
{
  EggGroup *group = DCAST(EggGroup, egg_stack.back());
  int value = (int)yyvsp[-1]._number;
  group->set_texlist_flag(value!=0);
}
    break;
case 85:
#line 1258 "parser.yxx"
{
  DCAST(EggGroup, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
    break;
case 86:
#line 1272 "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 {
    if (f == EggGroup::CST_polyset && group->get_cs_type() != EggGroup::CST_none) {
      // By convention, a CST_polyset doesn't replace any existing
      // contradictory type, so ignore it if this happens.  This
      // allows the artist to place, for instance, <ObjectType> {
      // sphere } and <ObjectType> { trigger } together.

    } else {
      group->set_cs_type(f);
    }
  }
}
    break;
case 88:
#line 1303 "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 89:
#line 1325 "parser.yxx"
{
  DCAST(EggGroup, egg_stack.back())->clear_transform();
}
    break;
case 99:
#line 1351 "parser.yxx"
{
  DCAST(EggGroup, egg_stack.back())->add_translate(LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number));
}
    break;
case 100:
#line 1357 "parser.yxx"
{
  DCAST(EggGroup, egg_stack.back())->add_rotx(yyvsp[-1]._number);
}
    break;
case 101:
#line 1363 "parser.yxx"
{
  DCAST(EggGroup, egg_stack.back())->add_roty(yyvsp[-1]._number);
}
    break;
case 102:
#line 1369 "parser.yxx"
{
  DCAST(EggGroup, egg_stack.back())->add_rotz(yyvsp[-1]._number);
}
    break;
case 103:
#line 1375 "parser.yxx"
{
  DCAST(EggGroup, egg_stack.back())->add_rotate(yyvsp[-4]._number, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number));
}
    break;
case 104:
#line 1381 "parser.yxx"
{
  DCAST(EggGroup, egg_stack.back())->add_scale(LVecBase3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number));
}
    break;
case 105:
#line 1385 "parser.yxx"
{
  DCAST(EggGroup, egg_stack.back())->add_uniform_scale(yyvsp[-1]._number);
}
    break;
case 108:
#line 1400 "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 109:
#line 1419 "parser.yxx"
{
  matrix_2d = LMatrix3d::ident_mat();
}
    break;
case 110:
#line 1423 "parser.yxx"
{
  DCAST(EggTexture, egg_stack.back())->set_transform(matrix_2d);
}
    break;
case 116:
#line 1445 "parser.yxx"
{
  matrix_2d *= LMatrix3d::translate_mat(yyvsp[-2]._number, yyvsp[-1]._number);
}
    break;
case 117:
#line 1451 "parser.yxx"
{
  matrix_2d *= LMatrix3d::rotate_mat(yyvsp[-1]._number);
}
    break;
case 118:
#line 1457 "parser.yxx"
{
  matrix_2d *= LMatrix3d::scale_mat(yyvsp[-2]._number, yyvsp[-1]._number);
}
    break;
case 121:
#line 1470 "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 122:
#line 1487 "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_forward_vertex(index);
      if (vertex == NULL) {
        ostringstream errmsg;
        errmsg << "No vertex " << index << " in pool " << pool->get_name() 
               << ends;
        eggyyerror(errmsg);
      } else {
        group->ref_vertex(vertex, membership);
      }
    }
  }
}
    break;
case 123:
#line 1520 "parser.yxx"
{
  yyval._number = 1.0;
}
    break;
case 124:
#line 1524 "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 126:
#line 1561 "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 127:
#line 1566 "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 128:
#line 1583 "parser.yxx"
{
  egg_stack.push_back(new EggPolygon(yyvsp[0]._string));
}
    break;
case 129:
#line 1587 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 130:
#line 1602 "parser.yxx"
{
  egg_stack.push_back(new EggPoint(yyvsp[0]._string));
}
    break;
case 131:
#line 1606 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 132:
#line 1621 "parser.yxx"
{
  egg_stack.push_back(new EggLine(yyvsp[0]._string));
}
    break;
case 133:
#line 1625 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 134:
#line 1640 "parser.yxx"
{
  egg_stack.push_back(new EggNurbsSurface(yyvsp[0]._string));
}
    break;
case 135:
#line 1644 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 136:
#line 1659 "parser.yxx"
{
  egg_stack.push_back(new EggNurbsCurve(yyvsp[0]._string));
}
    break;
case 137:
#line 1663 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 146:
#line 1687 "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, "visibility") == 0) {
    EggRenderMode::VisibilityMode m = 
      EggRenderMode::string_visibility_mode(strval);
    if (m == EggRenderMode::VM_unspecified) {
      eggyywarning("Unknown visibility mode " + strval);
    } else {
      primitive->set_visibility_mode(m);
    }

  } else if (cmp_nocase_uh(name, "draw_order") == 0) {
    primitive->set_draw_order((int)value);
  } else if (cmp_nocase_uh(name, "bin") == 0) {
    primitive->set_bin(strval);
  } else {
    eggyywarning("Unknown scalar " + name);
  }
}
    break;
case 158:
#line 1757 "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 160:
#line 1764 "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, "visibility") == 0) {
    EggRenderMode::VisibilityMode m = 
      EggRenderMode::string_visibility_mode(strval);
    if (m == EggRenderMode::VM_unspecified) {
      eggyywarning("Unknown visibility mode " + strval);
    } else {
      primitive->set_visibility_mode(m);
    }

  } else if (cmp_nocase_uh(name, "draw_order") == 0) {
    primitive->set_draw_order((int)value);
  } else if (cmp_nocase_uh(name, "bin") == 0) {
    primitive->set_bin(strval);
  } else if (cmp_nocase_uh(name, "u_subdiv") == 0) {
    primitive->set_u_subdiv((int)value);
  } else if (cmp_nocase_uh(name, "v_subdiv") == 0) {
    primitive->set_v_subdiv((int)value);
  } else {
    eggyywarning("Unknown scalar " + name);
  }
}
    break;
case 171:
#line 1838 "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, "visibility") == 0) {
    EggRenderMode::VisibilityMode m = 
      EggRenderMode::string_visibility_mode(strval);
    if (m == EggRenderMode::VM_unspecified) {
      eggyywarning("Unknown visibility mode " + strval);
    } else {
      primitive->set_visibility_mode(m);
    }

  } else if (cmp_nocase_uh(name, "draw_order") == 0) {
    primitive->set_draw_order((int)value);
  } else if (cmp_nocase_uh(name, "bin") == 0) {
    primitive->set_bin(strval);
  } else if (cmp_nocase_uh(name, "subdiv") == 0) {
    primitive->set_subdiv((int)value);
  } else if (cmp_nocase_uh(name, "type") == 0) {
    EggCurve::CurveType a = EggCurve::string_curve_type(strval);
    if (a == EggCurve::CT_none) {
      eggyywarning("Unknown curve type " + strval);
    } else {
      primitive->set_curve_type(a);
    }
    
  } else {
    eggyywarning("Unknown scalar " + name);
  }
}
    break;
case 172:
#line 1907 "parser.yxx"
{
  if (yyvsp[0]._egg != (EggTexture *)NULL) {
    EggTexture *texture = DCAST(EggTexture, yyvsp[0]._egg);
    DCAST(EggPrimitive, egg_stack.back())->add_texture(texture);
  }
}
    break;
case 173:
#line 1924 "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())->add_texture(texture);
}
    break;
case 174:
#line 1964 "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 175:
#line 1981 "parser.yxx"
{
  DCAST(EggPrimitive, egg_stack.back())->set_normal(Normald(yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
    break;
case 176:
#line 1985 "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 177:
#line 1993 "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 178:
#line 2011 "parser.yxx"
{
  DCAST(EggPrimitive, egg_stack.back())->set_color(Colorf(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number));
}
    break;
case 179:
#line 2015 "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 180:
#line 2023 "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 181:
#line 2041 "parser.yxx"
{
  EggPrimitive *primitive = DCAST(EggPrimitive, egg_stack.back());
  int value = (int)yyvsp[0]._number;
  primitive->set_bface_flag(value!=0);
}
    break;
case 182:
#line 2057 "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_forward_vertex(index);
      if (vertex == NULL) {
        ostringstream errmsg;
        errmsg << "No vertex " << index << " in pool " << pool->get_name() 
               << ends;
        eggyyerror(errmsg);
      } else {
        prim->add_vertex(vertex);
      }
    }
  }
}
    break;
case 183:
#line 2088 "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 184:
#line 2106 "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 185:
#line 2126 "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 186:
#line 2146 "parser.yxx"
{
  EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
  nurbs->_trims.push_back(EggNurbsSurface::Trim());
}
    break;
case 188:
#line 2162 "parser.yxx"
{
  EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back());
  nassertr(!nurbs->_trims.empty(), 0);
  nurbs->_trims.back().push_back(EggNurbsSurface::Loop());
}
    break;
case 189:
#line 2168 "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 190:
#line 2187 "parser.yxx"
{
  EggNurbsCurve *nurbs = DCAST(EggNurbsCurve, egg_stack.back());
  int order = (int)yyvsp[0]._number;
  nurbs->set_order(order);
}
    break;
case 191:
#line 2203 "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 192:
#line 2224 "parser.yxx"
{
  EggTable *table = new EggTable(yyvsp[0]._string);
  table->set_table_type(EggTable::TT_table);
  egg_stack.push_back(table);
}
    break;
case 193:
#line 2230 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 194:
#line 2246 "parser.yxx"
{
  EggTable *table = new EggTable(yyvsp[0]._string);
  table->set_table_type(EggTable::TT_bundle);
  egg_stack.push_back(table);
}
    break;
case 195:
#line 2252 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 197:
#line 2269 "parser.yxx"
{
  DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
    break;
case 198:
#line 2273 "parser.yxx"
{
  DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
    break;
case 199:
#line 2277 "parser.yxx"
{
  DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
    break;
case 200:
#line 2281 "parser.yxx"
{
  DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
    break;
case 201:
#line 2285 "parser.yxx"
{
  DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
    break;
case 202:
#line 2300 "parser.yxx"
{
  EggSAnimData *anim_data = new EggSAnimData(yyvsp[0]._string);
  egg_stack.push_back(anim_data);
}
    break;
case 203:
#line 2305 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 205:
#line 2322 "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 206:
#line 2334 "parser.yxx"
{
  DCAST(EggSAnimData, egg_stack.back())->set_data(yyvsp[-1]._number_list);
}
    break;
case 207:
#line 2348 "parser.yxx"
{
  EggXfmAnimData *anim_data = new EggXfmAnimData(yyvsp[0]._string);
  egg_stack.push_back(anim_data);
}
    break;
case 208:
#line 2353 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 210:
#line 2370 "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 211:
#line 2387 "parser.yxx"
{
  DCAST(EggXfmAnimData, egg_stack.back())->set_data(yyvsp[-1]._number_list);
}
    break;
case 212:
#line 2401 "parser.yxx"
{
  EggXfmSAnim *anim_group = new EggXfmSAnim(yyvsp[0]._string);
  egg_stack.push_back(anim_group);
}
    break;
case 213:
#line 2406 "parser.yxx"
{
  yyval._egg = egg_stack.back();
  egg_stack.pop_back();
}
    break;
case 215:
#line 2423 "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 216:
#line 2438 "parser.yxx"
{
  DCAST(EggXfmSAnim, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg));
}
    break;
case 217:
#line 2453 "parser.yxx"
{
  yyval._number_list = PTA_double::empty_array(0);
}
    break;
case 218:
#line 2457 "parser.yxx"
{
  yyval._number_list.push_back((double)yyvsp[0]._number);
}
    break;
case 219:
#line 2471 "parser.yxx"
{
  yyval._number_list = PTA_double::empty_array(0);
}
    break;
case 220:
#line 2475 "parser.yxx"
{
  yyval._number_list.push_back(yyvsp[0]._number);
}
    break;
case 221:
#line 2489 "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 222:
#line 2510 "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 223:
#line 2531 "parser.yxx"
{
  string name = yyvsp[0]._string;
  VertexPools::iterator vpi = vertex_pools.find(name);
  if (vpi == vertex_pools.end()) {
    // This will become a forward reference.
    EggVertexPool *pool = new EggVertexPool(name);
    vertex_pools[name] = pool;
    yyval._egg = pool;
  } else {
    yyval._egg = (*vpi).second;
  }
}
    break;
case 224:
#line 2555 "parser.yxx"
{
  eggyyerror("Name required.");
  yyval._string = "";
}
    break;
case 227:
#line 2584 "parser.yxx"
{
  eggyyerror("String required.");
  yyval._string = "";
}
    break;
case 229:
#line 2600 "parser.yxx"
{
  yyval._string = "";
}
    break;
case 231:
#line 2618 "parser.yxx"
{
  yyval._string = yyvsp[0]._string;
}
    break;
case 232:
#line 2622 "parser.yxx"
{
  yyval._string = yyvsp[0]._string;
}
    break;
case 234:
#line 2639 "parser.yxx"
{
  yyval._string = "";
}
    break;
case 235:
#line 2643 "parser.yxx"
{
  yyval._string = yyvsp[0]._string;
}
    break;
case 236:
#line 2659 "parser.yxx"
{
  yyval._string = yyvsp[0]._string;
}
    break;
case 237:
#line 2663 "parser.yxx"
{
  yyval._string = yyvsp[-1]._string + "\n" + yyvsp[0]._string;
}
    break;
case 239:
#line 2678 "parser.yxx"
{
  yyval._number = yyvsp[0]._ulong;
}
    break;
case 240:
#line 2693 "parser.yxx"
{
  yyval._number = yyvsp[0]._number;
  yyval._ulong = (unsigned long)yyvsp[0]._number;
  yyval._string = yyvsp[0]._string;
}
    break;
case 241:
#line 2699 "parser.yxx"
{
  yyval._number = yyvsp[0]._ulong;
  yyval._ulong = yyvsp[0]._ulong;
  yyval._string = yyvsp[0]._string;
}
    break;
case 242:
#line 2705 "parser.yxx"
{
  yyval._number = 0.0;
  yyval._ulong = 0;
  yyval._string = yyvsp[0]._string;
}
    break;
case 243:
#line 2722 "parser.yxx"
{
  int i = (int)yyvsp[0]._number;
  if ((double)i != yyvsp[0]._number) {
    eggyywarning("Integer expected.");
    yyval._number = (double)i;
  }
}
    break;
case 244:
#line 2730 "parser.yxx"
{
  yyval._number = yyvsp[0]._ulong;
}
    break;
}

#line 705 "/usr/share/bison/bison.simple"


  yyvsp -= yylen;
  yyssp -= yylen;
#if YYLSP_NEEDED
  yylsp -= yylen;
#endif

#if YYDEBUG
  if (yydebug)
    {
      short *yyssp1 = yyss - 1;
      YYFPRINTF (stderr, "state stack now");
      while (yyssp1 != yyssp)
	YYFPRINTF (stderr, " %d", *++yyssp1);
      YYFPRINTF (stderr, "\n");
    }
#endif

  *++yyvsp = yyval;
#if YYLSP_NEEDED
  *++yylsp = yyloc;
#endif

  /* Now `shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTBASE];

  goto yynewstate;


/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;

#ifdef YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (yyn > YYFLAG && yyn < YYLAST)
	{
	  YYSIZE_T yysize = 0;
	  char *yymsg;
	  int yyx, yycount;

	  yycount = 0;
	  /* Start YYX at -YYN if negative to avoid negative indexes in
	     YYCHECK.  */
	  for (yyx = yyn < 0 ? -yyn : 0;
	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
	    if (yycheck[yyx + yyn] == yyx)
	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
	  yysize += yystrlen ("parse error, unexpected ") + 1;
	  yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
	  yymsg = (char *) YYSTACK_ALLOC (yysize);
	  if (yymsg != 0)
	    {
	      char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
	      yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);

	      if (yycount < 5)
		{
		  yycount = 0;
		  for (yyx = yyn < 0 ? -yyn : 0;
		       yyx < (int) (sizeof (yytname) / sizeof (char *));
		       yyx++)
		    if (yycheck[yyx + yyn] == yyx)
		      {
			const char *yyq = ! yycount ? ", expecting " : " or ";
			yyp = yystpcpy (yyp, yyq);
			yyp = yystpcpy (yyp, yytname[yyx]);
			yycount++;
		      }
		}
	      yyerror (yymsg);
	      YYSTACK_FREE (yymsg);
	    }
	  else
	    yyerror ("parse error; also virtual memory exhausted");
	}
      else
#endif /* defined (YYERROR_VERBOSE) */
	yyerror ("parse error");
    }
  goto yyerrlab1;


/*--------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action |
`--------------------------------------------------*/
yyerrlab1:
  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
	 error, discard it.  */

      /* return failure if at end of input */
      if (yychar == YYEOF)
	YYABORT;
      YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
		  yychar, yytname[yychar1]));
      yychar = YYEMPTY;
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */

  yyerrstatus = 3;		/* Each real token shifted decrements this */

  goto yyerrhandle;


/*-------------------------------------------------------------------.
| yyerrdefault -- current state does not do anything special for the |
| error token.                                                       |
`-------------------------------------------------------------------*/
yyerrdefault:
#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */

  /* If its default is to accept any token, ok.  Otherwise pop it.  */
  yyn = yydefact[yystate];
  if (yyn)
    goto yydefault;
#endif


/*---------------------------------------------------------------.
| yyerrpop -- pop the current state because it cannot handle the |
| error token                                                    |
`---------------------------------------------------------------*/
yyerrpop:
  if (yyssp == yyss)
    YYABORT;
  yyvsp--;
  yystate = *--yyssp;
#if YYLSP_NEEDED
  yylsp--;
#endif

#if YYDEBUG
  if (yydebug)
    {
      short *yyssp1 = yyss - 1;
      YYFPRINTF (stderr, "Error: state stack now");
      while (yyssp1 != yyssp)
	YYFPRINTF (stderr, " %d", *++yyssp1);
      YYFPRINTF (stderr, "\n");
    }
#endif

/*--------------.
| yyerrhandle.  |
`--------------*/
yyerrhandle:
  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yyerrdefault;

  yyn += YYTERROR;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
    goto yyerrdefault;

  yyn = yytable[yyn];
  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrpop;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrpop;

  if (yyn == YYFINAL)
    YYACCEPT;

  YYDPRINTF ((stderr, "Shifting error token, "));

  *++yyvsp = yylval;
#if YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturn;

/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturn;

/*---------------------------------------------.
| yyoverflowab -- parser overflow comes here.  |
`---------------------------------------------*/
yyoverflowlab:
  yyerror ("parser stack overflow");
  yyresult = 2;
  /* Fall through.  */

yyreturn:
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
  return yyresult;
}
#line 2737 "parser.yxx"
