Преглед изворни кода

support GLSL tessellation shaders

David Rose пре 13 година
родитељ
комит
e9053ff910
45 измењених фајлова са 5555 додато и 4058 уклоњено
  1. 22 0
      panda/src/display/graphicsStateGuardian.I
  2. 19 0
      panda/src/display/graphicsStateGuardian.cxx
  3. 8 0
      panda/src/display/graphicsStateGuardian.h
  4. 20 1
      panda/src/doc/eggSyntax.txt
  5. 9 3
      panda/src/egg/Sources.pp
  6. 2 0
      panda/src/egg/config_egg.cxx
  7. 43 0
      panda/src/egg/eggPatch.I
  8. 37 0
      panda/src/egg/eggPatch.cxx
  9. 56 0
      panda/src/egg/eggPatch.h
  10. 3359 3345
      panda/src/egg/lexer.cxx.prebuilt
  11. 4 0
      panda/src/egg/lexer.lxx
  12. 1 0
      panda/src/egg/p3egg_composite2.cxx
  13. 449 437
      panda/src/egg/parser.cxx.prebuilt
  14. 103 102
      panda/src/egg/parser.h.prebuilt
  15. 23 1
      panda/src/egg/parser.yxx
  16. 16 1
      panda/src/egg2pg/eggBinner.cxx
  17. 1 0
      panda/src/egg2pg/eggBinner.h
  18. 8 1
      panda/src/egg2pg/eggLoader.cxx
  19. 1 1
      panda/src/glstuff/glGraphicsStateGuardian_src.I
  20. 82 10
      panda/src/glstuff/glGraphicsStateGuardian_src.cxx
  21. 5 2
      panda/src/glstuff/glGraphicsStateGuardian_src.h
  22. 111 44
      panda/src/glstuff/glShaderContext_src.cxx
  23. 2 0
      panda/src/glstuff/glShaderContext_src.h
  24. 768 89
      panda/src/glstuff/panda_glext.h
  25. 3 0
      panda/src/gobj/Sources.pp
  26. 3 0
      panda/src/gobj/config_gobj.cxx
  27. 2 1
      panda/src/gobj/geomEnums.h
  28. 1 0
      panda/src/gobj/geomLines.h
  29. 1 0
      panda/src/gobj/geomLinestrips.h
  30. 172 0
      panda/src/gobj/geomPatches.cxx
  31. 76 0
      panda/src/gobj/geomPatches.h
  32. 1 0
      panda/src/gobj/geomPoints.h
  33. 1 0
      panda/src/gobj/geomTriangles.h
  34. 1 0
      panda/src/gobj/geomTrifans.h
  35. 1 0
      panda/src/gobj/geomTristrips.h
  36. 1 0
      panda/src/gobj/p3gobj_composite1.cxx
  37. 6 0
      panda/src/gobj/shader.I
  38. 41 9
      panda/src/gobj/shader.cxx
  39. 42 11
      panda/src/gobj/shader.h
  40. 1 0
      panda/src/gsgbase/graphicsStateGuardianBase.h
  41. 20 0
      panda/src/pgraphnodes/sceneGraphAnalyzer.I
  42. 14 0
      panda/src/pgraphnodes/sceneGraphAnalyzer.cxx
  43. 4 0
      panda/src/pgraphnodes/sceneGraphAnalyzer.h
  44. 14 0
      pandatool/src/bam/bamToEgg.cxx
  45. 1 0
      pandatool/src/bam/bamToEgg.h

+ 22 - 0
panda/src/display/graphicsStateGuardian.I

@@ -633,6 +633,28 @@ get_supports_basic_shaders() const {
   return _supports_basic_shaders;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: GraphicsStateGuardian::get_supports_geometry_shaders
+//       Access: Published
+//  Description: Returns true if this particular GSG supports
+//               geometry shaders.
+////////////////////////////////////////////////////////////////////
+INLINE bool GraphicsStateGuardian::
+get_supports_geometry_shaders() const {
+  return _supports_geometry_shaders;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GraphicsStateGuardian::get_supports_tessellation_shaders
+//       Access: Published
+//  Description: Returns true if this particular GSG supports
+//               tesselation shaders.
+////////////////////////////////////////////////////////////////////
+INLINE bool GraphicsStateGuardian::
+get_supports_tessellation_shaders() const {
+  return _supports_tessellation_shaders;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: GraphicsStateGuardian::get_supports_glsl
 //       Access: Published

+ 19 - 0
panda/src/display/graphicsStateGuardian.cxx

@@ -80,10 +80,12 @@ PStatCollector GraphicsStateGuardian::_primitive_batches_pcollector("Primitive b
 PStatCollector GraphicsStateGuardian::_primitive_batches_tristrip_pcollector("Primitive batches:Triangle strips");
 PStatCollector GraphicsStateGuardian::_primitive_batches_trifan_pcollector("Primitive batches:Triangle fans");
 PStatCollector GraphicsStateGuardian::_primitive_batches_tri_pcollector("Primitive batches:Triangles");
+PStatCollector GraphicsStateGuardian::_primitive_batches_patch_pcollector("Primitive batches:Patches");
 PStatCollector GraphicsStateGuardian::_primitive_batches_other_pcollector("Primitive batches:Other");
 PStatCollector GraphicsStateGuardian::_vertices_tristrip_pcollector("Vertices:Triangle strips");
 PStatCollector GraphicsStateGuardian::_vertices_trifan_pcollector("Vertices:Triangle fans");
 PStatCollector GraphicsStateGuardian::_vertices_tri_pcollector("Vertices:Triangles");
+PStatCollector GraphicsStateGuardian::_vertices_patch_pcollector("Vertices:Patches");
 PStatCollector GraphicsStateGuardian::_vertices_other_pcollector("Vertices:Other");
 PStatCollector GraphicsStateGuardian::_state_pcollector("State changes");
 PStatCollector GraphicsStateGuardian::_transform_state_pcollector("State changes:Transforms");
@@ -214,6 +216,8 @@ GraphicsStateGuardian(CoordinateSystem internal_coordinate_system,
   _supports_depth_stencil = false;
   _supports_shadow_filter = false;
   _supports_basic_shaders = false;
+  _supports_geometry_shaders = false;
+  _supports_tessellation_shaders = false;
   _supports_glsl = false;
 
   _supports_stencil = false;
@@ -1554,10 +1558,12 @@ end_frame(Thread *current_thread) {
   _primitive_batches_tristrip_pcollector.flush_level();
   _primitive_batches_trifan_pcollector.flush_level();
   _primitive_batches_tri_pcollector.flush_level();
+  _primitive_batches_patch_pcollector.flush_level();
   _primitive_batches_other_pcollector.flush_level();
   _vertices_tristrip_pcollector.flush_level();
   _vertices_trifan_pcollector.flush_level();
   _vertices_tri_pcollector.flush_level();
+  _vertices_patch_pcollector.flush_level();
   _vertices_other_pcollector.flush_level();
 
   _state_pcollector.flush_level();
@@ -1720,6 +1726,17 @@ draw_trifans(const GeomPrimitivePipelineReader *, bool) {
   return false;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: GraphicsStateGuardian::draw_patches
+//       Access: Public, Virtual
+//  Description: Draws a series of "patches", which can only be
+//               processed by a tessellation shader.
+////////////////////////////////////////////////////////////////////
+bool GraphicsStateGuardian::
+draw_patches(const GeomPrimitivePipelineReader *, bool) {
+  return false;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: GraphicsStateGuardian::draw_lines
 //       Access: Public, Virtual
@@ -2241,10 +2258,12 @@ init_frame_pstats() {
     _primitive_batches_tristrip_pcollector.clear_level();
     _primitive_batches_trifan_pcollector.clear_level();
     _primitive_batches_tri_pcollector.clear_level();
+    _primitive_batches_patch_pcollector.clear_level();
     _primitive_batches_other_pcollector.clear_level();
     _vertices_tristrip_pcollector.clear_level();
     _vertices_trifan_pcollector.clear_level();
     _vertices_tri_pcollector.clear_level();
+    _vertices_patch_pcollector.clear_level();
     _vertices_other_pcollector.clear_level();
 
     _state_pcollector.clear_level();

+ 8 - 0
panda/src/display/graphicsStateGuardian.h

@@ -143,6 +143,8 @@ PUBLISHED:
   INLINE bool get_supports_depth_stencil() const;
   INLINE bool get_supports_shadow_filter() const;
   INLINE bool get_supports_basic_shaders() const;
+  INLINE bool get_supports_geometry_shaders() const;
+  INLINE bool get_supports_tessellation_shaders() const;
   INLINE bool get_supports_glsl() const;
   INLINE bool get_supports_stencil() const;
   INLINE bool get_supports_two_sided_stencil() const;
@@ -274,6 +276,8 @@ public:
                               bool force);
   virtual bool draw_trifans(const GeomPrimitivePipelineReader *reader,
                             bool force);
+  virtual bool draw_patches(const GeomPrimitivePipelineReader *reader,
+                            bool force);
   virtual bool draw_lines(const GeomPrimitivePipelineReader *reader,
                           bool force);
   virtual bool draw_linestrips(const GeomPrimitivePipelineReader *reader,
@@ -482,6 +486,8 @@ protected:
   bool _supports_depth_stencil;
   bool _supports_shadow_filter;
   bool _supports_basic_shaders;
+  bool _supports_geometry_shaders;
+  bool _supports_tessellation_shaders;
   bool _supports_glsl;
   bool _supports_framebuffer_multisample;
   bool _supports_framebuffer_blit;
@@ -534,10 +540,12 @@ public:
   static PStatCollector _primitive_batches_tristrip_pcollector;
   static PStatCollector _primitive_batches_trifan_pcollector;
   static PStatCollector _primitive_batches_tri_pcollector;
+  static PStatCollector _primitive_batches_patch_pcollector;
   static PStatCollector _primitive_batches_other_pcollector;
   static PStatCollector _vertices_tristrip_pcollector;
   static PStatCollector _vertices_trifan_pcollector;
   static PStatCollector _vertices_tri_pcollector;
+  static PStatCollector _vertices_patch_pcollector;
   static PStatCollector _vertices_other_pcollector;
   static PStatCollector _vertices_indexed_tristrip_pcollector;
   static PStatCollector _state_pcollector;

+ 20 - 1
panda/src/doc/eggSyntax.txt

@@ -916,6 +916,26 @@ GEOMETRY ENTRIES
     or even within a texture.
 
 
+<Patch> name { 
+    [attributes] 
+    <VertexRef> { 
+        indices 
+        <Ref> { pool-name } 
+    } 
+}
+
+  A patch is similar to a polygon, but it is a special primitive that
+  can only be rendered with the use of a tessellation shader.  Each
+  patch consists of an arbitrary number of vertices; all patches with
+  the same number of vertices are collected together into the same
+  GeomPatches object to be delivered to the shader in a single batch.
+  It is then up to the shader to create the correct set of triangles
+  from the patch data.
+
+  All of the attributes that are valid for Polygon, above, may also be
+  specified for Patch.
+
+
 <PointLight> name { 
     [attributes] 
     <VertexRef> { 
@@ -944,7 +964,6 @@ GEOMETRY ENTRIES
     viewer normally.
 
 
-
 <Line> name { 
     [attributes] 
     <VertexRef> { 

+ 9 - 3
panda/src/egg/Sources.pp

@@ -37,7 +37,9 @@
      eggNamedObject.I eggNamedObject.h eggNameUniquifier.h  \
      eggNode.I eggNode.h eggNurbsCurve.I eggNurbsCurve.h  \
      eggNurbsSurface.I eggNurbsSurface.h eggObject.I eggObject.h  \
-     eggParameters.h eggPoint.I eggPoint.h eggPolygon.I  \
+     eggParameters.h \
+     eggPatch.I eggPatch.h \
+     eggPoint.I eggPoint.h eggPolygon.I  \
      eggPolygon.h eggPolysetMaker.h eggPoolUniquifier.h \
      eggPrimitive.I eggPrimitive.h \
      eggRenderMode.I eggRenderMode.h  \
@@ -77,7 +79,9 @@
      eggMiscFuncs.cxx eggMorphList.cxx  \
      eggNamedObject.cxx eggNameUniquifier.cxx eggNode.cxx  \
      eggNurbsCurve.cxx eggNurbsSurface.cxx eggObject.cxx  \
-     eggParameters.cxx eggPoint.cxx eggPolygon.cxx eggPolysetMaker.cxx  \
+     eggParameters.cxx \
+     eggPatch.cxx \
+     eggPoint.cxx eggPolygon.cxx eggPolysetMaker.cxx  \
      eggPoolUniquifier.cxx eggPrimitive.cxx eggRenderMode.cxx  \
      eggSAnimData.cxx eggSurface.cxx eggSwitchCondition.cxx  \
      eggTable.cxx eggTexture.cxx eggTextureCollection.cxx  \
@@ -110,7 +114,9 @@
     eggMorph.I eggMorph.h eggMorphList.I eggMorphList.h \
     eggNamedObject.I eggNamedObject.h eggNameUniquifier.h eggNode.I eggNode.h \
     eggNurbsCurve.I eggNurbsCurve.h eggNurbsSurface.I eggNurbsSurface.h \
-    eggObject.I eggObject.h eggParameters.h eggPoint.I eggPoint.h \
+    eggObject.I eggObject.h eggParameters.h \
+    eggPatch.I eggPatch.h \
+    eggPoint.I eggPoint.h \
     eggPolygon.I eggPolygon.h eggPolysetMaker.h eggPoolUniquifier.h \
     eggPrimitive.I eggPrimitive.h eggRenderMode.I eggRenderMode.h \
     eggSAnimData.I eggSAnimData.h eggSurface.I eggSurface.h \

+ 2 - 0
panda/src/egg/config_egg.cxx

@@ -36,6 +36,7 @@
 #include "eggNurbsCurve.h"
 #include "eggNurbsSurface.h"
 #include "eggObject.h"
+#include "eggPatch.h"
 #include "eggPoint.h"
 #include "eggPolygon.h"
 #include "eggPolysetMaker.h"
@@ -199,6 +200,7 @@ init_libegg() {
   EggNurbsCurve::init_type();
   EggNurbsSurface::init_type();
   EggObject::init_type();
+  EggPatch::init_type();
   EggPoint::init_type();
   EggPolygon::init_type();
   EggPolysetMaker::init_type();

+ 43 - 0
panda/src/egg/eggPatch.I

@@ -0,0 +1,43 @@
+// Filename: eggPatch.I
+// Created by:  drose (27Apr12)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) Carnegie Mellon University.  All rights reserved.
+//
+// All use of this software is subject to the terms of the revised BSD
+// license.  You should have received a copy of this license along
+// with this source code in a file named "LICENSE."
+//
+////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////////////
+//     Function: EggPatch::Constructor
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE EggPatch::
+EggPatch(const string &name) : EggPrimitive(name) {
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: EggPatch::Copy constructor
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE EggPatch::
+EggPatch(const EggPatch &copy) : EggPrimitive(copy) {
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: EggPatch::Copy assignment operator
+//       Access: Published
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE EggPatch &EggPatch::
+operator = (const EggPatch &copy) {
+  EggPrimitive::operator = (copy);
+  return *this;
+}

+ 37 - 0
panda/src/egg/eggPatch.cxx

@@ -0,0 +1,37 @@
+// Filename: eggPatch.cxx
+// Created by:  drose (27Apr12)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) Carnegie Mellon University.  All rights reserved.
+//
+// All use of this software is subject to the terms of the revised BSD
+// license.  You should have received a copy of this license along
+// with this source code in a file named "LICENSE."
+//
+////////////////////////////////////////////////////////////////////
+
+#include "eggPatch.h"
+#include "eggGroupNode.h"
+#include "plane.h"
+
+#include "indent.h"
+
+#include <algorithm>
+
+TypeHandle EggPatch::_type_handle;
+
+
+////////////////////////////////////////////////////////////////////
+//     Function: EggPatch::write
+//       Access: Published, Virtual
+//  Description: Writes the patch to the indicated output stream in
+//               Egg format.
+////////////////////////////////////////////////////////////////////
+void EggPatch::
+write(ostream &out, int indent_level) const {
+  write_header(out, indent_level, "<Patch>");
+  write_body(out, indent_level+2);
+  indent(out, indent_level) << "}\n";
+}

+ 56 - 0
panda/src/egg/eggPatch.h

@@ -0,0 +1,56 @@
+// Filename: eggPatch.h
+// Created by:  drose (27Apr12)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) Carnegie Mellon University.  All rights reserved.
+//
+// All use of this software is subject to the terms of the revised BSD
+// license.  You should have received a copy of this license along
+// with this source code in a file named "LICENSE."
+//
+////////////////////////////////////////////////////////////////////
+
+#ifndef EGGPATCH_H
+#define EGGPATCH_H
+
+#include "pandabase.h"
+
+#include "eggPrimitive.h"
+
+////////////////////////////////////////////////////////////////////
+//       Class : EggPatch
+// Description : A single "patch", a special primitive to be rendered
+//               only with a tessellation shader.
+////////////////////////////////////////////////////////////////////
+class EXPCL_PANDAEGG EggPatch : public EggPrimitive {
+PUBLISHED:
+  INLINE EggPatch(const string &name = "");
+  INLINE EggPatch(const EggPatch &copy);
+  INLINE EggPatch &operator = (const EggPatch &copy);
+
+  virtual void write(ostream &out, int indent_level) const;
+
+public:
+  static TypeHandle get_class_type() {
+    return _type_handle;
+  }
+  static void init_type() {
+    EggPrimitive::init_type();
+    register_type(_type_handle, "EggPatch",
+                  EggPrimitive::get_class_type());
+  }
+  virtual TypeHandle get_type() const {
+    return get_class_type();
+  }
+  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
+
+private:
+  static TypeHandle _type_handle;
+
+};
+
+#include "eggPatch.I"
+
+#endif

+ 3359 - 3345
panda/src/egg/lexer.cxx.prebuilt

@@ -1,3345 +1,3359 @@
-#line 2 "lex.yy.c"
-
-#line 4 "lex.yy.c"
-
-#define  YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define yy_create_buffer eggyy_create_buffer
-#define yy_delete_buffer eggyy_delete_buffer
-#define yy_flex_debug eggyy_flex_debug
-#define yy_init_buffer eggyy_init_buffer
-#define yy_flush_buffer eggyy_flush_buffer
-#define yy_load_buffer_state eggyy_load_buffer_state
-#define yy_switch_to_buffer eggyy_switch_to_buffer
-#define yyin eggyyin
-#define yyleng eggyyleng
-#define yylex eggyylex
-#define yylineno eggyylineno
-#define yyout eggyyout
-#define yyrestart eggyyrestart
-#define yytext eggyytext
-#define yywrap eggyywrap
-#define yyalloc eggyyalloc
-#define yyrealloc eggyyrealloc
-#define yyfree eggyyfree
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN               (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN              (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN              (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX               (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX              (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX              (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX              (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX             (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX             (4294967295U)
-#endif
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else	/* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif	/* defined (__STDC__) */
-#endif	/* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN (yy_start) = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START (((yy_start) - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE eggyyrestart(eggyyin  )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-extern yy_size_t eggyyleng;
-
-extern FILE *eggyyin, *eggyyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-    #define YY_LESS_LINENO(n)
-    
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up eggyytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		*yy_cp = (yy_hold_char); \
-		YY_RESTORE_YY_MORE_OFFSET \
-		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up eggyytext again */ \
-		} \
-	while ( 0 )
-
-#define unput(c) yyunput( c, (yytext_ptr)  )
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-	{
-	FILE *yy_input_file;
-
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
-
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	yy_size_t yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-    
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
-
-	int yy_buffer_status;
-
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-	/* When an EOF's been seen but there's still some text to process
-	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-	 * shouldn't try reading from the input source any more.  We might
-	 * still have a bunch of tokens to match, though, because of
-	 * possible backing-up.
-	 *
-	 * When we actually see the EOF, we change the status to "new"
-	 * (via eggyyrestart()), so that the user can continue scanning by
-	 * just pointing eggyyin at a new input file.
-	 */
-#define YY_BUFFER_EOF_PENDING 2
-
-	};
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* Stack of input buffers. */
-static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
-static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
-                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
-                          : NULL)
-
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-
-/* yy_hold_char holds the character lost when eggyytext is formed. */
-static char yy_hold_char;
-static yy_size_t yy_n_chars;		/* number of characters read into yy_ch_buf */
-yy_size_t eggyyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0;		/* whether we need to initialize */
-static int yy_start = 0;	/* start state number */
-
-/* Flag which is used to allow eggyywrap()'s to do buffer switches
- * instead of setting up a fresh eggyyin.  A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void eggyyrestart (FILE *input_file  );
-void eggyy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
-YY_BUFFER_STATE eggyy_create_buffer (FILE *file,int size  );
-void eggyy_delete_buffer (YY_BUFFER_STATE b  );
-void eggyy_flush_buffer (YY_BUFFER_STATE b  );
-void eggyypush_buffer_state (YY_BUFFER_STATE new_buffer  );
-void eggyypop_buffer_state (void );
-
-static void eggyyensure_buffer_stack (void );
-static void eggyy_load_buffer_state (void );
-static void eggyy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
-
-#define YY_FLUSH_BUFFER eggyy_flush_buffer(YY_CURRENT_BUFFER )
-
-YY_BUFFER_STATE eggyy_scan_buffer (char *base,yy_size_t size  );
-YY_BUFFER_STATE eggyy_scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE eggyy_scan_bytes (yyconst char *bytes,yy_size_t len  );
-
-void *eggyyalloc (yy_size_t  );
-void *eggyyrealloc (void *,yy_size_t  );
-void eggyyfree (void *  );
-
-#define yy_new_buffer eggyy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){ \
-        eggyyensure_buffer_stack (); \
-		YY_CURRENT_BUFFER_LVALUE =    \
-            eggyy_create_buffer(eggyyin,YY_BUF_SIZE ); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-	}
-
-#define yy_set_bol(at_bol) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){\
-        eggyyensure_buffer_stack (); \
-		YY_CURRENT_BUFFER_LVALUE =    \
-            eggyy_create_buffer(eggyyin,YY_BUF_SIZE ); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-	}
-
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-typedef unsigned char YY_CHAR;
-
-FILE *eggyyin = (FILE *) 0, *eggyyout = (FILE *) 0;
-
-typedef int yy_state_type;
-
-extern int eggyylineno;
-
-int eggyylineno = 1;
-
-extern char *eggyytext;
-#define yytext_ptr eggyytext
-
-static yy_state_type yy_get_previous_state (void );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
-static int yy_get_next_buffer (void );
-static void yy_fatal_error (yyconst char msg[]  );
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up eggyytext.
- */
-#define YY_DO_BEFORE_ACTION \
-	(yytext_ptr) = yy_bp; \
-	eggyyleng = (size_t) (yy_cp - yy_bp); \
-	(yy_hold_char) = *yy_cp; \
-	*yy_cp = '\0'; \
-	(yy_c_buf_p) = yy_cp;
-
-#define YY_NUM_RULES 100
-#define YY_END_OF_BUFFER 101
-/* This struct is not used in this scanner,
-   but its presence is necessary. */
-struct yy_trans_info
-	{
-	flex_int32_t yy_verify;
-	flex_int32_t yy_nxt;
-	};
-static yyconst flex_int16_t yy_accept[580] =
-    {   0,
-        0,    0,  101,   99,    2,    1,   98,   99,   99,   99,
-       99,   90,   90,   90,   99,   99,   99,    5,   99,    1,
-       99,   90,   90,   99,   90,    4,    3,   90,   92,   99,
-       91,   90,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   90,   99,    3,    3,   92,   99,
-       90,   91,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   66,   99,   99,   99,
-       94,   99,   99,   95,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   20,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   81,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,    7,   99,   99,   99,   99,   99,
-
-       99,   99,   99,   99,   99,   99,   99,   26,   99,   99,
-       99,   99,   99,   24,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   52,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   67,   99,   99,
-       99,   99,   99,   99,   99,   99,   78,   99,   99,   99,
-       99,   99,   99,   93,   99,   96,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   99,   21,   99,
-       99,   99,   99,   99,   25,   99,   30,   99,   99,   99,
-       99,   99,   37,   38,   99,   99,   99,   43,   99,   99,
-
-       99,   99,   99,   99,   99,   53,   99,   55,   56,   57,
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   74,   99,   77,   99,   99,   99,   99,   99,
-       99,   93,   97,   99,   99,    9,   99,   99,   99,   14,
-       99,   99,   99,   99,   99,   99,   99,   99,   23,   28,
-       99,   31,   99,   99,   33,   34,   99,   99,   42,   99,
-       99,   99,   99,   48,   99,   99,   99,   99,   99,   99,
-       60,   99,   99,   99,   65,   99,   99,   99,   99,   99,
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   99,   13,   15,   99,   99,   99,   99,   99,   99,
-
-       99,   99,   99,   99,   99,   99,   99,   44,   99,   99,
-       99,   99,   99,   99,   54,   58,   59,   99,   99,   63,
-       99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   84,   99,   99,   99,   99,   99,   99,   99,   99,
-       99,   16,   17,   99,   99,   99,   99,   22,   99,   35,
-       99,   99,   40,   41,   99,   99,   99,   99,   99,   51,
-       99,   62,   99,   68,   69,   70,   99,   99,   99,   99,
-       79,   80,   82,   99,   99,   99,   83,   99,   99,   99,
-       99,   12,   99,   99,   99,   27,   99,   36,   39,   99,
-       99,   99,   99,   99,   61,   99,   71,   99,   99,   99,
-
-       99,   99,   99,   99,   88,   99,   99,   99,   10,   99,
-       18,   99,   99,   99,   99,   99,   99,   99,   99,   99,
-       72,   73,   99,   99,   99,   99,   87,   99,   99,   99,
-       99,   99,   99,   99,   45,   99,   47,   49,   50,   99,
-       99,   99,   85,   86,   99,    6,    8,   99,   99,   32,
-       99,   99,   99,   75,   99,   89,   99,   99,   99,   46,
-       99,   99,   99,   99,   99,   99,   76,   99,   99,   99,
-       99,   11,   99,   99,   64,   19,   99,   29,    0
-    } ;
-
-static yyconst flex_int32_t yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    1,    4,    5,    6,    1,    1,    1,    1,
-        1,    7,    8,    1,    9,   10,   11,   12,   13,   14,
-       15,   16,   14,   14,   14,   14,   14,    1,    1,   17,
-        1,   18,    1,    1,   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,
-        1,    1,    1,    1,   45,    1,   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,    1,   72,    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,    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,    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,    1
-    } ;
-
-static yyconst flex_int32_t yy_meta[73] =
-    {   0,
-        1,    2,    3,    2,    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,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2
-    } ;
-
-static yyconst flex_int16_t yy_base[585] =
-    {   0,
-        0,   71, 1215,    0, 1216,    0, 1216,    8,   23,   28,
-       18,  134,   55,   79,  203,    2,    0, 1216,    0,    0,
-       94,  101,  122,   17,  146,    0,   24,  151,   18,  174,
-      263,  276,  136,  277,  289,  338,   36,   63,   68,   68,
-       72,  146,  261,  284,  300,   79,  312,  352,  376,  293,
-      401,  129,  146,  139,  442,  154,   49,    0,   35,  339,
-      401,    0,  271,  276,  263,  296,  322,  339,  350,  375,
-      378,  404, 1196,  387,  388,  408,  399,  407,  416,  406,
-      403,  401,  416,  419,  420,  445,  433,  439,  441,  441,
-      439,  456,  456,  445,  447,  456,  463,  448,  461,  465,
-
-      470,  456,  476,  477,  462,  479,  475,  494,  461,  484,
-      508,  482,  499, 1195,  503,  504,    0,  500,  508,  507,
-        0, 1200,  512,    0,  508,  511, 1193,  516,  523,  515,
-      515,  527,  514,  514,  522,  549,  521,    0,  523, 1192,
-      549,  535,  538,  561,  559, 1191,  541,  567,  564,  550,
-      560,  553,  560,  555,  571,  562,  575,  574,  575,  571,
-      583,  581,  582,  568,  583,  579, 1190,  608,  609,  602,
-      605,  597,  615,  601,  610, 1189,  616,  618,  611,  612,
-      621,  627, 1188,  615,    0,  618,  625,  621,  628, 1199,
-      623,  637,  652,  647,    0,  659,  665,  669,  654,  661,
-
-     1197,  670,  667,  672,  664,  676, 1185,    0,  660,  681,
-      670,  683,  680,    0, 1184,  674, 1183,  672,  668,  691,
-      673,  675, 1182, 1181,  677,  687,  689, 1180,  704,  693,
-      714,  700,  723,  705,  719,    0, 1179,  707, 1178, 1177,
-     1176,  720,  729,  726,  724,  732,  731,    0,  732,  729,
-      719,  734,  723, 1175,  729, 1159,    0,  731,  732,  733,
-      744,  735,  754,  789,  765,    0,  754,  760, 1158,  764,
-      767,  776, 1157,  784,  785,  782,  783,  791,    0,  789,
-      788,  802, 1156, 1150,    0,  795,    0, 1149,  805,  796,
-     1144,  944,    0,    0,  802,  788,  814,    0,  801,  822,
-
-      806,  766,  818,  821,  819,    0,  830,    0,    0,    0,
-      829,  825,  759,  830,  831,  838,  538,  833,  829,  831,
-      830,  845,    0,  847,    0,  835,  836,  838,  839,  844,
-      851,    0,    0,  861,  864,    0,  878,  879,  413,    0,
-      412,  881,  867,  883,  875,  875,  893,  885,    0,    0,
-      895,    0,  894,  897,    0,    0,  900,   40,    0,  411,
-      881,  882,  884,    0,  898,  899,  895,  410,  409,  373,
-        0,  907,  904,  917,    0,  892,  898,  914,  913,  918,
-      933,  928,  922,  923,  924,  955,  930,  941,  939,  931,
-      935,  942,    0,    0,  372,  371,  943,  957,  943,  957,
-
-      369,  941,  367,  959,  953,  365,  361,    0,  948,  954,
-      949,  970,  975,  330,    0,    0,    0,  982,  316,    0,
-      973,  300,  290,  288,  975,  977,  976,  992,  278,  277,
-      275,    0,  989,  989, 1000,  189,  993,  992,  990, 1006,
-      181,    0,    0,  991,  992,  998,  176,    0, 1011,    0,
-      175,  174,    0,    0,  995, 1012, 1003, 1006, 1017,    0,
-      173,    0, 1012,    0,    0,    0,  167, 1014, 1023, 1023,
-        0,    0,    0, 1027, 1026, 1042,    0, 1049, 1049, 1029,
-     1057,    0,  159, 1053, 1040,    0, 1043,    0,    0, 1057,
-     1063, 1060, 1046, 1047,    0, 1066,    0,  138,  137, 1070,
-
-     1052, 1060, 1062,  134,    0, 1060, 1076, 1076,    0, 1077,
-        0, 1064, 1079, 1070,  124, 1092,  123,  122,  115, 1087,
-        0,    0, 1088, 1085,  105,  104,    0,  114,  101,  100,
-     1090, 1080,   79, 1107,    0, 1108,    0,    0,    0, 1094,
-       48, 1106,    0,    0,   46,    0,    0, 1096, 1099,    0,
-     1095,   44, 1111,    0, 1105,    0, 1119, 1105, 1110,    0,
-     1112,   42, 1110, 1128, 1119, 1121,    0,   40, 1123, 1122,
-       39,    0,   34, 1126,    0,    0,   27,    0, 1216, 1183,
-        0, 1186, 1188, 1190
-    } ;
-
-static yyconst flex_int16_t yy_def[585] =
-    {   0,
-      580,  580,  579,  581,  579,  582,  579,  581,  581,  581,
-      581,  581,  581,  581,  579,  581,  581,  579,  581,  582,
-      581,  581,  581,  581,  581,  581,  583,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  583,  584,  581,  581,
-      581,   31,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  264,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  581,
-      581,  581,  581,  581,  581,  581,  581,  581,    0,  579,
-      579,  579,  579,  579
-    } ;
-
-static yyconst flex_int16_t yy_nxt[1289] =
-    {   0,
-       19,    5,    6,    7,  579,  579,  579,    8,    9,   10,
-       11,   12,   13,   14,   14,   14,   15,   21,   54,   22,
-       22,   22,   22,   22,   26,   58,   16,   58,   27,   59,
-       59,   17,   21,   53,   22,   23,   22,   22,   22,   25,
-       25,   25,   25,   25,  578,   54,   59,   59,   56,   24,
-       58,  576,   58,   16,  406,  407,  575,  572,   17,  567,
-       53,  560,   84,  556,   32,  554,   22,   22,   22,   22,
-       22,   18,    5,    6,    7,   56,   24,   30,    8,    9,
-       10,   11,   12,   13,   14,   14,   14,   15,   28,   84,
-       22,   22,   22,   22,   22,   58,  550,   16,   85,   86,
-
-       87,   30,   17,   88,   30,   25,   25,   25,   25,   25,
-       28,   99,   22,   22,   22,   22,   22,  547,  546,  545,
-       58,  544,  543,   30,   16,   85,   86,   87,   30,   17,
-       88,   55,  539,   22,   22,   22,   22,   22,   99,  538,
-      537,  535,   18,   28,   30,   22,   22,   22,   22,   22,
-       30,  527,  120,   29,  522,  521,   30,   25,   25,   25,
-       25,   25,   25,   25,   25,   25,   25,   64,   30,  121,
-      122,   30,   89,   30,   65,   31,  511,  124,   90,  120,
-       29,   60,   60,   30,  497,   61,   61,   61,   61,   61,
-      495,  489,  488,  486,   64,   30,  121,  122,  482,   89,
-
-       30,   65,   31,   19,  124,   90,  477,   19,   19,   19,
-       19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
-       19,   33,   34,   35,   36,   19,   37,   38,   19,   39,
-       40,   41,   42,   43,   44,   45,   46,   19,   47,   48,
-       49,   50,   51,   19,   52,   19,   19,   19,   33,   34,
-       35,   36,   19,   37,   38,   19,   39,   40,   41,   42,
-       43,   44,   45,   46,   19,   47,   48,   49,   50,   51,
-       19,   52,   19,   19,   62,   62,   62,   62,   62,   91,
-       63,   62,   62,   62,   62,   62,   62,   25,   25,   25,
-       25,   25,  473,   92,  472,  471,   93,  125,   30,   66,
-
-       67,  113,  126,   68,  127,  466,   91,  465,   62,   62,
-       62,   62,   62,   62,   70,   69,   94,  464,   71,   96,
-       92,   72,   95,   93,  125,   30,   66,   67,   73,  126,
-       68,  127,  114,  462,  100,   97,  101,  115,   98,  128,
-      129,   70,   69,   94,  102,   71,   96,  460,   72,   95,
-       61,   61,   61,   61,   61,   73,   74,  103,   75,  114,
-       76,  100,   97,  101,   77,   98,  128,  129,  130,   78,
-      131,  102,  104,   79,  105,   80,   81,  106,  454,   82,
-       83,  132,  453,   74,  450,   75,  448,   76,  443,  442,
-      417,   77,  107,  133,  108,  130,   78,  131,  109,  104,
-
-       79,  105,   80,   81,  106,  110,   82,   83,  132,  116,
-      134,  111,   61,   61,   61,   61,   61,  112,  117,  107,
-      133,  108,  139,  118,  140,  109,  416,  415,  408,  394,
-      393,  141,  110,  135,  136,  142,  137,  134,  111,  143,
-      144,  145,  146,  147,  112,  119,  123,  148,  149,  139,
-      118,  140,  150,   25,   25,   25,   25,   25,  141,  153,
-      135,  136,  142,  137,   30,  151,  143,  144,  145,  146,
-      147,  154,  155,  156,  148,  149,  157,  158,  159,  150,
-      160,  152,  161,  162,  163,  164,  153,  165,  167,  168,
-      166,   30,  151,  169,  170,  171,  172,  173,  154,  155,
-
-      156,  174,  178,  157,  158,  159,  179,  160,  152,  161,
-      162,  163,  164,  175,  165,  167,  168,  166,  176,  183,
-      169,  170,  171,  172,  173,  177,  180,  184,  174,  178,
-      181,  186,  187,  179,  182,  188,  189,  190,  192,  193,
-      175,  194,  196,  197,  198,  176,  183,  199,  200,  201,
-      202,  203,  177,  180,  184,  375,  206,  181,  186,  187,
-      207,  182,  188,  189,  190,  192,  193,  209,  194,  196,
-      197,  198,  210,  211,  199,  200,  201,  202,  203,  204,
-      212,  213,  205,  206,  215,  216,  217,  207,  218,  219,
-      220,  221,  222,  223,  209,  224,  227,  225,  228,  210,
-
-      211,  229,  230,  231,  232,  233,  204,  212,  213,  205,
-      226,  215,  216,  217,  234,  218,  219,  220,  221,  222,
-      223,  235,  224,  227,  225,  228,  237,  238,  229,  230,
-      231,  232,  233,  242,  243,  244,  245,  226,  246,  247,
-      249,  234,  252,  253,  254,  255,  258,  250,  235,  259,
-      239,  240,  241,  237,  238,  251,  260,  256,  261,  262,
-      242,  243,  244,  245,  264,  246,  247,  249,  265,  252,
-      253,  254,  255,  258,  250,  266,  259,  239,  240,  241,
-      267,  268,  251,  260,  256,  261,  262,  269,  270,  271,
-      272,  264,  274,  275,  276,  265,  277,  278,  280,  281,
-
-      282,  283,  266,  284,  286,  288,  289,  267,  268,  290,
-      291,  292,  295,  296,  269,  270,  271,  272,  297,  274,
-      275,  276,  299,  277,  278,  280,  281,  282,  283,  300,
-      284,  286,  288,  289,  301,  302,  290,  291,  292,  295,
-      296,  303,  304,  305,  307,  297,  311,  312,  314,  299,
-      315,  313,  316,  317,  318,  319,  300,  320,  321,  322,
-      324,  301,  302,  326,  327,  328,  329,  330,  303,  304,
-      305,  307,  331,  311,  312,  314,  371,  315,  313,  316,
-      317,  318,  319,  364,  320,  321,  322,  324,  333,  334,
-      326,  327,  328,  329,  330,  335,  337,  338,  339,  331,
-
-      332,  332,  332,  332,  332,  341,  342,  332,  332,  332,
-      332,  332,  332,  343,  344,  333,  334,  345,  346,  347,
-      348,  351,  335,  337,  338,  339,  353,  354,  357,  358,
-      360,  359,  341,  342,  332,  332,  332,  332,  332,  332,
-      343,  344,  361,  363,  345,  346,  347,  348,  351,  365,
-      366,  367,  368,  353,  354,  357,  358,  360,  362,  369,
-      370,  372,  373,  374,  376,  377,  378,  379,  380,  361,
-      363,  382,  383,  384,  381,  385,  365,  366,  367,  368,
-      386,  387,  388,  389,  390,  362,  369,  370,  372,  373,
-      374,  376,  377,  378,  379,  380,  391,  392,  382,  383,
-
-      384,  381,  385,  395,  396,  397,  398,  386,  387,  388,
-      389,  390,  399,  400,  401,  402,  403,  404,  405,  409,
-      410,  411,  412,  391,  392,  413,  414,  418,  419,  422,
-      395,  396,  397,  398,  420,  423,  424,  421,  425,  399,
-      400,  401,  402,  403,  404,  405,  409,  410,  411,  412,
-      426,  427,  413,  414,  418,  419,  422,  428,  429,  430,
-      431,  356,  423,  424,  421,  425,  436,  437,  438,  439,
-      440,  441,  432,  433,  444,  445,  446,  426,  427,  447,
-      449,  451,  452,  455,  428,  429,  430,  431,  434,  456,
-      435,  457,  458,  436,  437,  438,  439,  440,  441,  459,
-
-      433,  444,  445,  446,  461,  463,  447,  449,  451,  452,
-      455,  467,  468,  469,  470,  434,  456,  435,  457,  458,
-      474,  475,  476,  478,  479,  480,  459,  481,  483,  484,
-      485,  461,  463,  487,  490,  491,  492,  493,  467,  468,
-      469,  470,  494,  496,  498,  499,  500,  474,  475,  476,
-      478,  479,  480,  502,  481,  483,  484,  485,  503,  501,
-      487,  490,  491,  492,  493,  504,  505,  507,  508,  494,
-      496,  498,  499,  500,  509,  512,  513,  510,  514,  515,
-      502,  516,  517,  518,  519,  503,  501,  520,  523,  524,
-      525,  526,  504,  506,  507,  508,  528,  529,  530,  531,
-
-      532,  533,  512,  513,  510,  514,  515,  534,  516,  517,
-      518,  519,  536,  540,  520,  523,  524,  525,  526,  541,
-      542,  548,  549,  528,  529,  530,  531,  532,  533,  551,
-      552,  553,  555,  557,  534,  558,  559,  561,  562,  536,
-      540,  563,  564,  565,  566,  568,  541,  542,  548,  549,
-      569,  570,  571,  573,  574,  577,  551,  552,  553,  555,
-      557,  355,  558,  559,  561,  562,  352,  350,  563,  564,
-      565,  566,  568,  349,  340,  336,  325,  569,  570,  571,
-      573,  574,  577,    4,    4,    4,   20,   20,   57,   57,
-       58,   58,  323,  310,  309,  308,  306,  298,  294,  293,
-
-      287,  285,  279,  273,  263,  257,  248,  236,  214,  208,
-      195,  191,  185,  138,  579,    3,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579
-    } ;
-
-static yyconst flex_int16_t yy_chk[1289] =
-    {   0,
-      581,    1,    1,    1,    0,    0,    0,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    8,   17,    8,
-        8,    8,    8,    8,   11,   27,    1,   27,   11,   29,
-       29,    1,    9,   16,    9,    9,    9,    9,    9,   10,
-       10,   10,   10,   10,  577,   17,   59,   59,   24,    9,
-       57,  573,   57,    1,  358,  358,  571,  568,    1,  562,
-       16,  552,   37,  545,   13,  541,   13,   13,   13,   13,
-       13,    1,    2,    2,    2,   24,    9,   13,    2,    2,
-        2,    2,    2,    2,    2,    2,    2,    2,   14,   37,
-       14,   14,   14,   14,   14,   27,  533,    2,   38,   39,
-
-       40,   14,    2,   41,   13,   21,   21,   21,   21,   21,
-       22,   46,   22,   22,   22,   22,   22,  530,  529,  528,
-       57,  526,  525,   22,    2,   38,   39,   40,   14,    2,
-       41,   23,  519,   23,   23,   23,   23,   23,   46,  518,
-      517,  515,    2,   12,   23,   12,   12,   12,   12,   12,
-       22,  504,   52,   12,  499,  498,   12,   25,   25,   25,
-       25,   25,   28,   28,   28,   28,   28,   33,   25,   53,
-       54,   23,   42,   28,   33,   12,  483,   56,   42,   52,
-       12,   30,   30,   12,  467,   30,   30,   30,   30,   30,
-      461,  452,  451,  447,   33,   25,   53,   54,  441,   42,
-
-       28,   33,   12,   15,   56,   42,  436,   15,   15,   15,
-       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
-       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
-       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
-       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
-       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
-       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
-       15,   15,   15,   15,   31,   31,   31,   31,   31,   43,
-       32,   31,   31,   31,   31,   31,   31,   32,   32,   32,
-       32,   32,  431,   43,  430,  429,   43,   63,   32,   34,
-
-       34,   50,   64,   34,   65,  424,   43,  423,   31,   31,
-       31,   31,   31,   31,   35,   34,   44,  422,   35,   45,
-       43,   35,   44,   43,   63,   32,   34,   34,   35,   64,
-       34,   65,   50,  419,   47,   45,   47,   50,   45,   66,
-       67,   35,   34,   44,   47,   35,   45,  414,   35,   44,
-       60,   60,   60,   60,   60,   35,   36,   48,   36,   50,
-       36,   47,   45,   47,   36,   45,   66,   67,   68,   36,
-       68,   47,   48,   36,   48,   36,   36,   48,  407,   36,
-       36,   69,  406,   36,  403,   36,  401,   36,  396,  395,
-      370,   36,   48,   70,   49,   68,   36,   68,   49,   48,
-
-       36,   48,   36,   36,   48,   49,   36,   36,   69,   51,
-       71,   49,   61,   61,   61,   61,   61,   49,   51,   48,
-       70,   49,   74,   51,   75,   49,  369,  368,  360,  341,
-      339,   76,   49,   72,   72,   77,   72,   71,   49,   78,
-       79,   80,   81,   82,   49,   51,   55,   83,   84,   74,
-       51,   75,   85,   55,   55,   55,   55,   55,   76,   87,
-       72,   72,   77,   72,   55,   86,   78,   79,   80,   81,
-       82,   88,   89,   90,   83,   84,   91,   92,   93,   85,
-       94,   86,   95,   96,   97,   98,   87,   99,  100,  101,
-       99,   55,   86,  102,  103,  104,  105,  106,   88,   89,
-
-       90,  107,  109,   91,   92,   93,  110,   94,   86,   95,
-       96,   97,   98,  108,   99,  100,  101,   99,  108,  112,
-      102,  103,  104,  105,  106,  108,  111,  113,  107,  109,
-      111,  115,  116,  110,  111,  118,  119,  120,  123,  125,
-      108,  126,  128,  129,  130,  108,  112,  131,  132,  133,
-      134,  135,  108,  111,  113,  317,  137,  111,  115,  116,
-      139,  111,  118,  119,  120,  123,  125,  141,  126,  128,
-      129,  130,  142,  143,  131,  132,  133,  134,  135,  136,
-      144,  145,  136,  137,  147,  148,  149,  139,  150,  151,
-      152,  153,  154,  155,  141,  156,  158,  157,  159,  142,
-
-      143,  160,  161,  162,  163,  164,  136,  144,  145,  136,
-      157,  147,  148,  149,  165,  150,  151,  152,  153,  154,
-      155,  166,  156,  158,  157,  159,  168,  169,  160,  161,
-      162,  163,  164,  170,  171,  172,  173,  157,  174,  175,
-      177,  165,  179,  180,  181,  182,  184,  178,  166,  186,
-      169,  169,  169,  168,  169,  178,  187,  182,  188,  189,
-      170,  171,  172,  173,  191,  174,  175,  177,  192,  179,
-      180,  181,  182,  184,  178,  193,  186,  169,  169,  169,
-      194,  196,  178,  187,  182,  188,  189,  197,  198,  199,
-      200,  191,  202,  203,  204,  192,  205,  206,  209,  210,
-
-      211,  212,  193,  213,  216,  218,  219,  194,  196,  220,
-      221,  222,  225,  226,  197,  198,  199,  200,  227,  202,
-      203,  204,  229,  205,  206,  209,  210,  211,  212,  230,
-      213,  216,  218,  219,  231,  232,  220,  221,  222,  225,
-      226,  233,  234,  235,  238,  227,  242,  243,  244,  229,
-      245,  243,  246,  247,  249,  250,  230,  251,  252,  253,
-      255,  231,  232,  258,  259,  260,  261,  262,  233,  234,
-      235,  238,  263,  242,  243,  244,  313,  245,  243,  246,
-      247,  249,  250,  302,  251,  252,  253,  255,  265,  267,
-      258,  259,  260,  261,  262,  268,  270,  271,  272,  263,
-
-      264,  264,  264,  264,  264,  274,  275,  264,  264,  264,
-      264,  264,  264,  276,  277,  265,  267,  278,  280,  281,
-      282,  286,  268,  270,  271,  272,  289,  290,  295,  296,
-      299,  297,  274,  275,  264,  264,  264,  264,  264,  264,
-      276,  277,  300,  301,  278,  280,  281,  282,  286,  303,
-      304,  305,  307,  289,  290,  295,  296,  299,  300,  311,
-      312,  314,  315,  316,  318,  319,  320,  321,  322,  300,
-      301,  324,  326,  327,  322,  328,  303,  304,  305,  307,
-      329,  330,  331,  334,  335,  300,  311,  312,  314,  315,
-      316,  318,  319,  320,  321,  322,  337,  338,  324,  326,
-
-      327,  322,  328,  342,  343,  344,  345,  329,  330,  331,
-      334,  335,  346,  347,  348,  351,  353,  354,  357,  361,
-      362,  363,  365,  337,  338,  366,  367,  372,  373,  376,
-      342,  343,  344,  345,  374,  377,  378,  374,  379,  346,
-      347,  348,  351,  353,  354,  357,  361,  362,  363,  365,
-      380,  381,  366,  367,  372,  373,  376,  382,  383,  384,
-      385,  292,  377,  378,  374,  379,  387,  388,  389,  390,
-      391,  392,  386,  386,  397,  398,  399,  380,  381,  400,
-      402,  404,  405,  409,  382,  383,  384,  385,  386,  410,
-      386,  411,  412,  387,  388,  389,  390,  391,  392,  413,
-
-      386,  397,  398,  399,  418,  421,  400,  402,  404,  405,
-      409,  425,  426,  427,  428,  386,  410,  386,  411,  412,
-      433,  434,  435,  437,  438,  439,  413,  440,  444,  445,
-      446,  418,  421,  449,  455,  456,  457,  458,  425,  426,
-      427,  428,  459,  463,  468,  469,  470,  433,  434,  435,
-      437,  438,  439,  474,  440,  444,  445,  446,  475,  470,
-      449,  455,  456,  457,  458,  476,  478,  479,  480,  459,
-      463,  468,  469,  470,  481,  484,  485,  481,  487,  490,
-      474,  491,  492,  493,  494,  475,  470,  496,  500,  501,
-      502,  503,  476,  478,  479,  480,  506,  507,  508,  510,
-
-      512,  513,  484,  485,  481,  487,  490,  514,  491,  492,
-      493,  494,  516,  520,  496,  500,  501,  502,  503,  523,
-      524,  531,  532,  506,  507,  508,  510,  512,  513,  534,
-      536,  540,  542,  548,  514,  549,  551,  553,  555,  516,
-      520,  557,  558,  559,  561,  563,  523,  524,  531,  532,
-      564,  565,  566,  569,  570,  574,  534,  536,  540,  542,
-      548,  291,  549,  551,  553,  555,  288,  284,  557,  558,
-      559,  561,  563,  283,  273,  269,  256,  564,  565,  566,
-      569,  570,  574,  580,  580,  580,  582,  582,  583,  583,
-      584,  584,  254,  241,  240,  239,  237,  228,  224,  223,
-
-      217,  215,  207,  201,  190,  183,  176,  167,  146,  140,
-      127,  122,  114,   73,    3,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579,  579,  579,
-      579,  579,  579,  579,  579,  579,  579,  579
-    } ;
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-extern int eggyy_flex_debug;
-int eggyy_flex_debug = 0;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *eggyytext;
-#line 1 "lexer.lxx"
-/*
-// Filename: lexer.l
-// Created by:  drose (16Jan99)
-// 
-////////////////////////////////////////////////////////////////////
-*/
-#line 9 "lexer.lxx"
-#include "pandabase.h"
-#include "lexerDefs.h"
-#include "parserDefs.h"
-#include "config_egg.h"
-#include "parser.h"
-#include "indent.h"
-#include "pnotify.h"
-#include "lightMutex.h"
-#include "thread.h"
-#include "pstrtod.h"
-
-#include <math.h>
-
-extern "C" int eggyywrap(void);  // declared below.
-
-static int yyinput(void);        // declared by flex.
-
-
-////////////////////////////////////////////////////////////////////
-// Static variables
-////////////////////////////////////////////////////////////////////
-
-// This mutex protects all of these global variables. 
-LightMutex egg_lock; 
-
-// We'll increment line_number and col_number as we parse the file, so
-// that we can report the position of an error.
-static int line_number = 0;
-static int col_number = 0;
-
-// current_line holds as much of the current line as will fit.  Its
-// only purpose is for printing it out to report an error to the user.
-static const int max_error_width = 1024;
-static char current_line[max_error_width + 1];
-
-static int error_count = 0;
-static int warning_count = 0;
-
-// This is the pointer to the current input stream.
-static istream *input_p = NULL;
-
-// This is the name of the egg file we're parsing.  We keep it so we
-// can print it out for error messages.
-static string egg_filename;
-
-// This is the initial token state returned by the lexer.  It allows
-// the yacc grammar to start from initial points.
-static int initial_token;
-
-////////////////////////////////////////////////////////////////////
-// Defining the interface to the lexer.
-////////////////////////////////////////////////////////////////////
-
-void
-egg_init_lexer(istream &in, const string &filename) {
-  input_p = &in;
-  egg_filename = filename;
-  line_number = 0;
-  col_number = 0;
-  error_count = 0;
-  warning_count = 0;
-  initial_token = START_EGG;
-}
-
-void
-egg_start_group_body() {
-  /* Set the initial state to begin within a group_body context,
-     instead of at the beginning of the egg file. */
-  initial_token = START_GROUP_BODY;
-}
-
-void
-egg_start_texture_body() {
-  initial_token = START_TEXTURE_BODY;
-}
-
-void
-egg_start_primitive_body() {
-  initial_token = START_PRIMITIVE_BODY;
-}
-
-int
-egg_error_count() {
-  return error_count;
-}
-
-int
-egg_warning_count() {
-  return warning_count;
-}
-
-
-////////////////////////////////////////////////////////////////////
-// Internal support functions.
-////////////////////////////////////////////////////////////////////
-
-int
-eggyywrap(void) {
-  return 1;
-}
-
-void
-eggyyerror(const string &msg) {
-  if (egg_cat.is_error()) {
-    ostream &out = egg_cat.error(false);
-
-    out << "\nError";
-    if (!egg_filename.empty()) {
-      out << " in " << egg_filename;
-    }
-    out 
-      << " at line " << line_number << ", column " << col_number << ":\n"
-      << setiosflags(Notify::get_literal_flag())
-      << current_line << "\n";
-    indent(out, col_number-1) 
-      << "^\n" << msg << "\n\n" 
-      << resetiosflags(Notify::get_literal_flag()) << flush;
-  }
-  error_count++;
-}
-
-void
-eggyyerror(ostringstream &strm) {
-  string s = strm.str();
-  eggyyerror(s);
-}
-
-void
-eggyywarning(const string &msg) {
-  if (egg_cat.is_warning()) {
-    ostream &out = egg_cat.warning(false);
-
-    out << "\nWarning";
-    if (!egg_filename.empty()) {
-      out << " in " << egg_filename;
-    }
-    out 
-      << " at line " << line_number << ", column " << col_number << ":\n"
-      << setiosflags(Notify::get_literal_flag())
-      << current_line << "\n";
-    indent(out, col_number-1) 
-      << "^\n" << msg << "\n\n" 
-      << resetiosflags(Notify::get_literal_flag()) << flush;
-  }
-  warning_count++;
-}
-
-void
-eggyywarning(ostringstream &strm) {
-  string s = strm.str();
-  eggyywarning(s);
-}
-
-// Now define a function to take input from an istream instead of a
-// stdio FILE pointer.  This is flex-specific.
-static void
-input_chars(char *buffer, int &result, int max_size) {
-  nassertv(input_p != NULL);
-  if (*input_p) {
-    input_p->read(buffer, max_size);
-    result = input_p->gcount();
-
-    if (line_number == 0) {
-      // This is a special case.  If we are reading the very first bit
-      // from the stream, copy it into the current_line array.  This
-      // is because the \n.* rule below, which fills current_line
-      // normally, doesn't catch the first line.
-      int length = min(max_error_width, result);
-      strncpy(current_line, buffer, length);
-      current_line[length] = '\0';
-      line_number++;
-      col_number = 0;
-
-      // Truncate it at the newline.
-      char *end = strchr(current_line, '\n');
-      if (end != NULL) {
-        *end = '\0';
-      }
-    }
-
-  } else {
-    // End of file or I/O error.
-    result = 0;
-  }
-  Thread::consider_yield();
-}
-#undef YY_INPUT
-
-// Define this macro carefully, since different flex versions call it
-// with a different type for result.
-#define YY_INPUT(buffer, result, max_size) { \
-  int int_result; \
-  input_chars((buffer), int_result, (max_size)); \
-  (result) = int_result; \
-}
-
-// read_char reads and returns a single character, incrementing the
-// supplied line and column numbers as appropriate.  A convenience
-// function for the scanning functions below.
-static int
-read_char(int &line, int &col) {
-  int c = yyinput();
-  if (c == '\n') {
-    line++;
-    col = 0;
-  } else {
-    col++;
-  }
-  return c;
-}
-
-// scan_quoted_string reads a string delimited by quotation marks and
-// returns it.
-static string
-scan_quoted_string() {
-  string result;
-
-  // We don't touch the current line number and column number during
-  // scanning, so that if we detect an error while scanning the string
-  // (e.g. an unterminated string), we'll report the error as
-  // occurring at the start of the string, not at the end--somewhat
-  // more convenient for the user.
-
-  // Instead of adjusting the global line_number and col_number
-  // variables, we'll operate on our own local variables for the
-  // interim.
-  int line = line_number;
-  int col = col_number;
-
-  int c;
-  c = read_char(line, col);
-  while (c != '"' && c != EOF) {
-    result += c;
-    c = read_char(line, col);
-  }
-
-  if (c == EOF) {
-    eggyyerror("This quotation mark is unterminated.");
-  }
-
-  line_number = line;
-  col_number = col;
-
-  return result;
-}
-
-// eat_c_comment scans past all characters up until the first */
-// encountered.
-static void
-eat_c_comment() {
-  // As above, we'll operate on our own local copies of line_number
-  // and col_number within this function.
-
-  int line = line_number;
-  int col = col_number;
-
-  int c, last_c;
-  
-  last_c = '\0';
-  c = read_char(line, col);
-  while (c != EOF && !(last_c == '*' && c == '/')) {
-    if (last_c == '/' && c == '*') {
-      ostringstream errmsg;
-      errmsg << "This comment contains a nested /* symbol at line "
-             << line << ", column " << col-1 << "--possibly unclosed?"
-             << ends;
-      eggyywarning(errmsg);
-    }
-    last_c = c;
-    c = read_char(line, col);
-  }
-
-  if (c == EOF) {
-    eggyyerror("This comment marker is unclosed.");
-  }
-
-  line_number = line;
-  col_number = col;
-}
-
-
-// accept() is called below as each piece is pulled off and
-// accepted by the lexer; it increments the current column number.
-INLINE void accept() {
-  col_number += eggyyleng;
-}
-
-#line 1236 "lex.yy.c"
-
-#define INITIAL 0
-
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#endif
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-
-static int yy_init_globals (void );
-
-/* Accessor methods to globals.
-   These are made visible to non-reentrant scanners for convenience. */
-
-int eggyylex_destroy (void );
-
-int eggyyget_debug (void );
-
-void eggyyset_debug (int debug_flag  );
-
-YY_EXTRA_TYPE eggyyget_extra (void );
-
-void eggyyset_extra (YY_EXTRA_TYPE user_defined  );
-
-FILE *eggyyget_in (void );
-
-void eggyyset_in  (FILE * in_str  );
-
-FILE *eggyyget_out (void );
-
-void eggyyset_out  (FILE * out_str  );
-
-yy_size_t eggyyget_leng (void );
-
-char *eggyyget_text (void );
-
-int eggyyget_lineno (void );
-
-void eggyyset_lineno (int line_number  );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int eggyywrap (void );
-#else
-extern int eggyywrap (void );
-#endif
-#endif
-
-    static void yyunput (int c,char *buf_ptr  );
-    
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
-#endif
-
-#ifndef YY_NO_INPUT
-
-#ifdef __cplusplus
-static int yyinput (void );
-#else
-static int input (void );
-#endif
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO fwrite( eggyytext, eggyyleng, 1, eggyyout )
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-		{ \
-		int c = '*'; \
-		yy_size_t n; \
-		for ( n = 0; n < max_size && \
-			     (c = getc( eggyyin )) != EOF && c != '\n'; ++n ) \
-			buf[n] = (char) c; \
-		if ( c == '\n' ) \
-			buf[n++] = (char) c; \
-		if ( c == EOF && ferror( eggyyin ) ) \
-			YY_FATAL_ERROR( "input in flex scanner failed" ); \
-		result = n; \
-		} \
-	else \
-		{ \
-		errno=0; \
-		while ( (result = fread(buf, 1, max_size, eggyyin))==0 && ferror(eggyyin)) \
-			{ \
-			if( errno != EINTR) \
-				{ \
-				YY_FATAL_ERROR( "input in flex scanner failed" ); \
-				break; \
-				} \
-			errno=0; \
-			clearerr(eggyyin); \
-			} \
-		}\
-\
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int eggyylex (void);
-
-#define YY_DECL int eggyylex (void)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after eggyytext and eggyyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
-	YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
-	register yy_state_type yy_current_state;
-	register char *yy_cp, *yy_bp;
-	register int yy_act;
-    
-#line 302 "lexer.lxx"
-
-
-
-  if (initial_token != 0) {
-    int t = initial_token;
-    initial_token = 0;
-    return t;
-  }
-
-
-#line 1429 "lex.yy.c"
-
-	if ( !(yy_init) )
-		{
-		(yy_init) = 1;
-
-#ifdef YY_USER_INIT
-		YY_USER_INIT;
-#endif
-
-		if ( ! (yy_start) )
-			(yy_start) = 1;	/* first start state */
-
-		if ( ! eggyyin )
-			eggyyin = stdin;
-
-		if ( ! eggyyout )
-			eggyyout = stdout;
-
-		if ( ! YY_CURRENT_BUFFER ) {
-			eggyyensure_buffer_stack ();
-			YY_CURRENT_BUFFER_LVALUE =
-				eggyy_create_buffer(eggyyin,YY_BUF_SIZE );
-		}
-
-		eggyy_load_buffer_state( );
-		}
-
-	while ( 1 )		/* loops until end-of-file is reached */
-		{
-		yy_cp = (yy_c_buf_p);
-
-		/* Support of eggyytext. */
-		*yy_cp = (yy_hold_char);
-
-		/* yy_bp points to the position in yy_ch_buf of the start of
-		 * the current run.
-		 */
-		yy_bp = yy_cp;
-
-		yy_current_state = (yy_start);
-yy_match:
-		do
-			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-			if ( yy_accept[yy_current_state] )
-				{
-				(yy_last_accepting_state) = yy_current_state;
-				(yy_last_accepting_cpos) = yy_cp;
-				}
-			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-				{
-				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 580 )
-					yy_c = yy_meta[(unsigned int) yy_c];
-				}
-			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-			++yy_cp;
-			}
-		while ( yy_base[yy_current_state] != 1216 );
-
-yy_find_action:
-		yy_act = yy_accept[yy_current_state];
-		if ( yy_act == 0 )
-			{ /* have to back up */
-			yy_cp = (yy_last_accepting_cpos);
-			yy_current_state = (yy_last_accepting_state);
-			yy_act = yy_accept[yy_current_state];
-			}
-
-		YY_DO_BEFORE_ACTION;
-
-do_action:	/* This label is used only to access EOF actions. */
-
-		switch ( yy_act )
-	{ /* beginning of action switch */
-			case 0: /* must back up */
-			/* undo the effects of YY_DO_BEFORE_ACTION */
-			*yy_cp = (yy_hold_char);
-			yy_cp = (yy_last_accepting_cpos);
-			yy_current_state = (yy_last_accepting_state);
-			goto yy_find_action;
-
-case 1:
-/* rule 1 can match eol */
-YY_RULE_SETUP
-#line 312 "lexer.lxx"
-{
-  // New line.  Save a copy of the line so we can print it out for the
-  // benefit of the user in case we get an error.
-
-  strncpy(current_line, eggyytext+1, max_error_width);
-  current_line[max_error_width] = '\0';
-  line_number++;
-  col_number=0;
-
-  // Return the whole line to the lexer, except the newline character,
-  // which we eat.
-  yyless(1);
-}
-	YY_BREAK
-case 2:
-YY_RULE_SETUP
-#line 326 "lexer.lxx"
-{ 
-  // Eat whitespace.
-  accept();
-}
-	YY_BREAK
-case 3:
-YY_RULE_SETUP
-#line 331 "lexer.lxx"
-{ 
-  // Eat C++-style comments.
-  accept();
-}
-	YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 336 "lexer.lxx"
-{
-  // Eat C-style comments.
-  accept();
-  eat_c_comment(); 
-}
-	YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 342 "lexer.lxx"
-{
-  // Send curly braces as themselves.
-  accept(); 
-  return eggyytext[0];
-}
-	YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 350 "lexer.lxx"
-{
-  accept();
-  return ANIMPRELOAD;
-}
-	YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 354 "lexer.lxx"
-{
-  accept();
-  return AUX;
-}
-	YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 358 "lexer.lxx"
-{
-  accept();
-  return BEZIERCURVE;
-}
-	YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 362 "lexer.lxx"
-{
-  accept();
-  return BFACE;
-}
-	YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 366 "lexer.lxx"
-{
-  accept();
-  return BILLBOARD;
-}
-	YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 370 "lexer.lxx"
-{
-  accept();
-  return BILLBOARDCENTER;
-}
-	YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 374 "lexer.lxx"
-{
-  accept();
-  return BINORMAL;
-}
-	YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 378 "lexer.lxx"
-{
-  accept();
-  return BUNDLE;
-}
-	YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 382 "lexer.lxx"
-{
-  accept();
-  return SCALAR;
-}
-	YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 386 "lexer.lxx"
-{
-  accept();
-  return CLOSED;
-}
-	YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 390 "lexer.lxx"
-{
-  accept();
-  return COLLIDE;
-}
-	YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 394 "lexer.lxx"
-{
-  accept();
-  return COMMENT;
-}
-	YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 398 "lexer.lxx"
-{
-  accept();
-  return COMPONENT;
-}
-	YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 402 "lexer.lxx"
-{
-  accept();
-  return COORDSYSTEM;
-}
-	YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 406 "lexer.lxx"
-{
-  accept();
-  return CV;
-}
-	YY_BREAK
-case 21:
-YY_RULE_SETUP
-#line 410 "lexer.lxx"
-{
-  accept();
-  return DART;
-}
-	YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 414 "lexer.lxx"
-{
-  accept();
-  return DNORMAL;
-}
-	YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 418 "lexer.lxx"
-{
-  accept();
-  return DRGBA;
-}
-	YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 422 "lexer.lxx"
-{
-  accept();
-  return DUV;
-}
-	YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 426 "lexer.lxx"
-{
-  accept();
-  return DXYZ;
-}
-	YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 430 "lexer.lxx"
-{
-  accept();
-  return DCS;
-}
-	YY_BREAK
-case 27:
-YY_RULE_SETUP
-#line 434 "lexer.lxx"
-{
-  accept();
-  return DISTANCE;
-}
-	YY_BREAK
-case 28:
-YY_RULE_SETUP
-#line 438 "lexer.lxx"
-{
-  accept();
-  return DTREF;
-}
-	YY_BREAK
-case 29:
-YY_RULE_SETUP
-#line 442 "lexer.lxx"
-{
-  accept();
-  return DYNAMICVERTEXPOOL;
-}
-	YY_BREAK
-case 30:
-YY_RULE_SETUP
-#line 446 "lexer.lxx"
-{
-  accept();
-  return EXTERNAL_FILE;
-}
-	YY_BREAK
-case 31:
-YY_RULE_SETUP
-#line 450 "lexer.lxx"
-{
-  accept();
-  return GROUP;
-}
-	YY_BREAK
-case 32:
-YY_RULE_SETUP
-#line 454 "lexer.lxx"
-{
-  accept();
-  return DEFAULTPOSE;
-}
-	YY_BREAK
-case 33:
-YY_RULE_SETUP
-#line 458 "lexer.lxx"
-{
-  accept();
-  return JOINT;
-}
-	YY_BREAK
-case 34:
-YY_RULE_SETUP
-#line 462 "lexer.lxx"
-{
-  accept();
-  return KNOTS;
-}
-	YY_BREAK
-case 35:
-YY_RULE_SETUP
-#line 466 "lexer.lxx"
-{
-  accept();
-  return INCLUDE;
-}
-	YY_BREAK
-case 36:
-YY_RULE_SETUP
-#line 470 "lexer.lxx"
-{
-  accept();
-  return INSTANCE;
-}
-	YY_BREAK
-case 37:
-YY_RULE_SETUP
-#line 474 "lexer.lxx"
-{
-  accept();
-  return LINE;
-}
-	YY_BREAK
-case 38:
-YY_RULE_SETUP
-#line 478 "lexer.lxx"
-{
-  accept();
-  return LOOP;
-}
-	YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 482 "lexer.lxx"
-{
-  accept();
-  return MATERIAL;
-}
-	YY_BREAK
-case 40:
-YY_RULE_SETUP
-#line 486 "lexer.lxx"
-{
-  accept();
-  return MATRIX3;
-}
-	YY_BREAK
-case 41:
-YY_RULE_SETUP
-#line 490 "lexer.lxx"
-{
-  accept();
-  return MATRIX4;
-}
-	YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 494 "lexer.lxx"
-{
-  accept();
-  return MODEL;
-}
-	YY_BREAK
-case 43:
-YY_RULE_SETUP
-#line 498 "lexer.lxx"
-{
-  accept();
-  return MREF;
-}
-	YY_BREAK
-case 44:
-YY_RULE_SETUP
-#line 502 "lexer.lxx"
-{
-  accept();
-  return NORMAL;
-}
-	YY_BREAK
-case 45:
-YY_RULE_SETUP
-#line 506 "lexer.lxx"
-{
-  accept();
-  return NURBSCURVE;
-}
-	YY_BREAK
-case 46:
-YY_RULE_SETUP
-#line 510 "lexer.lxx"
-{
-  accept();
-  return NURBSSURFACE;
-}
-	YY_BREAK
-case 47:
-YY_RULE_SETUP
-#line 514 "lexer.lxx"
-{
-  accept();
-  return OBJECTTYPE;
-}
-	YY_BREAK
-case 48:
-YY_RULE_SETUP
-#line 518 "lexer.lxx"
-{
-  accept();
-  return ORDER;
-}
-	YY_BREAK
-case 49:
-YY_RULE_SETUP
-#line 522 "lexer.lxx"
-{
-  accept();
-  return OUTTANGENT;
-}
-	YY_BREAK
-case 50:
-YY_RULE_SETUP
-#line 526 "lexer.lxx"
-{
-  accept();
-  return POINTLIGHT;
-}
-	YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 530 "lexer.lxx"
-{
-  accept();
-  return POLYGON;
-}
-	YY_BREAK
-case 52:
-YY_RULE_SETUP
-#line 534 "lexer.lxx"
-{
-  accept();
-  return REF;
-}
-	YY_BREAK
-case 53:
-YY_RULE_SETUP
-#line 538 "lexer.lxx"
-{
-  accept();
-  return RGBA;
-}
-	YY_BREAK
-case 54:
-YY_RULE_SETUP
-#line 542 "lexer.lxx"
-{
-  accept();
-  return ROTATE;
-}
-	YY_BREAK
-case 55:
-YY_RULE_SETUP
-#line 546 "lexer.lxx"
-{
-  accept();
-  return ROTX;
-}
-	YY_BREAK
-case 56:
-YY_RULE_SETUP
-#line 550 "lexer.lxx"
-{
-  accept();
-  return ROTY;
-}
-	YY_BREAK
-case 57:
-YY_RULE_SETUP
-#line 554 "lexer.lxx"
-{
-  accept();
-  return ROTZ;
-}
-	YY_BREAK
-case 58:
-YY_RULE_SETUP
-#line 558 "lexer.lxx"
-{
-  accept();
-  return SANIM;
-}
-	YY_BREAK
-case 59:
-YY_RULE_SETUP
-#line 562 "lexer.lxx"
-{
-  accept();
-  return SCALAR;
-}
-	YY_BREAK
-case 60:
-YY_RULE_SETUP
-#line 566 "lexer.lxx"
-{
-  accept();
-  return SCALE;
-}
-	YY_BREAK
-case 61:
-YY_RULE_SETUP
-#line 570 "lexer.lxx"
-{
-  accept();
-  return SEQUENCE;
-}
-	YY_BREAK
-case 62:
-YY_RULE_SETUP
-#line 574 "lexer.lxx"
-{
-  accept();
-  return SHADING;
-}
-	YY_BREAK
-case 63:
-YY_RULE_SETUP
-#line 578 "lexer.lxx"
-{
-  accept();
-  return SWITCH;
-}
-	YY_BREAK
-case 64:
-YY_RULE_SETUP
-#line 582 "lexer.lxx"
-{
-  accept();
-  return SWITCHCONDITION;
-}
-	YY_BREAK
-case 65:
-YY_RULE_SETUP
-#line 586 "lexer.lxx"
-{
-  accept();
-  return TABLE;
-}
-	YY_BREAK
-case 66:
-YY_RULE_SETUP
-#line 590 "lexer.lxx"
-{
-  accept();
-  return TABLE_V;
-}
-	YY_BREAK
-case 67:
-YY_RULE_SETUP
-#line 594 "lexer.lxx"
-{
-  accept();
-  return TAG;
-}
-	YY_BREAK
-case 68:
-YY_RULE_SETUP
-#line 598 "lexer.lxx"
-{
-  accept();
-  return TANGENT;
-}
-	YY_BREAK
-case 69:
-YY_RULE_SETUP
-#line 602 "lexer.lxx"
-{
-  accept();
-  return TEXLIST;
-}
-	YY_BREAK
-case 70:
-YY_RULE_SETUP
-#line 606 "lexer.lxx"
-{
-  accept();
-  return TEXTURE;
-}
-	YY_BREAK
-case 71:
-YY_RULE_SETUP
-#line 610 "lexer.lxx"
-{
-  accept();
-  return TLENGTHS;
-}
-	YY_BREAK
-case 72:
-YY_RULE_SETUP
-#line 614 "lexer.lxx"
-{
-  accept();
-  return TRANSFORM;
-}
-	YY_BREAK
-case 73:
-YY_RULE_SETUP
-#line 618 "lexer.lxx"
-{
-  accept();
-  return TRANSLATE;
-}
-	YY_BREAK
-case 74:
-YY_RULE_SETUP
-#line 622 "lexer.lxx"
-{
-  accept();
-  return TREF;
-}
-	YY_BREAK
-case 75:
-YY_RULE_SETUP
-#line 626 "lexer.lxx"
-{
-  accept();
-  return TRIANGLEFAN;
-}
-	YY_BREAK
-case 76:
-YY_RULE_SETUP
-#line 630 "lexer.lxx"
-{
-  accept();
-  return TRIANGLESTRIP;
-}
-	YY_BREAK
-case 77:
-YY_RULE_SETUP
-#line 634 "lexer.lxx"
-{
-  accept();
-  return TRIM;
-}
-	YY_BREAK
-case 78:
-YY_RULE_SETUP
-#line 638 "lexer.lxx"
-{
-  accept();
-  return TXT;
-}
-	YY_BREAK
-case 79:
-YY_RULE_SETUP
-#line 642 "lexer.lxx"
-{
-  accept();
-  return UKNOTS;
-}
-	YY_BREAK
-case 80:
-YY_RULE_SETUP
-#line 646 "lexer.lxx"
-{
-  accept();
-  return UKNOTS;
-}
-	YY_BREAK
-case 81:
-YY_RULE_SETUP
-#line 650 "lexer.lxx"
-{
-  accept();
-  return UV;
-}
-	YY_BREAK
-case 82:
-YY_RULE_SETUP
-#line 654 "lexer.lxx"
-{
-  accept();
-  return VKNOTS;
-}
-	YY_BREAK
-case 83:
-YY_RULE_SETUP
-#line 658 "lexer.lxx"
-{
-  accept();
-  return VKNOTS;
-}
-	YY_BREAK
-case 84:
-YY_RULE_SETUP
-#line 662 "lexer.lxx"
-{
-  accept();
-  return VERTEX;
-}
-	YY_BREAK
-case 85:
-YY_RULE_SETUP
-#line 666 "lexer.lxx"
-{
-  accept();
-  return VERTEXANIM;
-}
-	YY_BREAK
-case 86:
-YY_RULE_SETUP
-#line 670 "lexer.lxx"
-{
-  accept();
-  return VERTEXPOOL;
-}
-	YY_BREAK
-case 87:
-YY_RULE_SETUP
-#line 674 "lexer.lxx"
-{
-  accept();
-  return VERTEXREF;
-}
-	YY_BREAK
-case 88:
-YY_RULE_SETUP
-#line 678 "lexer.lxx"
-{
-  accept();
-  return XFMANIM;
-}
-	YY_BREAK
-case 89:
-YY_RULE_SETUP
-#line 682 "lexer.lxx"
-{
-  accept();
-  return XFMSANIM;
-}
-	YY_BREAK
-case 90:
-YY_RULE_SETUP
-#line 689 "lexer.lxx"
-{ 
-  // An integer or floating-point number.
-  accept(); 
-  eggyylval._number = patof(eggyytext); 
-  eggyylval._string = eggyytext;
-  return EGG_NUMBER; 
-}
-	YY_BREAK
-case 91:
-YY_RULE_SETUP
-#line 697 "lexer.lxx"
-{
-  // A hexadecimal integer number.
-  accept(); 
-  eggyylval._ulong = strtoul(eggyytext+2, NULL, 16);
-  eggyylval._string = eggyytext;
-  return EGG_ULONG; 
-}
-	YY_BREAK
-case 92:
-YY_RULE_SETUP
-#line 705 "lexer.lxx"
-{
-  // A binary integer number.
-  accept(); 
-  eggyylval._ulong = strtoul(eggyytext+2, NULL, 2);
-  eggyylval._string = eggyytext;
-  return EGG_ULONG; 
-}
-	YY_BREAK
-case 93:
-YY_RULE_SETUP
-#line 713 "lexer.lxx"
-{
-  // not-a-number.  These sometimes show up in egg files accidentally.
-  accept(); 
-  memset(&eggyylval._number, 0, sizeof(eggyylval._number));
-  *(unsigned long *)&eggyylval._number = strtoul(eggyytext+3, NULL, 0);
-  eggyylval._string = eggyytext;
-  return EGG_NUMBER;
-}
-	YY_BREAK
-case 94:
-YY_RULE_SETUP
-#line 722 "lexer.lxx"
-{ 
-  // infinity.  As above.
-  accept(); 
-  eggyylval._number = HUGE_VAL;
-  eggyylval._string = eggyytext;
-  return EGG_NUMBER; 
-}
-	YY_BREAK
-case 95:
-YY_RULE_SETUP
-#line 730 "lexer.lxx"
-{
-  // minus infinity.  As above.
-  accept(); 
-  eggyylval._number = -HUGE_VAL;
-  eggyylval._string = eggyytext;
-  return EGG_NUMBER; 
-}
-	YY_BREAK
-case 96:
-YY_RULE_SETUP
-#line 738 "lexer.lxx"
-{ 
-  // infinity, on Win32.  As above.
-  accept(); 
-  eggyylval._number = HUGE_VAL;
-  eggyylval._string = eggyytext;
-  return EGG_NUMBER; 
-}
-	YY_BREAK
-case 97:
-YY_RULE_SETUP
-#line 746 "lexer.lxx"
-{
-  // minus infinity, on Win32.  As above.
-  accept(); 
-  eggyylval._number = -HUGE_VAL;
-  eggyylval._string = eggyytext;
-  return EGG_NUMBER; 
-}
-	YY_BREAK
-case 98:
-YY_RULE_SETUP
-#line 755 "lexer.lxx"
-{
-  // Quoted string.
-  accept();
-  eggyylval._string = scan_quoted_string();
-  return EGG_STRING;
-}
-	YY_BREAK
-case 99:
-YY_RULE_SETUP
-#line 762 "lexer.lxx"
-{ 
-  // Unquoted string.
-  accept();
-  eggyylval._string = eggyytext;
-  return EGG_STRING;
-}
-	YY_BREAK
-case 100:
-YY_RULE_SETUP
-#line 768 "lexer.lxx"
-ECHO;
-	YY_BREAK
-#line 2350 "lex.yy.c"
-case YY_STATE_EOF(INITIAL):
-	yyterminate();
-
-	case YY_END_OF_BUFFER:
-		{
-		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
-		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = (yy_hold_char);
-		YY_RESTORE_YY_MORE_OFFSET
-
-		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-			{
-			/* We're scanning a new file or input source.  It's
-			 * possible that this happened because the user
-			 * just pointed eggyyin at a new source and called
-			 * eggyylex().  If so, then we have to assure
-			 * consistency between YY_CURRENT_BUFFER and our
-			 * globals.  Here is the right place to do so, because
-			 * this is the first action (other than possibly a
-			 * back-up) that will match for the new input source.
-			 */
-			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			YY_CURRENT_BUFFER_LVALUE->yy_input_file = eggyyin;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-			}
-
-		/* Note that here we test for yy_c_buf_p "<=" to the position
-		 * of the first EOB in the buffer, since yy_c_buf_p will
-		 * already have been incremented past the NUL character
-		 * (since all states make transitions on EOB to the
-		 * end-of-buffer state).  Contrast this with the test
-		 * in input().
-		 */
-		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-			{ /* This was really a NUL. */
-			yy_state_type yy_next_state;
-
-			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state(  );
-
-			/* Okay, we're now positioned to make the NUL
-			 * transition.  We couldn't have
-			 * yy_get_previous_state() go ahead and do it
-			 * for us because it doesn't know how to deal
-			 * with the possibility of jamming (and we don't
-			 * want to build jamming into it because then it
-			 * will run more slowly).
-			 */
-
-			yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
-			if ( yy_next_state )
-				{
-				/* Consume the NUL. */
-				yy_cp = ++(yy_c_buf_p);
-				yy_current_state = yy_next_state;
-				goto yy_match;
-				}
-
-			else
-				{
-				yy_cp = (yy_c_buf_p);
-				goto yy_find_action;
-				}
-			}
-
-		else switch ( yy_get_next_buffer(  ) )
-			{
-			case EOB_ACT_END_OF_FILE:
-				{
-				(yy_did_buffer_switch_on_eof) = 0;
-
-				if ( eggyywrap( ) )
-					{
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * eggyytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF(YY_START);
-					goto do_action;
-					}
-
-				else
-					{
-					if ( ! (yy_did_buffer_switch_on_eof) )
-						YY_NEW_FILE;
-					}
-				break;
-				}
-
-			case EOB_ACT_CONTINUE_SCAN:
-				(yy_c_buf_p) =
-					(yytext_ptr) + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state(  );
-
-				yy_cp = (yy_c_buf_p);
-				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-				goto yy_match;
-
-			case EOB_ACT_LAST_MATCH:
-				(yy_c_buf_p) =
-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
-				yy_current_state = yy_get_previous_state(  );
-
-				yy_cp = (yy_c_buf_p);
-				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-				goto yy_find_action;
-			}
-		break;
-		}
-
-	default:
-		YY_FATAL_ERROR(
-			"fatal flex scanner internal error--no action found" );
-	} /* end of action switch */
-		} /* end of scanning one token */
-} /* end of eggyylex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer (void)
-{
-    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-	register char *source = (yytext_ptr);
-	register int number_to_move, i;
-	int ret_val;
-
-	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
-		YY_FATAL_ERROR(
-		"fatal flex scanner internal error--end of buffer missed" );
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
-			{
-			/* We matched a single character, the EOB, so
-			 * treat this as a final EOF.
-			 */
-			return EOB_ACT_END_OF_FILE;
-			}
-
-		else
-			{
-			/* We matched some text prior to the EOB, first
-			 * process it.
-			 */
-			return EOB_ACT_LAST_MATCH;
-			}
-		}
-
-	/* Try to read more data. */
-
-	/* First move last chars to start of buffer. */
-	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
-	for ( i = 0; i < number_to_move; ++i )
-		*(dest++) = *(source++);
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-		/* don't do the read, it's not guaranteed to return an EOF,
-		 * just force an EOF
-		 */
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
-	else
-		{
-			yy_size_t num_to_read =
-			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-		while ( num_to_read <= 0 )
-			{ /* Not enough room in the buffer - grow it. */
-
-			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
-			int yy_c_buf_p_offset =
-				(int) ((yy_c_buf_p) - b->yy_ch_buf);
-
-			if ( b->yy_is_our_buffer )
-				{
-				yy_size_t new_size = b->yy_buf_size * 2;
-
-				if ( new_size <= 0 )
-					b->yy_buf_size += b->yy_buf_size / 8;
-				else
-					b->yy_buf_size *= 2;
-
-				b->yy_ch_buf = (char *)
-					/* Include room in for 2 EOB chars. */
-					eggyyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
-				}
-			else
-				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = 0;
-
-			if ( ! b->yy_ch_buf )
-				YY_FATAL_ERROR(
-				"fatal error - scanner input buffer overflow" );
-
-			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-						number_to_move - 1;
-
-			}
-
-		if ( num_to_read > YY_READ_BUF_SIZE )
-			num_to_read = YY_READ_BUF_SIZE;
-
-		/* Read in more data. */
-		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			(yy_n_chars), num_to_read );
-
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-		}
-
-	if ( (yy_n_chars) == 0 )
-		{
-		if ( number_to_move == YY_MORE_ADJ )
-			{
-			ret_val = EOB_ACT_END_OF_FILE;
-			eggyyrestart(eggyyin  );
-			}
-
-		else
-			{
-			ret_val = EOB_ACT_LAST_MATCH;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-				YY_BUFFER_EOF_PENDING;
-			}
-		}
-
-	else
-		ret_val = EOB_ACT_CONTINUE_SCAN;
-
-	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-		/* Extend the array by 50%, plus the number we really need. */
-		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) eggyyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
-		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-	}
-
-	(yy_n_chars) += number_to_move;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
-	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-	return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-    static yy_state_type yy_get_previous_state (void)
-{
-	register yy_state_type yy_current_state;
-	register char *yy_cp;
-    
-	yy_current_state = (yy_start);
-
-	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-		{
-		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-		if ( yy_accept[yy_current_state] )
-			{
-			(yy_last_accepting_state) = yy_current_state;
-			(yy_last_accepting_cpos) = yy_cp;
-			}
-		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-			{
-			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 580 )
-				yy_c = yy_meta[(unsigned int) yy_c];
-			}
-		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		}
-
-	return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
- */
-    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
-{
-	register int yy_is_jam;
-    	register char *yy_cp = (yy_c_buf_p);
-
-	register YY_CHAR yy_c = 1;
-	if ( yy_accept[yy_current_state] )
-		{
-		(yy_last_accepting_state) = yy_current_state;
-		(yy_last_accepting_cpos) = yy_cp;
-		}
-	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-		{
-		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 580 )
-			yy_c = yy_meta[(unsigned int) yy_c];
-		}
-	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 579);
-
-	return yy_is_jam ? 0 : yy_current_state;
-}
-
-    static void yyunput (int c, register char * yy_bp )
-{
-	register char *yy_cp;
-    
-    yy_cp = (yy_c_buf_p);
-
-	/* undo effects of setting up eggyytext */
-	*yy_cp = (yy_hold_char);
-
-	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-		{ /* need to shift things up to make room */
-		/* +2 for EOB chars. */
-		register yy_size_t number_to_move = (yy_n_chars) + 2;
-		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
-					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
-		register char *source =
-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
-		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-			*--dest = *--source;
-
-		yy_cp += (int) (dest - source);
-		yy_bp += (int) (dest - source);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
-			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
-		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-			YY_FATAL_ERROR( "flex scanner push-back overflow" );
-		}
-
-	*--yy_cp = (char) c;
-
-	(yytext_ptr) = yy_bp;
-	(yy_hold_char) = *yy_cp;
-	(yy_c_buf_p) = yy_cp;
-}
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-    static int yyinput (void)
-#else
-    static int input  (void)
-#endif
-
-{
-	int c;
-    
-	*(yy_c_buf_p) = (yy_hold_char);
-
-	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
-		{
-		/* yy_c_buf_p now points to the character we want to return.
-		 * If this occurs *before* the EOB characters, then it's a
-		 * valid NUL; if not, then we've hit the end of the buffer.
-		 */
-		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-			/* This was really a NUL. */
-			*(yy_c_buf_p) = '\0';
-
-		else
-			{ /* need more input */
-			yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
-			++(yy_c_buf_p);
-
-			switch ( yy_get_next_buffer(  ) )
-				{
-				case EOB_ACT_LAST_MATCH:
-					/* This happens because yy_g_n_b()
-					 * sees that we've accumulated a
-					 * token and flags that we need to
-					 * try matching the token before
-					 * proceeding.  But for input(),
-					 * there's no matching to consider.
-					 * So convert the EOB_ACT_LAST_MATCH
-					 * to EOB_ACT_END_OF_FILE.
-					 */
-
-					/* Reset buffer status. */
-					eggyyrestart(eggyyin );
-
-					/*FALLTHROUGH*/
-
-				case EOB_ACT_END_OF_FILE:
-					{
-					if ( eggyywrap( ) )
-						return 0;
-
-					if ( ! (yy_did_buffer_switch_on_eof) )
-						YY_NEW_FILE;
-#ifdef __cplusplus
-					return yyinput();
-#else
-					return input();
-#endif
-					}
-
-				case EOB_ACT_CONTINUE_SCAN:
-					(yy_c_buf_p) = (yytext_ptr) + offset;
-					break;
-				}
-			}
-		}
-
-	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
-	*(yy_c_buf_p) = '\0';	/* preserve eggyytext */
-	(yy_hold_char) = *++(yy_c_buf_p);
-
-	return c;
-}
-#endif	/* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * 
- * @note This function does not reset the start condition to @c INITIAL .
- */
-    void eggyyrestart  (FILE * input_file )
-{
-    
-	if ( ! YY_CURRENT_BUFFER ){
-        eggyyensure_buffer_stack ();
-		YY_CURRENT_BUFFER_LVALUE =
-            eggyy_create_buffer(eggyyin,YY_BUF_SIZE );
-	}
-
-	eggyy_init_buffer(YY_CURRENT_BUFFER,input_file );
-	eggyy_load_buffer_state( );
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * 
- */
-    void eggyy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
-{
-    
-	/* TODO. We should be able to replace this entire function body
-	 * with
-	 *		eggyypop_buffer_state();
-	 *		eggyypush_buffer_state(new_buffer);
-     */
-	eggyyensure_buffer_stack ();
-	if ( YY_CURRENT_BUFFER == new_buffer )
-		return;
-
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*(yy_c_buf_p) = (yy_hold_char);
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-		}
-
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-	eggyy_load_buffer_state( );
-
-	/* We don't actually know whether we did this switch during
-	 * EOF (eggyywrap()) processing, but the only time this flag
-	 * is looked at is after eggyywrap() is called, so it's safe
-	 * to go ahead and always set it.
-	 */
-	(yy_did_buffer_switch_on_eof) = 1;
-}
-
-static void eggyy_load_buffer_state  (void)
-{
-    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-	eggyyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-	(yy_hold_char) = *(yy_c_buf_p);
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * 
- * @return the allocated buffer state.
- */
-    YY_BUFFER_STATE eggyy_create_buffer  (FILE * file, int  size )
-{
-	YY_BUFFER_STATE b;
-    
-	b = (YY_BUFFER_STATE) eggyyalloc(sizeof( struct yy_buffer_state )  );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in eggyy_create_buffer()" );
-
-	b->yy_buf_size = size;
-
-	/* yy_ch_buf has to be 2 characters longer than the size given because
-	 * we need to put in 2 end-of-buffer characters.
-	 */
-	b->yy_ch_buf = (char *) eggyyalloc(b->yy_buf_size + 2  );
-	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in eggyy_create_buffer()" );
-
-	b->yy_is_our_buffer = 1;
-
-	eggyy_init_buffer(b,file );
-
-	return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with eggyy_create_buffer()
- * 
- */
-    void eggyy_delete_buffer (YY_BUFFER_STATE  b )
-{
-    
-	if ( ! b )
-		return;
-
-	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
-
-	if ( b->yy_is_our_buffer )
-		eggyyfree((void *) b->yy_ch_buf  );
-
-	eggyyfree((void *) b  );
-}
-
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-    
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a eggyyrestart() or at EOF.
- */
-    static void eggyy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
-
-{
-	int oerrno = errno;
-    
-	eggyy_flush_buffer(b );
-
-	b->yy_input_file = file;
-	b->yy_fill_buffer = 1;
-
-    /* If b is the current buffer, then eggyy_init_buffer was _probably_
-     * called from eggyyrestart() or through yy_get_next_buffer.
-     * In that case, we don't want to reset the lineno or column.
-     */
-    if (b != YY_CURRENT_BUFFER){
-        b->yy_bs_lineno = 1;
-        b->yy_bs_column = 0;
-    }
-
-        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-    
-	errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * 
- */
-    void eggyy_flush_buffer (YY_BUFFER_STATE  b )
-{
-    	if ( ! b )
-		return;
-
-	b->yy_n_chars = 0;
-
-	/* We always need two end-of-buffer characters.  The first causes
-	 * a transition to the end-of-buffer state.  The second causes
-	 * a jam in that state.
-	 */
-	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-	b->yy_buf_pos = &b->yy_ch_buf[0];
-
-	b->yy_at_bol = 1;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	if ( b == YY_CURRENT_BUFFER )
-		eggyy_load_buffer_state( );
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- *  the current state. This function will allocate the stack
- *  if necessary.
- *  @param new_buffer The new state.
- *  
- */
-void eggyypush_buffer_state (YY_BUFFER_STATE new_buffer )
-{
-    	if (new_buffer == NULL)
-		return;
-
-	eggyyensure_buffer_stack();
-
-	/* This block is copied from eggyy_switch_to_buffer. */
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*(yy_c_buf_p) = (yy_hold_char);
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-		}
-
-	/* Only push if top exists. Otherwise, replace top. */
-	if (YY_CURRENT_BUFFER)
-		(yy_buffer_stack_top)++;
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-	/* copied from eggyy_switch_to_buffer. */
-	eggyy_load_buffer_state( );
-	(yy_did_buffer_switch_on_eof) = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- *  The next element becomes the new top.
- *  
- */
-void eggyypop_buffer_state (void)
-{
-    	if (!YY_CURRENT_BUFFER)
-		return;
-
-	eggyy_delete_buffer(YY_CURRENT_BUFFER );
-	YY_CURRENT_BUFFER_LVALUE = NULL;
-	if ((yy_buffer_stack_top) > 0)
-		--(yy_buffer_stack_top);
-
-	if (YY_CURRENT_BUFFER) {
-		eggyy_load_buffer_state( );
-		(yy_did_buffer_switch_on_eof) = 1;
-	}
-}
-
-/* Allocates the stack if it does not exist.
- *  Guarantees space for at least one push.
- */
-static void eggyyensure_buffer_stack (void)
-{
-	yy_size_t num_to_alloc;
-    
-	if (!(yy_buffer_stack)) {
-
-		/* First allocation is just for 2 elements, since we don't know if this
-		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
-		 * immediate realloc on the next call.
-         */
-		num_to_alloc = 1;
-		(yy_buffer_stack) = (struct yy_buffer_state**)eggyyalloc
-								(num_to_alloc * sizeof(struct yy_buffer_state*)
-								);
-		if ( ! (yy_buffer_stack) )
-			YY_FATAL_ERROR( "out of dynamic memory in eggyyensure_buffer_stack()" );
-								  
-		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-				
-		(yy_buffer_stack_max) = num_to_alloc;
-		(yy_buffer_stack_top) = 0;
-		return;
-	}
-
-	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
-		/* Increase the buffer to prepare for a possible push. */
-		int grow_size = 8 /* arbitrary grow size */;
-
-		num_to_alloc = (yy_buffer_stack_max) + grow_size;
-		(yy_buffer_stack) = (struct yy_buffer_state**)eggyyrealloc
-								((yy_buffer_stack),
-								num_to_alloc * sizeof(struct yy_buffer_state*)
-								);
-		if ( ! (yy_buffer_stack) )
-			YY_FATAL_ERROR( "out of dynamic memory in eggyyensure_buffer_stack()" );
-
-		/* zero only the new slots.*/
-		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
-		(yy_buffer_stack_max) = num_to_alloc;
-	}
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- * 
- * @return the newly allocated buffer state object. 
- */
-YY_BUFFER_STATE eggyy_scan_buffer  (char * base, yy_size_t  size )
-{
-	YY_BUFFER_STATE b;
-    
-	if ( size < 2 ||
-	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
-	     base[size-1] != YY_END_OF_BUFFER_CHAR )
-		/* They forgot to leave room for the EOB's. */
-		return 0;
-
-	b = (YY_BUFFER_STATE) eggyyalloc(sizeof( struct yy_buffer_state )  );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in eggyy_scan_buffer()" );
-
-	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
-	b->yy_buf_pos = b->yy_ch_buf = base;
-	b->yy_is_our_buffer = 0;
-	b->yy_input_file = 0;
-	b->yy_n_chars = b->yy_buf_size;
-	b->yy_is_interactive = 0;
-	b->yy_at_bol = 1;
-	b->yy_fill_buffer = 0;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	eggyy_switch_to_buffer(b  );
-
-	return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to eggyylex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * 
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- *       eggyy_scan_bytes() instead.
- */
-YY_BUFFER_STATE eggyy_scan_string (yyconst char * yystr )
-{
-    
-	return eggyy_scan_bytes(yystr,strlen(yystr) );
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to eggyylex() will
- * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
- * 
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE eggyy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
-{
-	YY_BUFFER_STATE b;
-	char *buf;
-	yy_size_t n, i;
-    
-	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = _yybytes_len + 2;
-	buf = (char *) eggyyalloc(n  );
-	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in eggyy_scan_bytes()" );
-
-	for ( i = 0; i < _yybytes_len; ++i )
-		buf[i] = yybytes[i];
-
-	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = eggyy_scan_buffer(buf,n );
-	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in eggyy_scan_bytes()" );
-
-	/* It's okay to grow etc. this buffer, and we should throw it
-	 * away when we're done.
-	 */
-	b->yy_is_our_buffer = 1;
-
-	return b;
-}
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-static void yy_fatal_error (yyconst char* msg )
-{
-    	(void) fprintf( stderr, "%s\n", msg );
-	exit( YY_EXIT_FAILURE );
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up eggyytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		eggyytext[eggyyleng] = (yy_hold_char); \
-		(yy_c_buf_p) = eggyytext + yyless_macro_arg; \
-		(yy_hold_char) = *(yy_c_buf_p); \
-		*(yy_c_buf_p) = '\0'; \
-		eggyyleng = yyless_macro_arg; \
-		} \
-	while ( 0 )
-
-/* Accessor  methods (get/set functions) to struct members. */
-
-/** Get the current line number.
- * 
- */
-int eggyyget_lineno  (void)
-{
-        
-    return eggyylineno;
-}
-
-/** Get the input stream.
- * 
- */
-FILE *eggyyget_in  (void)
-{
-        return eggyyin;
-}
-
-/** Get the output stream.
- * 
- */
-FILE *eggyyget_out  (void)
-{
-        return eggyyout;
-}
-
-/** Get the length of the current token.
- * 
- */
-yy_size_t eggyyget_leng  (void)
-{
-        return eggyyleng;
-}
-
-/** Get the current token.
- * 
- */
-
-char *eggyyget_text  (void)
-{
-        return eggyytext;
-}
-
-/** Set the current line number.
- * @param line_number
- * 
- */
-void eggyyset_lineno (int  line_number )
-{
-    
-    eggyylineno = line_number;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param in_str A readable stream.
- * 
- * @see eggyy_switch_to_buffer
- */
-void eggyyset_in (FILE *  in_str )
-{
-        eggyyin = in_str ;
-}
-
-void eggyyset_out (FILE *  out_str )
-{
-        eggyyout = out_str ;
-}
-
-int eggyyget_debug  (void)
-{
-        return eggyy_flex_debug;
-}
-
-void eggyyset_debug (int  bdebug )
-{
-        eggyy_flex_debug = bdebug ;
-}
-
-static int yy_init_globals (void)
-{
-        /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from eggyylex_destroy(), so don't allocate here.
-     */
-
-    (yy_buffer_stack) = 0;
-    (yy_buffer_stack_top) = 0;
-    (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = (char *) 0;
-    (yy_init) = 0;
-    (yy_start) = 0;
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
-    eggyyin = stdin;
-    eggyyout = stdout;
-#else
-    eggyyin = (FILE *) 0;
-    eggyyout = (FILE *) 0;
-#endif
-
-    /* For future reference: Set errno on error, since we are called by
-     * eggyylex_init()
-     */
-    return 0;
-}
-
-/* eggyylex_destroy is for both reentrant and non-reentrant scanners. */
-int eggyylex_destroy  (void)
-{
-    
-    /* Pop the buffer stack, destroying each element. */
-	while(YY_CURRENT_BUFFER){
-		eggyy_delete_buffer(YY_CURRENT_BUFFER  );
-		YY_CURRENT_BUFFER_LVALUE = NULL;
-		eggyypop_buffer_state();
-	}
-
-	/* Destroy the stack itself. */
-	eggyyfree((yy_buffer_stack) );
-	(yy_buffer_stack) = NULL;
-
-    /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * eggyylex() is called, initialization will occur. */
-    yy_init_globals( );
-
-    return 0;
-}
-
-/*
- * Internal utility routines.
- */
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
-{
-	register int i;
-	for ( i = 0; i < n; ++i )
-		s1[i] = s2[i];
-}
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s )
-{
-	register int n;
-	for ( n = 0; s[n]; ++n )
-		;
-
-	return n;
-}
-#endif
-
-void *eggyyalloc (yy_size_t  size )
-{
-	return (void *) malloc( size );
-}
-
-void *eggyyrealloc  (void * ptr, yy_size_t  size )
-{
-	/* The cast to (char *) in the following accommodates both
-	 * implementations that use char* generic pointers, and those
-	 * that use void* generic pointers.  It works with the latter
-	 * because both ANSI C and C++ allow castless assignment from
-	 * any pointer type to void*, and deal with argument conversions
-	 * as though doing an assignment.
-	 */
-	return (void *) realloc( (char *) ptr, size );
-}
-
-void eggyyfree (void * ptr )
-{
-	free( (char *) ptr );	/* see eggyyrealloc() for (char *) cast */
-}
-
-#define YYTABLES_NAME "yytables"
-
-#line 768 "lexer.lxx"
+#line 2 "lex.yy.c"
+
+#line 4 "lex.yy.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define yy_create_buffer eggyy_create_buffer
+#define yy_delete_buffer eggyy_delete_buffer
+#define yy_flex_debug eggyy_flex_debug
+#define yy_init_buffer eggyy_init_buffer
+#define yy_flush_buffer eggyy_flush_buffer
+#define yy_load_buffer_state eggyy_load_buffer_state
+#define yy_switch_to_buffer eggyy_switch_to_buffer
+#define yyin eggyyin
+#define yyleng eggyyleng
+#define yylex eggyylex
+#define yylineno eggyylineno
+#define yyout eggyyout
+#define yyrestart eggyyrestart
+#define yytext eggyytext
+#define yywrap eggyywrap
+#define yyalloc eggyyalloc
+#define yyrealloc eggyyrealloc
+#define yyfree eggyyfree
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else	/* ! __cplusplus */
+
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
+#define YY_USE_CONST
+
+#endif	/* defined (__STDC__) */
+#endif	/* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN (yy_start) = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START (((yy_start) - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE eggyyrestart(eggyyin  )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#define YY_BUF_SIZE 16384
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+extern int eggyyleng;
+
+extern FILE *eggyyin, *eggyyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+    #define YY_LESS_LINENO(n)
+    
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up eggyytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		*yy_cp = (yy_hold_char); \
+		YY_RESTORE_YY_MORE_OFFSET \
+		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up eggyytext again */ \
+		} \
+	while ( 0 )
+
+#define unput(c) yyunput( c, (yytext_ptr)  )
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+	{
+	FILE *yy_input_file;
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	yy_size_t yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+    
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via eggyyrestart()), so that the user can continue scanning by
+	 * just pointing eggyyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+
+	};
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+                          : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+/* yy_hold_char holds the character lost when eggyytext is formed. */
+static char yy_hold_char;
+static int yy_n_chars;		/* number of characters read into yy_ch_buf */
+int eggyyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 0;		/* whether we need to initialize */
+static int yy_start = 0;	/* start state number */
+
+/* Flag which is used to allow eggyywrap()'s to do buffer switches
+ * instead of setting up a fresh eggyyin.  A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void eggyyrestart (FILE *input_file  );
+void eggyy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
+YY_BUFFER_STATE eggyy_create_buffer (FILE *file,int size  );
+void eggyy_delete_buffer (YY_BUFFER_STATE b  );
+void eggyy_flush_buffer (YY_BUFFER_STATE b  );
+void eggyypush_buffer_state (YY_BUFFER_STATE new_buffer  );
+void eggyypop_buffer_state (void );
+
+static void eggyyensure_buffer_stack (void );
+static void eggyy_load_buffer_state (void );
+static void eggyy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
+
+#define YY_FLUSH_BUFFER eggyy_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE eggyy_scan_buffer (char *base,yy_size_t size  );
+YY_BUFFER_STATE eggyy_scan_string (yyconst char *yy_str  );
+YY_BUFFER_STATE eggyy_scan_bytes (yyconst char *bytes,int len  );
+
+void *eggyyalloc (yy_size_t  );
+void *eggyyrealloc (void *,yy_size_t  );
+void eggyyfree (void *  );
+
+#define yy_new_buffer eggyy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! YY_CURRENT_BUFFER ){ \
+        eggyyensure_buffer_stack (); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            eggyy_create_buffer(eggyyin,YY_BUF_SIZE ); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+	}
+
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! YY_CURRENT_BUFFER ){\
+        eggyyensure_buffer_stack (); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            eggyy_create_buffer(eggyyin,YY_BUF_SIZE ); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+	}
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+typedef unsigned char YY_CHAR;
+
+FILE *eggyyin = (FILE *) 0, *eggyyout = (FILE *) 0;
+
+typedef int yy_state_type;
+
+extern int eggyylineno;
+
+int eggyylineno = 1;
+
+extern char *eggyytext;
+#define yytext_ptr eggyytext
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[]  );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up eggyytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	(yytext_ptr) = yy_bp; \
+	eggyyleng = (size_t) (yy_cp - yy_bp); \
+	(yy_hold_char) = *yy_cp; \
+	*yy_cp = '\0'; \
+	(yy_c_buf_p) = yy_cp;
+
+#define YY_NUM_RULES 101
+#define YY_END_OF_BUFFER 102
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+	{
+	flex_int32_t yy_verify;
+	flex_int32_t yy_nxt;
+	};
+static yyconst flex_int16_t yy_accept[585] =
+    {   0,
+        0,    0,  102,  100,    2,    1,   99,  100,  100,  100,
+      100,   91,   91,   91,  100,  100,  100,    5,  100,    1,
+      100,   91,   91,  100,   91,    4,    3,   91,   93,  100,
+       92,   91,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,   91,  100,    3,    3,   93,  100,
+       91,   92,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,   67,  100,  100,
+      100,   95,  100,  100,   96,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,   20,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,   82,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,    7,  100,  100,  100,
+
+      100,  100,  100,  100,  100,  100,  100,  100,  100,   26,
+      100,  100,  100,  100,  100,   24,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,   53,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+       68,  100,  100,  100,  100,  100,  100,  100,  100,   79,
+      100,  100,  100,  100,  100,  100,   94,  100,   97,  100,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,   21,  100,  100,  100,  100,  100,   25,  100,   30,
+      100,  100,  100,  100,  100,   37,   38,  100,  100,  100,
+
+       43,  100,  100,  100,  100,  100,  100,  100,  100,   54,
+      100,   56,   57,   58,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,   75,  100,   78,  100,
+      100,  100,  100,  100,  100,   94,   98,  100,  100,    9,
+      100,  100,  100,   14,  100,  100,  100,  100,  100,  100,
+      100,  100,   23,   28,  100,   31,  100,  100,   33,   34,
+      100,  100,   42,  100,  100,  100,  100,   48,  100,   50,
+      100,  100,  100,  100,  100,   61,  100,  100,  100,   66,
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,  100,   13,   15,  100,
+
+      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
+      100,  100,   44,  100,  100,  100,  100,  100,  100,   55,
+       59,   60,  100,  100,   64,  100,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,   85,  100,  100,  100,
+      100,  100,  100,  100,  100,  100,   16,   17,  100,  100,
+      100,  100,   22,  100,   35,  100,  100,   40,   41,  100,
+      100,  100,  100,  100,   52,  100,   63,  100,   69,   70,
+       71,  100,  100,  100,  100,   80,   81,   83,  100,  100,
+      100,   84,  100,  100,  100,  100,   12,  100,  100,  100,
+       27,  100,   36,   39,  100,  100,  100,  100,  100,   62,
+
+      100,   72,  100,  100,  100,  100,  100,  100,  100,   89,
+      100,  100,  100,   10,  100,   18,  100,  100,  100,  100,
+      100,  100,  100,  100,  100,   73,   74,  100,  100,  100,
+      100,   88,  100,  100,  100,  100,  100,  100,  100,   45,
+      100,   47,   49,   51,  100,  100,  100,   86,   87,  100,
+        6,    8,  100,  100,   32,  100,  100,  100,   76,  100,
+       90,  100,  100,  100,   46,  100,  100,  100,  100,  100,
+      100,   77,  100,  100,  100,  100,   11,  100,  100,   65,
+       19,  100,   29,    0
+    } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    1,    4,    5,    6,    1,    1,    1,    1,
+        1,    7,    8,    1,    9,   10,   11,   12,   13,   14,
+       15,   16,   14,   14,   14,   14,   14,    1,    1,   17,
+        1,   18,    1,    1,   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,
+        1,    1,    1,    1,   45,    1,   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,    1,   72,    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,    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,    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,    1
+    } ;
+
+static yyconst flex_int32_t yy_meta[73] =
+    {   0,
+        1,    2,    3,    2,    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,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2
+    } ;
+
+static yyconst flex_int16_t yy_base[590] =
+    {   0,
+        0,   71, 1224,    0, 1225,    0, 1225,    8,   23,   28,
+       18,  134,   55,   79,  203,    2,    0, 1225,    0,    0,
+       94,  101,  122,   17,  146,    0,   24,  151,   18,  174,
+      263,  276,  136,  277,  289,  338,   36,   63,   68,   68,
+       72,  146,  261,  284,  300,  318,  335,  373,  370,  373,
+      401,   88,  129,  138,  440,  147,   49,    0,   35,  416,
+      422,    0,  151,  271,  261,  261,  287,  385,  276,  299,
+      307,  417, 1205,  312,  334,  398,  406,  424,  433,  423,
+      420,  418,  430,  434,  432,  445,  440,  435,  437,  438,
+      434,  451,  453,  442,  443,  452,  459,  445,  459,  474,
+
+      478,  491,  474,  494,  495,  480,  497,  490,  498,  477,
+      497,  529,  484,  497, 1204,  498,  503,    0,  497,  505,
+      504,    0, 1209,  509,    0,  505,  520, 1202,  528,  537,
+      535,  533,  545,  532,  532,  540,  540,  536,    0,  535,
+     1201,  557,  539,  544,  561,  561, 1200,  542,  568,  565,
+      550,  560,  553,  570,  567,  583,  575,  587,  589,  595,
+      589,  601,  599,  601,  587,  605,  595,  585, 1199,  611,
+      616,  602,  608,  601,  619,  604,  613, 1198,  619,  626,
+      613,  631,  642,  657, 1197,  641,    0,  642,  643,  639,
+      646, 1208,  637,  648,  657,  648,    0,  661,  666,  672,
+
+      658,  665, 1206,  673,  670,  675,  666,  688, 1194,    0,
+      673,  694,  683,  698,  694,    0, 1193,  689, 1192,  693,
+      689,  710,  692,  694, 1191, 1175,  696,  706,  704, 1167,
+      716,  699,  717,  706,  724,  720,  710,  724,    0, 1166,
+      712, 1165, 1164, 1163,  724,  745,  729,  726,  745,  744,
+        0,  748,  745,  735,  756,  745, 1156,  751, 1155,    0,
+      751,  752,  753,  764,  755,  770,  805,  772,    0,  767,
+      768,  830,  772,  775,  784,  784,  800,  813,  804,  805,
+      811,    0,  809,  808,  822,  782,  779,    0,  815,    0,
+      774,  821,  812,  772,  613,    0,    0,  818,  804,  507,
+
+        0,  817,  838,  812,  503,  825,  407,  828,  827,    0,
+      838,    0,    0,    0,  845,  842,  393,  847,  848,  855,
+      391,  850,  846,  853,  852,  867,    0,  867,    0,  855,
+      856,  857,  854,  860,  867,    0,    0,  877,  880,    0,
+      885,  892,  387,    0,  384,  889,  875,  891,  883,  891,
+      909,  902,    0,    0,  912,    0,  911,  914,    0,    0,
+      917,   40,    0,  373,  898,  904,  906,    0,  920,    0,
+      919,  915,  372,  365,  355,    0,  927,  924,  932,    0,
+      913,  914,  931,  929,  925,  946,  936,  930,  931,  932,
+      965,  940,  959,  957,  949,  953,  960,    0,    0,  354,
+
+      351,  959,  978,  964,  977,  344,  962,  337,  980,  975,
+      336,  335,    0,  970,  971,  965,  986,  985,  334,    0,
+        0,    0,  989,  323,    0,  986,  320,  316,  284,  983,
+      985,  984, 1000,  278,  277,  275,    0,  999, 1005, 1017,
+      189, 1010, 1009, 1007, 1022,  181,    0,    0, 1007, 1013,
+     1019,  176,    0, 1030,    0,  175,  174,    0,    0, 1014,
+     1031, 1022, 1025, 1033,    0,  173,    0, 1028,    0,    0,
+        0,  167, 1030, 1039, 1039,    0,    0,    0, 1037, 1033,
+     1049,    0, 1056, 1056, 1037, 1074,    0,  159, 1062, 1057,
+        0, 1060,    0,    0, 1074, 1079, 1076, 1067, 1068,    0,
+
+     1085,    0,  138,  137, 1089, 1071, 1079, 1081,  134,    0,
+     1076, 1092, 1092,    0, 1093,    0, 1080, 1095, 1081,  124,
+     1099,  123,  122,  115, 1100,    0,    0, 1096, 1093,  105,
+      104,    0,  114,  101,  100, 1098, 1088,   79, 1116,    0,
+     1125,    0,    0,    0, 1111,   48, 1123,    0,    0,   46,
+        0,    0, 1113, 1115,    0, 1111,   44, 1132,    0, 1126,
+        0, 1138, 1124, 1129,    0, 1131,   42, 1129, 1144, 1135,
+     1137,    0,   40, 1139, 1138,   39,    0,   34, 1142,    0,
+        0,   27,    0, 1225, 1199,    0, 1202, 1204, 1206
+    } ;
+
+static yyconst flex_int16_t yy_def[590] =
+    {   0,
+      585,  585,  584,  586,  584,  587,  584,  586,  586,  586,
+      586,  586,  586,  586,  584,  586,  586,  584,  586,  587,
+      586,  586,  586,  586,  586,  586,  588,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  588,  589,  586,  586,
+      586,   31,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  267,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,  586,  586,  586,  586,  586,  586,  586,
+      586,  586,  586,    0,  584,  584,  584,  584,  584
+    } ;
+
+static yyconst flex_int16_t yy_nxt[1298] =
+    {   0,
+       19,    5,    6,    7,  584,  584,  584,    8,    9,   10,
+       11,   12,   13,   14,   14,   14,   15,   21,   54,   22,
+       22,   22,   22,   22,   26,   58,   16,   58,   27,   59,
+       59,   17,   21,   53,   22,   23,   22,   22,   22,   25,
+       25,   25,   25,   25,  583,   54,   59,   59,   56,   24,
+       58,  581,   58,   16,  411,  412,  580,  577,   17,  572,
+       53,  565,   84,  561,   32,  559,   22,   22,   22,   22,
+       22,   18,    5,    6,    7,   56,   24,   30,    8,    9,
+       10,   11,   12,   13,   14,   14,   14,   15,   28,   84,
+       22,   22,   22,   22,   22,   58,  555,   16,   85,   86,
+
+       87,   30,   17,   88,   30,   25,   25,   25,   25,   25,
+       28,  121,   22,   22,   22,   22,   22,  552,  551,  550,
+       58,  549,  548,   30,   16,   85,   86,   87,   30,   17,
+       88,   55,  544,   22,   22,   22,   22,   22,  121,  543,
+      542,  540,   18,   28,   30,   22,   22,   22,   22,   22,
+       30,  532,  122,   29,  527,  526,   30,   25,   25,   25,
+       25,   25,   25,   25,   25,   25,   25,   64,   30,  123,
+      125,   30,   89,   30,   65,   31,  516,  126,   90,  122,
+       29,   60,   60,   30,  502,   61,   61,   61,   61,   61,
+      500,  494,  493,  491,   64,   30,  123,  125,  487,   89,
+
+       30,   65,   31,   19,  126,   90,  482,   19,   19,   19,
+       19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
+       19,   33,   34,   35,   36,   19,   37,   38,   19,   39,
+       40,   41,   42,   43,   44,   45,   46,   19,   47,   48,
+       49,   50,   51,   19,   52,   19,   19,   19,   33,   34,
+       35,   36,   19,   37,   38,   19,   39,   40,   41,   42,
+       43,   44,   45,   46,   19,   47,   48,   49,   50,   51,
+       19,   52,   19,   19,   62,   62,   62,   62,   62,   91,
+       63,   62,   62,   62,   62,   62,   62,   25,   25,   25,
+       25,   25,  478,   92,  477,  476,   93,  127,   30,   66,
+
+       67,  471,  128,   68,  129,  130,   91,  133,   62,   62,
+       62,   62,   62,   62,   70,   69,   94,  134,   71,   96,
+       92,   72,   95,   93,  127,   30,   66,   67,   73,  128,
+       68,  129,  130,  470,  133,   97,   99,  469,   98,  135,
+      467,   70,   69,   94,  134,   71,   96,  140,   72,   95,
+      100,  465,  459,  458,  455,   73,   74,  101,   75,  102,
+       76,  453,   97,   99,   77,   98,  135,  103,  448,   78,
+      141,  447,  422,   79,  140,   80,   81,  100,  104,   82,
+       83,  114,  421,   74,  101,   75,  102,   76,  109,  420,
+      413,   77,  110,  105,  103,  106,   78,  141,  107,  111,
+
+       79,  399,   80,   81,  398,  112,   82,   83,  380,  117,
+      376,  113,  115,  108,  131,  109,  132,  116,  118,  110,
+      105,  142,  106,  119,  370,  107,  111,   61,   61,   61,
+       61,   61,  112,   61,   61,   61,   61,   61,  113,  115,
+      108,  131,  143,  132,  124,  120,  136,  137,  142,  138,
+      119,   25,   25,   25,   25,   25,  144,  145,  146,  147,
+      148,  149,   30,  150,  151,  152,  154,  155,  156,  143,
+      157,  158,  159,  136,  137,  160,  138,  161,  162,  163,
+      164,  153,  165,  144,  145,  146,  147,  148,  149,   30,
+      150,  151,  152,  154,  155,  156,  166,  157,  158,  159,
+
+      167,  169,  160,  168,  161,  162,  163,  164,  153,  165,
+      170,  171,  172,  173,  174,  175,  176,  177,  180,  181,
+      368,  185,  178,  166,  363,  186,  188,  167,  169,  179,
+      168,  189,  190,  191,  192,  194,  195,  170,  171,  172,
+      173,  174,  175,  176,  177,  180,  181,  182,  185,  178,
+      196,  183,  186,  188,  198,  184,  179,  199,  189,  190,
+      191,  192,  194,  195,  200,  201,  202,  203,  204,  205,
+      206,  208,  209,  207,  182,  211,  212,  196,  183,  213,
+      214,  198,  184,  215,  199,  217,  218,  219,  220,  221,
+      222,  200,  201,  202,  203,  204,  205,  206,  208,  209,
+
+      207,  223,  211,  212,  224,  225,  213,  214,  226,  227,
+      215,  229,  217,  218,  219,  220,  221,  222,  230,  231,
+      232,  233,  228,  234,  235,  236,  237,  238,  223,  240,
+      360,  224,  225,  245,  241,  226,  227,  246,  229,  247,
+      248,  249,  250,  252,  255,  230,  231,  232,  233,  228,
+      234,  235,  236,  237,  238,  253,  240,  242,  243,  244,
+      245,  241,  256,  254,  246,  257,  247,  248,  249,  250,
+      252,  255,  261,  262,  263,  258,  264,  265,  267,  268,
+      269,  270,  253,  271,  242,  243,  244,  259,  272,  256,
+      254,  273,  257,  274,  275,  277,  278,  279,  280,  261,
+
+      262,  263,  258,  264,  265,  267,  268,  269,  270,  281,
+      271,  283,  284,  285,  259,  272,  286,  287,  273,  289,
+      274,  275,  277,  278,  279,  280,  291,  292,  293,  294,
+      295,  298,  299,  300,  302,  303,  281,  304,  283,  284,
+      285,  305,  306,  286,  287,  307,  289,  308,  309,  311,
+      315,  318,  319,  291,  292,  293,  294,  295,  298,  299,
+      300,  302,  303,  316,  304,  320,  321,  317,  305,  306,
+      322,  323,  307,  324,  308,  309,  311,  315,  318,  319,
+      325,  326,  328,  330,  331,  332,  333,  334,  335,  359,
+      316,  356,  320,  321,  317,  337,  354,  322,  323,  353,
+
+      324,  344,  338,  339,  341,  342,  343,  325,  326,  328,
+      330,  331,  332,  333,  334,  335,  336,  336,  336,  336,
+      336,  345,  337,  336,  336,  336,  336,  336,  336,  338,
+      339,  341,  342,  343,  346,  347,  348,  349,  350,  351,
+      352,  355,  357,  358,  361,  362,  364,  340,  345,  367,
+      336,  336,  336,  336,  336,  336,  369,  371,  365,  372,
+      373,  346,  347,  348,  349,  350,  351,  352,  355,  357,
+      358,  361,  362,  364,  366,  374,  367,  375,  377,  378,
+      379,  381,  382,  369,  371,  365,  372,  373,  383,  384,
+      385,  387,  388,  389,  390,  391,  386,  392,  393,  394,
+
+      395,  366,  374,  396,  375,  377,  378,  379,  381,  382,
+      397,  400,  401,  402,  403,  383,  384,  385,  387,  388,
+      389,  390,  391,  386,  392,  393,  394,  395,  404,  405,
+      396,  406,  407,  408,  409,  410,  414,  397,  400,  401,
+      402,  403,  415,  416,  417,  418,  419,  423,  424,  425,
+      427,  428,  426,  429,  430,  404,  405,  431,  406,  407,
+      408,  409,  410,  414,  432,  433,  434,  435,  436,  415,
+      416,  417,  418,  419,  423,  424,  441,  427,  428,  426,
+      429,  430,  437,  438,  431,  442,  443,  444,  445,  446,
+      449,  432,  433,  434,  435,  436,  450,  451,  439,  452,
+
+      440,  454,  456,  441,  457,  460,  461,  462,  463,  464,
+      438,  466,  442,  443,  444,  445,  446,  449,  468,  472,
+      473,  474,  475,  450,  451,  439,  452,  440,  454,  456,
+      479,  457,  460,  461,  462,  463,  464,  480,  466,  481,
+      483,  484,  485,  486,  488,  468,  472,  473,  474,  475,
+      489,  490,  492,  495,  496,  497,  498,  479,  499,  501,
+      503,  504,  505,  507,  480,  508,  481,  483,  484,  485,
+      486,  488,  509,  510,  512,  506,  513,  489,  490,  492,
+      495,  496,  497,  498,  517,  499,  501,  503,  504,  505,
+      507,  514,  508,  518,  515,  519,  520,  521,  522,  509,
+
+      511,  512,  506,  513,  523,  524,  525,  528,  529,  530,
+      531,  517,  533,  534,  535,  536,  537,  538,  539,  541,
+      518,  515,  519,  520,  521,  522,  545,  546,  547,  553,
+      554,  523,  524,  525,  528,  529,  530,  531,  556,  533,
+      534,  535,  536,  537,  538,  539,  541,  557,  558,  560,
+      562,  563,  564,  545,  546,  547,  553,  554,  566,  567,
+      568,  569,  570,  571,  573,  556,  574,  575,  576,  578,
+      579,  582,  329,  327,  557,  558,  560,  562,  563,  564,
+      314,  313,  312,  310,  301,  566,  567,  568,  569,  570,
+      571,  573,  297,  574,  575,  576,  578,  579,  582,    4,
+
+        4,    4,   20,   20,   57,   57,   58,   58,  296,  290,
+      288,  282,  276,  266,  260,  251,  239,  216,  210,  197,
+      193,  187,  139,  584,    3,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584
+
+    } ;
+
+static yyconst flex_int16_t yy_chk[1298] =
+    {   0,
+      586,    1,    1,    1,    0,    0,    0,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    8,   17,    8,
+        8,    8,    8,    8,   11,   27,    1,   27,   11,   29,
+       29,    1,    9,   16,    9,    9,    9,    9,    9,   10,
+       10,   10,   10,   10,  582,   17,   59,   59,   24,    9,
+       57,  578,   57,    1,  362,  362,  576,  573,    1,  567,
+       16,  557,   37,  550,   13,  546,   13,   13,   13,   13,
+       13,    1,    2,    2,    2,   24,    9,   13,    2,    2,
+        2,    2,    2,    2,    2,    2,    2,    2,   14,   37,
+       14,   14,   14,   14,   14,   27,  538,    2,   38,   39,
+
+       40,   14,    2,   41,   13,   21,   21,   21,   21,   21,
+       22,   52,   22,   22,   22,   22,   22,  535,  534,  533,
+       57,  531,  530,   22,    2,   38,   39,   40,   14,    2,
+       41,   23,  524,   23,   23,   23,   23,   23,   52,  523,
+      522,  520,    2,   12,   23,   12,   12,   12,   12,   12,
+       22,  509,   53,   12,  504,  503,   12,   25,   25,   25,
+       25,   25,   28,   28,   28,   28,   28,   33,   25,   54,
+       56,   23,   42,   28,   33,   12,  488,   63,   42,   53,
+       12,   30,   30,   12,  472,   30,   30,   30,   30,   30,
+      466,  457,  456,  452,   33,   25,   54,   56,  446,   42,
+
+       28,   33,   12,   15,   63,   42,  441,   15,   15,   15,
+       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
+       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
+       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
+       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
+       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
+       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
+       15,   15,   15,   15,   31,   31,   31,   31,   31,   43,
+       32,   31,   31,   31,   31,   31,   31,   32,   32,   32,
+       32,   32,  436,   43,  435,  434,   43,   64,   32,   34,
+
+       34,  429,   65,   34,   66,   67,   43,   69,   31,   31,
+       31,   31,   31,   31,   35,   34,   44,   70,   35,   45,
+       43,   35,   44,   43,   64,   32,   34,   34,   35,   65,
+       34,   66,   67,  428,   69,   45,   46,  427,   45,   71,
+      424,   35,   34,   44,   70,   35,   45,   74,   35,   44,
+       46,  419,  412,  411,  408,   35,   36,   47,   36,   47,
+       36,  406,   45,   46,   36,   45,   71,   47,  401,   36,
+       75,  400,  375,   36,   74,   36,   36,   46,   48,   36,
+       36,   50,  374,   36,   47,   36,   47,   36,   49,  373,
+      364,   36,   49,   48,   47,   48,   36,   75,   48,   49,
+
+       36,  345,   36,   36,  343,   49,   36,   36,  321,   51,
+      317,   49,   50,   48,   68,   49,   68,   50,   51,   49,
+       48,   76,   48,   51,  307,   48,   49,   60,   60,   60,
+       60,   60,   49,   61,   61,   61,   61,   61,   49,   50,
+       48,   68,   77,   68,   55,   51,   72,   72,   76,   72,
+       51,   55,   55,   55,   55,   55,   78,   79,   80,   81,
+       82,   83,   55,   84,   85,   86,   87,   88,   89,   77,
+       90,   91,   92,   72,   72,   93,   72,   94,   95,   96,
+       97,   86,   98,   78,   79,   80,   81,   82,   83,   55,
+       84,   85,   86,   87,   88,   89,   99,   90,   91,   92,
+
+      100,  101,   93,  100,   94,   95,   96,   97,   86,   98,
+      102,  103,  104,  105,  106,  107,  108,  109,  110,  111,
+      305,  113,  109,   99,  300,  114,  116,  100,  101,  109,
+      100,  117,  119,  120,  121,  124,  126,  102,  103,  104,
+      105,  106,  107,  108,  109,  110,  111,  112,  113,  109,
+      127,  112,  114,  116,  129,  112,  109,  130,  117,  119,
+      120,  121,  124,  126,  131,  132,  133,  134,  135,  136,
+      137,  138,  140,  137,  112,  142,  143,  127,  112,  144,
+      145,  129,  112,  146,  130,  148,  149,  150,  151,  152,
+      153,  131,  132,  133,  134,  135,  136,  137,  138,  140,
+
+      137,  154,  142,  143,  155,  156,  144,  145,  157,  158,
+      146,  159,  148,  149,  150,  151,  152,  153,  160,  161,
+      162,  163,  158,  164,  165,  166,  167,  168,  154,  170,
+      295,  155,  156,  172,  171,  157,  158,  173,  159,  174,
+      175,  176,  177,  179,  181,  160,  161,  162,  163,  158,
+      164,  165,  166,  167,  168,  180,  170,  171,  171,  171,
+      172,  171,  182,  180,  173,  183,  174,  175,  176,  177,
+      179,  181,  186,  188,  189,  184,  190,  191,  193,  194,
+      195,  196,  180,  198,  171,  171,  171,  184,  199,  182,
+      180,  200,  183,  201,  202,  204,  205,  206,  207,  186,
+
+      188,  189,  184,  190,  191,  193,  194,  195,  196,  208,
+      198,  211,  212,  213,  184,  199,  214,  215,  200,  218,
+      201,  202,  204,  205,  206,  207,  220,  221,  222,  223,
+      224,  227,  228,  229,  231,  232,  208,  233,  211,  212,
+      213,  234,  235,  214,  215,  236,  218,  237,  238,  241,
+      245,  247,  248,  220,  221,  222,  223,  224,  227,  228,
+      229,  231,  232,  246,  233,  249,  250,  246,  234,  235,
+      252,  253,  236,  254,  237,  238,  241,  245,  247,  248,
+      255,  256,  258,  261,  262,  263,  264,  265,  266,  294,
+      246,  291,  249,  250,  246,  268,  287,  252,  253,  286,
+
+      254,  276,  270,  271,  273,  274,  275,  255,  256,  258,
+      261,  262,  263,  264,  265,  266,  267,  267,  267,  267,
+      267,  277,  268,  267,  267,  267,  267,  267,  267,  270,
+      271,  273,  274,  275,  278,  279,  280,  281,  283,  284,
+      285,  289,  292,  293,  298,  299,  302,  272,  277,  304,
+      267,  267,  267,  267,  267,  267,  306,  308,  303,  309,
+      311,  278,  279,  280,  281,  283,  284,  285,  289,  292,
+      293,  298,  299,  302,  303,  315,  304,  316,  318,  319,
+      320,  322,  323,  306,  308,  303,  309,  311,  324,  325,
+      326,  328,  330,  331,  332,  333,  326,  334,  335,  338,
+
+      339,  303,  315,  341,  316,  318,  319,  320,  322,  323,
+      342,  346,  347,  348,  349,  324,  325,  326,  328,  330,
+      331,  332,  333,  326,  334,  335,  338,  339,  350,  351,
+      341,  352,  355,  357,  358,  361,  365,  342,  346,  347,
+      348,  349,  366,  367,  369,  371,  372,  377,  378,  379,
+      381,  382,  379,  383,  384,  350,  351,  385,  352,  355,
+      357,  358,  361,  365,  386,  387,  388,  389,  390,  366,
+      367,  369,  371,  372,  377,  378,  392,  381,  382,  379,
+      383,  384,  391,  391,  385,  393,  394,  395,  396,  397,
+      402,  386,  387,  388,  389,  390,  403,  404,  391,  405,
+
+      391,  407,  409,  392,  410,  414,  415,  416,  417,  418,
+      391,  423,  393,  394,  395,  396,  397,  402,  426,  430,
+      431,  432,  433,  403,  404,  391,  405,  391,  407,  409,
+      438,  410,  414,  415,  416,  417,  418,  439,  423,  440,
+      442,  443,  444,  445,  449,  426,  430,  431,  432,  433,
+      450,  451,  454,  460,  461,  462,  463,  438,  464,  468,
+      473,  474,  475,  479,  439,  480,  440,  442,  443,  444,
+      445,  449,  481,  483,  484,  475,  485,  450,  451,  454,
+      460,  461,  462,  463,  489,  464,  468,  473,  474,  475,
+      479,  486,  480,  490,  486,  492,  495,  496,  497,  481,
+
+      483,  484,  475,  485,  498,  499,  501,  505,  506,  507,
+      508,  489,  511,  512,  513,  515,  517,  518,  519,  521,
+      490,  486,  492,  495,  496,  497,  525,  528,  529,  536,
+      537,  498,  499,  501,  505,  506,  507,  508,  539,  511,
+      512,  513,  515,  517,  518,  519,  521,  541,  545,  547,
+      553,  554,  556,  525,  528,  529,  536,  537,  558,  560,
+      562,  563,  564,  566,  568,  539,  569,  570,  571,  574,
+      575,  579,  259,  257,  541,  545,  547,  553,  554,  556,
+      244,  243,  242,  240,  230,  558,  560,  562,  563,  564,
+      566,  568,  226,  569,  570,  571,  574,  575,  579,  585,
+
+      585,  585,  587,  587,  588,  588,  589,  589,  225,  219,
+      217,  209,  203,  192,  185,  178,  169,  147,  141,  128,
+      123,  115,   73,    3,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584,  584,  584,  584,
+      584,  584,  584,  584,  584,  584,  584
+
+    } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+extern int eggyy_flex_debug;
+int eggyy_flex_debug = 0;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *eggyytext;
+#line 1 "lexer.lxx"
+/*
+// Filename: lexer.l
+// Created by:  drose (16Jan99)
+// 
+////////////////////////////////////////////////////////////////////
+*/
+#line 9 "lexer.lxx"
+#include "pandabase.h"
+#include "lexerDefs.h"
+#include "parserDefs.h"
+#include "config_egg.h"
+#include "parser.h"
+#include "indent.h"
+#include "pnotify.h"
+#include "lightMutex.h"
+#include "thread.h"
+#include "pstrtod.h"
+
+#include <math.h>
+
+extern "C" int eggyywrap(void);  // declared below.
+
+static int yyinput(void);        // declared by flex.
+
+
+////////////////////////////////////////////////////////////////////
+// Static variables
+////////////////////////////////////////////////////////////////////
+
+// This mutex protects all of these global variables. 
+LightMutex egg_lock; 
+
+// We'll increment line_number and col_number as we parse the file, so
+// that we can report the position of an error.
+static int line_number = 0;
+static int col_number = 0;
+
+// current_line holds as much of the current line as will fit.  Its
+// only purpose is for printing it out to report an error to the user.
+static const int max_error_width = 1024;
+static char current_line[max_error_width + 1];
+
+static int error_count = 0;
+static int warning_count = 0;
+
+// This is the pointer to the current input stream.
+static istream *input_p = NULL;
+
+// This is the name of the egg file we're parsing.  We keep it so we
+// can print it out for error messages.
+static string egg_filename;
+
+// This is the initial token state returned by the lexer.  It allows
+// the yacc grammar to start from initial points.
+static int initial_token;
+
+////////////////////////////////////////////////////////////////////
+// Defining the interface to the lexer.
+////////////////////////////////////////////////////////////////////
+
+void
+egg_init_lexer(istream &in, const string &filename) {
+  input_p = &in;
+  egg_filename = filename;
+  line_number = 0;
+  col_number = 0;
+  error_count = 0;
+  warning_count = 0;
+  initial_token = START_EGG;
+}
+
+void
+egg_start_group_body() {
+  /* Set the initial state to begin within a group_body context,
+     instead of at the beginning of the egg file. */
+  initial_token = START_GROUP_BODY;
+}
+
+void
+egg_start_texture_body() {
+  initial_token = START_TEXTURE_BODY;
+}
+
+void
+egg_start_primitive_body() {
+  initial_token = START_PRIMITIVE_BODY;
+}
+
+int
+egg_error_count() {
+  return error_count;
+}
+
+int
+egg_warning_count() {
+  return warning_count;
+}
+
+
+////////////////////////////////////////////////////////////////////
+// Internal support functions.
+////////////////////////////////////////////////////////////////////
+
+int
+eggyywrap(void) {
+  return 1;
+}
+
+void
+eggyyerror(const string &msg) {
+  if (egg_cat.is_error()) {
+    ostream &out = egg_cat.error(false);
+
+    out << "\nError";
+    if (!egg_filename.empty()) {
+      out << " in " << egg_filename;
+    }
+    out 
+      << " at line " << line_number << ", column " << col_number << ":\n"
+      << setiosflags(Notify::get_literal_flag())
+      << current_line << "\n";
+    indent(out, col_number-1) 
+      << "^\n" << msg << "\n\n" 
+      << resetiosflags(Notify::get_literal_flag()) << flush;
+  }
+  error_count++;
+}
+
+void
+eggyyerror(ostringstream &strm) {
+  string s = strm.str();
+  eggyyerror(s);
+}
+
+void
+eggyywarning(const string &msg) {
+  if (egg_cat.is_warning()) {
+    ostream &out = egg_cat.warning(false);
+
+    out << "\nWarning";
+    if (!egg_filename.empty()) {
+      out << " in " << egg_filename;
+    }
+    out 
+      << " at line " << line_number << ", column " << col_number << ":\n"
+      << setiosflags(Notify::get_literal_flag())
+      << current_line << "\n";
+    indent(out, col_number-1) 
+      << "^\n" << msg << "\n\n" 
+      << resetiosflags(Notify::get_literal_flag()) << flush;
+  }
+  warning_count++;
+}
+
+void
+eggyywarning(ostringstream &strm) {
+  string s = strm.str();
+  eggyywarning(s);
+}
+
+// Now define a function to take input from an istream instead of a
+// stdio FILE pointer.  This is flex-specific.
+static void
+input_chars(char *buffer, int &result, int max_size) {
+  nassertv(input_p != NULL);
+  if (*input_p) {
+    input_p->read(buffer, max_size);
+    result = input_p->gcount();
+
+    if (line_number == 0) {
+      // This is a special case.  If we are reading the very first bit
+      // from the stream, copy it into the current_line array.  This
+      // is because the \n.* rule below, which fills current_line
+      // normally, doesn't catch the first line.
+      int length = min(max_error_width, result);
+      strncpy(current_line, buffer, length);
+      current_line[length] = '\0';
+      line_number++;
+      col_number = 0;
+
+      // Truncate it at the newline.
+      char *end = strchr(current_line, '\n');
+      if (end != NULL) {
+        *end = '\0';
+      }
+    }
+
+  } else {
+    // End of file or I/O error.
+    result = 0;
+  }
+  Thread::consider_yield();
+}
+#undef YY_INPUT
+
+// Define this macro carefully, since different flex versions call it
+// with a different type for result.
+#define YY_INPUT(buffer, result, max_size) { \
+  int int_result; \
+  input_chars((buffer), int_result, (max_size)); \
+  (result) = int_result; \
+}
+
+// read_char reads and returns a single character, incrementing the
+// supplied line and column numbers as appropriate.  A convenience
+// function for the scanning functions below.
+static int
+read_char(int &line, int &col) {
+  int c = yyinput();
+  if (c == '\n') {
+    line++;
+    col = 0;
+  } else {
+    col++;
+  }
+  return c;
+}
+
+// scan_quoted_string reads a string delimited by quotation marks and
+// returns it.
+static string
+scan_quoted_string() {
+  string result;
+
+  // We don't touch the current line number and column number during
+  // scanning, so that if we detect an error while scanning the string
+  // (e.g. an unterminated string), we'll report the error as
+  // occurring at the start of the string, not at the end--somewhat
+  // more convenient for the user.
+
+  // Instead of adjusting the global line_number and col_number
+  // variables, we'll operate on our own local variables for the
+  // interim.
+  int line = line_number;
+  int col = col_number;
+
+  int c;
+  c = read_char(line, col);
+  while (c != '"' && c != EOF) {
+    result += c;
+    c = read_char(line, col);
+  }
+
+  if (c == EOF) {
+    eggyyerror("This quotation mark is unterminated.");
+  }
+
+  line_number = line;
+  col_number = col;
+
+  return result;
+}
+
+// eat_c_comment scans past all characters up until the first */
+// encountered.
+static void
+eat_c_comment() {
+  // As above, we'll operate on our own local copies of line_number
+  // and col_number within this function.
+
+  int line = line_number;
+  int col = col_number;
+
+  int c, last_c;
+  
+  last_c = '\0';
+  c = read_char(line, col);
+  while (c != EOF && !(last_c == '*' && c == '/')) {
+    if (last_c == '/' && c == '*') {
+      ostringstream errmsg;
+      errmsg << "This comment contains a nested /* symbol at line "
+             << line << ", column " << col-1 << "--possibly unclosed?"
+             << ends;
+      eggyywarning(errmsg);
+    }
+    last_c = c;
+    c = read_char(line, col);
+  }
+
+  if (c == EOF) {
+    eggyyerror("This comment marker is unclosed.");
+  }
+
+  line_number = line;
+  col_number = col;
+}
+
+
+// accept() is called below as each piece is pulled off and
+// accepted by the lexer; it increments the current column number.
+INLINE void accept() {
+  col_number += eggyyleng;
+}
+
+#line 1241 "lex.yy.c"
+
+#define INITIAL 0
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+static int yy_init_globals (void );
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int eggyylex_destroy (void );
+
+int eggyyget_debug (void );
+
+void eggyyset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE eggyyget_extra (void );
+
+void eggyyset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *eggyyget_in (void );
+
+void eggyyset_in  (FILE * in_str  );
+
+FILE *eggyyget_out (void );
+
+void eggyyset_out  (FILE * out_str  );
+
+int eggyyget_leng (void );
+
+char *eggyyget_text (void );
+
+int eggyyget_lineno (void );
+
+void eggyyset_lineno (int line_number  );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int eggyywrap (void );
+#else
+extern int eggyywrap (void );
+#endif
+#endif
+
+    static void yyunput (int c,char *buf_ptr  );
+    
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int );
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * );
+#endif
+
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (void );
+#else
+static int input (void );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO fwrite( eggyytext, eggyyleng, 1, eggyyout )
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+		{ \
+		int c = '*'; \
+		int n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( eggyyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( eggyyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else \
+		{ \
+		errno=0; \
+		while ( (result = fread(buf, 1, max_size, eggyyin))==0 && ferror(eggyyin)) \
+			{ \
+			if( errno != EINTR) \
+				{ \
+				YY_FATAL_ERROR( "input in flex scanner failed" ); \
+				break; \
+				} \
+			errno=0; \
+			clearerr(eggyyin); \
+			} \
+		}\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int eggyylex (void);
+
+#define YY_DECL int eggyylex (void)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after eggyytext and eggyyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+	YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+	register yy_state_type yy_current_state;
+	register char *yy_cp, *yy_bp;
+	register int yy_act;
+    
+#line 302 "lexer.lxx"
+
+
+
+  if (initial_token != 0) {
+    int t = initial_token;
+    initial_token = 0;
+    return t;
+  }
+
+
+#line 1434 "lex.yy.c"
+
+	if ( !(yy_init) )
+		{
+		(yy_init) = 1;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+		if ( ! (yy_start) )
+			(yy_start) = 1;	/* first start state */
+
+		if ( ! eggyyin )
+			eggyyin = stdin;
+
+		if ( ! eggyyout )
+			eggyyout = stdout;
+
+		if ( ! YY_CURRENT_BUFFER ) {
+			eggyyensure_buffer_stack ();
+			YY_CURRENT_BUFFER_LVALUE =
+				eggyy_create_buffer(eggyyin,YY_BUF_SIZE );
+		}
+
+		eggyy_load_buffer_state( );
+		}
+
+	while ( 1 )		/* loops until end-of-file is reached */
+		{
+		yy_cp = (yy_c_buf_p);
+
+		/* Support of eggyytext. */
+		*yy_cp = (yy_hold_char);
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = (yy_start);
+yy_match:
+		do
+			{
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			if ( yy_accept[yy_current_state] )
+				{
+				(yy_last_accepting_state) = yy_current_state;
+				(yy_last_accepting_cpos) = yy_cp;
+				}
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 585 )
+					yy_c = yy_meta[(unsigned int) yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+			++yy_cp;
+			}
+		while ( yy_base[yy_current_state] != 1225 );
+
+yy_find_action:
+		yy_act = yy_accept[yy_current_state];
+		if ( yy_act == 0 )
+			{ /* have to back up */
+			yy_cp = (yy_last_accepting_cpos);
+			yy_current_state = (yy_last_accepting_state);
+			yy_act = yy_accept[yy_current_state];
+			}
+
+		YY_DO_BEFORE_ACTION;
+
+do_action:	/* This label is used only to access EOF actions. */
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+			case 0: /* must back up */
+			/* undo the effects of YY_DO_BEFORE_ACTION */
+			*yy_cp = (yy_hold_char);
+			yy_cp = (yy_last_accepting_cpos);
+			yy_current_state = (yy_last_accepting_state);
+			goto yy_find_action;
+
+case 1:
+/* rule 1 can match eol */
+YY_RULE_SETUP
+#line 312 "lexer.lxx"
+{
+  // New line.  Save a copy of the line so we can print it out for the
+  // benefit of the user in case we get an error.
+
+  strncpy(current_line, eggyytext+1, max_error_width);
+  current_line[max_error_width] = '\0';
+  line_number++;
+  col_number=0;
+
+  // Return the whole line to the lexer, except the newline character,
+  // which we eat.
+  yyless(1);
+}
+	YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 326 "lexer.lxx"
+{ 
+  // Eat whitespace.
+  accept();
+}
+	YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 331 "lexer.lxx"
+{ 
+  // Eat C++-style comments.
+  accept();
+}
+	YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 336 "lexer.lxx"
+{
+  // Eat C-style comments.
+  accept();
+  eat_c_comment(); 
+}
+	YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 342 "lexer.lxx"
+{
+  // Send curly braces as themselves.
+  accept(); 
+  return eggyytext[0];
+}
+	YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 350 "lexer.lxx"
+{
+  accept();
+  return ANIMPRELOAD;
+}
+	YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 354 "lexer.lxx"
+{
+  accept();
+  return AUX;
+}
+	YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 358 "lexer.lxx"
+{
+  accept();
+  return BEZIERCURVE;
+}
+	YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 362 "lexer.lxx"
+{
+  accept();
+  return BFACE;
+}
+	YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 366 "lexer.lxx"
+{
+  accept();
+  return BILLBOARD;
+}
+	YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 370 "lexer.lxx"
+{
+  accept();
+  return BILLBOARDCENTER;
+}
+	YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 374 "lexer.lxx"
+{
+  accept();
+  return BINORMAL;
+}
+	YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 378 "lexer.lxx"
+{
+  accept();
+  return BUNDLE;
+}
+	YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 382 "lexer.lxx"
+{
+  accept();
+  return SCALAR;
+}
+	YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 386 "lexer.lxx"
+{
+  accept();
+  return CLOSED;
+}
+	YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 390 "lexer.lxx"
+{
+  accept();
+  return COLLIDE;
+}
+	YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 394 "lexer.lxx"
+{
+  accept();
+  return COMMENT;
+}
+	YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 398 "lexer.lxx"
+{
+  accept();
+  return COMPONENT;
+}
+	YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 402 "lexer.lxx"
+{
+  accept();
+  return COORDSYSTEM;
+}
+	YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 406 "lexer.lxx"
+{
+  accept();
+  return CV;
+}
+	YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 410 "lexer.lxx"
+{
+  accept();
+  return DART;
+}
+	YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 414 "lexer.lxx"
+{
+  accept();
+  return DNORMAL;
+}
+	YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 418 "lexer.lxx"
+{
+  accept();
+  return DRGBA;
+}
+	YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 422 "lexer.lxx"
+{
+  accept();
+  return DUV;
+}
+	YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 426 "lexer.lxx"
+{
+  accept();
+  return DXYZ;
+}
+	YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 430 "lexer.lxx"
+{
+  accept();
+  return DCS;
+}
+	YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 434 "lexer.lxx"
+{
+  accept();
+  return DISTANCE;
+}
+	YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 438 "lexer.lxx"
+{
+  accept();
+  return DTREF;
+}
+	YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 442 "lexer.lxx"
+{
+  accept();
+  return DYNAMICVERTEXPOOL;
+}
+	YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 446 "lexer.lxx"
+{
+  accept();
+  return EXTERNAL_FILE;
+}
+	YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 450 "lexer.lxx"
+{
+  accept();
+  return GROUP;
+}
+	YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 454 "lexer.lxx"
+{
+  accept();
+  return DEFAULTPOSE;
+}
+	YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 458 "lexer.lxx"
+{
+  accept();
+  return JOINT;
+}
+	YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 462 "lexer.lxx"
+{
+  accept();
+  return KNOTS;
+}
+	YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 466 "lexer.lxx"
+{
+  accept();
+  return INCLUDE;
+}
+	YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 470 "lexer.lxx"
+{
+  accept();
+  return INSTANCE;
+}
+	YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 474 "lexer.lxx"
+{
+  accept();
+  return LINE;
+}
+	YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 478 "lexer.lxx"
+{
+  accept();
+  return LOOP;
+}
+	YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 482 "lexer.lxx"
+{
+  accept();
+  return MATERIAL;
+}
+	YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 486 "lexer.lxx"
+{
+  accept();
+  return MATRIX3;
+}
+	YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 490 "lexer.lxx"
+{
+  accept();
+  return MATRIX4;
+}
+	YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 494 "lexer.lxx"
+{
+  accept();
+  return MODEL;
+}
+	YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 498 "lexer.lxx"
+{
+  accept();
+  return MREF;
+}
+	YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 502 "lexer.lxx"
+{
+  accept();
+  return NORMAL;
+}
+	YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 506 "lexer.lxx"
+{
+  accept();
+  return NURBSCURVE;
+}
+	YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 510 "lexer.lxx"
+{
+  accept();
+  return NURBSSURFACE;
+}
+	YY_BREAK
+case 47:
+YY_RULE_SETUP
+#line 514 "lexer.lxx"
+{
+  accept();
+  return OBJECTTYPE;
+}
+	YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 518 "lexer.lxx"
+{
+  accept();
+  return ORDER;
+}
+	YY_BREAK
+case 49:
+YY_RULE_SETUP
+#line 522 "lexer.lxx"
+{
+  accept();
+  return OUTTANGENT;
+}
+	YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 526 "lexer.lxx"
+{
+  accept();
+  return PATCH;
+}
+	YY_BREAK
+case 51:
+YY_RULE_SETUP
+#line 530 "lexer.lxx"
+{
+  accept();
+  return POINTLIGHT;
+}
+	YY_BREAK
+case 52:
+YY_RULE_SETUP
+#line 534 "lexer.lxx"
+{
+  accept();
+  return POLYGON;
+}
+	YY_BREAK
+case 53:
+YY_RULE_SETUP
+#line 538 "lexer.lxx"
+{
+  accept();
+  return REF;
+}
+	YY_BREAK
+case 54:
+YY_RULE_SETUP
+#line 542 "lexer.lxx"
+{
+  accept();
+  return RGBA;
+}
+	YY_BREAK
+case 55:
+YY_RULE_SETUP
+#line 546 "lexer.lxx"
+{
+  accept();
+  return ROTATE;
+}
+	YY_BREAK
+case 56:
+YY_RULE_SETUP
+#line 550 "lexer.lxx"
+{
+  accept();
+  return ROTX;
+}
+	YY_BREAK
+case 57:
+YY_RULE_SETUP
+#line 554 "lexer.lxx"
+{
+  accept();
+  return ROTY;
+}
+	YY_BREAK
+case 58:
+YY_RULE_SETUP
+#line 558 "lexer.lxx"
+{
+  accept();
+  return ROTZ;
+}
+	YY_BREAK
+case 59:
+YY_RULE_SETUP
+#line 562 "lexer.lxx"
+{
+  accept();
+  return SANIM;
+}
+	YY_BREAK
+case 60:
+YY_RULE_SETUP
+#line 566 "lexer.lxx"
+{
+  accept();
+  return SCALAR;
+}
+	YY_BREAK
+case 61:
+YY_RULE_SETUP
+#line 570 "lexer.lxx"
+{
+  accept();
+  return SCALE;
+}
+	YY_BREAK
+case 62:
+YY_RULE_SETUP
+#line 574 "lexer.lxx"
+{
+  accept();
+  return SEQUENCE;
+}
+	YY_BREAK
+case 63:
+YY_RULE_SETUP
+#line 578 "lexer.lxx"
+{
+  accept();
+  return SHADING;
+}
+	YY_BREAK
+case 64:
+YY_RULE_SETUP
+#line 582 "lexer.lxx"
+{
+  accept();
+  return SWITCH;
+}
+	YY_BREAK
+case 65:
+YY_RULE_SETUP
+#line 586 "lexer.lxx"
+{
+  accept();
+  return SWITCHCONDITION;
+}
+	YY_BREAK
+case 66:
+YY_RULE_SETUP
+#line 590 "lexer.lxx"
+{
+  accept();
+  return TABLE;
+}
+	YY_BREAK
+case 67:
+YY_RULE_SETUP
+#line 594 "lexer.lxx"
+{
+  accept();
+  return TABLE_V;
+}
+	YY_BREAK
+case 68:
+YY_RULE_SETUP
+#line 598 "lexer.lxx"
+{
+  accept();
+  return TAG;
+}
+	YY_BREAK
+case 69:
+YY_RULE_SETUP
+#line 602 "lexer.lxx"
+{
+  accept();
+  return TANGENT;
+}
+	YY_BREAK
+case 70:
+YY_RULE_SETUP
+#line 606 "lexer.lxx"
+{
+  accept();
+  return TEXLIST;
+}
+	YY_BREAK
+case 71:
+YY_RULE_SETUP
+#line 610 "lexer.lxx"
+{
+  accept();
+  return TEXTURE;
+}
+	YY_BREAK
+case 72:
+YY_RULE_SETUP
+#line 614 "lexer.lxx"
+{
+  accept();
+  return TLENGTHS;
+}
+	YY_BREAK
+case 73:
+YY_RULE_SETUP
+#line 618 "lexer.lxx"
+{
+  accept();
+  return TRANSFORM;
+}
+	YY_BREAK
+case 74:
+YY_RULE_SETUP
+#line 622 "lexer.lxx"
+{
+  accept();
+  return TRANSLATE;
+}
+	YY_BREAK
+case 75:
+YY_RULE_SETUP
+#line 626 "lexer.lxx"
+{
+  accept();
+  return TREF;
+}
+	YY_BREAK
+case 76:
+YY_RULE_SETUP
+#line 630 "lexer.lxx"
+{
+  accept();
+  return TRIANGLEFAN;
+}
+	YY_BREAK
+case 77:
+YY_RULE_SETUP
+#line 634 "lexer.lxx"
+{
+  accept();
+  return TRIANGLESTRIP;
+}
+	YY_BREAK
+case 78:
+YY_RULE_SETUP
+#line 638 "lexer.lxx"
+{
+  accept();
+  return TRIM;
+}
+	YY_BREAK
+case 79:
+YY_RULE_SETUP
+#line 642 "lexer.lxx"
+{
+  accept();
+  return TXT;
+}
+	YY_BREAK
+case 80:
+YY_RULE_SETUP
+#line 646 "lexer.lxx"
+{
+  accept();
+  return UKNOTS;
+}
+	YY_BREAK
+case 81:
+YY_RULE_SETUP
+#line 650 "lexer.lxx"
+{
+  accept();
+  return UKNOTS;
+}
+	YY_BREAK
+case 82:
+YY_RULE_SETUP
+#line 654 "lexer.lxx"
+{
+  accept();
+  return UV;
+}
+	YY_BREAK
+case 83:
+YY_RULE_SETUP
+#line 658 "lexer.lxx"
+{
+  accept();
+  return VKNOTS;
+}
+	YY_BREAK
+case 84:
+YY_RULE_SETUP
+#line 662 "lexer.lxx"
+{
+  accept();
+  return VKNOTS;
+}
+	YY_BREAK
+case 85:
+YY_RULE_SETUP
+#line 666 "lexer.lxx"
+{
+  accept();
+  return VERTEX;
+}
+	YY_BREAK
+case 86:
+YY_RULE_SETUP
+#line 670 "lexer.lxx"
+{
+  accept();
+  return VERTEXANIM;
+}
+	YY_BREAK
+case 87:
+YY_RULE_SETUP
+#line 674 "lexer.lxx"
+{
+  accept();
+  return VERTEXPOOL;
+}
+	YY_BREAK
+case 88:
+YY_RULE_SETUP
+#line 678 "lexer.lxx"
+{
+  accept();
+  return VERTEXREF;
+}
+	YY_BREAK
+case 89:
+YY_RULE_SETUP
+#line 682 "lexer.lxx"
+{
+  accept();
+  return XFMANIM;
+}
+	YY_BREAK
+case 90:
+YY_RULE_SETUP
+#line 686 "lexer.lxx"
+{
+  accept();
+  return XFMSANIM;
+}
+	YY_BREAK
+case 91:
+YY_RULE_SETUP
+#line 693 "lexer.lxx"
+{ 
+  // An integer or floating-point number.
+  accept(); 
+  eggyylval._number = patof(eggyytext); 
+  eggyylval._string = eggyytext;
+  return EGG_NUMBER; 
+}
+	YY_BREAK
+case 92:
+YY_RULE_SETUP
+#line 701 "lexer.lxx"
+{
+  // A hexadecimal integer number.
+  accept(); 
+  eggyylval._ulong = strtoul(eggyytext+2, NULL, 16);
+  eggyylval._string = eggyytext;
+  return EGG_ULONG; 
+}
+	YY_BREAK
+case 93:
+YY_RULE_SETUP
+#line 709 "lexer.lxx"
+{
+  // A binary integer number.
+  accept(); 
+  eggyylval._ulong = strtoul(eggyytext+2, NULL, 2);
+  eggyylval._string = eggyytext;
+  return EGG_ULONG; 
+}
+	YY_BREAK
+case 94:
+YY_RULE_SETUP
+#line 717 "lexer.lxx"
+{
+  // not-a-number.  These sometimes show up in egg files accidentally.
+  accept(); 
+  memset(&eggyylval._number, 0, sizeof(eggyylval._number));
+  *(unsigned long *)&eggyylval._number = strtoul(eggyytext+3, NULL, 0);
+  eggyylval._string = eggyytext;
+  return EGG_NUMBER;
+}
+	YY_BREAK
+case 95:
+YY_RULE_SETUP
+#line 726 "lexer.lxx"
+{ 
+  // infinity.  As above.
+  accept(); 
+  eggyylval._number = HUGE_VAL;
+  eggyylval._string = eggyytext;
+  return EGG_NUMBER; 
+}
+	YY_BREAK
+case 96:
+YY_RULE_SETUP
+#line 734 "lexer.lxx"
+{
+  // minus infinity.  As above.
+  accept(); 
+  eggyylval._number = -HUGE_VAL;
+  eggyylval._string = eggyytext;
+  return EGG_NUMBER; 
+}
+	YY_BREAK
+case 97:
+YY_RULE_SETUP
+#line 742 "lexer.lxx"
+{ 
+  // infinity, on Win32.  As above.
+  accept(); 
+  eggyylval._number = HUGE_VAL;
+  eggyylval._string = eggyytext;
+  return EGG_NUMBER; 
+}
+	YY_BREAK
+case 98:
+YY_RULE_SETUP
+#line 750 "lexer.lxx"
+{
+  // minus infinity, on Win32.  As above.
+  accept(); 
+  eggyylval._number = -HUGE_VAL;
+  eggyylval._string = eggyytext;
+  return EGG_NUMBER; 
+}
+	YY_BREAK
+case 99:
+YY_RULE_SETUP
+#line 759 "lexer.lxx"
+{
+  // Quoted string.
+  accept();
+  eggyylval._string = scan_quoted_string();
+  return EGG_STRING;
+}
+	YY_BREAK
+case 100:
+YY_RULE_SETUP
+#line 766 "lexer.lxx"
+{ 
+  // Unquoted string.
+  accept();
+  eggyylval._string = eggyytext;
+  return EGG_STRING;
+}
+	YY_BREAK
+case 101:
+YY_RULE_SETUP
+#line 772 "lexer.lxx"
+ECHO;
+	YY_BREAK
+#line 2363 "lex.yy.c"
+case YY_STATE_EOF(INITIAL):
+	yyterminate();
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = (yy_hold_char);
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed eggyyin at a new source and called
+			 * eggyylex().  If so, then we have to assure
+			 * consistency between YY_CURRENT_BUFFER and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			YY_CURRENT_BUFFER_LVALUE->yy_input_file = eggyyin;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state(  );
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++(yy_c_buf_p);
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = (yy_c_buf_p);
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer(  ) )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				(yy_did_buffer_switch_on_eof) = 0;
+
+				if ( eggyywrap( ) )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * eggyytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! (yy_did_buffer_switch_on_eof) )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				(yy_c_buf_p) =
+					(yytext_ptr) + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state(  );
+
+				yy_cp = (yy_c_buf_p);
+				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				(yy_c_buf_p) =
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+				yy_current_state = yy_get_previous_state(  );
+
+				yy_cp = (yy_c_buf_p);
+				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+} /* end of eggyylex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (void)
+{
+    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+	register char *source = (yytext_ptr);
+	register int number_to_move, i;
+	int ret_val;
+
+	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+	else
+		{
+			int num_to_read =
+			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+		while ( num_to_read <= 0 )
+			{ /* Not enough room in the buffer - grow it. */
+
+			/* just a shorter name for the current buffer */
+			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+			int yy_c_buf_p_offset =
+				(int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+			if ( b->yy_is_our_buffer )
+				{
+				int new_size = b->yy_buf_size * 2;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					eggyyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = 0;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+						number_to_move - 1;
+
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			(yy_n_chars), (size_t) num_to_read );
+
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+		}
+
+	if ( (yy_n_chars) == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			eggyyrestart(eggyyin  );
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+		/* Extend the array by 50%, plus the number we really need. */
+		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) eggyyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
+		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+	}
+
+	(yy_n_chars) += number_to_move;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+	return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+    static yy_state_type yy_get_previous_state (void)
+{
+	register yy_state_type yy_current_state;
+	register char *yy_cp;
+    
+	yy_current_state = (yy_start);
+
+	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+		{
+		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		if ( yy_accept[yy_current_state] )
+			{
+			(yy_last_accepting_state) = yy_current_state;
+			(yy_last_accepting_cpos) = yy_cp;
+			}
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 585 )
+				yy_c = yy_meta[(unsigned int) yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		}
+
+	return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *	next_state = yy_try_NUL_trans( current_state );
+ */
+    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
+{
+	register int yy_is_jam;
+    	register char *yy_cp = (yy_c_buf_p);
+
+	register YY_CHAR yy_c = 1;
+	if ( yy_accept[yy_current_state] )
+		{
+		(yy_last_accepting_state) = yy_current_state;
+		(yy_last_accepting_cpos) = yy_cp;
+		}
+	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+		{
+		yy_current_state = (int) yy_def[yy_current_state];
+		if ( yy_current_state >= 585 )
+			yy_c = yy_meta[(unsigned int) yy_c];
+		}
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+	yy_is_jam = (yy_current_state == 584);
+
+	return yy_is_jam ? 0 : yy_current_state;
+}
+
+    static void yyunput (int c, register char * yy_bp )
+{
+	register char *yy_cp;
+    
+    yy_cp = (yy_c_buf_p);
+
+	/* undo effects of setting up eggyytext */
+	*yy_cp = (yy_hold_char);
+
+	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+		{ /* need to shift things up to make room */
+		/* +2 for EOB chars. */
+		register int number_to_move = (yy_n_chars) + 2;
+		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+		register char *source =
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+
+		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+			*--dest = *--source;
+
+		yy_cp += (int) (dest - source);
+		yy_bp += (int) (dest - source);
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+
+		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+			YY_FATAL_ERROR( "flex scanner push-back overflow" );
+		}
+
+	*--yy_cp = (char) c;
+
+	(yytext_ptr) = yy_bp;
+	(yy_hold_char) = *yy_cp;
+	(yy_c_buf_p) = yy_cp;
+}
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+    static int yyinput (void)
+#else
+    static int input  (void)
+#endif
+
+{
+	int c;
+    
+	*(yy_c_buf_p) = (yy_hold_char);
+
+	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+		{
+		/* yy_c_buf_p now points to the character we want to return.
+		 * If this occurs *before* the EOB characters, then it's a
+		 * valid NUL; if not, then we've hit the end of the buffer.
+		 */
+		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+			/* This was really a NUL. */
+			*(yy_c_buf_p) = '\0';
+
+		else
+			{ /* need more input */
+			int offset = (yy_c_buf_p) - (yytext_ptr);
+			++(yy_c_buf_p);
+
+			switch ( yy_get_next_buffer(  ) )
+				{
+				case EOB_ACT_LAST_MATCH:
+					/* This happens because yy_g_n_b()
+					 * sees that we've accumulated a
+					 * token and flags that we need to
+					 * try matching the token before
+					 * proceeding.  But for input(),
+					 * there's no matching to consider.
+					 * So convert the EOB_ACT_LAST_MATCH
+					 * to EOB_ACT_END_OF_FILE.
+					 */
+
+					/* Reset buffer status. */
+					eggyyrestart(eggyyin );
+
+					/*FALLTHROUGH*/
+
+				case EOB_ACT_END_OF_FILE:
+					{
+					if ( eggyywrap( ) )
+						return EOF;
+
+					if ( ! (yy_did_buffer_switch_on_eof) )
+						YY_NEW_FILE;
+#ifdef __cplusplus
+					return yyinput();
+#else
+					return input();
+#endif
+					}
+
+				case EOB_ACT_CONTINUE_SCAN:
+					(yy_c_buf_p) = (yytext_ptr) + offset;
+					break;
+				}
+			}
+		}
+
+	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
+	*(yy_c_buf_p) = '\0';	/* preserve eggyytext */
+	(yy_hold_char) = *++(yy_c_buf_p);
+
+	return c;
+}
+#endif	/* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * 
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+    void eggyyrestart  (FILE * input_file )
+{
+    
+	if ( ! YY_CURRENT_BUFFER ){
+        eggyyensure_buffer_stack ();
+		YY_CURRENT_BUFFER_LVALUE =
+            eggyy_create_buffer(eggyyin,YY_BUF_SIZE );
+	}
+
+	eggyy_init_buffer(YY_CURRENT_BUFFER,input_file );
+	eggyy_load_buffer_state( );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * 
+ */
+    void eggyy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
+{
+    
+	/* TODO. We should be able to replace this entire function body
+	 * with
+	 *		eggyypop_buffer_state();
+	 *		eggyypush_buffer_state(new_buffer);
+     */
+	eggyyensure_buffer_stack ();
+	if ( YY_CURRENT_BUFFER == new_buffer )
+		return;
+
+	if ( YY_CURRENT_BUFFER )
+		{
+		/* Flush out information for old buffer. */
+		*(yy_c_buf_p) = (yy_hold_char);
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+		}
+
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+	eggyy_load_buffer_state( );
+
+	/* We don't actually know whether we did this switch during
+	 * EOF (eggyywrap()) processing, but the only time this flag
+	 * is looked at is after eggyywrap() is called, so it's safe
+	 * to go ahead and always set it.
+	 */
+	(yy_did_buffer_switch_on_eof) = 1;
+}
+
+static void eggyy_load_buffer_state  (void)
+{
+    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+	eggyyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+	(yy_hold_char) = *(yy_c_buf_p);
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * 
+ * @return the allocated buffer state.
+ */
+    YY_BUFFER_STATE eggyy_create_buffer  (FILE * file, int  size )
+{
+	YY_BUFFER_STATE b;
+    
+	b = (YY_BUFFER_STATE) eggyyalloc(sizeof( struct yy_buffer_state )  );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in eggyy_create_buffer()" );
+
+	b->yy_buf_size = size;
+
+	/* yy_ch_buf has to be 2 characters longer than the size given because
+	 * we need to put in 2 end-of-buffer characters.
+	 */
+	b->yy_ch_buf = (char *) eggyyalloc(b->yy_buf_size + 2  );
+	if ( ! b->yy_ch_buf )
+		YY_FATAL_ERROR( "out of dynamic memory in eggyy_create_buffer()" );
+
+	b->yy_is_our_buffer = 1;
+
+	eggyy_init_buffer(b,file );
+
+	return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with eggyy_create_buffer()
+ * 
+ */
+    void eggyy_delete_buffer (YY_BUFFER_STATE  b )
+{
+    
+	if ( ! b )
+		return;
+
+	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+	if ( b->yy_is_our_buffer )
+		eggyyfree((void *) b->yy_ch_buf  );
+
+	eggyyfree((void *) b  );
+}
+
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+    
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a eggyyrestart() or at EOF.
+ */
+    static void eggyy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
+
+{
+	int oerrno = errno;
+    
+	eggyy_flush_buffer(b );
+
+	b->yy_input_file = file;
+	b->yy_fill_buffer = 1;
+
+    /* If b is the current buffer, then eggyy_init_buffer was _probably_
+     * called from eggyyrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
+     */
+    if (b != YY_CURRENT_BUFFER){
+        b->yy_bs_lineno = 1;
+        b->yy_bs_column = 0;
+    }
+
+        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+    
+	errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * 
+ */
+    void eggyy_flush_buffer (YY_BUFFER_STATE  b )
+{
+    	if ( ! b )
+		return;
+
+	b->yy_n_chars = 0;
+
+	/* We always need two end-of-buffer characters.  The first causes
+	 * a transition to the end-of-buffer state.  The second causes
+	 * a jam in that state.
+	 */
+	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+	b->yy_buf_pos = &b->yy_ch_buf[0];
+
+	b->yy_at_bol = 1;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	if ( b == YY_CURRENT_BUFFER )
+		eggyy_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ *  the current state. This function will allocate the stack
+ *  if necessary.
+ *  @param new_buffer The new state.
+ *  
+ */
+void eggyypush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+    	if (new_buffer == NULL)
+		return;
+
+	eggyyensure_buffer_stack();
+
+	/* This block is copied from eggyy_switch_to_buffer. */
+	if ( YY_CURRENT_BUFFER )
+		{
+		/* Flush out information for old buffer. */
+		*(yy_c_buf_p) = (yy_hold_char);
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+		}
+
+	/* Only push if top exists. Otherwise, replace top. */
+	if (YY_CURRENT_BUFFER)
+		(yy_buffer_stack_top)++;
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+	/* copied from eggyy_switch_to_buffer. */
+	eggyy_load_buffer_state( );
+	(yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ *  The next element becomes the new top.
+ *  
+ */
+void eggyypop_buffer_state (void)
+{
+    	if (!YY_CURRENT_BUFFER)
+		return;
+
+	eggyy_delete_buffer(YY_CURRENT_BUFFER );
+	YY_CURRENT_BUFFER_LVALUE = NULL;
+	if ((yy_buffer_stack_top) > 0)
+		--(yy_buffer_stack_top);
+
+	if (YY_CURRENT_BUFFER) {
+		eggyy_load_buffer_state( );
+		(yy_did_buffer_switch_on_eof) = 1;
+	}
+}
+
+/* Allocates the stack if it does not exist.
+ *  Guarantees space for at least one push.
+ */
+static void eggyyensure_buffer_stack (void)
+{
+	int num_to_alloc;
+    
+	if (!(yy_buffer_stack)) {
+
+		/* First allocation is just for 2 elements, since we don't know if this
+		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
+		 * immediate realloc on the next call.
+         */
+		num_to_alloc = 1;
+		(yy_buffer_stack) = (struct yy_buffer_state**)eggyyalloc
+								(num_to_alloc * sizeof(struct yy_buffer_state*)
+								);
+		if ( ! (yy_buffer_stack) )
+			YY_FATAL_ERROR( "out of dynamic memory in eggyyensure_buffer_stack()" );
+								  
+		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+				
+		(yy_buffer_stack_max) = num_to_alloc;
+		(yy_buffer_stack_top) = 0;
+		return;
+	}
+
+	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+		/* Increase the buffer to prepare for a possible push. */
+		int grow_size = 8 /* arbitrary grow size */;
+
+		num_to_alloc = (yy_buffer_stack_max) + grow_size;
+		(yy_buffer_stack) = (struct yy_buffer_state**)eggyyrealloc
+								((yy_buffer_stack),
+								num_to_alloc * sizeof(struct yy_buffer_state*)
+								);
+		if ( ! (yy_buffer_stack) )
+			YY_FATAL_ERROR( "out of dynamic memory in eggyyensure_buffer_stack()" );
+
+		/* zero only the new slots.*/
+		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+		(yy_buffer_stack_max) = num_to_alloc;
+	}
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * 
+ * @return the newly allocated buffer state object. 
+ */
+YY_BUFFER_STATE eggyy_scan_buffer  (char * base, yy_size_t  size )
+{
+	YY_BUFFER_STATE b;
+    
+	if ( size < 2 ||
+	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
+	     base[size-1] != YY_END_OF_BUFFER_CHAR )
+		/* They forgot to leave room for the EOB's. */
+		return 0;
+
+	b = (YY_BUFFER_STATE) eggyyalloc(sizeof( struct yy_buffer_state )  );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in eggyy_scan_buffer()" );
+
+	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
+	b->yy_buf_pos = b->yy_ch_buf = base;
+	b->yy_is_our_buffer = 0;
+	b->yy_input_file = 0;
+	b->yy_n_chars = b->yy_buf_size;
+	b->yy_is_interactive = 0;
+	b->yy_at_bol = 1;
+	b->yy_fill_buffer = 0;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	eggyy_switch_to_buffer(b  );
+
+	return b;
+}
+
+/** Setup the input buffer state to scan a string. The next call to eggyylex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * 
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ *       eggyy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE eggyy_scan_string (yyconst char * yystr )
+{
+    
+	return eggyy_scan_bytes(yystr,strlen(yystr) );
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to eggyylex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * 
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE eggyy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
+{
+	YY_BUFFER_STATE b;
+	char *buf;
+	yy_size_t n;
+	int i;
+    
+	/* Get memory for full buffer, including space for trailing EOB's. */
+	n = _yybytes_len + 2;
+	buf = (char *) eggyyalloc(n  );
+	if ( ! buf )
+		YY_FATAL_ERROR( "out of dynamic memory in eggyy_scan_bytes()" );
+
+	for ( i = 0; i < _yybytes_len; ++i )
+		buf[i] = yybytes[i];
+
+	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = eggyy_scan_buffer(buf,n );
+	if ( ! b )
+		YY_FATAL_ERROR( "bad buffer in eggyy_scan_bytes()" );
+
+	/* It's okay to grow etc. this buffer, and we should throw it
+	 * away when we're done.
+	 */
+	b->yy_is_our_buffer = 1;
+
+	return b;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yy_fatal_error (yyconst char* msg )
+{
+    	(void) fprintf( stderr, "%s\n", msg );
+	exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up eggyytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		eggyytext[eggyyleng] = (yy_hold_char); \
+		(yy_c_buf_p) = eggyytext + yyless_macro_arg; \
+		(yy_hold_char) = *(yy_c_buf_p); \
+		*(yy_c_buf_p) = '\0'; \
+		eggyyleng = yyless_macro_arg; \
+		} \
+	while ( 0 )
+
+/* Accessor  methods (get/set functions) to struct members. */
+
+/** Get the current line number.
+ * 
+ */
+int eggyyget_lineno  (void)
+{
+        
+    return eggyylineno;
+}
+
+/** Get the input stream.
+ * 
+ */
+FILE *eggyyget_in  (void)
+{
+        return eggyyin;
+}
+
+/** Get the output stream.
+ * 
+ */
+FILE *eggyyget_out  (void)
+{
+        return eggyyout;
+}
+
+/** Get the length of the current token.
+ * 
+ */
+int eggyyget_leng  (void)
+{
+        return eggyyleng;
+}
+
+/** Get the current token.
+ * 
+ */
+
+char *eggyyget_text  (void)
+{
+        return eggyytext;
+}
+
+/** Set the current line number.
+ * @param line_number
+ * 
+ */
+void eggyyset_lineno (int  line_number )
+{
+    
+    eggyylineno = line_number;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * 
+ * @see eggyy_switch_to_buffer
+ */
+void eggyyset_in (FILE *  in_str )
+{
+        eggyyin = in_str ;
+}
+
+void eggyyset_out (FILE *  out_str )
+{
+        eggyyout = out_str ;
+}
+
+int eggyyget_debug  (void)
+{
+        return eggyy_flex_debug;
+}
+
+void eggyyset_debug (int  bdebug )
+{
+        eggyy_flex_debug = bdebug ;
+}
+
+static int yy_init_globals (void)
+{
+        /* Initialization is the same as for the non-reentrant scanner.
+     * This function is called from eggyylex_destroy(), so don't allocate here.
+     */
+
+    (yy_buffer_stack) = 0;
+    (yy_buffer_stack_top) = 0;
+    (yy_buffer_stack_max) = 0;
+    (yy_c_buf_p) = (char *) 0;
+    (yy_init) = 0;
+    (yy_start) = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+    eggyyin = stdin;
+    eggyyout = stdout;
+#else
+    eggyyin = (FILE *) 0;
+    eggyyout = (FILE *) 0;
+#endif
+
+    /* For future reference: Set errno on error, since we are called by
+     * eggyylex_init()
+     */
+    return 0;
+}
+
+/* eggyylex_destroy is for both reentrant and non-reentrant scanners. */
+int eggyylex_destroy  (void)
+{
+    
+    /* Pop the buffer stack, destroying each element. */
+	while(YY_CURRENT_BUFFER){
+		eggyy_delete_buffer(YY_CURRENT_BUFFER  );
+		YY_CURRENT_BUFFER_LVALUE = NULL;
+		eggyypop_buffer_state();
+	}
+
+	/* Destroy the stack itself. */
+	eggyyfree((yy_buffer_stack) );
+	(yy_buffer_stack) = NULL;
+
+    /* Reset the globals. This is important in a non-reentrant scanner so the next time
+     * eggyylex() is called, initialization will occur. */
+    yy_init_globals( );
+
+    return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
+	register int i;
+	for ( i = 0; i < n; ++i )
+		s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s )
+{
+	register int n;
+	for ( n = 0; s[n]; ++n )
+		;
+
+	return n;
+}
+#endif
+
+void *eggyyalloc (yy_size_t  size )
+{
+	return (void *) malloc( size );
+}
+
+void *eggyyrealloc  (void * ptr, yy_size_t  size )
+{
+	/* The cast to (char *) in the following accommodates both
+	 * implementations that use char* generic pointers, and those
+	 * that use void* generic pointers.  It works with the latter
+	 * because both ANSI C and C++ allow castless assignment from
+	 * any pointer type to void*, and deal with argument conversions
+	 * as though doing an assignment.
+	 */
+	return (void *) realloc( (char *) ptr, size );
+}
+
+void eggyyfree (void * ptr )
+{
+	free( (char *) ptr );	/* see eggyyrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#line 772 "lexer.lxx"

+ 4 - 0
panda/src/egg/lexer.lxx

@@ -523,6 +523,10 @@ NUMERIC         ([+-]?(([0-9]+[.]?)|([0-9]*[.][0-9]+))([eE][+-]?[0-9]+)?)
   accept();
   return OUTTANGENT;
 }
+"<PATCH>" {
+  accept();
+  return PATCH;
+}
 "<POINTLIGHT>" {
   accept();
   return POINTLIGHT;

+ 1 - 0
panda/src/egg/p3egg_composite2.cxx

@@ -1,5 +1,6 @@
 #include "eggObject.cxx"
 #include "eggParameters.cxx"
+#include "eggPatch.cxx"
 #include "eggPoint.cxx"
 #include "eggPolygon.cxx"
 #include "eggPolysetMaker.cxx"

Разлика између датотеке није приказан због своје велике величине
+ 449 - 437
panda/src/egg/parser.cxx.prebuilt


+ 103 - 102
panda/src/egg/parser.h.prebuilt

@@ -1,24 +1,22 @@
-/* A Bison parser, made by GNU Bison 2.3.  */
+/* A Bison parser, made by GNU Bison 2.4.2.  */
 
 /* Skeleton interface for Bison's Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
-   Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
+   
+      Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 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.
-
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+   
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-
+   
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* As a special exception, you may create a larger work that contains
    part or all of the Bison parser skeleton and distribute that work
@@ -29,10 +27,11 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-
+   
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
+
 /* Tokens.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
@@ -84,49 +83,50 @@
      OBJECTTYPE = 300,
      ORDER = 301,
      OUTTANGENT = 302,
-     POINTLIGHT = 303,
-     POLYGON = 304,
-     REF = 305,
-     RGBA = 306,
-     ROTATE = 307,
-     ROTX = 308,
-     ROTY = 309,
-     ROTZ = 310,
-     SANIM = 311,
-     SCALAR = 312,
-     SCALE = 313,
-     SEQUENCE = 314,
-     SHADING = 315,
-     SWITCH = 316,
-     SWITCHCONDITION = 317,
-     TABLE = 318,
-     TABLE_V = 319,
-     TAG = 320,
-     TANGENT = 321,
-     TEXLIST = 322,
-     TEXTURE = 323,
-     TLENGTHS = 324,
-     TRANSFORM = 325,
-     TRANSLATE = 326,
-     TREF = 327,
-     TRIANGLEFAN = 328,
-     TRIANGLESTRIP = 329,
-     TRIM = 330,
-     TXT = 331,
-     UKNOTS = 332,
-     UV = 333,
-     AUX = 334,
-     VKNOTS = 335,
-     VERTEX = 336,
-     VERTEXANIM = 337,
-     VERTEXPOOL = 338,
-     VERTEXREF = 339,
-     XFMANIM = 340,
-     XFMSANIM = 341,
-     START_EGG = 342,
-     START_GROUP_BODY = 343,
-     START_TEXTURE_BODY = 344,
-     START_PRIMITIVE_BODY = 345
+     PATCH = 303,
+     POINTLIGHT = 304,
+     POLYGON = 305,
+     REF = 306,
+     RGBA = 307,
+     ROTATE = 308,
+     ROTX = 309,
+     ROTY = 310,
+     ROTZ = 311,
+     SANIM = 312,
+     SCALAR = 313,
+     SCALE = 314,
+     SEQUENCE = 315,
+     SHADING = 316,
+     SWITCH = 317,
+     SWITCHCONDITION = 318,
+     TABLE = 319,
+     TABLE_V = 320,
+     TAG = 321,
+     TANGENT = 322,
+     TEXLIST = 323,
+     TEXTURE = 324,
+     TLENGTHS = 325,
+     TRANSFORM = 326,
+     TRANSLATE = 327,
+     TREF = 328,
+     TRIANGLEFAN = 329,
+     TRIANGLESTRIP = 330,
+     TRIM = 331,
+     TXT = 332,
+     UKNOTS = 333,
+     UV = 334,
+     AUX = 335,
+     VKNOTS = 336,
+     VERTEX = 337,
+     VERTEXANIM = 338,
+     VERTEXPOOL = 339,
+     VERTEXREF = 340,
+     XFMANIM = 341,
+     XFMSANIM = 342,
+     START_EGG = 343,
+     START_GROUP_BODY = 344,
+     START_TEXTURE_BODY = 345,
+     START_PRIMITIVE_BODY = 346
    };
 #endif
 /* Tokens.  */
@@ -175,59 +175,60 @@
 #define OBJECTTYPE 300
 #define ORDER 301
 #define OUTTANGENT 302
-#define POINTLIGHT 303
-#define POLYGON 304
-#define REF 305
-#define RGBA 306
-#define ROTATE 307
-#define ROTX 308
-#define ROTY 309
-#define ROTZ 310
-#define SANIM 311
-#define SCALAR 312
-#define SCALE 313
-#define SEQUENCE 314
-#define SHADING 315
-#define SWITCH 316
-#define SWITCHCONDITION 317
-#define TABLE 318
-#define TABLE_V 319
-#define TAG 320
-#define TANGENT 321
-#define TEXLIST 322
-#define TEXTURE 323
-#define TLENGTHS 324
-#define TRANSFORM 325
-#define TRANSLATE 326
-#define TREF 327
-#define TRIANGLEFAN 328
-#define TRIANGLESTRIP 329
-#define TRIM 330
-#define TXT 331
-#define UKNOTS 332
-#define UV 333
-#define AUX 334
-#define VKNOTS 335
-#define VERTEX 336
-#define VERTEXANIM 337
-#define VERTEXPOOL 338
-#define VERTEXREF 339
-#define XFMANIM 340
-#define XFMSANIM 341
-#define START_EGG 342
-#define START_GROUP_BODY 343
-#define START_TEXTURE_BODY 344
-#define START_PRIMITIVE_BODY 345
+#define PATCH 303
+#define POINTLIGHT 304
+#define POLYGON 305
+#define REF 306
+#define RGBA 307
+#define ROTATE 308
+#define ROTX 309
+#define ROTY 310
+#define ROTZ 311
+#define SANIM 312
+#define SCALAR 313
+#define SCALE 314
+#define SEQUENCE 315
+#define SHADING 316
+#define SWITCH 317
+#define SWITCHCONDITION 318
+#define TABLE 319
+#define TABLE_V 320
+#define TAG 321
+#define TANGENT 322
+#define TEXLIST 323
+#define TEXTURE 324
+#define TLENGTHS 325
+#define TRANSFORM 326
+#define TRANSLATE 327
+#define TREF 328
+#define TRIANGLEFAN 329
+#define TRIANGLESTRIP 330
+#define TRIM 331
+#define TXT 332
+#define UKNOTS 333
+#define UV 334
+#define AUX 335
+#define VKNOTS 336
+#define VERTEX 337
+#define VERTEXANIM 338
+#define VERTEXPOOL 339
+#define VERTEXREF 340
+#define XFMANIM 341
+#define XFMSANIM 342
+#define START_EGG 343
+#define START_GROUP_BODY 344
+#define START_TEXTURE_BODY 345
+#define START_PRIMITIVE_BODY 346
 
 
 
 
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef int YYSTYPE;
+
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
 #endif
 
 extern YYSTYPE eggyylval;
 
+

+ 23 - 1
panda/src/egg/parser.yxx

@@ -19,6 +19,7 @@
 #include "eggCompositePrimitive.h"
 #include "eggTriangleFan.h"
 #include "eggTriangleStrip.h"
+#include "eggPatch.h"
 #include "eggPoint.h"
 #include "eggLine.h"
 #include "eggNurbsSurface.h"
@@ -169,7 +170,7 @@ egg_cleanup_parser() {
 %token JOINT KNOTS INCLUDE
 %token INSTANCE LINE LOOP MATERIAL MATRIX3 MATRIX4 MODEL MREF NORMAL
 %token NURBSCURVE NURBSSURFACE OBJECTTYPE ORDER
-%token OUTTANGENT POINTLIGHT POLYGON REF RGBA ROTATE ROTX ROTY ROTZ
+%token OUTTANGENT PATCH POINTLIGHT POLYGON REF RGBA ROTATE ROTX ROTY ROTZ
 %token SANIM SCALAR SCALE SEQUENCE SHADING SWITCH SWITCHCONDITION
 %token TABLE TABLE_V TAG TANGENT TEXLIST TEXTURE TLENGTHS TRANSFORM TRANSLATE
 %token TREF TRIANGLEFAN TRIANGLESTRIP 
@@ -199,6 +200,7 @@ egg_cleanup_parser() {
 %type <_egg> polygon
 %type <_egg> trianglefan
 %type <_egg> trianglestrip
+%type <_egg> patch
 %type <_egg> point_light
 %type <_egg> nurbs_surface
 %type <_egg> nurbs_curve
@@ -272,6 +274,7 @@ node:
         | polygon
         | trianglefan
         | trianglestrip
+        | patch
         | point_light
         | line
         | nurbs_surface
@@ -1886,6 +1889,25 @@ trianglestrip:
 }
         ;
 
+/*
+ * patch
+ *
+ * enter:
+ * exit: returns a new EggPatch.
+ *
+ */
+patch:
+        PATCH optional_name
+{
+  egg_stack.push_back(new EggPatch($2));
+}
+        '{' primitive_body '}'
+{
+  $$ = egg_stack.back();
+  egg_stack.pop_back();
+}
+        ;
+
 /*
  * point_light
  *

+ 16 - 1
panda/src/egg2pg/eggBinner.cxx

@@ -17,6 +17,7 @@
 #include "eggPrimitive.h"
 #include "eggNurbsSurface.h"
 #include "eggNurbsCurve.h"
+#include "eggPatch.h"
 #include "eggSwitchCondition.h"
 #include "eggGroup.h"
 #include "dcast.h"
@@ -62,6 +63,9 @@ get_bin_number(const EggNode *node) {
   } else if (node->is_of_type(EggNurbsCurve::get_class_type())) {
     return (int)BN_nurbs_curve;
 
+  } else if (node->is_of_type(EggPatch::get_class_type())) {
+    return (int)BN_patches;
+
   } else if (node->is_of_type(EggPrimitive::get_class_type())) {
     return (int)BN_polyset;
 
@@ -84,7 +88,7 @@ get_bin_number(const EggNode *node) {
 ////////////////////////////////////////////////////////////////////
 string EggBinner::
 get_bin_name(int bin_number, const EggNode *child) { 
-  if (bin_number == BN_polyset) {
+  if (bin_number == BN_polyset || bin_number == BN_patches) {
     return DCAST(EggPrimitive, child)->get_sort_name();
   }
 
@@ -100,6 +104,7 @@ bool EggBinner::
 sorts_less(int bin_number, const EggNode *a, const EggNode *b) {
   switch (bin_number) {
   case BN_polyset:
+  case BN_patches:
     {
       const EggPrimitive *pa, *pb;
       DCAST_INTO_R(pa, a, false);
@@ -114,6 +119,16 @@ sorts_less(int bin_number, const EggNode *a, const EggNode *b) {
         return (compare < 0);
       }
 
+      if (bin_number == BN_patches) {
+        // For patches only, we group together patches of similar size.
+        const EggPatch *patch_a, *patch_b;
+        DCAST_INTO_R(patch_a, a, false);
+        DCAST_INTO_R(patch_b, b, false);
+        if (patch_a->size() != patch_b->size()) {
+          return patch_a->size() < patch_b->size();
+        }
+      }
+
       // Also, if the primitive was given a name (that does not begin
       // with a digit), it gets binned with similar-named primitives.
       return pa->get_sort_name() < pb->get_sort_name();

+ 1 - 0
panda/src/egg2pg/eggBinner.h

@@ -41,6 +41,7 @@ public:
     BN_lod,
     BN_nurbs_surface,
     BN_nurbs_curve,
+    BN_patches,
   };
 
   EggBinner(EggLoader &loader);

+ 8 - 1
panda/src/egg2pg/eggLoader.cxx

@@ -40,6 +40,7 @@
 #include "geomLines.h"
 #include "geomLinestrips.h"
 #include "geomPoints.h"
+#include "geomPatches.h"
 #include "sequenceNode.h"
 #include "switchNode.h"
 #include "portalNode.h"
@@ -50,6 +51,7 @@
 #include "modelRoot.h"
 #include "string_utils.h"
 #include "eggPrimitive.h"
+#include "eggPatch.h"
 #include "eggPoint.h"
 #include "eggLine.h"
 #include "eggTextureCollection.h"
@@ -356,7 +358,7 @@ make_polyset(EggBin *egg_bin, PandaNode *parent, const LMatrix4d *transform,
   egg_bin->apply_first_attribute(false);
   egg_bin->post_apply_flat_attribute(false);
 
-  //  egg_bin->write(cerr, 0);
+  //egg_bin->write(cerr, 0);
 
   PT(GeomNode) geom_node;
 
@@ -1742,6 +1744,7 @@ make_node(EggBin *egg_bin, PandaNode *parent) {
   // node (a parent of one or more similar EggPrimitives).
   switch (egg_bin->get_bin_number()) {
   case EggBinner::BN_polyset:
+  case EggBinner::BN_patches:
     make_polyset(egg_bin, parent, NULL, _dynamic_override, _dynamic_override_char_maker);
     return NULL;
 
@@ -2615,6 +2618,10 @@ make_primitive(const EggRenderState *render_state, EggPrimitive *egg_prim,
 
   } else if (egg_prim->is_of_type(EggPoint::get_class_type())) {
     primitive = new GeomPoints(Geom::UH_static);
+
+  } else if (egg_prim->is_of_type(EggPatch::get_class_type())) {
+    int num_vertices = egg_prim->size();
+    primitive = new GeomPatches(num_vertices, Geom::UH_static);
   }
 
   if (primitive == (GeomPrimitive *)NULL) {

+ 1 - 1
panda/src/glstuff/glGraphicsStateGuardian_src.I

@@ -401,7 +401,7 @@ setup_antialias_point() {
 //     Function: GLGraphicsStateGuardian::setup_antialias_polygon
 //       Access: Protected
 //  Description: Sets the appropriate antialiasing modes to render a
-//               series of point primitives, according to
+//               series of polygon primitives, according to
 //               _auto_antialias_mode.
 ////////////////////////////////////////////////////////////////////
 INLINE void CLP(GraphicsStateGuardian)::

+ 82 - 10
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -955,7 +955,9 @@ reset() {
   #ifdef OPENGLES_1
     _supports_glsl = false;
   #else
-    _supports_glsl = is_at_least_gl_version(2, 0);
+    _supports_glsl = is_at_least_gl_version(2, 0) || has_extension("GL_ARB_shading_language_100");
+    _supports_geometry_shaders = is_at_least_gl_version(3, 2) || has_extension("GL_ARB_geometry_shader4");
+    _supports_tessellation_shaders = is_at_least_gl_version(4, 0) || has_extension("GL_ARB_tessellation_shader");
   #endif
 #endif
   _shader_caps._supports_glsl = _supports_glsl;
@@ -1034,15 +1036,10 @@ reset() {
        get_extension_func(GLPREFIX_QUOTED, "ValidateProgram");
     _glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)
        get_extension_func(GLPREFIX_QUOTED, "VertexAttribPointer");
-  }
-#endif
-
-#ifndef OPENGLES
-  if (has_extension("GL_EXT_geometry_shader4")) {
-    _glProgramParameteri = (PFNGLPROGRAMPARAMETERIEXTPROC)
-      get_extension_func(GLPREFIX_QUOTED, "ProgramParameteriEXT");
-  } else {
-    _glProgramParameteri = NULL;
+    _glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)
+      get_extension_func(GLPREFIX_QUOTED, "ProgramParameteri");
+    _glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)
+       get_extension_func(GLPREFIX_QUOTED, "PatchParameteri");
   }
 #endif
 
@@ -2314,6 +2311,7 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader,
   if (_auto_antialias_mode) {
     switch (geom_reader->get_primitive_type()) {
     case GeomPrimitive::PT_polygons:
+    case GeomPrimitive::PT_patches:
       setup_antialias_polygon();
       break;
     case GeomPrimitive::PT_points:
@@ -3141,6 +3139,80 @@ draw_trifans(const GeomPrimitivePipelineReader *reader, bool force) {
   return true;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: GLGraphicsStateGuardian::draw_patches
+//       Access: Public, Virtual
+//  Description: Draws a series of "patches", which can only be
+//               processed by a tessellation shader.
+////////////////////////////////////////////////////////////////////
+bool CLP(GraphicsStateGuardian)::
+draw_patches(const GeomPrimitivePipelineReader *reader, bool force) {
+  //PStatTimer timer(_draw_primitive_pcollector, reader->get_current_thread());
+
+#ifndef NDEBUG
+  if (GLCAT.is_spam()) {
+    GLCAT.spam() << "draw_patches: " << *(reader->get_object()) << "\n";
+  }
+#endif  // NDEBUG
+
+  if (!get_supports_tessellation_shaders()) {
+    return false;
+  }
+
+  _glPatchParameteri(GL_PATCH_VERTICES, reader->get_object()->get_num_vertices_per_primitive());
+
+#ifdef SUPPORT_IMMEDIATE_MODE
+  if (_use_sender) {
+    draw_immediate_simple_primitives(reader, GL_PATCHES);
+
+  } else
+#endif  // SUPPORT_IMMEDIATE_MODE
+  {
+    int num_vertices = reader->get_num_vertices();
+    _vertices_patch_pcollector.add_level(num_vertices);
+    _primitive_batches_patch_pcollector.add_level(1);
+
+    if (reader->is_indexed()) {
+      const unsigned char *client_pointer;
+      if (!setup_primitive(client_pointer, reader, force)) {
+        return false;
+      }
+
+#ifndef OPENGLES
+      if (_supports_geometry_instancing && _instance_count > 0) {
+        _glDrawElementsInstanced(GL_PATCHES, num_vertices,
+                                 get_numeric_type(reader->get_index_type()),
+                                 client_pointer, _instance_count);
+      } else
+#endif
+      {
+        _glDrawRangeElements(GL_PATCHES,
+                             reader->get_min_vertex(),
+                             reader->get_max_vertex(),
+                             num_vertices,
+                             get_numeric_type(reader->get_index_type()),
+                             client_pointer);
+      }
+    } else {
+#ifndef OPENGLES
+      if (_supports_geometry_instancing && _instance_count > 0) {
+        _glDrawArraysInstanced(GL_PATCHES,
+                               reader->get_first_vertex(),
+                               num_vertices, _instance_count);
+      } else
+#endif
+      {
+        GLP(DrawArrays)(GL_PATCHES,
+                        reader->get_first_vertex(),
+                        num_vertices);
+      }
+    }
+  }
+
+  report_my_gl_errors();
+  return true;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: GLGraphicsStateGuardian::draw_lines
 //       Access: Public, Virtual

+ 5 - 2
panda/src/glstuff/glGraphicsStateGuardian_src.h

@@ -150,7 +150,7 @@ typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLin
 typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
 typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
 typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
+typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length);
 typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
 typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
 typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3);
@@ -217,6 +217,8 @@ public:
                               bool force);
   virtual bool draw_trifans(const GeomPrimitivePipelineReader *reader,
                             bool force);
+  virtual bool draw_patches(const GeomPrimitivePipelineReader *reader,
+                            bool force);
   virtual bool draw_lines(const GeomPrimitivePipelineReader *reader,
                           bool force);
   virtual bool draw_linestrips(const GeomPrimitivePipelineReader *reader,
@@ -681,7 +683,8 @@ public:
   PFNGLVERTEXATTRIBPOINTERPROC _glVertexAttribPointer;
 #endif  // OPENGLES_1
 #ifndef OPENGLES
-  PFNGLPROGRAMPARAMETERIEXTPROC _glProgramParameteri;
+  PFNGLPROGRAMPARAMETERIPROC _glProgramParameteri;
+  PFNGLPATCHPARAMETERIPROC _glPatchParameteri;
   PFNGLDRAWARRAYSINSTANCEDPROC _glDrawArraysInstanced;
   PFNGLDRAWELEMENTSINSTANCEDPROC _glDrawElementsInstanced;
 #endif  // OPENGLES

+ 111 - 44
panda/src/glstuff/glShaderContext_src.cxx

@@ -59,6 +59,8 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
   _glsl_vshader = 0;
   _glsl_fshader = 0;
   _glsl_gshader = 0;
+  _glsl_tcshader = 0;
+  _glsl_teshader = 0;
 #if defined(HAVE_CG) && !defined(OPENGLES)
   _cg_context = 0;
   if (s->get_language() == Shader::SL_Cg) {
@@ -116,6 +118,7 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
   if (s->get_language() == Shader::SL_GLSL) {
     // We compile and analyze the shader here, instead of in shader.cxx, to avoid gobj getting a dependency on GL stuff.
     if (_glsl_program == 0) {
+      gsg->report_my_gl_errors();
       if (!glsl_compile_shader(gsg)) {
         release_resources(gsg);
         s->_error_flag = true;
@@ -130,19 +133,22 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
       GLenum param_type;
       gsg->_glGetProgramiv(_glsl_program, GL_ACTIVE_UNIFORMS, &param_count);
       gsg->_glGetProgramiv(_glsl_program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &param_maxlength);
-      char* param_name = new char[param_maxlength];
+      char* param_name_cstr = (char *)alloca(param_maxlength);
       for (int i = 0; i < param_count; ++i) {
-        gsg->_glGetActiveUniform(_glsl_program, i, param_maxlength, NULL, &param_size, &param_type, param_name);
-        GLint p = gsg->_glGetUniformLocation(_glsl_program, param_name);
+        gsg->_glGetActiveUniform(_glsl_program, i, param_maxlength, NULL, &param_size, &param_type, param_name_cstr);
+        string param_name(param_name_cstr);
+        GLint p = gsg->_glGetUniformLocation(_glsl_program, param_name_cstr);
         if (p > -1) {
           Shader::ShaderArgId arg_id;
           arg_id._name  = param_name;
           arg_id._seqno = seqno++;
           s->_glsl_parameter_map.push_back(p);
-          PT(InternalName) inputname = InternalName::make(param_name);
-          if (inputname->get_name().substr(0, 4) == "p3d_" || inputname->get_name().substr(0, 3) == "gl_") {
-            if (inputname->get_name().substr(0, 3) == "gl_") noprefix = inputname->get_name().substr(3);
-            else noprefix = inputname->get_name().substr(4);
+          if (param_name.substr(0, 4) == "p3d_" || param_name.substr(0, 3) == "gl_") {
+            if (param_name.substr(0, 3) == "gl_") {
+              noprefix = param_name.substr(3);
+            } else {
+              noprefix = param_name.substr(4);
+            }
             
             if (noprefix == "ModelViewProjectionMatrix") {
               Shader::ShaderMatSpec bind;
@@ -151,8 +157,10 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
               bind._func = Shader::SMF_compose;
               bind._part[0] = Shader::SMO_model_to_view;
               bind._arg[0] = NULL;
+              bind._dep[0] = Shader::SSD_general | Shader::SSD_transform;
               bind._part[1] = Shader::SMO_view_to_apiclip;
               bind._arg[1] = NULL;
+              bind._dep[1] = Shader::SSD_general | Shader::SSD_transform;
               s->_mat_spec.push_back(bind);
               continue;
             }
@@ -163,6 +171,10 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
               bind._func = Shader::SMF_first;
               bind._part[0] = Shader::SMO_model_to_view;
               bind._arg[0] = NULL;
+              bind._dep[0] = Shader::SSD_general | Shader::SSD_transform;
+              bind._part[1] = Shader::SMO_identity;
+              bind._arg[1] = NULL;
+              bind._dep[1] = Shader::SSD_NONE;
               s->_mat_spec.push_back(bind);
               continue;
             }
@@ -173,6 +185,10 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
               bind._func = Shader::SMF_first;
               bind._part[0] = Shader::SMO_view_to_apiclip;
               bind._arg[0] = NULL;
+              bind._dep[0] = Shader::SSD_general | Shader::SSD_transform;
+              bind._part[1] = Shader::SMO_identity;
+              bind._arg[1] = NULL;
+              bind._dep[1] = Shader::SSD_NONE;
               s->_mat_spec.push_back(bind);
               continue;
             }
@@ -185,7 +201,7 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
               s->_tex_spec.push_back(bind);
               continue;
             }
-            GLCAT.error() << "Unrecognized uniform name '" << param_name << "'!\n";
+            GLCAT.error() << "Unrecognized uniform name '" << param_name_cstr << "'!\n";
             continue;
           }
 
@@ -196,7 +212,7 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
               case GL_SAMPLER_1D: {
                 Shader::ShaderTexSpec bind;
                 bind._id = arg_id;
-                bind._name = inputname;
+                bind._name = InternalName::make(param_name);;
                 bind._desired_type = Texture::TT_1d_texture;
                 bind._stage = texunitno++;
                 s->_tex_spec.push_back(bind);
@@ -206,7 +222,7 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
               case GL_SAMPLER_2D: {
                 Shader::ShaderTexSpec bind;
                 bind._id = arg_id;
-                bind._name = inputname;
+                bind._name = InternalName::make(param_name);;
                 bind._desired_type = Texture::TT_2d_texture;
                 bind._stage = texunitno++;
                 s->_tex_spec.push_back(bind);
@@ -214,7 +230,7 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
               case GL_SAMPLER_3D: {
                 Shader::ShaderTexSpec bind;
                 bind._id = arg_id;
-                bind._name = inputname;
+                bind._name = InternalName::make(param_name);;
                 bind._desired_type = Texture::TT_3d_texture;
                 bind._stage = texunitno++;
                 s->_tex_spec.push_back(bind);
@@ -222,7 +238,7 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
               case GL_SAMPLER_CUBE: {
                 Shader::ShaderTexSpec bind;
                 bind._id = arg_id;
-                bind._name = inputname;
+                bind._name = InternalName::make(param_name);;
                 bind._desired_type = Texture::TT_cube_map;
                 bind._stage = texunitno++;
                 s->_tex_spec.push_back(bind);
@@ -245,11 +261,12 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
                 bind._piece = Shader::SMP_whole;
                 bind._func = Shader::SMF_first;
                 bind._part[0] = Shader::SMO_mat_constant_x;
-                bind._arg[0] = inputname;
+                bind._arg[0] = InternalName::make(param_name);;
                 bind._part[1] = Shader::SMO_identity;
                 bind._arg[1] = NULL;
+                bind._part[1] = Shader::SMO_identity;
                 bind._dep[0]  = Shader::SSD_general | Shader::SSD_shaderinputs;
-                bind._dep[1]  = Shader::SSD_general | Shader::SSD_NONE;
+                bind._dep[1]  = Shader::SSD_NONE;
                 s->_mat_spec.push_back(bind);
                 continue; }
               case GL_BOOL:
@@ -274,11 +291,11 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
                 }
                 bind._func = Shader::SMF_first;
                 bind._part[0] = Shader::SMO_vec_constant_x;
-                bind._arg[0] = inputname;
+                bind._arg[0] = InternalName::make(param_name);;
+                bind._dep[0]  = Shader::SSD_general | Shader::SSD_shaderinputs;
                 bind._part[1] = Shader::SMO_identity;
                 bind._arg[1] = NULL;
-                bind._dep[0]  = Shader::SSD_general | Shader::SSD_shaderinputs;
-                bind._dep[1]  = Shader::SSD_general | Shader::SSD_NONE;
+                bind._dep[1]  = Shader::SSD_NONE;
                 s->_mat_spec.push_back(bind);
                 continue; }
               case GL_INT:
@@ -327,10 +344,10 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
                 case GL_BOOL_VEC4:
                 case GL_FLOAT_VEC4: bind._dim[1] = 4; break;
               }
-              bind._arg = inputname;
+              bind._arg = InternalName::make(param_name);;
               bind._dim[0] = param_size;
               bind._dep[0] = Shader::SSD_general | Shader::SSD_shaderinputs;
-              bind._dep[1] = Shader::SSD_general | Shader::SSD_NONE;
+              bind._dep[1] = Shader::SSD_NONE;
               s->_ptr_spec.push_back(bind);
               continue; }
             case GL_INT:
@@ -345,39 +362,40 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
           }
         }
       }
-      delete[] param_name;
       
       // Now we've processed the uniforms, we'll process the attribs.
       gsg->_glGetProgramiv(_glsl_program, GL_ACTIVE_ATTRIBUTES, &param_count);
       gsg->_glGetProgramiv(_glsl_program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &param_maxlength);
-      param_name = new char[param_maxlength];
+      param_name_cstr = (char *)alloca(param_maxlength);
       for (int i = 0; i < param_count; ++i) {
-        gsg->_glGetActiveAttrib(_glsl_program, i, param_maxlength, NULL, &param_size, &param_type, param_name);
-        PT(InternalName) inputname = InternalName::make(param_name);
+        gsg->_glGetActiveAttrib(_glsl_program, i, param_maxlength, NULL, &param_size, &param_type, param_name_cstr);
+        string param_name(param_name_cstr);
 
-        if (inputname->get_name().substr(0, 3) == "gl_") {
+        if (param_name.substr(0, 3) == "gl_") {
           // We shouldn't bind anything to these.
-        } else if (inputname->get_name().substr(0, 4) == "p3d_") {
-          noprefix = inputname->get_name().substr(4);
+
+        } else if (param_name.substr(0, 4) == "p3d_") {
+          noprefix = param_name.substr(4);
+
           Shader::ShaderVarSpec bind;
           bind._append_uv = -1;
 
           if (noprefix == "Vertex") {
             bind._name = InternalName::get_vertex();
             s->_var_spec.push_back(bind);
-            gsg->_glBindAttribLocation(_glsl_program, i, param_name);
+            gsg->_glBindAttribLocation(_glsl_program, i, param_name_cstr);
             continue;
           }
           if (noprefix == "Normal") {
             bind._name = InternalName::get_normal();
             s->_var_spec.push_back(bind);
-            gsg->_glBindAttribLocation(_glsl_program, i, param_name);
+            gsg->_glBindAttribLocation(_glsl_program, i, param_name_cstr);
             continue;
           }
           if (noprefix == "Color") {
             bind._name = InternalName::get_color();
             s->_var_spec.push_back(bind);
-            gsg->_glBindAttribLocation(_glsl_program, i, param_name);
+            gsg->_glBindAttribLocation(_glsl_program, i, param_name_cstr);
             continue;
           }
           if (noprefix.substr(0, 7)  == "Tangent") {
@@ -386,7 +404,7 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
               bind._append_uv = atoi(noprefix.substr(7).c_str());
             }
             s->_var_spec.push_back(bind);
-            gsg->_glBindAttribLocation(_glsl_program, i, param_name);
+            gsg->_glBindAttribLocation(_glsl_program, i, param_name_cstr);
             continue;
           }
           if (noprefix.substr(0, 8)  == "Binormal") {
@@ -395,27 +413,27 @@ CLP(ShaderContext)(Shader *s, GSG *gsg) : ShaderContext(s) {
               bind._append_uv = atoi(noprefix.substr(8).c_str());
             }
             s->_var_spec.push_back(bind);
-            gsg->_glBindAttribLocation(_glsl_program, i, param_name);
+            gsg->_glBindAttribLocation(_glsl_program, i, param_name_cstr);
             continue;
           }
           if (noprefix.substr(0, 13)  == "MultiTexCoord") {
             bind._name = InternalName::get_texcoord();
-            bind._append_uv = atoi(inputname->get_name().substr(13).c_str());
+            bind._append_uv = atoi(noprefix.substr(13).c_str());
             s->_var_spec.push_back(bind);
-            gsg->_glBindAttribLocation(_glsl_program, i, param_name);
+            gsg->_glBindAttribLocation(_glsl_program, i, param_name_cstr);
             continue;
           }
           GLCAT.error() << "Unrecognized vertex attrib '" << param_name << "'!\n";
           continue;
+
         } else {
           Shader::ShaderVarSpec bind;
-          bind._name = inputname;
+          bind._name = InternalName::make(param_name);
           bind._append_uv = -1;
           s->_var_spec.push_back(bind);
-          gsg->_glBindAttribLocation(_glsl_program, i, param_name);
+          gsg->_glBindAttribLocation(_glsl_program, i, param_name_cstr);
         }
       }
-      delete[] param_name;
     }
     
     // Finally, re-link the program, or otherwise the glBindAttribLocation
@@ -485,6 +503,12 @@ release_resources(GSG *gsg) {
     if (_glsl_gshader != 0) {
       gsg->_glDetachShader(_glsl_program, _glsl_gshader);
     }
+    if (_glsl_tcshader != 0) {
+      gsg->_glDetachShader(_glsl_program, _glsl_tcshader);
+    }
+    if (_glsl_teshader != 0) {
+      gsg->_glDetachShader(_glsl_program, _glsl_teshader);
+    }
     gsg->_glDeleteProgram(_glsl_program);
     _glsl_program = 0;
   }
@@ -500,6 +524,14 @@ release_resources(GSG *gsg) {
     gsg->_glDeleteShader(_glsl_gshader);
     _glsl_gshader = 0;
   }
+  if (_glsl_tcshader != 0) {
+    gsg->_glDeleteShader(_glsl_tcshader);
+    _glsl_tcshader = 0;
+  }
+  if (_glsl_teshader != 0) {
+    gsg->_glDeleteShader(_glsl_teshader);
+    _glsl_teshader = 0;
+  }
   
   gsg->report_my_gl_errors();
 }
@@ -1111,7 +1143,7 @@ glsl_report_program_errors(GSG *gsg, unsigned int program) {
 ////////////////////////////////////////////////////////////////////
 unsigned int CLP(ShaderContext)::
 glsl_compile_entry_point(GSG *gsg, Shader::ShaderType type) {
-  unsigned int handle;
+  unsigned int handle = 0;
   switch (type) {
     case Shader::ST_vertex:
       handle = gsg->_glCreateShader(GL_VERTEX_SHADER);
@@ -1120,26 +1152,44 @@ glsl_compile_entry_point(GSG *gsg, Shader::ShaderType type) {
       handle = gsg->_glCreateShader(GL_FRAGMENT_SHADER);
       break;
     case Shader::ST_geometry:
-      handle = gsg->_glCreateShader(GL_GEOMETRY_SHADER_EXT);
+      if (gsg->get_supports_geometry_shaders()) {
+        handle = gsg->_glCreateShader(GL_GEOMETRY_SHADER);
+      }
+      break;
+    case Shader::ST_tess_control:
+      if (gsg->get_supports_tessellation_shaders()) {
+        handle = gsg->_glCreateShader(GL_TESS_CONTROL_SHADER);
+      }
+      break;
+    case Shader::ST_tess_evaluation:
+      if (gsg->get_supports_tessellation_shaders()) {
+        handle = gsg->_glCreateShader(GL_TESS_EVALUATION_SHADER);
+      }
       break;
-    default:
-      return 0;
   }
   if (!handle) {
+    gsg->report_my_gl_errors();
     return 0;
   }
+
   string text_str = _shader->get_text(type);
   const char* text = text_str.c_str();
   gsg->_glShaderSource(handle, 1, &text, NULL);
   gsg->_glCompileShader(handle);
   GLint status;
   gsg->_glGetShaderiv(handle, GL_COMPILE_STATUS, &status);
+  
   if (status != GL_TRUE) {
-    GLCAT.error() << "An error occurred while compiling shader!\n";
+    GLCAT.error() 
+      << "An error occurred while compiling shader " 
+      << _shader->get_filename(type) << "\n";
     glsl_report_shader_errors(gsg, handle);
     gsg->_glDeleteShader(handle);
+    gsg->report_my_gl_errors();
     return 0;
   }
+
+  gsg->report_my_gl_errors();
   return handle;
 }
 
@@ -1169,16 +1219,29 @@ glsl_compile_shader(GSG *gsg) {
     _glsl_gshader = glsl_compile_entry_point(gsg, Shader::ST_geometry);
     if (!_glsl_gshader) return false;
     gsg->_glAttachShader(_glsl_program, _glsl_gshader);
-    
+
 #ifdef OPENGLES
     nassertr(false, false); // OpenGL ES has no geometry shaders.
 #else
     // Set the vertex output limit to the maximum
     nassertr(gsg->_glProgramParameteri != NULL, false);
     GLint max_vertices;
-    glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT, &max_vertices);
-    gsg->_glProgramParameteri(_glsl_program, GL_GEOMETRY_VERTICES_OUT_EXT, max_vertices); 
+    glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES, &max_vertices);
+    gsg->_glProgramParameteri(_glsl_program, GL_GEOMETRY_VERTICES_OUT_ARB, max_vertices); 
 #endif
+    gsg->report_my_gl_errors();
+  }
+
+  if (!_shader->get_text(Shader::ST_tess_control).empty()) {
+    _glsl_tcshader = glsl_compile_entry_point(gsg, Shader::ST_tess_control);
+    if (!_glsl_tcshader) return false;
+    gsg->_glAttachShader(_glsl_program, _glsl_tcshader);
+  }
+
+  if (!_shader->get_text(Shader::ST_tess_evaluation).empty()) {
+    _glsl_teshader = glsl_compile_entry_point(gsg, Shader::ST_tess_evaluation);
+    if (!_glsl_teshader) return false;
+    gsg->_glAttachShader(_glsl_program, _glsl_teshader);
   }
   
   // There might be warnings. Only report them for one shader program.
@@ -1188,6 +1251,10 @@ glsl_compile_shader(GSG *gsg) {
     glsl_report_shader_errors(gsg, _glsl_fshader);
   } else if (_glsl_gshader != 0) {
     glsl_report_shader_errors(gsg, _glsl_gshader);
+  } else if (_glsl_tcshader != 0) {
+    glsl_report_shader_errors(gsg, _glsl_tcshader);
+  } else if (_glsl_teshader != 0) {
+    glsl_report_shader_errors(gsg, _glsl_teshader);
   }
 
   gsg->_glLinkProgram(_glsl_program);

+ 2 - 0
panda/src/glstuff/glShaderContext_src.h

@@ -64,6 +64,8 @@ private:
   GLuint _glsl_vshader;
   GLuint _glsl_fshader;
   GLuint _glsl_gshader;
+  GLuint _glsl_tcshader;
+  GLuint _glsl_teshader;
 
   int _stage_offset;
   // Avoid using this! It merely exists so the

Разлика између датотеке није приказан због своје велике величине
+ 768 - 89
panda/src/glstuff/panda_glext.h


+ 3 - 0
panda/src/gobj/Sources.pp

@@ -22,6 +22,7 @@
     geomEnums.h \
     geomMunger.h geomMunger.I \
     geomPrimitive.h geomPrimitive.I \
+    geomPatches.h \
     geomTriangles.h \
     geomTristrips.h \
     geomTrifans.h \
@@ -91,6 +92,7 @@
     geomEnums.cxx \
     geomMunger.cxx \
     geomPrimitive.cxx \
+    geomPatches.cxx \
     geomTriangles.cxx \
     geomTristrips.cxx \
     geomTrifans.cxx \
@@ -162,6 +164,7 @@
     geomEnums.h \
     geomMunger.h geomMunger.I \
     geomPrimitive.h geomPrimitive.I \
+    geomPatches.h \
     geomTriangles.h \
     geomTristrips.h \
     geomTrifans.h \

+ 3 - 0
panda/src/gobj/config_gobj.cxx

@@ -23,6 +23,7 @@
 #include "geomTriangles.h"
 #include "geomTristrips.h"
 #include "geomTrifans.h"
+#include "geomPatches.h"
 #include "geomLines.h"
 #include "geomLinestrips.h"
 #include "geomPoints.h"
@@ -525,6 +526,7 @@ ConfigureFn(config_gobj) {
   GeomTriangles::init_type();
   GeomTrifans::init_type();
   GeomTristrips::init_type();
+  GeomPatches::init_type();
   GeomVertexArrayData::init_type();
   GeomVertexArrayDataHandle::init_type();
   GeomVertexArrayFormat::init_type();
@@ -570,6 +572,7 @@ ConfigureFn(config_gobj) {
   GeomTriangles::register_with_read_factory();
   GeomTrifans::register_with_read_factory();
   GeomTristrips::register_with_read_factory();
+  GeomPatches::register_with_read_factory();
   GeomVertexArrayData::register_with_read_factory();
   GeomVertexArrayFormat::register_with_read_factory();
   GeomVertexData::register_with_read_factory();

+ 2 - 1
panda/src/gobj/geomEnums.h

@@ -170,7 +170,8 @@ PUBLISHED:
     PT_none,
     PT_polygons,
     PT_lines,
-    PT_points
+    PT_points,
+    PT_patches
   };
 
   // The numeric type determines what physical representation is used

+ 1 - 0
panda/src/gobj/geomLines.h

@@ -27,6 +27,7 @@ PUBLISHED:
   GeomLines(UsageHint usage_hint);
   GeomLines(const GeomLines &copy);
   virtual ~GeomLines();
+  ALLOC_DELETED_CHAIN(GeomLines);
 
 public:
   virtual PT(GeomPrimitive) make_copy() const;

+ 1 - 0
panda/src/gobj/geomLinestrips.h

@@ -27,6 +27,7 @@ PUBLISHED:
   GeomLinestrips(UsageHint usage_hint);
   GeomLinestrips(const GeomLinestrips &copy);
   virtual ~GeomLinestrips();
+  ALLOC_DELETED_CHAIN(GeomLinestrips);
 
 public:
   virtual PT(GeomPrimitive) make_copy() const;

+ 172 - 0
panda/src/gobj/geomPatches.cxx

@@ -0,0 +1,172 @@
+// Filename: geomPatches.cxx
+// Created by:  drose (27Apr12)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) Carnegie Mellon University.  All rights reserved.
+//
+// All use of this software is subject to the terms of the revised BSD
+// license.  You should have received a copy of this license along
+// with this source code in a file named "LICENSE."
+//
+////////////////////////////////////////////////////////////////////
+
+#include "geomPatches.h"
+#include "geomVertexRewriter.h"
+#include "pStatTimer.h"
+#include "bamReader.h"
+#include "bamWriter.h"
+#include "graphicsStateGuardianBase.h"
+
+TypeHandle GeomPatches::_type_handle;
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomPatches::Constructor
+//       Access: Published
+//  Description: The number of vertices per patch must be specified to
+//               the GeomPatches constructor, and it may not be
+//               changed during the lifetime of the GeomPatches
+//               object.  Create a new GeomPatches if you need to have
+//               a different value.
+////////////////////////////////////////////////////////////////////
+GeomPatches::
+GeomPatches(int num_vertices_per_patch, GeomPatches::UsageHint usage_hint) :
+  GeomPrimitive(usage_hint),
+  _num_vertices_per_patch(num_vertices_per_patch)
+{
+}
+ 
+////////////////////////////////////////////////////////////////////
+//     Function: GeomPatches::Copy Constructor
+//       Access: Published
+//  Description: 
+////////////////////////////////////////////////////////////////////
+GeomPatches::
+GeomPatches(const GeomPatches &copy) :
+  GeomPrimitive(copy),
+  _num_vertices_per_patch(copy._num_vertices_per_patch)
+{
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomPatches::Destructor
+//       Access: Published, Virtual
+//  Description: 
+////////////////////////////////////////////////////////////////////
+GeomPatches::
+~GeomPatches() {
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomPatches::make_copy
+//       Access: Public, Virtual
+//  Description: 
+////////////////////////////////////////////////////////////////////
+PT(GeomPrimitive) GeomPatches::
+make_copy() const {
+  return new GeomPatches(*this);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomPatches::get_primitive_type
+//       Access: Public, Virtual
+//  Description: Returns the fundamental rendering type of this
+//               primitive: whether it is points, lines, or polygons.
+//
+//               This is used to set up the appropriate antialiasing
+//               settings when AntialiasAttrib::M_auto is in effect;
+//               it also implies the type of primitive that will be
+//               produced when decompose() is called.
+////////////////////////////////////////////////////////////////////
+GeomPrimitive::PrimitiveType GeomPatches::
+get_primitive_type() const {
+  return PT_patches;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomPatches::get_num_vertices_per_primitive
+//       Access: Public, Virtual
+//  Description: If the primitive type is a simple type in which all
+//               primitives have the same number of vertices, like
+//               patches, returns the number of vertices per
+//               primitive.  If the primitive type is a more complex
+//               type in which different primitives might have
+//               different numbers of vertices, for instance a
+//               triangle strip, returns 0.
+//
+//               In the case of GeomPatches, this returns the fixed
+//               number that was specified to the constructor.
+////////////////////////////////////////////////////////////////////
+int GeomPatches::
+get_num_vertices_per_primitive() const {
+  return _num_vertices_per_patch;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomPatches::draw
+//       Access: Public, Virtual
+//  Description: Calls the appropriate method on the GSG to draw the
+//               primitive.
+////////////////////////////////////////////////////////////////////
+bool GeomPatches::
+draw(GraphicsStateGuardianBase *gsg, const GeomPrimitivePipelineReader *reader,
+     bool force) const {
+  return gsg->draw_patches(reader, force);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomPatches::register_with_read_factory
+//       Access: Public, Static
+//  Description: Tells the BamReader how to create objects of type
+//               Geom.
+////////////////////////////////////////////////////////////////////
+void GeomPatches::
+register_with_read_factory() {
+  BamReader::get_factory()->register_factory(get_class_type(), make_from_bam);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomPatches::write_datagram
+//       Access: Public, Virtual
+//  Description: Writes the contents of this object to the datagram
+//               for shipping out to a Bam file.
+////////////////////////////////////////////////////////////////////
+void GeomPatches::
+write_datagram(BamWriter *manager, Datagram &dg) {
+  GeomPrimitive::write_datagram(manager, dg);
+  dg.add_uint16(_num_vertices_per_patch);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomPatches::fillin
+//       Access: Protected
+//  Description: This internal function is called by make_from_bam to
+//               read in all of the relevant data from the BamFile for
+//               the new GeomPatches.
+////////////////////////////////////////////////////////////////////
+void GeomPatches::
+fillin(DatagramIterator &scan, BamReader *manager) {
+  GeomPrimitive::fillin(scan, manager);
+  _num_vertices_per_patch = scan.get_uint16();
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: GeomPatches::make_from_bam
+//       Access: Protected, Static
+//  Description: This function is called by the BamReader's factory
+//               when a new object of type Geom is encountered
+//               in the Bam file.  It should create the Geom
+//               and extract its information from the file.
+////////////////////////////////////////////////////////////////////
+TypedWritable *GeomPatches::
+make_from_bam(const FactoryParams &params) {
+  GeomPatches *object = new GeomPatches(0, UH_unspecified);
+  DatagramIterator scan;
+  BamReader *manager;
+
+  parse_params(params, scan, manager);
+  object->fillin(scan, manager);
+
+  return object;
+}

+ 76 - 0
panda/src/gobj/geomPatches.h

@@ -0,0 +1,76 @@
+// Filename: geomPatches.h
+// Created by:  drose (27Apr12)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) Carnegie Mellon University.  All rights reserved.
+//
+// All use of this software is subject to the terms of the revised BSD
+// license.  You should have received a copy of this license along
+// with this source code in a file named "LICENSE."
+//
+////////////////////////////////////////////////////////////////////
+
+#ifndef GEOMPATCHES_H
+#define GEOMPATCHES_H
+
+#include "pandabase.h"
+#include "geomPrimitive.h"
+
+////////////////////////////////////////////////////////////////////
+//       Class : GeomPatches
+// Description : Defines a series of "patches", fixed-size groupings
+//               of vertices that must be processed by a tessellation
+//               shader.
+////////////////////////////////////////////////////////////////////
+class EXPCL_PANDA_GOBJ GeomPatches : public GeomPrimitive {
+PUBLISHED:
+  GeomPatches(int num_vertices_per_patch, UsageHint usage_hint);
+  GeomPatches(const GeomPatches &copy);
+  virtual ~GeomPatches();
+  ALLOC_DELETED_CHAIN(GeomPatches);
+
+public:
+  virtual PT(GeomPrimitive) make_copy() const;
+  virtual PrimitiveType get_primitive_type() const;
+
+  virtual int get_num_vertices_per_primitive() const;
+
+public:
+  virtual bool draw(GraphicsStateGuardianBase *gsg,
+                    const GeomPrimitivePipelineReader *reader,
+                    bool force) const;
+
+private:
+  int _num_vertices_per_patch;
+
+public:
+  static void register_with_read_factory();
+  virtual void write_datagram(BamWriter *manager, Datagram &dg);
+
+protected:
+  void fillin(DatagramIterator &scan, BamReader *manager);
+  static TypedWritable *make_from_bam(const FactoryParams &params);
+
+public:
+  static TypeHandle get_class_type() {
+    return _type_handle;
+  }
+  static void init_type() {
+    GeomPrimitive::init_type();
+    register_type(_type_handle, "GeomPatches",
+                  GeomPrimitive::get_class_type());
+  }
+  virtual TypeHandle get_type() const {
+    return get_class_type();
+  }
+  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
+
+private:
+  static TypeHandle _type_handle;
+
+  friend class Geom;
+};
+
+#endif

+ 1 - 0
panda/src/gobj/geomPoints.h

@@ -27,6 +27,7 @@ PUBLISHED:
   GeomPoints(UsageHint usage_hint);
   GeomPoints(const GeomPoints &copy);
   virtual ~GeomPoints();
+  ALLOC_DELETED_CHAIN(GeomPoints);
 
 public:
   virtual PT(GeomPrimitive) make_copy() const;

+ 1 - 0
panda/src/gobj/geomTriangles.h

@@ -27,6 +27,7 @@ PUBLISHED:
   GeomTriangles(UsageHint usage_hint);
   GeomTriangles(const GeomTriangles &copy);
   virtual ~GeomTriangles();
+  ALLOC_DELETED_CHAIN(GeomTriangles);
 
 public:
   virtual PT(GeomPrimitive) make_copy() const;

+ 1 - 0
panda/src/gobj/geomTrifans.h

@@ -27,6 +27,7 @@ PUBLISHED:
   GeomTrifans(UsageHint usage_hint);
   GeomTrifans(const GeomTrifans &copy);
   virtual ~GeomTrifans();
+  ALLOC_DELETED_CHAIN(GeomTrifans);
 
 public:
   virtual PT(GeomPrimitive) make_copy() const;

+ 1 - 0
panda/src/gobj/geomTristrips.h

@@ -27,6 +27,7 @@ PUBLISHED:
   GeomTristrips(UsageHint usage_hint);
   GeomTristrips(const GeomTristrips &copy);
   virtual ~GeomTristrips();
+  ALLOC_DELETED_CHAIN(GeomTristrips);
 
 public:
   virtual PT(GeomPrimitive) make_copy() const;

+ 1 - 0
panda/src/gobj/p3gobj_composite1.cxx

@@ -12,6 +12,7 @@
 #include "geomLines.cxx"
 #include "geomLinestrips.cxx"
 #include "geomMunger.cxx"
+#include "geomPatches.cxx"
 #include "geomPoints.cxx"
 #include "geomPrimitive.cxx"
 #include "geomTriangles.cxx"

+ 6 - 0
panda/src/gobj/shader.I

@@ -59,6 +59,12 @@ get_text(const ShaderType &type) const {
       case ST_geometry:
         return _text->_geometry;
         break;
+      case ST_tess_control:
+        return _text->_tess_control;
+        break;
+      case ST_tess_evaluation:
+        return _text->_tess_evaluation;
+        break;
       default:
         return _text->_shared;
     }

+ 41 - 9
panda/src/gobj/shader.cxx

@@ -1384,6 +1384,12 @@ cg_compile_entry_point(const char *entry, const ShaderCaps &caps, ShaderType typ
     ultimate = caps._ultimate_gprofile;
     break;
 
+  case ST_tess_evaluation:
+  case ST_tess_control:
+    active   = caps._active_tprofile;
+    ultimate = caps._ultimate_tprofile;
+    break;
+
   case ST_none:
   default:
     active   = CG_PROFILE_UNKNOWN;
@@ -1875,6 +1881,7 @@ Shader(CPT(ShaderFile) filename, CPT(ShaderFile) text, const ShaderLanguage &lan
   if (_default_caps._ultimate_vprofile == 0 || _default_caps._ultimate_vprofile == CG_PROFILE_UNKNOWN) {
     _default_caps._active_vprofile = CG_PROFILE_UNKNOWN;
     _default_caps._active_fprofile = CG_PROFILE_UNKNOWN;
+    _default_caps._active_gprofile = CG_PROFILE_UNKNOWN;
     _default_caps._ultimate_vprofile = cgGetProfile("glslv");
     _default_caps._ultimate_fprofile = cgGetProfile("glslf");
     _default_caps._ultimate_gprofile = cgGetProfile("glslg");
@@ -2090,9 +2097,11 @@ load(const Filename &file, const ShaderLanguage &lang) {
 
   VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
   if (!vfs->read_file(file, sbody->_shared, true)) {
-    gobj_cat.error() << "Could not read shader file: " << file << "\n";
+    gobj_cat.error()
+      << "Could not read shader file: " << file << "\n";
     return NULL;
   }
+
   PT(Shader) result = new Shader(sfile, sbody, lang);
   result->_loaded = true;
   _load_table[sfile] = result;
@@ -2106,26 +2115,43 @@ load(const Filename &file, const ShaderLanguage &lang) {
 //               programs separately.
 ////////////////////////////////////////////////////////////////////
 PT(Shader) Shader::
-load(const ShaderLanguage &lang, const Filename &vertex, const Filename &fragment, const Filename &geometry) {
-  PT(ShaderFile) sfile = new ShaderFile(vertex, fragment, geometry);
+load(const ShaderLanguage &lang, const Filename &vertex, 
+     const Filename &fragment, const Filename &geometry, 
+     const Filename &tess_control, const Filename &tess_evaluation) {
+  PT(ShaderFile) sfile = new ShaderFile(vertex, fragment, geometry, tess_control, tess_evaluation);
   ShaderTable::const_iterator i = _load_table.find(sfile);
   if (i != _load_table.end() && (lang == SL_none || lang == i->second->_language)) {
     return i->second;
   }
-  PT(ShaderFile) sbody = new ShaderFile("", "", "");
+
+  PT(ShaderFile) sbody = new ShaderFile("", "", "", "", "");
   VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
   if (!vertex.empty() && !vfs->read_file(vertex, sbody->_vertex, true)) {
-    gobj_cat.error() << "Could not read vertex shader file: " << vertex << "\n";
+    gobj_cat.error()
+      << "Could not read vertex shader file: " << vertex << "\n";
     return NULL;
   }
   if (!fragment.empty() && !vfs->read_file(fragment, sbody->_fragment, true)) {
-    gobj_cat.error() << "Could not read fragment shader file: " << vertex << "\n";
+    gobj_cat.error()
+      << "Could not read fragment shader file: " << fragment << "\n";
     return NULL;
   }
   if (!geometry.empty() && !vfs->read_file(geometry, sbody->_geometry, true)) {
-    gobj_cat.error() << "Could not read geometry shader file: " << vertex << "\n";
+    gobj_cat.error()
+      << "Could not read geometry shader file: " << geometry << "\n";
     return NULL;
   }
+  if (!tess_control.empty() && !vfs->read_file(tess_control, sbody->_tess_control, true)) {
+    gobj_cat.error()
+      << "Could not read tess_control shader file: " << tess_control << "\n";
+    return NULL;
+  }
+  if (!tess_evaluation.empty() && !vfs->read_file(tess_evaluation, sbody->_tess_evaluation, true)) {
+    gobj_cat.error()
+      << "Could not read tess_evaluation shader file: " << tess_evaluation << "\n";
+    return NULL;
+  }
+
   PT(Shader) result = new Shader(sfile, sbody, lang);
   result->_loaded = true;
   _load_table[sfile] = result;
@@ -2167,12 +2193,16 @@ make(const string &body, const ShaderLanguage &lang) {
 //  Description: Loads the shader, using the strings as shader bodies.
 //////////////////////////////////////////////////////////////////////
 PT(Shader) Shader::
-make(const ShaderLanguage &lang, const string &vertex, const string &fragment, const string &geometry) {
-  PT(ShaderFile) sbody = new ShaderFile(vertex, fragment, geometry);
+make(const ShaderLanguage &lang, const string &vertex, const string &fragment, 
+     const string &geometry, const string &tess_control, 
+     const string &tess_evaluation) {
+  PT(ShaderFile) sbody = new ShaderFile(vertex, fragment, geometry, tess_control, tess_evaluation);
+
   ShaderTable::const_iterator i = _make_table.find(sbody);
   if (i != _make_table.end() && (lang == SL_none || lang == i->second->_language)) {
     return i->second;
   }
+
   PT(ShaderFile) sfile = new ShaderFile("created-shader");
   PT(Shader) result = new Shader(sfile, sbody, lang);
   _make_table[sbody] = result;
@@ -2425,9 +2455,11 @@ clear() {
   _active_vprofile = CG_PROFILE_UNKNOWN;
   _active_fprofile = CG_PROFILE_UNKNOWN;
   _active_gprofile = CG_PROFILE_UNKNOWN;
+  _active_fprofile = CG_PROFILE_UNKNOWN;
   _ultimate_vprofile = CG_PROFILE_UNKNOWN;
   _ultimate_fprofile = CG_PROFILE_UNKNOWN;
   _ultimate_gprofile = CG_PROFILE_UNKNOWN;
+  _ultimate_fprofile = CG_PROFILE_UNKNOWN;
 #endif
 }
 

+ 42 - 11
panda/src/gobj/shader.h

@@ -59,6 +59,8 @@ PUBLISHED:
     ST_vertex,
     ST_fragment,
     ST_geometry,
+    ST_tess_control,
+    ST_tess_evaluation,
   };
 
   enum AutoShaderSwitch {
@@ -79,8 +81,16 @@ PUBLISHED:
 
   static PT(Shader) load(const Filename &file, const ShaderLanguage &lang = SL_none);
   static PT(Shader) make(const string &body, const ShaderLanguage &lang = SL_none);
-  static PT(Shader) load(const ShaderLanguage &lang, const Filename &vertex, const Filename &fragment, const Filename &geometry = "");
-  static PT(Shader) make(const ShaderLanguage &lang, const string &vertex, const string &fragment, const string &geometry = "");
+  static PT(Shader) load(const ShaderLanguage &lang, 
+                         const Filename &vertex, const Filename &fragment, 
+                         const Filename &geometry = "",
+                         const Filename &tess_control = "",
+                         const Filename &tess_evaluation = "");
+  static PT(Shader) make(const ShaderLanguage &lang, 
+                         const string &vertex, const string &fragment, 
+                         const string &geometry = "",
+                         const string &tess_control = "",
+                         const string &tess_evaluation = "");
 
   INLINE const Filename get_filename(const ShaderType &type = ST_none) const;
   INLINE const string &get_text(const ShaderType &type = ST_none) const;
@@ -336,36 +346,57 @@ public:
     ShaderArgInfo     _info;
   };
 
-  struct ShaderCaps {
+  class ShaderCaps {
+  public:
+    void clear();
+    INLINE bool operator == (const ShaderCaps &other) const;
+    INLINE ShaderCaps();
+
+  public:
     bool _supports_glsl;
 
 #ifdef HAVE_CG
     int _active_vprofile;
     int _active_fprofile;
     int _active_gprofile;
+    int _active_tprofile;
 
     int _ultimate_vprofile;
     int _ultimate_fprofile;
     int _ultimate_gprofile;
+    int _ultimate_tprofile;
 
     pset <ShaderBug> _bug_list;
 #endif
-    void clear();
-    INLINE bool operator == (const ShaderCaps &other) const;
-    INLINE ShaderCaps();
   };
 
-  struct ShaderFile : public ReferenceCount {
-    ShaderFile(string shared) { _separate = false; _shared = shared; }
-    ShaderFile(string vertex, string fragment, string geometry = "") {
-      _separate = true;     _vertex   = vertex;
-      _fragment = fragment; _geometry = geometry;
+  class ShaderFile : public ReferenceCount {
+  public:
+    ShaderFile(const string &shared) { 
+      _separate = false; 
+      _shared = shared; 
     }
+    ShaderFile(const string &vertex, 
+               const string &fragment, 
+               const string &geometry,
+               const string &tess_control,
+               const string &tess_evaluation) {
+      _separate = true;
+      _vertex = vertex;
+      _fragment = fragment;
+      _geometry = geometry;
+      _tess_control = tess_control;
+      _tess_evaluation = tess_evaluation;
+    }
+
+  public:
     bool _separate;
     string _shared;
     string _vertex;
     string _fragment;
     string _geometry;
+    string _tess_control;
+    string _tess_evaluation;
   };
 
  private:

+ 1 - 0
panda/src/gsgbase/graphicsStateGuardianBase.h

@@ -200,6 +200,7 @@ public:
   virtual bool draw_triangles(const GeomPrimitivePipelineReader *reader, bool force)=0;
   virtual bool draw_tristrips(const GeomPrimitivePipelineReader *reader, bool force)=0;
   virtual bool draw_trifans(const GeomPrimitivePipelineReader *reader, bool force)=0;
+  virtual bool draw_patches(const GeomPrimitivePipelineReader *reader, bool force)=0;
   virtual bool draw_lines(const GeomPrimitivePipelineReader *reader, bool force)=0;
   virtual bool draw_linestrips(const GeomPrimitivePipelineReader *reader, bool force)=0;
   virtual bool draw_points(const GeomPrimitivePipelineReader *reader, bool force)=0;

+ 20 - 0
panda/src/pgraphnodes/sceneGraphAnalyzer.I

@@ -204,6 +204,16 @@ get_num_points() const {
   return _num_points;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: SceneGraphAnalyzer::get_num_patches
+//       Access: Published
+//  Description: 
+////////////////////////////////////////////////////////////////////
+int SceneGraphAnalyzer::
+get_num_patches() const {
+  return _num_patches;
+}
+
 
 ////////////////////////////////////////////////////////////////////
 //     Function: SceneGraphAnalyzer::get_num_individual_tris
@@ -255,6 +265,16 @@ get_num_triangles_in_fans() const {
   return _num_triangles_in_fans;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: SceneGraphAnalyzer::get_num_vertices_in_patches
+//       Access: Published
+//  Description: 
+////////////////////////////////////////////////////////////////////
+int SceneGraphAnalyzer::
+get_num_vertices_in_patches() const {
+  return _num_vertices_in_patches;
+}
+
 
 ////////////////////////////////////////////////////////////////////
 //     Function: SceneGraphAnalyzer::get_texture_bytes

+ 14 - 0
panda/src/pgraphnodes/sceneGraphAnalyzer.cxx

@@ -27,6 +27,7 @@
 #include "geomTriangles.h"
 #include "geomTristrips.h"
 #include "geomTrifans.h"
+#include "geomPatches.h"
 #include "transformState.h"
 #include "textureAttrib.h"
 #include "pta_ushort.h"
@@ -88,12 +89,14 @@ clear() {
   _num_tris = 0;
   _num_lines = 0;
   _num_points = 0;
+  _num_patches = 0;
 
   _num_individual_tris = 0;
   _num_tristrips = 0;
   _num_triangles_in_strips = 0;
   _num_trifans = 0;
   _num_triangles_in_fans = 0;
+  _num_vertices_in_patches = 0;
 
   _texture_bytes = 0;
 
@@ -254,6 +257,13 @@ write(ostream &out, int indent_level) const {
     << _num_individual_tris
     << " of these are independent triangles.\n";
 
+  if (_num_patches != 0) {
+    indent(out, indent_level)
+      << _num_patches << " patches ("
+      << (double)_num_vertices_in_patches / (double)_num_patches
+      << " average verts per patch).\n";
+  }
+
   if (_num_lines != 0 || _num_points != 0) {
     indent(out, indent_level)
       << _num_lines << " lines, " << _num_points << " points.\n";
@@ -474,6 +484,10 @@ collect_statistics(const Geom *geom) {
       _num_trifans += prim->get_num_primitives();
       _num_triangles_in_fans += prim->get_num_faces();
 
+    } else if (prim->is_of_type(GeomPatches::get_class_type())) {
+      _num_patches += prim->get_num_primitives();
+      _num_vertices_in_patches += prim->get_num_vertices();
+
     } else {
       pgraph_cat.warning()
         << "Unknown GeomPrimitive type in SceneGraphAnalyzer: "

+ 4 - 0
panda/src/pgraphnodes/sceneGraphAnalyzer.h

@@ -74,12 +74,14 @@ PUBLISHED:
   INLINE int get_num_tris() const;
   INLINE int get_num_lines() const;
   INLINE int get_num_points() const;
+  INLINE int get_num_patches() const;
 
   INLINE int get_num_individual_tris() const;
   INLINE int get_num_tristrips() const;
   INLINE int get_num_triangles_in_strips() const;
   INLINE int get_num_trifans() const;
   INLINE int get_num_triangles_in_fans() const;
+  INLINE int get_num_vertices_in_patches() const;
 
   INLINE int get_texture_bytes() const;
 
@@ -141,12 +143,14 @@ private:
   int _num_tris;
   int _num_lines;
   int _num_points;
+  int _num_patches;
 
   int _num_individual_tris;
   int _num_tristrips;
   int _num_triangles_in_strips;
   int _num_trifans;
   int _num_triangles_in_fans;
+  int _num_vertices_in_patches;
 
   int _texture_bytes;
 

+ 14 - 0
pandatool/src/bam/bamToEgg.cxx

@@ -39,6 +39,7 @@
 #include "geomNode.h"
 #include "geom.h"
 #include "geomTriangles.h"
+#include "geomPatches.h"
 #include "geomPoints.h"
 #include "geomLines.h"
 #include "geomVertexReader.h"
@@ -59,6 +60,7 @@
 #include "eggVertex.h"
 #include "eggPrimitive.h"
 #include "eggPolygon.h"
+#include "eggPatch.h"
 #include "eggPoint.h"
 #include "eggLine.h"
 #include "eggTexture.h"
@@ -747,6 +749,8 @@ convert_primitive(const GeomVertexData *vertex_data,
 
   if (primitive->is_of_type(GeomTriangles::get_class_type())) {
     make_func = make_egg_polygon;
+  } else if (primitive->is_of_type(GeomPatches::get_class_type())) {
+    make_func = make_egg_patch;
   } else if (primitive->is_of_type(GeomPoints::get_class_type())) {
     make_func = make_egg_point;
   } else if (primitive->is_of_type(GeomLines::get_class_type())) {
@@ -1156,6 +1160,16 @@ make_egg_polygon() {
   return new EggPolygon;
 }
 
+////////////////////////////////////////////////////////////////////
+//     Function: BamToEgg::make_egg_patch
+//       Access: Public, Static
+//  Description: A factory function to make a new EggPatch instance.
+////////////////////////////////////////////////////////////////////
+EggPrimitive *BamToEgg::
+make_egg_patch() {
+  return new EggPatch;
+}
+
 ////////////////////////////////////////////////////////////////////
 //     Function: BamToEgg::make_egg_point
 //       Access: Public, Static

+ 1 - 0
pandatool/src/bam/bamToEgg.h

@@ -92,6 +92,7 @@ private:
   EggTexture *get_egg_texture(Texture *tex);
 
   static EggPrimitive *make_egg_polygon();
+  static EggPrimitive *make_egg_patch();
   static EggPrimitive *make_egg_point();
   static EggPrimitive *make_egg_line();
 

Неке датотеке нису приказане због велике количине промена