From 1adc4992ffea69cf948646f63eb892fd800bca79 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 31 Jul 2002 15:16:14 +0000 Subject: [PATCH] Updates to iv/vrml loader from Ruben. --- src/osgPlugins/iv/atrvec3list.h | 39 + src/osgPlugins/iv/indexedtristripset.h | 52 + src/osgPlugins/iv/main.cpp | 2 +- src/osgPlugins/iv/mynodevisitor.h | 2 + src/osgPlugins/iv/osgvisitor.cpp | 136 ++- src/osgPlugins/iv/osgvisitor.h | 4 + src/osgPlugins/iv/parser.cpp | 1549 ++++++++++++++---------- src/osgPlugins/iv/parser.hpp | 31 +- src/osgPlugins/iv/parser.y | 17 +- src/osgPlugins/iv/scanner.cpp | 833 ++++++------- src/osgPlugins/iv/scanner.l | 5 +- 11 files changed, 1558 insertions(+), 1112 deletions(-) create mode 100644 src/osgPlugins/iv/atrvec3list.h create mode 100644 src/osgPlugins/iv/indexedtristripset.h diff --git a/src/osgPlugins/iv/atrvec3list.h b/src/osgPlugins/iv/atrvec3list.h new file mode 100644 index 000000000..cef42c090 --- /dev/null +++ b/src/osgPlugins/iv/atrvec3list.h @@ -0,0 +1,39 @@ +/* + * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph + * Copyright (C) 2002 Ruben Lopez + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __ATR_VEC3_LIST_H__ +#define __ATR_VEC3_LIST_H__ + +#include "attribute.h" +#include "geometry.h" + +class AtrVec3List: public Attribute { + VertexList *list; +public: + AtrVec3List(char *name):Attribute(name) { list=0; } + AtrVec3List(char *name, VertexList *vlist):Attribute(name) { + this->list=vlist; + } + VertexList *getList() { return list; } + int getSize() { return list->size(); } + virtual char *type() { return "AtrVec3List"; } +}; + + +#endif diff --git a/src/osgPlugins/iv/indexedtristripset.h b/src/osgPlugins/iv/indexedtristripset.h new file mode 100644 index 000000000..9086843ec --- /dev/null +++ b/src/osgPlugins/iv/indexedtristripset.h @@ -0,0 +1,52 @@ +/* + * osgDB::wrl - a VRML 1.0 loader for OpenSceneGraph + * Copyright (C) 2002 Ruben Lopez + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __INDEXED_TRI_STRIP_SET_H__ +#define __INDEXED_TRI_STRIP_SET_H__ + +#include "mynode.h" + +class IndexedTriStripSet: public MyNode { + PolygonList polys; + PolygonList textureIndices; // Indexed texture set. + bool _hasTextureIndices; +public: + IndexedTriStripSet() {} + + IndexedTriStripSet(PolygonList *p) { + polys=*p; + _hasTextureIndices=false; + } + + IndexedTriStripSet(PolygonList *p, PolygonList *t) { + polys=*p; + textureIndices=*t; + _hasTextureIndices=true; + } + + bool hasTextureIndices() { return _hasTextureIndices; } + PolygonList getPolygons() { return polys; } + PolygonList getTextureIndices() { return textureIndices; } + virtual char *type() { return "IndexedTriStripSet"; } + virtual void accept(MyNodeVisitor *v) { v->applyIndexedTriStripSet(this); } + +}; + + +#endif diff --git a/src/osgPlugins/iv/main.cpp b/src/osgPlugins/iv/main.cpp index 442028274..c715a11f4 100644 --- a/src/osgPlugins/iv/main.cpp +++ b/src/osgPlugins/iv/main.cpp @@ -40,7 +40,7 @@ osg::Node *readVRMLNode(const char *file) { yydebug=0; yyin=fopen(file,"r"); std::cout << "Parsing..." << std::endl; - yyparse(); + if (yyparse()!=0) return 0; osg::ref_ptr n=getRoot(); try { std::cout << "Generating OSG tree..." << std::endl; diff --git a/src/osgPlugins/iv/mynodevisitor.h b/src/osgPlugins/iv/mynodevisitor.h index 4db570154..0a5b51850 100644 --- a/src/osgPlugins/iv/mynodevisitor.h +++ b/src/osgPlugins/iv/mynodevisitor.h @@ -26,6 +26,7 @@ class Coordinate3; class MatrixTransform; class Separator; class IndexedFaceSet; +class IndexedTriStripSet; class TextureCoordinate; class Texture2; class Transform; @@ -40,6 +41,7 @@ public: virtual void applyMatrixTransform(MatrixTransform *tr)=0; virtual void applySeparator(Separator *sep)=0; virtual void applyIndexedFaceSet(IndexedFaceSet *ifs)=0; + virtual void applyIndexedTriStripSet(IndexedTriStripSet *its)=0; virtual void applyTextureCoordinate(TextureCoordinate *texc)=0; virtual void applyTexture2(Texture2 *tex)=0; virtual void applyTransform(Transform *trans)=0; diff --git a/src/osgPlugins/iv/osgvisitor.cpp b/src/osgPlugins/iv/osgvisitor.cpp index 6127b9ebc..353a2ee7f 100644 --- a/src/osgPlugins/iv/osgvisitor.cpp +++ b/src/osgPlugins/iv/osgvisitor.cpp @@ -28,6 +28,7 @@ #include "separator.h" #include "matrixtransform.h" #include "indexedfaceset.h" +#include "indexedtristripset.h" #include "texturecoordinate.h" #include "texture2.h" #include "transform.h" @@ -51,18 +52,19 @@ #include "atrvec.h" #include "atrfloat.h" #include "atrstring.h" +#include "atrvec3list.h" #include "ltstr.h" #include "normals.h" #define CREASE_ANGLE 2//3.14159265359 * 2.0 / 3.0 -class CacheObjetos { +class ObjectCache { typedef std::map, osg::ref_ptr > MaterialMap; typedef std::map, ltstr> TextureMap; typedef std::map, osg::ref_ptr > NodeMap; - static MaterialMap materiales; + static MaterialMap materials; static TextureMap textures; static NodeMap nodos; public: @@ -71,21 +73,23 @@ public: } static osg::Material* getMaterial(Material* _material) { - if (materiales.find(_material) == materiales.end()) { - AtrVec *ambient=(AtrVec*)_material->getAttribute("ambientColor"); - AtrVec *diffuse=(AtrVec*)_material->getAttribute("diffuseColor"); - AtrVec *specular=(AtrVec*)_material->getAttribute("specularColor"); - AtrFloat *shininess=(AtrFloat*)_material->getAttribute("shininess"); - AtrFloat *transparency=(AtrFloat*)_material->getAttribute("transparency"); + if (materials.find(_material) == materials.end()) { + AtrVec *ambient=dynamic_cast(_material->getAttribute("ambientColor")); + AtrVec *diffuse=dynamic_cast(_material->getAttribute("diffuseColor")); + AtrVec *specular=dynamic_cast(_material->getAttribute("specularColor")); + AtrFloat *shininess=dynamic_cast(_material->getAttribute("shininess")); + AtrFloat *transparency=dynamic_cast(_material->getAttribute("transparency")); osg::Material *material=new osg::Material(); if (ambient) material->setAmbient(osg::Material::FRONT_AND_BACK,osg::Vec4(ambient->getValCut(0),ambient->getValCut(1),ambient->getValCut(2),1.0f)); if (diffuse) material->setDiffuse(osg::Material::FRONT_AND_BACK,osg::Vec4(diffuse->getValCut(0),diffuse->getValCut(1),diffuse->getValCut(2),1.0f)); if (specular) material->setSpecular(osg::Material::FRONT_AND_BACK,osg::Vec4(specular->getValCut(0),specular->getValCut(1),specular->getValCut(2),1.0f)); if (shininess) material->setShininess(osg::Material::FRONT_AND_BACK,shininess->getValue()); if (transparency) material->setTransparency(osg::Material::FRONT_AND_BACK,transparency->getValue()); - materiales[_material]=material; + if (ambient || diffuse || specular || transparency) + materials[_material]=material; + else return 0; } - return materiales[_material].get(); + return materials[_material].get(); } static osg::Texture* getTextura(const char* _texture) { @@ -101,9 +105,9 @@ public: } }; -CacheObjetos::MaterialMap CacheObjetos::materiales; -CacheObjetos::TextureMap CacheObjetos::textures; -CacheObjetos::NodeMap CacheObjetos::nodos; +ObjectCache::MaterialMap ObjectCache::materials; +ObjectCache::TextureMap ObjectCache::textures; +ObjectCache::NodeMap ObjectCache::nodos; static void makeTransform(MatrixTransform *matriz_active, osg::Transform *nodo) { // Original @@ -214,21 +218,14 @@ osg::Primitive *generatePrimitive(PolygonList &polys, unsigned primsize) { return p; } -void OSGVisitor::applyIndexedFaceSet(IndexedFaceSet *ifs) { - unsigned i; - if (coord3_active == 0) { - std::cerr << "ERROR: IndexedFaceSet without previous Coordinate3!" << std::endl; - throw -1; - } - osg::Geode *geode=new osg::Geode(); - osg::Geometry *geometry=new osg::Geometry(); +void OSGVisitor::makeGeode(osg::Geode *geode, osg::Geometry *geometry, bool twoSided) { osg::StateSet *state=new osg::StateSet(); osg::FrontFace *frontface=new osg::FrontFace(); frontface->setMode(osg::FrontFace::CLOCKWISE); state->setAttributeAndModes(frontface,osg::StateAttribute::ON); osg::CullFace *cull=new osg::CullFace(); cull->setMode(osg::CullFace::BACK); - if (ifs->getTwoSided() == false) { + if (twoSided) { state->setAttributeAndModes(cull,osg::StateAttribute::ON); } else { std::cout << "Deactivating culling for this object" << std::endl; @@ -242,18 +239,44 @@ void OSGVisitor::applyIndexedFaceSet(IndexedFaceSet *ifs) { geode->setStateSet(state); /** Applying the material */ if (material_active!=0) { - osg::Material *material = CacheObjetos::getMaterial(material_active); + osg::Material *material = ObjectCache::getMaterial(material_active); state->setAttributeAndModes(material,osg::StateAttribute::ON); } /** Applying the texture */ if (texture_active!=0) { AtrString *filename=(AtrString*)texture_active->getAttribute("filename"); if (filename) { - osg::Texture *texture=CacheObjetos::getTextura(filename->getValue()); + osg::Texture *texture=ObjectCache::getTextura(filename->getValue()); state->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); } - } + + /* If needed, apply per-vertex colors */ + if (material_active) { + AtrVec3List *diffuse=dynamic_cast(material_active->getAttribute("diffuseColor")); + if (diffuse) { // Has per-vertex colors + std::cout << "Per vertex colors" << std::endl; + VertexList *colors=diffuse->getList(); + osg::Vec3Array *colors_osg=new osg::Vec3Array(); + for (unsigned i=0;isize();i++) { + colors_osg->push_back((*colors)[i]); + } + std::cout << colors->size() << " colors" << std::endl; + geometry->setColorArray(colors_osg); + geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX); + } + } +} + +void OSGVisitor::applyIndexedFaceSet(IndexedFaceSet *ifs) { + unsigned i; + if (coord3_active == 0) { + std::cerr << "ERROR: IndexedFaceSet without previous Coordinate3!" << std::endl; + throw -1; + } + osg::Geode *geode=new osg::Geode(); + osg::Geometry *geometry=new osg::Geometry(); + makeGeode(geode,geometry,ifs->getTwoSided()); /* Converting list of vertices to the OSG way (mostly the same) */ VertexList vertices=coord3_active->getVertices(); osg::Vec3Array *vertices_osg=new osg::Vec3Array(); @@ -261,6 +284,7 @@ void OSGVisitor::applyIndexedFaceSet(IndexedFaceSet *ifs) { vertices_osg->push_back(vertices[i]); } geometry->setVertexArray(vertices_osg); + total_vert+=vertices.size(); /* Converting list of polys */ PolygonList polys=ifs->getPolygons(); @@ -281,9 +305,10 @@ void OSGVisitor::applyIndexedFaceSet(IndexedFaceSet *ifs) { for (i=0;ipush_back(osg::Vec2(tcoord[i].first,tcoord[i].second)); } - geometry->setTexCoordArray(0,texCoords); + geometry->setTexCoordArray(0,texCoords); } } + osgUtil::SmoothingVisitor v; v.smooth(*geometry); @@ -297,6 +322,65 @@ void OSGVisitor::applyIndexedFaceSet(IndexedFaceSet *ifs) { parent->addChild(geode); } +void OSGVisitor::applyIndexedTriStripSet(IndexedTriStripSet *its) { + unsigned i,j; + if (coord3_active == 0) { + std::cerr << "ERROR: IndexedFaceSet without previous Coordinate3!" << std::endl; + throw -1; + } + osg::Geode *geode=new osg::Geode(); + osg::Geometry *geometry=new osg::Geometry(); + makeGeode(geode,geometry,its->getTwoSided()); + /* Converting list of vertices to the OSG way (mostly the same) */ + VertexList vertices=coord3_active->getVertices(); + osg::Vec3Array *vertices_osg=new osg::Vec3Array(); + for (i=0;ipush_back(vertices[i]); + } + geometry->setVertexArray(vertices_osg); + total_vert+=vertices.size(); + + /* Converting list of polys */ + PolygonList polys=its->getPolygons(); + for (i=0;iaddPrimitive(new osg::DrawElementsUShort(osg::Primitive::TRIANGLE_STRIP,vindex.size(),indices)); + } + + + TextureCoordList tcoord; + if (tcoord_active) tcoord=tcoord_active->getTextureCoords(); + PolygonList textureIndices = its->getTextureIndices(); + if (tcoord_active) { + if (its->hasTextureIndices()) { + std::cerr << "texture indices are not supported!" << std::endl; + } else { + osg::Vec2Array *texCoords=new osg::Vec2Array(); + for (i=0;ipush_back(osg::Vec2(tcoord[i].first,tcoord[i].second)); + } + geometry->setTexCoordArray(0,texCoords); + } + } + + osgUtil::SmoothingVisitor v; + v.smooth(*geometry); + + // As SmoothingVisitor doesn't take the front face into account: + osg::Vec3Array *norm=geometry->getNormalArray(); + for (i=0;isize();i++) { + (*norm)[i] = - (*norm)[i]; + } + + geode->addDrawable(geometry); + parent->addChild(geode); +} + + void OSGVisitor::applyTextureCoordinate(TextureCoordinate *texc) { tcoord_active=texc; } diff --git a/src/osgPlugins/iv/osgvisitor.h b/src/osgPlugins/iv/osgvisitor.h index c97a7a2fe..87390c015 100644 --- a/src/osgPlugins/iv/osgvisitor.h +++ b/src/osgPlugins/iv/osgvisitor.h @@ -22,6 +22,7 @@ #include "mynodevisitor.h" #include +#include class OSGVisitor: public MyNodeVisitor { osg::Node *root; @@ -41,10 +42,13 @@ public: virtual void applyMatrixTransform(MatrixTransform *tr); virtual void applySeparator(Separator *sep); virtual void applyIndexedFaceSet(IndexedFaceSet *ifs); + virtual void applyIndexedTriStripSet(IndexedTriStripSet *its); virtual void applyTextureCoordinate(TextureCoordinate *texc); virtual void applyTexture2(Texture2 *tex); virtual void applyTransform(Transform *trans); osg::Node* getRoot(); +private: + void makeGeode(osg::Geode *geode, osg::Geometry *geometry, bool twoSided); }; #endif diff --git a/src/osgPlugins/iv/parser.cpp b/src/osgPlugins/iv/parser.cpp index ad53dbd38..7cdee2198 100644 --- a/src/osgPlugins/iv/parser.cpp +++ b/src/osgPlugins/iv/parser.cpp @@ -1,34 +1,34 @@ - -/* A Bison parser, made from parser.y - by GNU Bison version 1.28 */ +/* A Bison parser, made from parser.y + by GNU bison 1.35. */ #define YYBISON 1 /* Identify Bison output. */ -#define STRING 257 -#define QUOTED_STRING 258 -#define FLOAT 259 -#define INT 260 -#define SEPARATOR 261 -#define DEF 262 -#define UN_MATERIAL 263 -#define DIFFUSE_COLOR 264 -#define COORDINATE3 265 -#define INDEXED_FACE_SET 266 -#define A_POINT 267 -#define COORD_INDEX 268 -#define TEXTURE_COORD_INDEX 269 -#define NORMAL_INDEX 270 -#define TEXTURE_COORDINATE 271 -#define TEXTURE2 272 -#define MATRIX_TRANSFORM 273 -#define MATRIX 274 -#define LISTA_VACIA 275 -#define FINPOLY 276 -#define DOBLE_CARA 277 -#define VECTOR 278 -#define VRML_HEADER 279 -#define TRANSFORM 280 -#define USE 281 +# define STRING 257 +# define QUOTED_STRING 258 +# define FLOAT 259 +# define INT 260 +# define SEPARATOR 261 +# define DEF 262 +# define UN_MATERIAL 263 +# define DIFFUSE_COLOR 264 +# define COORDINATE3 265 +# define INDEXED_FACE_SET 266 +# define INDEXED_TRIANGLE_STRIP_SET 267 +# define A_POINT 268 +# define COORD_INDEX 269 +# define TEXTURE_COORD_INDEX 270 +# define NORMAL_INDEX 271 +# define TEXTURE_COORDINATE 272 +# define TEXTURE2 273 +# define MATRIX_TRANSFORM 274 +# define MATRIX 275 +# define LISTA_VACIA 276 +# define FINPOLY 277 +# define TWO_SIDED 278 +# define VECTOR 279 +# define VRML_HEADER 280 +# define TRANSFORM 281 +# define USE 282 #line 1 "parser.y" @@ -67,6 +67,7 @@ #include "separator.h" #include "matrixtransform.h" #include "indexedfaceset.h" +#include "indexedtristripset.h" #include "texturecoordinate.h" #include "texture2.h" #include "transform.h" @@ -74,6 +75,7 @@ #include "atrfloat.h" #include "atrstring.h" #include "atrvec.h" +#include "atrvec3list.h" #include "string.h" extern int yyline; extern int yylex(); @@ -81,7 +83,8 @@ void yyerror(char *str,...); static MyNode *root_node; -#line 52 "parser.y" +#line 54 "parser.y" +#ifndef YYSTYPE typedef union { char *s_value; float f_value; @@ -93,217 +96,259 @@ typedef union { PolygonList *plist; Matrix matrix; int i_value; -} YYSTYPE; +} yystype; +# define YYSTYPE yystype +# define YYSTYPE_IS_TRIVIAL 1 +#endif #ifndef YYDEBUG -#define YYDEBUG 1 -#endif - -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif +# define YYDEBUG 1 #endif -#define YYFINAL 120 +#define YYFINAL 140 #define YYFLAG -32768 -#define YYNTBASE 32 +#define YYNTBASE 33 -#define YYTRANSLATE(x) ((unsigned)(x) <= 281 ? yytranslate[x] : 41) +/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ +#define YYTRANSLATE(x) ((unsigned)(x) <= 282 ? yytranslate[x] : 42) -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 30, 2, 31, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 28, 2, 29, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27 +/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ +static const char yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 31, 2, 32, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 29, 2, 30, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28 }; -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 3, 8, 13, 21, 29, 41, 53, 62, 75, - 88, 94, 102, 107, 112, 117, 118, 121, 126, 129, - 133, 138, 143, 144, 147, 148, 151, 153, 170, 173, - 176, 180, 185, 191, 194, 198 +#if YYDEBUG +static const short yyprhs[] = +{ + 0, 0, 3, 8, 13, 21, 29, 41, 53, 62, + 75, 88, 96, 108, 120, 126, 134, 139, 144, 149, + 150, 153, 158, 161, 165, 170, 175, 176, 179, 180, + 183, 185, 202, 205, 208, 212, 217, 223, 226, 231, + 235 }; - -static const short yyrhs[] = { 25, - 33, 0, 9, 28, 34, 29, 0, 18, 28, 34, - 29, 0, 11, 28, 13, 30, 35, 31, 29, 0, - 12, 28, 14, 30, 36, 31, 29, 0, 12, 28, - 14, 30, 36, 31, 15, 30, 36, 31, 29, 0, - 12, 28, 14, 30, 36, 31, 16, 30, 36, 31, - 29, 0, 12, 28, 23, 14, 30, 36, 31, 29, - 0, 12, 28, 23, 14, 30, 36, 31, 15, 30, - 36, 31, 29, 0, 12, 28, 23, 14, 30, 36, - 31, 16, 30, 36, 31, 29, 0, 19, 28, 20, - 38, 29, 0, 17, 28, 13, 30, 40, 31, 29, - 0, 26, 28, 34, 29, 0, 3, 28, 34, 29, - 0, 7, 28, 34, 29, 0, 0, 34, 39, 0, - 34, 8, 3, 33, 0, 34, 33, 0, 34, 27, - 3, 0, 24, 30, 35, 31, 0, 35, 5, 5, - 5, 0, 0, 36, 37, 0, 0, 6, 37, 0, - 22, 0, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 0, 3, - 5, 0, 3, 3, 0, 3, 5, 5, 0, 3, - 5, 5, 5, 0, 3, 5, 5, 5, 5, 0, - 3, 4, 0, 40, 5, 5, 0, 0 +static const short yyrhs[] = +{ + 26, 34, 0, 9, 29, 35, 30, 0, 19, 29, + 35, 30, 0, 11, 29, 14, 31, 36, 32, 30, + 0, 12, 29, 15, 31, 37, 32, 30, 0, 12, + 29, 15, 31, 37, 32, 16, 31, 37, 32, 30, + 0, 12, 29, 15, 31, 37, 32, 17, 31, 37, + 32, 30, 0, 12, 29, 24, 15, 31, 37, 32, + 30, 0, 12, 29, 24, 15, 31, 37, 32, 16, + 31, 37, 32, 30, 0, 12, 29, 24, 15, 31, + 37, 32, 17, 31, 37, 32, 30, 0, 13, 29, + 15, 31, 37, 32, 30, 0, 13, 29, 15, 31, + 37, 32, 16, 31, 37, 32, 30, 0, 13, 29, + 15, 31, 37, 32, 17, 31, 37, 32, 30, 0, + 20, 29, 21, 39, 30, 0, 18, 29, 14, 31, + 41, 32, 30, 0, 27, 29, 35, 30, 0, 3, + 29, 35, 30, 0, 7, 29, 35, 30, 0, 0, + 35, 40, 0, 35, 8, 3, 34, 0, 35, 34, + 0, 35, 28, 3, 0, 25, 31, 36, 32, 0, + 36, 5, 5, 5, 0, 0, 37, 38, 0, 0, + 6, 38, 0, 23, 0, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 0, 3, 5, 0, 3, 3, 0, 3, 5, + 5, 0, 3, 5, 5, 5, 0, 3, 5, 5, + 5, 5, 0, 3, 4, 0, 3, 31, 36, 32, + 0, 41, 5, 5, 0, 0 }; #endif -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 92, 95, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 112, 113, 114, 115, 116, - 117, 120, 121, 124, 125, 128, 129, 132, 140, 141, - 142, 143, 144, 145, 148, 149 +#if YYDEBUG +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const short yyrline[] = +{ + 0, 94, 97, 99, 100, 101, 102, 103, 104, 105, + 106, 108, 109, 110, 111, 112, 113, 114, 115, 118, + 119, 120, 121, 122, 123, 126, 127, 130, 131, 134, + 135, 138, 146, 147, 148, 149, 150, 151, 152, 155, + 156 }; #endif -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) +#if (YYDEBUG) || defined YYERROR_VERBOSE -static const char * const yytname[] = { "$","error","$undefined.","STRING", -"QUOTED_STRING","FLOAT","INT","SEPARATOR","DEF","UN_MATERIAL","DIFFUSE_COLOR", -"COORDINATE3","INDEXED_FACE_SET","A_POINT","COORD_INDEX","TEXTURE_COORD_INDEX", -"NORMAL_INDEX","TEXTURE_COORDINATE","TEXTURE2","MATRIX_TRANSFORM","MATRIX","LISTA_VACIA", -"FINPOLY","DOBLE_CARA","VECTOR","VRML_HEADER","TRANSFORM","USE","'{'","'}'", -"'['","']'","vrml_file","node","node_contents","points","polylist","vertexilist", -"matrix","attr","coords", NULL +/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ +static const char *const yytname[] = +{ + "$", "error", "$undefined.", "STRING", "QUOTED_STRING", "FLOAT", "INT", + "SEPARATOR", "DEF", "UN_MATERIAL", "DIFFUSE_COLOR", "COORDINATE3", + "INDEXED_FACE_SET", "INDEXED_TRIANGLE_STRIP_SET", "A_POINT", + "COORD_INDEX", "TEXTURE_COORD_INDEX", "NORMAL_INDEX", + "TEXTURE_COORDINATE", "TEXTURE2", "MATRIX_TRANSFORM", "MATRIX", + "LISTA_VACIA", "FINPOLY", "TWO_SIDED", "VECTOR", "VRML_HEADER", + "TRANSFORM", "USE", "'{'", "'}'", "'['", "']'", "vrml_file", "node", + "node_contents", "points", "polylist", "vertexilist", "matrix", "attr", + "coords", 0 }; #endif -static const short yyr1[] = { 0, - 32, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, - 34, 35, 35, 36, 36, 37, 37, 38, 39, 39, - 39, 39, 39, 39, 40, 40 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const short yyr1[] = +{ + 0, 33, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, + 35, 35, 35, 35, 35, 36, 36, 37, 37, 38, + 38, 39, 40, 40, 40, 40, 40, 40, 40, 41, + 41 }; -static const short yyr2[] = { 0, - 2, 4, 4, 7, 7, 11, 11, 8, 12, 12, - 5, 7, 4, 4, 4, 0, 2, 4, 2, 3, - 4, 4, 0, 2, 0, 2, 1, 16, 2, 2, - 3, 4, 5, 2, 3, 0 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const short yyr2[] = +{ + 0, 2, 4, 4, 7, 7, 11, 11, 8, 12, + 12, 7, 11, 11, 5, 7, 4, 4, 4, 0, + 2, 4, 2, 3, 4, 4, 0, 2, 0, 2, + 1, 16, 2, 2, 3, 4, 5, 2, 4, 3, + 0 }; -static const short yydefact[] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 16, 16, 16, 0, 0, 0, 16, 0, 16, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 23, 0, 0, 0, 14, 19, 17, 15, 2, - 23, 25, 0, 36, 3, 0, 0, 13, 0, 30, - 34, 29, 0, 20, 0, 0, 25, 0, 0, 11, - 0, 21, 31, 18, 0, 0, 27, 0, 24, 0, - 0, 0, 0, 0, 32, 4, 26, 0, 0, 5, - 0, 35, 12, 0, 22, 33, 25, 25, 0, 0, - 8, 0, 0, 0, 25, 25, 0, 0, 0, 0, - 0, 0, 6, 7, 0, 0, 0, 9, 10, 0, - 0, 0, 0, 0, 0, 0, 28, 0, 0, 0 +/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE + doesn't specify something else to do. Zero means the default is an + error. */ +static const short yydefact[] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 19, 19, 19, 0, 0, 0, 0, + 19, 0, 19, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 26, 0, 0, 0, 17, + 22, 20, 18, 2, 26, 28, 0, 28, 40, 3, + 0, 0, 16, 0, 33, 37, 32, 26, 0, 23, + 0, 0, 28, 0, 0, 0, 14, 0, 24, 34, + 0, 21, 0, 0, 30, 0, 27, 0, 0, 0, + 0, 0, 0, 35, 38, 4, 29, 0, 0, 5, + 0, 0, 0, 11, 39, 15, 0, 25, 36, 28, + 28, 0, 0, 8, 28, 28, 0, 0, 0, 28, + 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 7, 0, 0, 12, 13, 0, 9, 10, + 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, + 0 }; -static const short yydefgoto[] = { 118, - 37, 22, 49, 56, 69, 47, 38, 58 +static const short yydefgoto[] = +{ + 138, 40, 24, 53, 61, 76, 51, 41, 64 }; -static const short yypact[] = { -20, - 121, -22, 2, 16, 23, 25, 33, 43, 44, 45, --32768, 1, 1, 1, 35, 20, 62, 1, 13, 1, - 46, 0, 38, 51, 56, 59, 67, 84, 76, 116, - 89,-32768, 10, 119, 120,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 101,-32768,-32768, 132, 112,-32768, -3,-32768, --32768, 137, 121,-32768, 5, 60,-32768, 11, 138,-32768, - 139,-32768, 140,-32768, 117, -2,-32768, 6,-32768, 68, - 143, 122, 144, 145, 147,-32768,-32768, 123, 124,-32768, - 8,-32768,-32768, 150,-32768,-32768,-32768,-32768, 126, 127, --32768, 153, 98, 103,-32768,-32768, 154, 131, 133, 104, - 105, 156,-32768,-32768, 134, 135, 160,-32768,-32768, 161, - 162, 163, 164, 165, 166, 167,-32768, 173, 174,-32768 +static const short yypact[] = +{ + -16, 157, -8, -2, 12, 13, 15, 21, 22, 32, + 38, 44,-32768, 53, 53, 53, 31, 25, 59, 65, + 53, 68, 53, 62, 5, 57, 83, 66, 73, 91, + 88, 94, 109, 102, 135,-32768, 0, 120, 123,-32768, + -32768,-32768,-32768,-32768,-32768,-32768, 99,-32768,-32768,-32768, + 128, 104,-32768, -4,-32768,-32768, 130,-32768, 157,-32768, + 2, 14,-32768, 16, 4, 136,-32768, 144,-32768, 145, + 6,-32768, 110, 20,-32768, 115,-32768, 24, 141, 146, + 122, 151, 154, 162,-32768,-32768,-32768, 143, 147,-32768, + 156, 150, 152,-32768,-32768,-32768, 177,-32768,-32768,-32768, + -32768, 158, 159,-32768,-32768,-32768, 183, 48, 49,-32768, + -32768, 76, 77, 186, 131, 163, 82, 92, 164, 166, + 187,-32768,-32768, 167, 168,-32768,-32768, 190,-32768,-32768, + 194, 195, 196, 197, 198, 199, 200,-32768, 206, 207, + -32768 }; -static const short yypgoto[] = {-32768, - -1, 99, 136, -56, 109,-32768,-32768,-32768 +static const short yypgoto[] = +{ + -32768, 1, 165, -38, -47, 137,-32768,-32768,-32768 }; -#define YYLAST 177 +#define YYLAST 210 -static const short yytable[] = { 11, - 70, 61, 33, 66, 1, 12, 3, 34, 4, 61, - 5, 6, 50, 51, 52, 71, 7, 8, 9, 67, - 78, 79, 89, 90, 21, 10, 35, 62, 36, 13, - 93, 94, 30, 26, 80, 65, 91, 12, 100, 101, - 33, 72, 27, 14, 3, 34, 4, 25, 5, 6, - 15, 64, 16, 33, 7, 8, 9, 3, 34, 4, - 17, 5, 6, 10, 35, 66, 39, 7, 8, 9, - 18, 19, 20, 66, 28, 32, 10, 35, 33, 40, - 43, 67, 3, 34, 4, 41, 5, 6, 42, 67, - 68, 33, 7, 8, 9, 3, 34, 4, 81, 5, - 6, 10, 35, 66, 45, 7, 8, 9, 66, 66, - 66, 23, 24, 44, 10, 35, 29, 48, 31, 67, - 46, 53, 54, 2, 67, 67, 67, 3, 98, 4, - 57, 5, 6, 99, 105, 106, 59, 7, 8, 9, - 60, 63, 73, 74, 75, 76, 10, 82, 84, 85, - 83, 86, 87, 88, 92, 95, 96, 97, 102, 103, - 107, 104, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 119, 120, 77, 0, 55 +static const short yytable[] = +{ + 63, 67, 12, 54, 55, 56, 60, 67, 36, 79, + 1, 67, 3, 37, 4, 77, 5, 6, 7, 70, + 73, 13, 73, 8, 9, 10, 73, 14, 68, 13, + 73, 57, 11, 38, 72, 39, 80, 74, 84, 74, + 28, 15, 16, 74, 17, 27, 75, 74, 78, 29, + 18, 19, 107, 108, 73, 73, 90, 111, 112, 71, + 36, 20, 116, 117, 3, 37, 4, 21, 5, 6, + 7, 74, 74, 22, 30, 8, 9, 10, 23, 31, + 114, 115, 73, 73, 11, 38, 36, 42, 73, 33, + 3, 37, 4, 35, 5, 6, 7, 44, 73, 74, + 74, 8, 9, 10, 45, 74, 46, 50, 118, 119, + 11, 38, 36, 43, 123, 74, 3, 37, 4, 47, + 5, 6, 7, 58, 124, 48, 59, 8, 9, 10, + 62, 87, 88, 65, 66, 69, 11, 38, 36, 49, + 85, 81, 3, 37, 4, 89, 5, 6, 7, 82, + 83, 94, 95, 8, 9, 10, 96, 91, 92, 97, + 2, 121, 11, 38, 3, 52, 4, 98, 5, 6, + 7, 93, 101, 102, 99, 8, 9, 10, 100, 25, + 26, 104, 106, 105, 11, 32, 103, 34, 113, 109, + 110, 120, 127, 122, 125, 130, 126, 128, 129, 131, + 132, 133, 134, 135, 136, 137, 139, 140, 0, 0, + 86 }; -static const short yycheck[] = { 1, - 57, 5, 3, 6, 25, 28, 7, 8, 9, 5, - 11, 12, 3, 4, 5, 5, 17, 18, 19, 22, - 15, 16, 15, 16, 24, 26, 27, 31, 29, 28, - 87, 88, 20, 14, 29, 31, 29, 28, 95, 96, - 3, 31, 23, 28, 7, 8, 9, 13, 11, 12, - 28, 53, 28, 3, 17, 18, 19, 7, 8, 9, - 28, 11, 12, 26, 27, 6, 29, 17, 18, 19, - 28, 28, 28, 6, 13, 30, 26, 27, 3, 29, - 14, 22, 7, 8, 9, 30, 11, 12, 30, 22, - 31, 3, 17, 18, 19, 7, 8, 9, 31, 11, - 12, 26, 27, 6, 29, 17, 18, 19, 6, 6, - 6, 13, 14, 30, 26, 27, 18, 29, 20, 22, - 5, 3, 3, 3, 22, 22, 22, 7, 31, 9, - 30, 11, 12, 31, 31, 31, 5, 17, 18, 19, - 29, 5, 5, 5, 5, 29, 26, 5, 5, 5, - 29, 5, 30, 30, 5, 30, 30, 5, 5, 29, - 5, 29, 29, 29, 5, 5, 5, 5, 5, 5, - 5, 5, 0, 0, 66, -1, 41 +static const short yycheck[] = +{ + 47, 5, 1, 3, 4, 5, 44, 5, 3, 5, + 26, 5, 7, 8, 9, 62, 11, 12, 13, 57, + 6, 29, 6, 18, 19, 20, 6, 29, 32, 29, + 6, 31, 27, 28, 32, 30, 32, 23, 32, 23, + 15, 29, 29, 23, 29, 14, 32, 23, 32, 24, + 29, 29, 99, 100, 6, 6, 32, 104, 105, 58, + 3, 29, 109, 110, 7, 8, 9, 29, 11, 12, + 13, 23, 23, 29, 15, 18, 19, 20, 25, 14, + 32, 32, 6, 6, 27, 28, 3, 30, 6, 21, + 7, 8, 9, 31, 11, 12, 13, 31, 6, 23, + 23, 18, 19, 20, 31, 23, 15, 5, 32, 32, + 27, 28, 3, 30, 32, 23, 7, 8, 9, 31, + 11, 12, 13, 3, 32, 31, 3, 18, 19, 20, + 31, 16, 17, 5, 30, 5, 27, 28, 3, 30, + 30, 5, 7, 8, 9, 30, 11, 12, 13, 5, + 5, 5, 30, 18, 19, 20, 5, 16, 17, 5, + 3, 30, 27, 28, 7, 30, 9, 5, 11, 12, + 13, 30, 16, 17, 31, 18, 19, 20, 31, 14, + 15, 31, 5, 31, 27, 20, 30, 22, 5, 31, + 31, 5, 5, 30, 30, 5, 30, 30, 30, 5, + 5, 5, 5, 5, 5, 5, 0, 0, -1, -1, + 73 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/lib/bison.simple" -/* This file comes from bison-1.28. */ +#line 3 "/usr/share/bison/bison.simple" /* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software + Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -325,62 +370,131 @@ static const short yycheck[] = { 1, This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ +/* This is the parser code that is written into each bison parser when + the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA -#include -#else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ -#include -#endif -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include */ - #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#endif /* __hpux */ -#endif -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# if YYSTACK_USE_ALLOCA +# define YYSTACK_ALLOC alloca +# else +# ifndef YYSTACK_USE_ALLOCA +# if defined (alloca) || defined (_ALLOCA_H) +# define YYSTACK_ALLOC alloca +# else +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# else +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +# define YYSTACK_ALLOC malloc +# define YYSTACK_FREE free +# endif +#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ + + +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short yyss; + YYSTYPE yyvs; +# if YYLSP_NEEDED + YYLTYPE yyls; +# endif +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# if YYLSP_NEEDED +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAX) +# else +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAX) +# endif + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + register YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc #endif -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) @@ -389,131 +503,161 @@ static const short yycheck[] = { 1, #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ +#define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ + { \ + yychar = (Token); \ + yylval = (Value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ + { \ + yyerror ("syntax error: cannot back up"); \ + YYERROR; \ + } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 -#ifndef YYPURE -#define YYLEX yylex() + +/* YYLLOC_DEFAULT -- Compute the default location (before the actions + are run). + + When YYLLOC_DEFAULT is run, CURRENT is set the location of the + first token. By default, to implement support for ranges, extend + its range to the last symbol. */ + +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + Current.last_line = Rhs[N].last_line; \ + Current.last_column = Rhs[N].last_column; #endif -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif -/* If nonreentrant, generate the variables here */ +/* YYLEX -- calling `yylex' with the right arguments. */ -#ifndef YYPURE +#if YYPURE +# if YYLSP_NEEDED +# ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) +# else +# define YYLEX yylex (&yylval, &yylloc) +# endif +# else /* !YYLSP_NEEDED */ +# ifdef YYLEX_PARAM +# define YYLEX yylex (&yylval, YYLEX_PARAM) +# else +# define YYLEX yylex (&yylval) +# endif +# endif /* !YYLSP_NEEDED */ +#else /* !YYPURE */ +# define YYLEX yylex () +#endif /* !YYPURE */ -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif +/* Enable debugging if requested. */ +#if YYDEBUG -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +#endif /* !YYDEBUG */ +/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -#define YYINITDEPTH 200 +# define YYINITDEPTH 200 #endif -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ #if YYMAXDEPTH == 0 -#undef YYMAXDEPTH +# undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 +# define YYMAXDEPTH 10000 #endif -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ +#ifdef YYERROR_VERBOSE -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - unsigned int count; +# ifndef yystrlen +# if defined (__GLIBC__) && defined (_STRING_H) +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +# if defined (__STDC__) || defined (__cplusplus) +yystrlen (const char *yystr) +# else +yystrlen (yystr) + const char *yystr; +# endif { - register char *f = from; - register char *t = to; - register int i = count; + register const char *yys = yystr; - while (i-- > 0) - *t++ = *f++; + while (*yys++ != '\0') + continue; + + return yys - yystr - 1; } +# endif +# endif -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, unsigned int count) +# ifndef yystpcpy +# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +# if defined (__STDC__) || defined (__cplusplus) +yystpcpy (char *yydest, const char *yysrc) +# else +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +# endif { - register char *t = to; - register char *f = from; - register int i = count; + register char *yyd = yydest; + register const char *yys = yysrc; - while (i-- > 0) - *t++ = *f++; + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; } - -#endif +# endif +# endif #endif -#line 217 "/usr/lib/bison.simple" +#line 315 "/usr/share/bison/bison.simple" + /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. @@ -522,76 +666,121 @@ __yy_memcpy (char *to, char *from, unsigned int count) to the proper pointer type. */ #ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ +# if defined (__STDC__) || defined (__cplusplus) +# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +# define YYPARSE_PARAM_DECL +# else +# define YYPARSE_PARAM_ARG YYPARSE_PARAM +# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +# endif +#else /* !YYPARSE_PARAM */ +# define YYPARSE_PARAM_ARG +# define YYPARSE_PARAM_DECL +#endif /* !YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ -#ifdef YYPARSE_PARAM +# ifdef YYPARSE_PARAM int yyparse (void *); -#else +# else int yyparse (void); +# endif #endif + +/* YY_DECL_VARIABLES -- depending whether we use a pure parser, + variables are global, or local to YYPARSE. */ + +#define YY_DECL_NON_LSP_VARIABLES \ +/* The lookahead symbol. */ \ +int yychar; \ + \ +/* The semantic value of the lookahead symbol. */ \ +YYSTYPE yylval; \ + \ +/* Number of parse errors so far. */ \ +int yynerrs; + +#if YYLSP_NEEDED +# define YY_DECL_VARIABLES \ +YY_DECL_NON_LSP_VARIABLES \ + \ +/* Location data for the lookahead symbol. */ \ +YYLTYPE yylloc; +#else +# define YY_DECL_VARIABLES \ +YY_DECL_NON_LSP_VARIABLES #endif + +/* If nonreentrant, generate the variables here. */ + +#if !YYPURE +YY_DECL_VARIABLES +#endif /* !YYPURE */ + int -yyparse(YYPARSE_PARAM_ARG) +yyparse (YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { + /* If reentrant, generate the variables here. */ +#if YYPURE + YY_DECL_VARIABLES +#endif /* !YYPURE */ + register int yystate; register int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Lookahead token as an internal (translated) token number. */ + int yychar1 = 0; + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + short yyssa[YYINITDEPTH]; + short *yyss = yyssa; register short *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ +#if YYLSP_NEEDED + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; +#endif -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#if YYLSP_NEEDED +# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else -#define YYPOPSTACK (yyvsp--, yyssp--) +# define YYPOPSTACK (yyvsp--, yyssp--) #endif - int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; + YYSIZE_T yystacksize = YYINITDEPTH; -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; +#if YYLSP_NEEDED + YYLTYPE yyloc; #endif - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - + /* When reducing, the number of symbols on the RHS of the reduced + rule. */ int yylen; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; @@ -603,110 +792,110 @@ yyparse(YYPARSE_PARAM_ARG) so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss - 1; + yyssp = yyss; yyvsp = yyvs; -#ifdef YYLSP_NEEDED +#if YYLSP_NEEDED yylsp = yyls; #endif + goto yysetstate; -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. + */ + yyssp++; - *++yyssp = yystate; + yysetstate: + *yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; + YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. */ +# if YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow ("parser stack overflow", + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); + yyls = yyls1; +# else + yyoverflow ("parser stack overflow", + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); +# endif + yyss = yyss1; + yyvs = yyvs1; + } #else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyoverflowlab; +# else /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 2; - } + goto yyoverflowlab; yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); -#endif + + { + short *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyoverflowlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); +# if YYLSP_NEEDED + YYSTACK_RELOCATE (yyls); +# endif +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif #endif /* no yyoverflow */ - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; +#if YYLSP_NEEDED + yylsp = yyls + yysize - 1; #endif -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); if (yyssp >= yyss + yystacksize - 1) YYABORT; } -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; - yybackup: + + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ @@ -725,10 +914,7 @@ yynewstate: if (yychar == YYEMPTY) { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif + YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } @@ -739,25 +925,25 @@ yynewstate: yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif + YYDPRINTF ((stderr, "Now at end of input.\n")); } else { - yychar1 = YYTRANSLATE(yychar); + yychar1 = YYTRANSLATE (yychar); -#if YYDEBUG != 0 +#if YYDEBUG + /* We have to keep this `#if YYDEBUG', since we use variables + which are defined only if `YYDEBUG' is set. */ if (yydebug) { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT + YYFPRINTF (stderr, "Next token is %d (%s", + yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise + meaning of a token, for further debugging info. */ +# ifdef YYPRINT YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); +# endif + YYFPRINTF (stderr, ")\n"); } #endif } @@ -789,246 +975,270 @@ yynewstate: YYACCEPT; /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif + YYDPRINTF ((stderr, "Shifting token %d (%s), ", + yychar, yytname[yychar1])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; -#ifdef YYLSP_NEEDED +#if YYLSP_NEEDED *++yylsp = yylloc; #endif - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; yystate = yyn; goto yynewstate; -/* Do the default action for the current state. */ -yydefault: +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; + goto yyreduce; -/* Do a reduction. yyn is the number of a rule to reduce with. */ + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ yyreduce: + /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ -#if YYDEBUG != 0 - if (yydebug) - { - int i; + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); + Otherwise, the following line sets YYVAL to the semantic value of + the lookahead token. This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } +#if YYLSP_NEEDED + /* Similarly for the default location. Let the user run additional + commands if for instance locations are ranges. */ + yyloc = yylsp[1-yylen]; + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); #endif +#if YYDEBUG + /* We have to keep this `#if YYDEBUG', since we use variables which + are defined only if `YYDEBUG' is set. */ + if (yydebug) + { + int yyi; + + YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif switch (yyn) { case 1: -#line 92 "parser.y" +#line 94 "parser.y" { root_node=yyvsp[0].nodo; ; break;} case 2: -#line 96 "parser.y" +#line 98 "parser.y" { yyval.nodo=new Material(yyvsp[-1].nodo); delete yyvsp[-1].nodo;; break;} case 3: -#line 97 "parser.y" +#line 99 "parser.y" { yyval.nodo=new Texture2(yyvsp[-1].nodo); delete yyvsp[-1].nodo;; break;} case 4: -#line 98 "parser.y" +#line 100 "parser.y" { yyval.nodo=new Coordinate3(yyvsp[-2].vlist); delete yyvsp[-2].vlist; ; break;} case 5: -#line 99 "parser.y" +#line 101 "parser.y" {yyval.nodo=new IndexedFaceSet(yyvsp[-2].plist); delete yyvsp[-2].plist; ; break;} case 6: -#line 100 "parser.y" +#line 102 "parser.y" {yyval.nodo=new IndexedFaceSet(yyvsp[-6].plist,yyvsp[-2].plist); delete yyvsp[-6].plist; delete yyvsp[-2].plist; ; break;} case 7: -#line 101 "parser.y" +#line 103 "parser.y" {yyval.nodo=new IndexedFaceSet(yyvsp[-6].plist); delete yyvsp[-6].plist; delete yyvsp[-2].plist; ; break;} case 8: -#line 102 "parser.y" +#line 104 "parser.y" {yyval.nodo=new IndexedFaceSet(yyvsp[-2].plist); delete yyvsp[-2].plist; yyval.nodo->setTwoSided(); ; break;} case 9: -#line 103 "parser.y" +#line 105 "parser.y" {yyval.nodo=new IndexedFaceSet(yyvsp[-6].plist,yyvsp[-2].plist); delete yyvsp[-6].plist; delete yyvsp[-2].plist; yyval.nodo->setTwoSided(); yyval.nodo->setTwoSided(); ; break;} case 10: -#line 104 "parser.y" +#line 106 "parser.y" {yyval.nodo=new IndexedFaceSet(yyvsp[-6].plist); delete yyvsp[-6].plist; delete yyvsp[-2].plist; yyval.nodo->setTwoSided(); ; break;} case 11: -#line 105 "parser.y" -{ yyval.nodo=new MatrixTransform(yyvsp[-1].matrix); ; +#line 108 "parser.y" +{yyval.nodo=new IndexedTriStripSet(yyvsp[-2].plist); delete yyvsp[-2].plist; ; break;} case 12: -#line 106 "parser.y" -{ yyval.nodo=new TextureCoordinate(yyvsp[-2].tcoord); delete yyvsp[-2].tcoord; ; +#line 109 "parser.y" +{yyval.nodo=new IndexedTriStripSet(yyvsp[-6].plist,yyvsp[-2].plist); delete yyvsp[-6].plist; delete yyvsp[-2].plist; ; break;} case 13: -#line 107 "parser.y" -{ yyval.nodo=new Transform(yyvsp[-1].nodo); delete yyvsp[-1].nodo; ; +#line 110 "parser.y" +{yyval.nodo=new IndexedTriStripSet(yyvsp[-6].plist); delete yyvsp[-6].plist; delete yyvsp[-2].plist; ; break;} case 14: -#line 108 "parser.y" -{ yyval.nodo=yyvsp[-1].nodo; ; +#line 111 "parser.y" +{ yyval.nodo=new MatrixTransform(yyvsp[-1].matrix); ; break;} case 15: -#line 109 "parser.y" -{yyval.nodo=new Separator(yyvsp[-1].nodo); delete yyvsp[-1].nodo; ; +#line 112 "parser.y" +{ yyval.nodo=new TextureCoordinate(yyvsp[-2].tcoord); delete yyvsp[-2].tcoord; ; break;} case 16: -#line 112 "parser.y" -{ yyval.nodo=new MyNode(); ; +#line 113 "parser.y" +{ yyval.nodo=new Transform(yyvsp[-1].nodo); delete yyvsp[-1].nodo; ; break;} case 17: -#line 113 "parser.y" -{ yyvsp[-1].nodo->addAttribute(yyvsp[0].attribute->getName(), yyvsp[0].attribute); yyval.nodo=yyvsp[-1].nodo; ; +#line 114 "parser.y" +{ yyval.nodo=yyvsp[-1].nodo; ; break;} case 18: -#line 114 "parser.y" -{ NodeCache::addNode(yyvsp[-1].s_value,yyvsp[0].nodo); yyvsp[-3].nodo->addChild(yyvsp[0].nodo); yyval.nodo=yyvsp[-3].nodo; ; +#line 115 "parser.y" +{yyval.nodo=new Separator(yyvsp[-1].nodo); delete yyvsp[-1].nodo; ; break;} case 19: -#line 115 "parser.y" -{ yyvsp[-1].nodo->addChild(yyvsp[0].nodo); yyval.nodo=yyvsp[-1].nodo; ; +#line 118 "parser.y" +{ yyval.nodo=new MyNode(); ; break;} case 20: -#line 116 "parser.y" -{yyvsp[-2].nodo->addChild(NodeCache::getNode(yyvsp[0].s_value)); yyval.nodo=yyvsp[-2].nodo; ; +#line 119 "parser.y" +{ yyvsp[-1].nodo->addAttribute(yyvsp[0].attribute->getName(), yyvsp[0].attribute); yyval.nodo=yyvsp[-1].nodo; ; break;} case 21: -#line 117 "parser.y" -{ delete yyvsp[-1].vlist;yyval.nodo=new MyNode(); ; +#line 120 "parser.y" +{ NodeCache::addNode(yyvsp[-1].s_value,yyvsp[0].nodo); yyvsp[-3].nodo->addChild(yyvsp[0].nodo); yyval.nodo=yyvsp[-3].nodo; ; break;} case 22: -#line 120 "parser.y" -{ yyvsp[-3].vlist->push_back(osg::Vec3(yyvsp[-2].f_value,yyvsp[-1].f_value,yyvsp[0].f_value)); yyval.vlist=yyvsp[-3].vlist; ; +#line 121 "parser.y" +{ yyvsp[-1].nodo->addChild(yyvsp[0].nodo); yyval.nodo=yyvsp[-1].nodo; ; break;} case 23: -#line 121 "parser.y" -{ yyval.vlist=new VertexList(); ; +#line 122 "parser.y" +{yyvsp[-2].nodo->addChild(NodeCache::getNode(yyvsp[0].s_value)); yyval.nodo=yyvsp[-2].nodo; ; break;} case 24: -#line 124 "parser.y" -{ yyvsp[-1].plist->push_back(yyvsp[0].vindex);yyval.plist=yyvsp[-1].plist; ; +#line 123 "parser.y" +{ delete yyvsp[-1].vlist;yyval.nodo=new MyNode(); ; break;} case 25: -#line 125 "parser.y" -{ yyval.plist=new PolygonList(); ; +#line 126 "parser.y" +{ yyvsp[-3].vlist->push_back(osg::Vec3(yyvsp[-2].f_value,yyvsp[-1].f_value,yyvsp[0].f_value)); yyval.vlist=yyvsp[-3].vlist; ; break;} case 26: -#line 128 "parser.y" -{ yyvsp[0].vindex->push_back(yyvsp[-1].i_value);yyval.vindex=yyvsp[0].vindex; ; +#line 127 "parser.y" +{ yyval.vlist=new VertexList(); ; break;} case 27: -#line 129 "parser.y" -{ yyval.vindex=new VertexIndexList(); ; +#line 130 "parser.y" +{ yyvsp[-1].plist->push_back(yyvsp[0].vindex);yyval.plist=yyvsp[-1].plist; ; break;} case 28: -#line 136 "parser.y" -{Matrix m; m[0]=yyvsp[-15].f_value; m[1]=yyvsp[-14].f_value; m[2]=yyvsp[-13].f_value;m[3]=yyvsp[-12].f_value;m[4]=yyvsp[-11].f_value;m[5]=yyvsp[-10].f_value;m[6]=yyvsp[-9].f_value;m[7]=yyvsp[-8].f_value;m[8]=yyvsp[-7].f_value;m[9]=yyvsp[-6].f_value;m[10]=yyvsp[-5].f_value;m[11]=yyvsp[-4].f_value;m[12]=yyvsp[-3].f_value;m[13]=yyvsp[-2].f_value;m[14]=yyvsp[-1].f_value;m[15]=yyvsp[0].f_value; memcpy(yyval.matrix,m,sizeof(m));; +#line 131 "parser.y" +{ yyval.plist=new PolygonList(); ; break;} case 29: -#line 140 "parser.y" -{ yyval.attribute=new AtrFloat(yyvsp[-1].s_value,yyvsp[0].f_value); ; +#line 134 "parser.y" +{ yyvsp[0].vindex->push_back(yyvsp[-1].i_value);yyval.vindex=yyvsp[0].vindex; ; break;} case 30: -#line 141 "parser.y" -{ yyval.attribute=new AtrString(yyvsp[-1].s_value,yyvsp[0].s_value); ; +#line 135 "parser.y" +{ yyval.vindex=new VertexIndexList(); ; break;} case 31: #line 142 "parser.y" -{ yyval.attribute=new AtrVec(yyvsp[-2].s_value,yyvsp[-1].f_value,yyvsp[0].f_value); ; +{Matrix m; m[0]=yyvsp[-15].f_value; m[1]=yyvsp[-14].f_value; m[2]=yyvsp[-13].f_value;m[3]=yyvsp[-12].f_value;m[4]=yyvsp[-11].f_value;m[5]=yyvsp[-10].f_value;m[6]=yyvsp[-9].f_value;m[7]=yyvsp[-8].f_value;m[8]=yyvsp[-7].f_value;m[9]=yyvsp[-6].f_value;m[10]=yyvsp[-5].f_value;m[11]=yyvsp[-4].f_value;m[12]=yyvsp[-3].f_value;m[13]=yyvsp[-2].f_value;m[14]=yyvsp[-1].f_value;m[15]=yyvsp[0].f_value; memcpy(yyval.matrix,m,sizeof(m));; break;} case 32: -#line 143 "parser.y" -{ yyval.attribute=new AtrVec(yyvsp[-3].s_value,yyvsp[-2].f_value,yyvsp[-1].f_value,yyvsp[0].f_value); ; +#line 146 "parser.y" +{ yyval.attribute=new AtrFloat(yyvsp[-1].s_value,yyvsp[0].f_value); ; break;} case 33: -#line 144 "parser.y" -{ yyval.attribute=new AtrVec(yyvsp[-4].s_value,yyvsp[-3].f_value,yyvsp[-2].f_value,yyvsp[-1].f_value,yyvsp[0].f_value); ; - break;} -case 34: -#line 145 "parser.y" +#line 147 "parser.y" { yyval.attribute=new AtrString(yyvsp[-1].s_value,yyvsp[0].s_value); ; break;} -case 35: +case 34: #line 148 "parser.y" -{ yyvsp[-2].tcoord->push_back(TextureCoordVal(yyvsp[-1].f_value,yyvsp[0].f_value));yyval.tcoord=yyvsp[-2].tcoord; ; +{ yyval.attribute=new AtrVec(yyvsp[-2].s_value,yyvsp[-1].f_value,yyvsp[0].f_value); ; + break;} +case 35: +#line 149 "parser.y" +{ yyval.attribute=new AtrVec(yyvsp[-3].s_value,yyvsp[-2].f_value,yyvsp[-1].f_value,yyvsp[0].f_value); ; break;} case 36: -#line 149 "parser.y" +#line 150 "parser.y" +{ yyval.attribute=new AtrVec(yyvsp[-4].s_value,yyvsp[-3].f_value,yyvsp[-2].f_value,yyvsp[-1].f_value,yyvsp[0].f_value); ; + break;} +case 37: +#line 151 "parser.y" +{ yyval.attribute=new AtrString(yyvsp[-1].s_value,yyvsp[0].s_value); ; + break;} +case 38: +#line 152 "parser.y" +{ yyval.attribute=new AtrVec3List(yyvsp[-3].s_value,yyvsp[-1].vlist); ; + break;} +case 39: +#line 155 "parser.y" +{ yyvsp[-2].tcoord->push_back(TextureCoordVal(yyvsp[-1].f_value,yyvsp[0].f_value));yyval.tcoord=yyvsp[-2].tcoord; ; + break;} +case 40: +#line 156 "parser.y" { yyval.tcoord=new TextureCoordList(); ; break;} } - /* the action file gets copied in in place of this dollarsign */ -#line 543 "/usr/lib/bison.simple" + +#line 705 "/usr/share/bison/bison.simple" + yyvsp -= yylen; yyssp -= yylen; -#ifdef YYLSP_NEEDED +#if YYLSP_NEEDED yylsp -= yylen; #endif -#if YYDEBUG != 0 +#if YYDEBUG if (yydebug) { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); + short *yyssp1 = yyss - 1; + YYFPRINTF (stderr, "state stack now"); + while (yyssp1 != yyssp) + YYFPRINTF (stderr, " %d", *++yyssp1); + YYFPRINTF (stderr, "\n"); } #endif *++yyvsp = yyval; - -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } +#if YYLSP_NEEDED + *++yylsp = yyloc; #endif - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ yyn = yyr1[yyn]; @@ -1040,10 +1250,13 @@ case 36: goto yynewstate; -yyerrlab: /* here on detecting error */ - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) { ++yynerrs; @@ -1052,102 +1265,121 @@ yyerrlab: /* here on detecting error */ if (yyn > YYFLAG && yyn < YYLAST) { - int size = 0; - char *msg; - int x, count; + YYSIZE_T yysize = 0; + char *yymsg; + int yyx, yycount; - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) + yycount = 0; + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + for (yyx = yyn < 0 ? -yyn : 0; + yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) + if (yycheck[yyx + yyn] == yyx) + yysize += yystrlen (yytname[yyx]) + 15, yycount++; + yysize += yystrlen ("parse error, unexpected ") + 1; + yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg != 0) { - strcpy(msg, "parse error"); + char *yyp = yystpcpy (yymsg, "parse error, unexpected "); + yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); - if (count < 5) + if (yycount < 5) { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) + yycount = 0; + for (yyx = yyn < 0 ? -yyn : 0; + yyx < (int) (sizeof (yytname) / sizeof (char *)); + yyx++) + if (yycheck[yyx + yyn] == yyx) { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; + const char *yyq = ! yycount ? ", expecting " : " or "; + yyp = yystpcpy (yyp, yyq); + yyp = yystpcpy (yyp, yytname[yyx]); + yycount++; } } - yyerror(msg); - free(msg); + yyerror (yymsg); + YYSTACK_FREE (yymsg); } else - yyerror ("parse error; also virtual memory exceeded"); + yyerror ("parse error; also virtual memory exhausted"); } else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); +#endif /* defined (YYERROR_VERBOSE) */ + yyerror ("parse error"); } - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ + +/*--------------------------------------------------. +| yyerrlab1 -- error raised explicitly by an action | +`--------------------------------------------------*/ +yyerrlab1: if (yyerrstatus == 3) { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - + YYDPRINTF ((stderr, "Discarding token %d (%s).\n", + yychar, yytname[yychar1])); yychar = YYEMPTY; } - /* Else will try to reuse lookahead token - after shifting the error token. */ + /* Else will try to reuse lookahead token after shifting the error + token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; -yyerrdefault: /* current state does not do anything special for the error token. */ +/*-------------------------------------------------------------------. +| yyerrdefault -- current state does not do anything special for the | +| error token. | +`-------------------------------------------------------------------*/ +yyerrdefault: #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; + + /* If its default is to accept any token, ok. Otherwise pop it. */ + yyn = yydefact[yystate]; + if (yyn) + goto yydefault; #endif -yyerrpop: /* pop the current state because it cannot handle the error token */ - if (yyssp == yyss) YYABORT; +/*---------------------------------------------------------------. +| yyerrpop -- pop the current state because it cannot handle the | +| error token | +`---------------------------------------------------------------*/ +yyerrpop: + if (yyssp == yyss) + YYABORT; yyvsp--; yystate = *--yyssp; -#ifdef YYLSP_NEEDED +#if YYLSP_NEEDED yylsp--; #endif -#if YYDEBUG != 0 +#if YYDEBUG if (yydebug) { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); + short *yyssp1 = yyss - 1; + YYFPRINTF (stderr, "Error: state stack now"); + while (yyssp1 != yyssp) + YYFPRINTF (stderr, " %d", *++yyssp1); + YYFPRINTF (stderr, "\n"); } #endif +/*--------------. +| yyerrhandle. | +`--------------*/ yyerrhandle: - yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; @@ -1170,44 +1402,47 @@ yyerrhandle: if (yyn == YYFINAL) YYACCEPT; -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); -#endif + YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; -#ifdef YYLSP_NEEDED +#if YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 0; - yyabortlab: - /* YYABORT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +/*---------------------------------------------. +| yyoverflowab -- parser overflow comes here. | +`---------------------------------------------*/ +yyoverflowlab: + yyerror ("parser stack overflow"); + yyresult = 2; + /* Fall through. */ + +yyreturn: +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); #endif - } - return 1; + return yyresult; } -#line 152 "parser.y" +#line 159 "parser.y" void yyerror(char *str,...) diff --git a/src/osgPlugins/iv/parser.hpp b/src/osgPlugins/iv/parser.hpp index 189d89e0f..b094be336 100644 --- a/src/osgPlugins/iv/parser.hpp +++ b/src/osgPlugins/iv/parser.hpp @@ -27,21 +27,22 @@ typedef union { # define DIFFUSE_COLOR 264 # define COORDINATE3 265 # define INDEXED_FACE_SET 266 -# define A_POINT 267 -# define COORD_INDEX 268 -# define TEXTURE_COORD_INDEX 269 -# define NORMAL_INDEX 270 -# define TEXTURE_COORDINATE 271 -# define TEXTURE2 272 -# define MATRIX_TRANSFORM 273 -# define MATRIX 274 -# define LISTA_VACIA 275 -# define FINPOLY 276 -# define DOBLE_CARA 277 -# define VECTOR 278 -# define VRML_HEADER 279 -# define TRANSFORM 280 -# define USE 281 +# define INDEXED_TRIANGLE_STRIP_SET 267 +# define A_POINT 268 +# define COORD_INDEX 269 +# define TEXTURE_COORD_INDEX 270 +# define NORMAL_INDEX 271 +# define TEXTURE_COORDINATE 272 +# define TEXTURE2 273 +# define MATRIX_TRANSFORM 274 +# define MATRIX 275 +# define LISTA_VACIA 276 +# define FINPOLY 277 +# define TWO_SIDED 278 +# define VECTOR 279 +# define VRML_HEADER 280 +# define TRANSFORM 281 +# define USE 282 extern YYSTYPE yylval; diff --git a/src/osgPlugins/iv/parser.y b/src/osgPlugins/iv/parser.y index a660f6a3f..579c5a915 100644 --- a/src/osgPlugins/iv/parser.y +++ b/src/osgPlugins/iv/parser.y @@ -34,6 +34,7 @@ #include "separator.h" #include "matrixtransform.h" #include "indexedfaceset.h" +#include "indexedtristripset.h" #include "texturecoordinate.h" #include "texture2.h" #include "transform.h" @@ -41,6 +42,7 @@ #include "atrfloat.h" #include "atrstring.h" #include "atrvec.h" +#include "atrvec3list.h" #include "string.h" extern int yyline; extern int yylex(); @@ -66,11 +68,11 @@ static MyNode *root_node; %token QUOTED_STRING %token FLOAT %token INT -%token SEPARATOR DEF UN_MATERIAL DIFFUSE_COLOR COORDINATE3 INDEXED_FACE_SET +%token SEPARATOR DEF UN_MATERIAL DIFFUSE_COLOR COORDINATE3 INDEXED_FACE_SET INDEXED_TRIANGLE_STRIP_SET %token A_POINT COORD_INDEX TEXTURE_COORD_INDEX NORMAL_INDEX TEXTURE_COORDINATE TEXTURE2 %token MATRIX_TRANSFORM MATRIX %token LISTA_VACIA FINPOLY -%token DOBLE_CARA +%token TWO_SIDED %token VECTOR %token VRML_HEADER %token TRANSFORM @@ -99,9 +101,13 @@ node: | INDEXED_FACE_SET '{' COORD_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($5); delete $5; } | INDEXED_FACE_SET '{' COORD_INDEX '[' polylist ']' TEXTURE_COORD_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($5,$9); delete $5; delete $9; } | INDEXED_FACE_SET '{' COORD_INDEX '[' polylist ']' NORMAL_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($5); delete $5; delete $9; } - | INDEXED_FACE_SET '{' DOBLE_CARA COORD_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($6); delete $6; $$->setTwoSided(); } - | INDEXED_FACE_SET '{' DOBLE_CARA COORD_INDEX '[' polylist ']' TEXTURE_COORD_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($6,$10); delete $6; delete $10; $$->setTwoSided(); $$->setTwoSided(); } - | INDEXED_FACE_SET '{' DOBLE_CARA COORD_INDEX '[' polylist ']' NORMAL_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($6); delete $6; delete $10; $$->setTwoSided(); } + | INDEXED_FACE_SET '{' TWO_SIDED COORD_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($6); delete $6; $$->setTwoSided(); } + | INDEXED_FACE_SET '{' TWO_SIDED COORD_INDEX '[' polylist ']' TEXTURE_COORD_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($6,$10); delete $6; delete $10; $$->setTwoSided(); $$->setTwoSided(); } + | INDEXED_FACE_SET '{' TWO_SIDED COORD_INDEX '[' polylist ']' NORMAL_INDEX '[' polylist ']' '}' {$$=new IndexedFaceSet($6); delete $6; delete $10; $$->setTwoSided(); } + + | INDEXED_TRIANGLE_STRIP_SET '{' COORD_INDEX '[' polylist ']' '}' {$$=new IndexedTriStripSet($5); delete $5; } + | INDEXED_TRIANGLE_STRIP_SET '{' COORD_INDEX '[' polylist ']' TEXTURE_COORD_INDEX '[' polylist ']' '}' {$$=new IndexedTriStripSet($5,$9); delete $5; delete $9; } + | INDEXED_TRIANGLE_STRIP_SET '{' COORD_INDEX '[' polylist ']' NORMAL_INDEX '[' polylist ']' '}' {$$=new IndexedTriStripSet($5); delete $5; delete $9; } | MATRIX_TRANSFORM '{' MATRIX matrix '}' { $$=new MatrixTransform($4); } | TEXTURE_COORDINATE '{' A_POINT '[' coords ']' '}' { $$=new TextureCoordinate($5); delete $5; } | TRANSFORM '{' node_contents '}' { $$=new Transform($3); delete $3; } @@ -143,6 +149,7 @@ attr: STRING FLOAT { $$=new AtrFloat($1,$2); } | STRING FLOAT FLOAT FLOAT { $$=new AtrVec($1,$2,$3,$4); } | STRING FLOAT FLOAT FLOAT FLOAT { $$=new AtrVec($1,$2,$3,$4,$5); } | STRING QUOTED_STRING { $$=new AtrString($1,$2); } + | STRING '[' points ']' { $$=new AtrVec3List($1,$3); } ; coords: coords FLOAT FLOAT { $1->push_back(TextureCoordVal($2,$3));$$=$1; } diff --git a/src/osgPlugins/iv/scanner.cpp b/src/osgPlugins/iv/scanner.cpp index 6f75ad309..c7e7bf9ae 100644 --- a/src/osgPlugins/iv/scanner.cpp +++ b/src/osgPlugins/iv/scanner.cpp @@ -286,36 +286,38 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 34 -#define YY_END_OF_BUFFER 35 -static yyconst short int yy_accept[232] = +#define YY_NUM_RULES 35 +#define YY_END_OF_BUFFER 36 +static yyconst short int yy_accept[254] = { 0, - 32, 32, 0, 0, 32, 32, 35, 34, 1, 2, - 1, 32, 34, 24, 32, 1, 32, 28, 32, 32, - 32, 32, 32, 32, 32, 30, 20, 32, 32, 32, - 32, 32, 32, 30, 34, 29, 0, 0, 32, 0, - 33, 24, 24, 24, 32, 28, 25, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 31, 32, 32, - 32, 32, 32, 32, 29, 19, 24, 24, 25, 32, - 0, 32, 32, 3, 32, 32, 32, 32, 32, 32, - 21, 32, 32, 32, 32, 32, 32, 24, 24, 0, - 32, 27, 27, 32, 32, 32, 32, 32, 32, 32, + 33, 33, 0, 0, 33, 33, 36, 35, 1, 2, + 1, 33, 35, 25, 33, 1, 33, 29, 33, 33, + 33, 33, 33, 33, 33, 31, 21, 33, 33, 33, + 33, 33, 33, 31, 35, 30, 0, 0, 33, 0, + 34, 25, 25, 25, 33, 29, 26, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 32, 33, 33, + 33, 33, 33, 33, 30, 20, 25, 25, 26, 33, + 0, 33, 33, 3, 33, 33, 33, 33, 33, 33, + 22, 33, 33, 33, 33, 33, 33, 25, 25, 0, + 33, 28, 28, 33, 33, 33, 33, 33, 33, 33, - 32, 32, 32, 32, 32, 32, 32, 24, 24, 26, - 26, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 14, 32, 32, 24, 24, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 13, 32, 32, 18, - 24, 24, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 24, 24, 32, 32, 32, 7, 32, - 32, 5, 32, 32, 32, 32, 32, 24, 24, 32, - 12, 32, 32, 6, 32, 10, 32, 32, 32, 24, - 24, 32, 32, 32, 32, 15, 32, 32, 24, 24, - 4, 32, 32, 32, 17, 32, 24, 24, 32, 32, + 33, 33, 33, 33, 33, 33, 33, 25, 25, 27, + 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 15, 33, 33, 25, 25, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 14, 33, 33, 19, + 25, 25, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 25, 25, 33, 33, 33, 7, 33, + 33, 5, 33, 33, 13, 33, 33, 33, 25, 25, + 33, 33, 33, 33, 6, 33, 11, 33, 33, 33, + 25, 25, 33, 33, 33, 33, 33, 16, 33, 33, + 25, 25, 4, 33, 33, 33, 33, 18, 33, 25, - 32, 32, 24, 24, 32, 32, 32, 32, 24, 24, - 8, 32, 32, 32, 24, 24, 11, 32, 32, 24, - 22, 32, 32, 24, 32, 16, 24, 9, 24, 23, - 0 + 25, 33, 33, 33, 33, 33, 25, 25, 33, 33, + 33, 33, 33, 25, 0, 25, 8, 33, 33, 33, + 33, 25, 0, 25, 33, 12, 33, 33, 25, 0, + 23, 33, 33, 33, 25, 0, 33, 33, 17, 25, + 0, 33, 10, 25, 0, 33, 24, 24, 33, 33, + 33, 9, 0 } ; static yyconst int yy_ec[256] = @@ -329,11 +331,11 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 9, 9, 19, 20, 21, 22, 9, 9, 23, 9, 9, 24, 25, 9, 9, 9, 9, 26, 27, 28, 29, 30, 9, 9, 9, 9, - 31, 1, 32, 1, 9, 1, 33, 34, 35, 36, + 31, 1, 32, 1, 9, 1, 33, 9, 34, 35, - 37, 38, 9, 9, 39, 9, 9, 40, 41, 42, - 43, 44, 9, 45, 46, 47, 48, 49, 9, 50, - 9, 9, 51, 1, 51, 1, 1, 1, 1, 1, + 36, 37, 38, 9, 39, 9, 9, 40, 41, 42, + 43, 44, 9, 45, 46, 47, 48, 49, 50, 51, + 9, 9, 52, 1, 52, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -350,392 +352,406 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[52] = +static yyconst int yy_meta[53] = { 0, - 1, 1, 2, 2, 3, 4, 1, 1, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 1, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 1 + 1, 1, 2, 3, 4, 5, 1, 1, 5, 1, + 1, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 4, 1, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 1 } ; -static yyconst short int yy_base[238] = +static yyconst short int yy_base[261] = { 0, - 0, 0, 50, 100, 151, 202, 181, 1353, 1353, 1353, - 52, 0, 173, 33, 64, 1353, 249, 59, 79, 114, - 94, 133, 136, 163, 165, 147, 1353, 180, 184, 213, - 215, 237, 246, 1353, 72, 221, 66, 145, 0, 168, - 1353, 0, 132, 146, 265, 100, 270, 287, 289, 299, - 303, 309, 318, 320, 322, 337, 342, 1353, 353, 356, - 369, 373, 375, 384, 377, 393, 116, 138, 406, 48, - 414, 419, 433, 435, 439, 444, 449, 454, 471, 477, - 483, 486, 492, 498, 507, 519, 521, 123, 126, 526, - 539, 544, 555, 569, 571, 573, 575, 585, 588, 590, + 0, 0, 51, 102, 154, 206, 236, 1405, 1405, 1405, + 53, 0, 227, 34, 65, 1405, 254, 59, 68, 81, + 84, 116, 132, 138, 119, 187, 1405, 135, 166, 187, + 189, 216, 218, 1405, 225, 247, 54, 183, 0, 205, + 1405, 0, 163, 178, 122, 87, 259, 276, 278, 222, + 220, 287, 291, 293, 297, 306, 310, 1405, 320, 333, + 337, 342, 347, 352, 373, 378, 154, 176, 385, 65, + 393, 398, 412, 366, 414, 417, 423, 427, 429, 446, + 433, 462, 473, 475, 477, 479, 489, 162, 172, 482, + 497, 507, 513, 527, 529, 532, 542, 538, 544, 548, - 604, 609, 621, 623, 626, 636, 638, 106, 142, 647, - 660, 666, 677, 680, 682, 693, 696, 709, 713, 725, - 728, 740, 744, 755, 757, 97, 113, 759, 761, 776, - 778, 790, 792, 809, 811, 814, 820, 824, 830, 844, - 97, 119, 847, 853, 857, 859, 863, 876, 887, 891, - 896, 907, 910, 88, 117, 920, 929, 939, 934, 948, - 951, 953, 963, 972, 984, 986, 995, 124, 114, 999, - 1014, 1018, 1027, 1029, 1041, 1046, 1050, 1060, 1062, 96, - 119, 1065, 1081, 1093, 1096, 1098, 1102, 1115, 107, 76, - 1117, 1130, 1132, 1145, 1149, 1159, 95, 60, 1161, 1172, + 559, 565, 580, 582, 596, 599, 601, 149, 185, 606, + 619, 633, 635, 644, 646, 648, 657, 663, 679, 685, + 690, 699, 712, 714, 718, 142, 157, 723, 727, 742, + 729, 761, 763, 766, 775, 772, 785, 799, 812, 814, + 141, 167, 818, 828, 823, 833, 852, 855, 867, 871, + 876, 886, 891, 136, 167, 888, 903, 908, 918, 924, + 920, 935, 937, 941, 939, 954, 956, 958, 172, 162, + 968, 971, 987, 990, 1002, 1004, 1006, 1017, 1023, 1033, + 145, 168, 1036, 1038, 1050, 1060, 1065, 1074, 1080, 1084, + 154, 134, 1089, 1094, 1103, 1113, 1117, 1122, 1127, 147, - 1178, 1181, 84, 59, 1183, 1194, 1200, 1205, 88, 52, - 1214, 1227, 1238, 1243, 46, 39, 1247, 1249, 1260, 30, - 0, 1270, 1279, 40, 1282, 1299, 35, 1303, 34, 0, - 1353, 1334, 1338, 55, 1342, 1346, 1348 + 106, 1133, 1136, 1150, 1155, 1160, 138, 105, 1165, 1171, + 1174, 1184, 1193, 131, 126, 91, 1203, 1208, 1212, 1217, + 1223, 77, 76, 62, 1232, 1236, 1251, 1255, 52, 47, + 0, 1264, 1266, 1268, 58, 57, 1270, 1287, 1283, 49, + 40, 1299, 1303, 37, 22, 1315, 0, 1405, 1318, 1320, + 1330, 1334, 1405, 1377, 1382, 55, 1387, 1392, 1394, 1399 } ; -static yyconst short int yy_def[238] = +static yyconst short int yy_def[261] = { 0, - 231, 1, 232, 232, 233, 233, 231, 231, 231, 231, - 231, 234, 235, 236, 237, 231, 237, 17, 237, 237, - 237, 237, 237, 237, 237, 231, 231, 237, 237, 237, - 237, 237, 237, 231, 231, 231, 231, 231, 234, 235, - 231, 236, 236, 236, 237, 17, 234, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 231, 237, 237, - 237, 237, 237, 237, 231, 231, 236, 236, 234, 234, - 231, 17, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 236, 236, 231, - 234, 231, 17, 237, 237, 237, 237, 237, 237, 237, + 253, 1, 254, 254, 255, 255, 253, 253, 253, 253, + 253, 256, 257, 258, 259, 253, 259, 17, 259, 259, + 259, 259, 259, 259, 259, 253, 253, 259, 259, 259, + 259, 259, 259, 253, 253, 253, 253, 253, 256, 257, + 253, 258, 258, 258, 259, 17, 256, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 253, 259, 259, + 259, 259, 259, 259, 253, 253, 258, 258, 256, 256, + 253, 17, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 258, 258, 253, + 256, 253, 17, 259, 259, 259, 259, 259, 259, 259, - 237, 237, 237, 237, 237, 237, 237, 236, 236, 231, - 234, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 236, 236, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, - 236, 236, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 237, 236, 236, 237, 237, 237, 237, 237, - 237, 237, 237, 237, 237, 237, 237, 236, 236, 237, - 237, 237, 237, 237, 237, 237, 237, 237, 237, 236, - 236, 237, 237, 237, 237, 237, 237, 237, 236, 236, - 237, 237, 237, 237, 237, 237, 236, 236, 237, 237, + 259, 259, 259, 259, 259, 259, 259, 258, 258, 253, + 256, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 258, 258, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 258, 258, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 258, 258, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 259, 259, 259, 258, 258, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 258, 258, 259, 259, 259, 259, 259, 259, 259, 259, + 258, 258, 259, 259, 259, 259, 259, 259, 259, 258, - 237, 237, 236, 236, 237, 237, 237, 237, 236, 236, - 237, 237, 237, 237, 236, 236, 237, 237, 237, 236, - 236, 237, 237, 236, 237, 237, 236, 237, 236, 236, - 0, 231, 231, 231, 231, 231, 231 + 258, 259, 259, 259, 259, 259, 260, 258, 259, 259, + 259, 259, 259, 258, 253, 258, 259, 259, 259, 259, + 259, 258, 253, 258, 259, 259, 259, 259, 258, 253, + 258, 259, 259, 259, 258, 253, 259, 259, 259, 258, + 253, 259, 259, 258, 253, 259, 258, 253, 259, 259, + 259, 259, 0, 253, 253, 253, 253, 253, 253, 253 } ; -static yyconst short int yy_nxt[1405] = +static yyconst short int yy_nxt[1458] = { 0, 8, 9, 10, 9, 11, 12, 13, 14, 15, 8, 16, 17, 12, 18, 18, 18, 18, 18, 19, 20, 15, 15, 21, 15, 22, 15, 23, 24, 25, 15, - 26, 27, 15, 15, 28, 15, 15, 15, 15, 15, + 26, 27, 15, 28, 15, 15, 15, 15, 15, 15, 29, 30, 15, 31, 15, 15, 32, 15, 33, 15, - 34, 9, 10, 9, 9, 43, 37, 90, 39, 91, - 16, 35, 44, 36, 36, 36, 36, 36, 37, 39, - 37, 47, 230, 229, 227, 224, 39, 221, 220, 48, - 34, 27, 38, 37, 39, 65, 66, 65, 65, 65, - 216, 39, 215, 210, 38, 48, 38, 209, 37, 39, + 15, 34, 9, 10, 9, 9, 43, 37, 37, 39, + 248, 16, 35, 44, 36, 36, 36, 36, 36, 37, + 39, 47, 37, 39, 90, 247, 91, 39, 245, 48, + 39, 34, 27, 38, 38, 37, 39, 244, 37, 39, + 241, 240, 236, 39, 48, 38, 39, 235, 38, 47, - 34, 9, 10, 9, 9, 204, 39, 203, 198, 38, - 16, 35, 47, 36, 36, 36, 36, 36, 37, 39, - 48, 49, 197, 190, 38, 189, 39, 181, 180, 169, - 34, 27, 168, 155, 50, 52, 48, 37, 39, 154, - 37, 39, 142, 141, 38, 39, 127, 126, 39, 109, - 34, 8, 8, 8, 8, 8, 51, 8, 8, 108, - 8, 8, 89, 38, 88, 53, 38, 37, 39, 37, - 39, 68, 54, 67, 41, 39, 58, 39, 58, 41, - 231, 8, 8, 231, 37, 39, 231, 231, 37, 39, - 231, 57, 39, 38, 231, 38, 39, 231, 231, 55, + 231, 50, 34, 9, 10, 9, 9, 48, 230, 229, + 49, 38, 16, 35, 38, 36, 36, 36, 36, 36, + 37, 39, 48, 37, 39, 51, 37, 39, 39, 224, + 223, 39, 34, 27, 39, 222, 37, 39, 216, 37, + 39, 215, 37, 39, 39, 57, 38, 39, 52, 38, + 39, 208, 38, 34, 8, 8, 8, 8, 8, 207, + 8, 8, 38, 8, 8, 38, 201, 53, 38, 200, + 37, 39, 192, 54, 191, 182, 181, 59, 39, 170, + 169, 155, 55, 154, 8, 8, 142, 56, 141, 127, + 126, 37, 39, 37, 39, 109, 38, 108, 60, 39, - 231, 8, 8, 8, 8, 8, 8, 56, 8, 8, - 38, 8, 8, 231, 38, 231, 60, 37, 39, 37, - 39, 231, 59, 231, 231, 39, 231, 39, 231, 231, - 231, 231, 8, 8, 65, 65, 65, 65, 65, 231, - 231, 37, 39, 38, 231, 38, 231, 231, 231, 39, - 37, 39, 8, 37, 39, 61, 231, 62, 39, 231, - 231, 39, 46, 46, 46, 46, 46, 38, 231, 37, - 39, 231, 231, 63, 231, 231, 38, 39, 231, 38, - 231, 231, 64, 69, 69, 69, 69, 69, 231, 231, - 70, 37, 39, 37, 39, 38, 71, 231, 72, 39, + 89, 39, 88, 68, 67, 8, 8, 8, 8, 8, + 8, 41, 8, 8, 58, 8, 8, 38, 58, 38, + 37, 39, 37, 39, 37, 39, 37, 39, 39, 61, + 39, 62, 39, 41, 39, 253, 8, 8, 65, 66, + 65, 65, 65, 74, 253, 253, 38, 253, 38, 253, + 38, 63, 38, 64, 75, 253, 253, 8, 37, 39, + 65, 65, 65, 65, 65, 253, 39, 46, 46, 46, + 46, 46, 69, 69, 69, 69, 69, 253, 253, 70, + 37, 39, 37, 39, 38, 71, 253, 72, 39, 253, + 39, 37, 39, 253, 70, 37, 39, 37, 39, 39, - 231, 39, 231, 37, 39, 231, 70, 37, 39, 231, - 231, 39, 231, 37, 39, 39, 231, 38, 231, 38, - 74, 39, 37, 39, 37, 39, 37, 39, 231, 38, - 39, 73, 39, 38, 39, 231, 75, 231, 231, 38, - 231, 37, 39, 231, 76, 231, 37, 39, 38, 39, - 38, 231, 38, 231, 39, 231, 231, 37, 39, 231, - 37, 39, 81, 78, 77, 39, 231, 38, 39, 80, - 231, 79, 38, 37, 39, 231, 231, 37, 39, 37, - 39, 39, 231, 38, 231, 39, 38, 39, 37, 39, - 65, 65, 65, 65, 65, 82, 39, 231, 231, 38, + 253, 37, 39, 39, 253, 39, 38, 253, 38, 39, + 37, 39, 253, 253, 37, 39, 253, 38, 39, 253, + 73, 38, 39, 38, 37, 39, 253, 38, 253, 79, + 81, 253, 39, 76, 77, 253, 38, 37, 39, 253, + 38, 37, 39, 78, 253, 39, 37, 39, 80, 39, + 38, 37, 39, 253, 39, 253, 37, 39, 253, 39, + 253, 253, 82, 38, 39, 253, 253, 38, 253, 253, + 37, 39, 38, 253, 253, 253, 253, 38, 39, 83, + 85, 84, 38, 253, 253, 87, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 38, 86, 69, 69, - 231, 231, 83, 38, 231, 38, 65, 65, 65, 65, - 65, 85, 231, 84, 38, 231, 231, 231, 87, 69, - 69, 69, 69, 69, 86, 231, 70, 92, 92, 92, - 92, 92, 93, 93, 93, 93, 93, 37, 39, 37, - 39, 231, 70, 37, 39, 39, 231, 39, 37, 39, - 231, 39, 231, 37, 39, 231, 39, 231, 37, 39, - 231, 39, 231, 38, 231, 38, 39, 231, 231, 38, - 231, 231, 231, 231, 38, 37, 39, 94, 95, 38, - 96, 37, 39, 39, 38, 97, 99, 37, 39, 39, - 37, 39, 231, 98, 231, 39, 37, 39, 39, 231, + 69, 69, 69, 253, 253, 70, 92, 92, 92, 92, + 92, 93, 93, 93, 93, 93, 37, 39, 37, 39, + 70, 37, 39, 253, 39, 253, 39, 37, 39, 39, + 253, 37, 39, 37, 39, 39, 253, 37, 39, 39, + 253, 39, 38, 253, 38, 39, 253, 38, 253, 95, + 37, 39, 96, 38, 253, 98, 94, 38, 39, 38, + 253, 97, 253, 38, 253, 253, 37, 39, 253, 253, + 100, 253, 101, 99, 39, 253, 38, 37, 39, 37, + 39, 37, 39, 37, 39, 39, 253, 39, 253, 39, + 253, 39, 38, 37, 39, 110, 110, 110, 110, 110, - 231, 38, 37, 39, 39, 231, 231, 38, 231, 231, - 39, 37, 39, 38, 231, 231, 38, 100, 101, 39, - 231, 231, 38, 37, 39, 37, 39, 231, 38, 231, - 102, 39, 231, 39, 231, 231, 103, 38, 104, 110, - 110, 110, 110, 110, 231, 231, 231, 231, 105, 38, - 231, 38, 111, 111, 111, 111, 111, 92, 92, 92, - 92, 92, 231, 231, 231, 106, 231, 107, 93, 93, - 93, 93, 93, 37, 39, 37, 39, 37, 39, 37, - 39, 39, 231, 39, 231, 39, 231, 39, 231, 37, - 39, 231, 37, 39, 37, 39, 231, 39, 231, 38, + 253, 39, 253, 38, 253, 38, 102, 38, 253, 38, + 111, 111, 111, 111, 111, 104, 253, 103, 105, 38, + 92, 92, 92, 92, 92, 106, 93, 93, 93, 93, + 93, 37, 39, 37, 39, 107, 37, 39, 253, 39, + 253, 39, 37, 39, 39, 253, 37, 39, 37, 39, + 39, 253, 37, 39, 39, 253, 39, 38, 253, 38, + 39, 112, 38, 37, 39, 253, 253, 253, 38, 37, + 39, 39, 38, 253, 38, 253, 114, 39, 38, 113, + 115, 253, 116, 253, 37, 39, 37, 39, 253, 38, + 253, 117, 39, 118, 39, 38, 253, 119, 253, 120, - 39, 38, 39, 38, 112, 38, 231, 113, 37, 39, - 231, 231, 231, 37, 39, 38, 39, 231, 38, 115, - 38, 39, 114, 116, 231, 37, 39, 37, 39, 231, - 37, 39, 117, 39, 38, 39, 231, 118, 39, 38, - 37, 39, 37, 39, 120, 231, 231, 231, 39, 119, - 39, 38, 231, 38, 231, 122, 38, 231, 231, 121, - 110, 110, 110, 110, 110, 231, 38, 231, 38, 231, - 37, 39, 123, 111, 111, 111, 111, 111, 39, 231, - 125, 37, 39, 124, 37, 39, 37, 39, 231, 39, - 231, 231, 39, 231, 39, 129, 38, 37, 39, 231, + 37, 39, 253, 37, 39, 37, 39, 253, 39, 253, + 38, 39, 38, 39, 122, 253, 253, 253, 121, 110, + 110, 110, 110, 110, 253, 253, 38, 253, 253, 38, + 253, 38, 111, 111, 111, 111, 111, 37, 39, 37, + 39, 253, 123, 125, 253, 39, 124, 39, 37, 39, + 37, 39, 37, 39, 253, 253, 39, 253, 39, 253, + 39, 37, 39, 38, 253, 38, 253, 37, 39, 39, + 129, 128, 253, 253, 38, 39, 38, 253, 38, 253, + 132, 253, 130, 37, 39, 253, 253, 38, 253, 37, + 39, 39, 253, 38, 37, 39, 131, 39, 253, 134, - 37, 39, 231, 231, 128, 39, 231, 38, 39, 231, - 38, 231, 38, 37, 39, 231, 130, 37, 39, 231, - 131, 39, 231, 38, 231, 39, 38, 231, 133, 37, - 39, 231, 37, 39, 231, 231, 231, 39, 231, 38, - 39, 231, 132, 38, 37, 39, 231, 136, 37, 39, - 135, 231, 39, 134, 231, 38, 39, 231, 38, 37, - 39, 37, 39, 37, 39, 37, 39, 39, 231, 39, - 38, 39, 231, 39, 38, 231, 231, 137, 231, 138, - 37, 39, 37, 39, 231, 38, 231, 38, 39, 38, - 39, 38, 231, 144, 37, 39, 37, 39, 231, 139, + 253, 133, 39, 37, 39, 253, 253, 136, 253, 38, + 253, 39, 253, 135, 253, 38, 37, 39, 37, 39, + 38, 253, 37, 39, 39, 253, 39, 37, 39, 38, + 39, 37, 39, 37, 39, 39, 253, 253, 138, 39, + 137, 39, 38, 253, 38, 253, 37, 39, 38, 253, + 253, 253, 253, 38, 39, 253, 146, 38, 139, 38, + 253, 144, 140, 253, 143, 37, 39, 37, 39, 253, + 37, 39, 38, 39, 145, 39, 37, 39, 39, 37, + 39, 253, 253, 253, 39, 253, 253, 39, 253, 37, + 39, 38, 253, 38, 253, 253, 38, 39, 148, 253, - 143, 140, 39, 231, 39, 231, 38, 231, 38, 231, - 146, 145, 231, 37, 39, 37, 39, 147, 37, 39, - 38, 39, 38, 39, 37, 39, 39, 231, 37, 39, - 231, 231, 39, 231, 37, 39, 39, 231, 148, 38, - 231, 38, 39, 231, 38, 149, 152, 231, 37, 39, - 38, 37, 39, 150, 38, 151, 39, 37, 39, 39, - 38, 37, 39, 37, 39, 39, 153, 37, 39, 39, - 231, 39, 231, 231, 38, 39, 231, 38, 158, 156, - 37, 39, 231, 38, 231, 231, 231, 38, 39, 38, - 231, 37, 39, 38, 231, 37, 39, 157, 159, 39, + 253, 253, 38, 37, 39, 38, 253, 147, 149, 253, + 150, 39, 253, 151, 253, 38, 37, 39, 37, 39, + 253, 152, 37, 39, 39, 253, 39, 37, 39, 38, + 39, 253, 37, 39, 253, 39, 253, 37, 39, 253, + 39, 253, 38, 253, 38, 39, 253, 153, 38, 157, + 156, 253, 253, 38, 253, 158, 37, 39, 38, 37, + 39, 253, 159, 38, 39, 253, 253, 39, 253, 253, + 162, 37, 39, 163, 253, 37, 39, 160, 253, 39, + 37, 39, 38, 39, 253, 38, 253, 253, 39, 253, + 37, 39, 37, 39, 161, 37, 39, 38, 39, 253, - 37, 39, 162, 39, 231, 163, 38, 160, 39, 231, - 231, 37, 39, 231, 37, 39, 231, 38, 161, 39, - 231, 38, 39, 231, 37, 39, 38, 231, 167, 231, - 231, 165, 39, 37, 39, 164, 231, 38, 37, 39, - 38, 39, 231, 37, 39, 231, 39, 231, 166, 231, - 38, 39, 37, 39, 231, 37, 39, 37, 39, 38, - 39, 171, 231, 39, 38, 39, 170, 37, 39, 38, - 231, 172, 231, 231, 231, 39, 37, 39, 38, 231, - 173, 38, 231, 38, 39, 231, 231, 231, 37, 39, - 37, 39, 231, 38, 231, 174, 39, 231, 39, 37, + 39, 38, 253, 39, 253, 165, 38, 37, 39, 168, + 166, 164, 37, 39, 253, 39, 38, 253, 38, 253, + 39, 38, 37, 39, 37, 39, 253, 167, 37, 39, + 39, 253, 39, 38, 171, 172, 39, 253, 38, 37, + 39, 37, 39, 37, 39, 37, 39, 39, 38, 39, + 38, 39, 173, 39, 38, 253, 174, 253, 37, 39, + 37, 39, 37, 39, 175, 38, 39, 38, 39, 38, + 39, 38, 37, 39, 253, 37, 39, 253, 253, 176, + 39, 177, 253, 39, 38, 253, 38, 253, 38, 178, + 179, 37, 39, 253, 37, 39, 253, 253, 38, 39, - 39, 231, 38, 37, 39, 175, 231, 39, 231, 231, - 231, 39, 176, 231, 38, 231, 38, 231, 37, 39, - 177, 178, 37, 39, 231, 38, 39, 231, 231, 38, - 39, 37, 39, 37, 39, 182, 231, 179, 231, 39, - 231, 39, 231, 231, 38, 37, 39, 231, 38, 231, - 37, 39, 183, 39, 37, 39, 231, 38, 39, 38, - 231, 231, 39, 231, 37, 39, 37, 39, 184, 37, - 39, 38, 39, 231, 39, 231, 38, 39, 231, 231, - 38, 191, 231, 185, 231, 37, 39, 231, 231, 231, - 38, 231, 38, 39, 231, 38, 187, 37, 39, 186, + 180, 38, 39, 183, 184, 253, 37, 39, 37, 39, + 37, 39, 253, 253, 39, 253, 39, 38, 39, 253, + 38, 37, 39, 253, 253, 185, 253, 37, 39, 39, + 253, 186, 38, 253, 38, 39, 38, 37, 39, 253, + 37, 39, 37, 39, 253, 39, 187, 38, 39, 253, + 39, 253, 193, 38, 37, 39, 253, 253, 189, 253, + 253, 253, 39, 38, 37, 39, 38, 188, 38, 37, + 39, 253, 39, 194, 253, 190, 253, 39, 37, 39, + 38, 253, 195, 253, 37, 39, 39, 253, 37, 39, + 38, 253, 39, 37, 39, 38, 39, 253, 37, 39, - 37, 39, 37, 39, 188, 39, 37, 39, 39, 231, - 39, 38, 231, 231, 39, 231, 231, 192, 231, 37, - 39, 37, 39, 38, 231, 231, 38, 39, 38, 39, - 231, 231, 38, 231, 37, 39, 37, 39, 193, 231, - 194, 231, 39, 231, 39, 38, 231, 38, 231, 37, - 39, 195, 231, 37, 39, 231, 199, 39, 231, 196, - 38, 39, 38, 37, 39, 37, 39, 231, 231, 200, - 231, 39, 231, 39, 231, 38, 37, 39, 231, 38, - 201, 231, 37, 39, 39, 37, 39, 37, 39, 38, - 39, 38, 231, 39, 202, 39, 231, 205, 37, 39, + 253, 39, 253, 253, 38, 196, 39, 37, 39, 197, + 38, 253, 253, 253, 38, 39, 253, 37, 39, 38, + 202, 37, 39, 253, 38, 39, 37, 39, 199, 39, + 198, 37, 39, 38, 39, 253, 253, 37, 39, 39, + 37, 39, 253, 38, 203, 39, 253, 38, 39, 204, + 253, 205, 38, 253, 37, 39, 253, 38, 253, 37, + 39, 206, 39, 38, 37, 39, 38, 39, 209, 37, + 39, 253, 39, 210, 253, 37, 39, 39, 37, 39, + 38, 253, 213, 39, 253, 38, 39, 253, 37, 39, + 38, 253, 211, 212, 253, 38, 39, 37, 39, 253, - 231, 231, 38, 208, 37, 39, 39, 231, 38, 37, - 39, 38, 39, 38, 206, 231, 207, 39, 37, 39, - 231, 231, 231, 231, 38, 231, 39, 231, 231, 211, - 38, 37, 39, 231, 231, 38, 231, 231, 212, 39, - 231, 213, 37, 39, 38, 231, 214, 37, 39, 231, - 39, 37, 39, 37, 39, 39, 231, 38, 231, 39, - 231, 39, 231, 231, 37, 39, 231, 217, 38, 231, - 218, 231, 39, 38, 37, 39, 231, 38, 219, 38, - 231, 231, 39, 37, 39, 231, 37, 39, 231, 231, - 38, 39, 231, 231, 39, 222, 223, 228, 231, 231, + 253, 38, 253, 253, 38, 39, 253, 37, 39, 253, + 218, 217, 37, 39, 38, 39, 37, 39, 219, 253, + 39, 37, 39, 38, 39, 220, 253, 37, 39, 39, + 253, 253, 253, 38, 221, 39, 37, 39, 38, 253, + 37, 39, 38, 225, 39, 253, 253, 38, 39, 227, + 253, 253, 226, 38, 253, 37, 39, 228, 232, 37, + 39, 253, 38, 39, 253, 253, 38, 39, 37, 39, + 37, 39, 37, 39, 37, 39, 39, 253, 39, 253, + 39, 38, 39, 253, 253, 38, 253, 37, 39, 253, + 234, 37, 39, 253, 38, 39, 38, 233, 38, 39, - 38, 231, 231, 37, 39, 231, 225, 37, 39, 38, - 231, 39, 38, 231, 231, 39, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 226, 38, - 231, 231, 231, 38, 8, 8, 8, 8, 12, 12, - 12, 12, 40, 40, 40, 40, 42, 231, 42, 42, - 45, 45, 7, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, + 38, 238, 243, 37, 39, 253, 253, 37, 39, 253, + 237, 39, 253, 38, 242, 39, 253, 38, 239, 37, + 39, 253, 37, 39, 37, 39, 253, 39, 253, 38, + 39, 253, 39, 38, 37, 39, 253, 246, 37, 39, + 253, 253, 39, 253, 250, 38, 39, 253, 38, 253, + 38, 253, 253, 253, 253, 251, 253, 253, 249, 253, + 38, 253, 253, 253, 38, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 252, 8, 8, 8, + 8, 8, 12, 12, 12, 12, 12, 40, 40, 40, + 40, 40, 42, 253, 253, 42, 42, 45, 45, 214, - 231, 231, 231, 231 + 253, 214, 214, 214, 7, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 253 } ; -static yyconst short int yy_chk[1405] = +static yyconst short int yy_chk[1458] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 3, 3, 14, 11, 70, 234, 70, - 3, 3, 14, 3, 3, 3, 3, 3, 15, 15, - 37, 18, 229, 227, 224, 220, 15, 216, 215, 18, - 3, 3, 11, 19, 19, 35, 35, 35, 35, 35, - 210, 19, 209, 204, 15, 18, 37, 203, 21, 21, + 1, 1, 3, 3, 3, 3, 14, 11, 37, 256, + 245, 3, 3, 14, 3, 3, 3, 3, 3, 15, + 15, 18, 19, 19, 70, 244, 70, 15, 241, 18, + 19, 3, 3, 11, 37, 20, 20, 240, 21, 21, + 236, 235, 230, 20, 18, 15, 21, 229, 19, 46, - 3, 4, 4, 4, 4, 198, 21, 197, 190, 19, - 4, 4, 46, 4, 4, 4, 4, 4, 20, 20, - 46, 19, 189, 181, 21, 180, 20, 169, 168, 155, - 4, 4, 154, 142, 20, 21, 46, 22, 22, 141, - 23, 23, 127, 126, 20, 22, 109, 108, 23, 89, - 4, 5, 5, 5, 5, 5, 20, 5, 5, 88, - 5, 5, 68, 22, 67, 22, 23, 24, 24, 25, - 25, 44, 23, 43, 40, 24, 38, 25, 26, 13, - 7, 5, 5, 0, 28, 28, 0, 0, 29, 29, - 0, 25, 28, 24, 0, 25, 29, 0, 0, 24, + 224, 20, 3, 4, 4, 4, 4, 46, 223, 222, + 19, 20, 4, 4, 21, 4, 4, 4, 4, 4, + 22, 22, 46, 25, 25, 21, 45, 45, 22, 216, + 215, 25, 4, 4, 45, 214, 23, 23, 208, 28, + 28, 207, 24, 24, 23, 25, 22, 28, 22, 25, + 24, 201, 45, 4, 5, 5, 5, 5, 5, 200, + 5, 5, 23, 5, 5, 28, 192, 23, 24, 191, + 29, 29, 182, 24, 181, 170, 169, 28, 29, 155, + 154, 142, 24, 141, 5, 5, 127, 24, 126, 109, + 108, 30, 30, 31, 31, 89, 29, 88, 29, 30, - 0, 5, 6, 6, 6, 6, 6, 24, 6, 6, - 28, 6, 6, 0, 29, 0, 29, 30, 30, 31, - 31, 0, 28, 0, 0, 30, 0, 31, 0, 0, - 0, 0, 6, 6, 36, 36, 36, 36, 36, 0, - 0, 32, 32, 30, 0, 31, 0, 0, 0, 32, - 33, 33, 6, 17, 17, 30, 0, 31, 33, 0, - 0, 17, 17, 17, 17, 17, 17, 32, 0, 45, - 45, 0, 0, 32, 0, 0, 33, 45, 0, 17, - 0, 0, 33, 47, 47, 47, 47, 47, 0, 0, - 47, 48, 48, 49, 49, 45, 48, 0, 48, 48, + 68, 31, 67, 44, 43, 5, 6, 6, 6, 6, + 6, 40, 6, 6, 38, 6, 6, 30, 26, 31, + 32, 32, 33, 33, 51, 51, 50, 50, 32, 30, + 33, 31, 51, 13, 50, 7, 6, 6, 35, 35, + 35, 35, 35, 50, 0, 0, 32, 0, 33, 0, + 51, 32, 50, 33, 51, 0, 0, 6, 17, 17, + 36, 36, 36, 36, 36, 0, 17, 17, 17, 17, + 17, 17, 47, 47, 47, 47, 47, 0, 0, 47, + 48, 48, 49, 49, 17, 48, 0, 48, 48, 0, + 49, 52, 52, 0, 47, 53, 53, 54, 54, 52, - 0, 49, 0, 50, 50, 0, 47, 51, 51, 0, - 0, 50, 0, 52, 52, 51, 0, 48, 0, 49, - 50, 52, 53, 53, 54, 54, 55, 55, 0, 50, - 53, 49, 54, 51, 55, 0, 51, 0, 0, 52, - 0, 56, 56, 0, 52, 0, 57, 57, 53, 56, - 54, 0, 55, 0, 57, 0, 0, 59, 59, 0, - 60, 60, 57, 54, 53, 59, 0, 56, 60, 56, - 0, 55, 57, 61, 61, 0, 0, 62, 62, 63, - 63, 61, 0, 59, 0, 62, 60, 63, 64, 64, - 65, 65, 65, 65, 65, 59, 64, 0, 0, 61, + 0, 55, 55, 53, 0, 54, 48, 0, 49, 55, + 56, 56, 0, 0, 57, 57, 0, 52, 56, 0, + 49, 53, 57, 54, 59, 59, 0, 55, 0, 55, + 57, 0, 59, 52, 53, 0, 56, 60, 60, 0, + 57, 61, 61, 54, 0, 60, 62, 62, 56, 61, + 59, 63, 63, 0, 62, 0, 64, 64, 0, 63, + 0, 0, 59, 60, 64, 0, 0, 61, 0, 0, + 74, 74, 62, 0, 0, 0, 0, 63, 74, 60, + 62, 61, 64, 0, 0, 64, 65, 65, 65, 65, + 65, 66, 66, 66, 66, 66, 74, 63, 69, 69, - 0, 0, 60, 62, 0, 63, 66, 66, 66, 66, - 66, 62, 0, 61, 64, 0, 0, 0, 64, 69, - 69, 69, 69, 69, 63, 0, 69, 71, 71, 71, - 71, 71, 72, 72, 72, 72, 72, 73, 73, 74, - 74, 0, 69, 75, 75, 73, 0, 74, 76, 76, - 0, 75, 0, 77, 77, 0, 76, 0, 78, 78, - 0, 77, 0, 73, 0, 74, 78, 0, 0, 75, - 0, 0, 0, 0, 76, 79, 79, 73, 75, 77, - 76, 80, 80, 79, 78, 77, 78, 81, 81, 80, - 82, 82, 0, 77, 0, 81, 83, 83, 82, 0, + 69, 69, 69, 0, 0, 69, 71, 71, 71, 71, + 71, 72, 72, 72, 72, 72, 73, 73, 75, 75, + 69, 76, 76, 0, 73, 0, 75, 77, 77, 76, + 0, 78, 78, 79, 79, 77, 0, 81, 81, 78, + 0, 79, 73, 0, 75, 81, 0, 76, 0, 75, + 80, 80, 76, 77, 0, 77, 73, 78, 80, 79, + 0, 76, 0, 81, 0, 0, 82, 82, 0, 0, + 79, 0, 80, 78, 82, 0, 80, 83, 83, 84, + 84, 85, 85, 86, 86, 83, 0, 84, 0, 85, + 0, 86, 82, 87, 87, 90, 90, 90, 90, 90, - 0, 79, 84, 84, 83, 0, 0, 80, 0, 0, - 84, 85, 85, 81, 0, 0, 82, 79, 80, 85, - 0, 0, 83, 86, 86, 87, 87, 0, 84, 0, - 82, 86, 0, 87, 0, 0, 83, 85, 84, 90, - 90, 90, 90, 90, 0, 0, 0, 0, 85, 86, - 0, 87, 91, 91, 91, 91, 91, 92, 92, 92, - 92, 92, 0, 0, 0, 86, 0, 87, 93, 93, - 93, 93, 93, 94, 94, 95, 95, 96, 96, 97, - 97, 94, 0, 95, 0, 96, 0, 97, 0, 98, - 98, 0, 99, 99, 100, 100, 0, 98, 0, 94, + 0, 87, 0, 83, 0, 84, 82, 85, 0, 86, + 91, 91, 91, 91, 91, 84, 0, 83, 85, 87, + 92, 92, 92, 92, 92, 86, 93, 93, 93, 93, + 93, 94, 94, 95, 95, 87, 96, 96, 0, 94, + 0, 95, 98, 98, 96, 0, 97, 97, 99, 99, + 98, 0, 100, 100, 97, 0, 99, 94, 0, 95, + 100, 94, 96, 101, 101, 0, 0, 0, 98, 102, + 102, 101, 97, 0, 99, 0, 96, 102, 100, 95, + 97, 0, 98, 0, 103, 103, 104, 104, 0, 101, + 0, 99, 103, 100, 104, 102, 0, 101, 0, 102, - 99, 95, 100, 96, 94, 97, 0, 95, 101, 101, - 0, 0, 0, 102, 102, 98, 101, 0, 99, 97, - 100, 102, 96, 98, 0, 103, 103, 104, 104, 0, - 105, 105, 99, 103, 101, 104, 0, 100, 105, 102, - 106, 106, 107, 107, 102, 0, 0, 0, 106, 101, - 107, 103, 0, 104, 0, 104, 105, 0, 0, 103, - 110, 110, 110, 110, 110, 0, 106, 0, 107, 0, - 112, 112, 105, 111, 111, 111, 111, 111, 112, 0, - 107, 113, 113, 106, 114, 114, 115, 115, 0, 113, - 0, 0, 114, 0, 115, 113, 112, 116, 116, 0, + 105, 105, 0, 106, 106, 107, 107, 0, 105, 0, + 103, 106, 104, 107, 104, 0, 0, 0, 103, 110, + 110, 110, 110, 110, 0, 0, 105, 0, 0, 106, + 0, 107, 111, 111, 111, 111, 111, 112, 112, 113, + 113, 0, 105, 107, 0, 112, 106, 113, 114, 114, + 115, 115, 116, 116, 0, 0, 114, 0, 115, 0, + 116, 117, 117, 112, 0, 113, 0, 118, 118, 117, + 113, 112, 0, 0, 114, 118, 115, 0, 116, 0, + 116, 0, 114, 119, 119, 0, 0, 117, 0, 120, + 120, 119, 0, 118, 121, 121, 115, 120, 0, 118, - 117, 117, 0, 0, 112, 116, 0, 113, 117, 0, - 114, 0, 115, 118, 118, 0, 114, 119, 119, 0, - 115, 118, 0, 116, 0, 119, 117, 0, 117, 120, - 120, 0, 121, 121, 0, 0, 0, 120, 0, 118, - 121, 0, 116, 119, 122, 122, 0, 120, 123, 123, - 119, 0, 122, 118, 0, 120, 123, 0, 121, 124, - 124, 125, 125, 128, 128, 129, 129, 124, 0, 125, - 122, 128, 0, 129, 123, 0, 0, 121, 0, 122, - 130, 130, 131, 131, 0, 124, 0, 125, 130, 128, - 131, 129, 0, 129, 132, 132, 133, 133, 0, 124, + 0, 117, 121, 122, 122, 0, 0, 120, 0, 119, + 0, 122, 0, 119, 0, 120, 123, 123, 124, 124, + 121, 0, 125, 125, 123, 0, 124, 128, 128, 122, + 125, 129, 129, 131, 131, 128, 0, 0, 122, 129, + 121, 131, 123, 0, 124, 0, 130, 130, 125, 0, + 0, 0, 0, 128, 130, 0, 131, 129, 124, 131, + 0, 129, 125, 0, 128, 132, 132, 133, 133, 0, + 134, 134, 130, 132, 130, 133, 136, 136, 134, 135, + 135, 0, 0, 0, 136, 0, 0, 135, 0, 137, + 137, 132, 0, 133, 0, 0, 134, 137, 133, 0, - 128, 125, 132, 0, 133, 0, 130, 0, 131, 0, - 131, 130, 0, 134, 134, 135, 135, 132, 136, 136, - 132, 134, 133, 135, 137, 137, 136, 0, 138, 138, - 0, 0, 137, 0, 139, 139, 138, 0, 133, 134, - 0, 135, 139, 0, 136, 134, 138, 0, 140, 140, - 137, 143, 143, 135, 138, 136, 140, 144, 144, 143, - 139, 145, 145, 146, 146, 144, 139, 147, 147, 145, - 0, 146, 0, 0, 140, 147, 0, 143, 145, 143, - 148, 148, 0, 144, 0, 0, 0, 145, 148, 146, - 0, 149, 149, 147, 0, 150, 150, 144, 146, 149, + 0, 0, 136, 138, 138, 135, 0, 132, 134, 0, + 135, 138, 0, 136, 0, 137, 139, 139, 140, 140, + 0, 138, 143, 143, 139, 0, 140, 145, 145, 138, + 143, 0, 144, 144, 0, 145, 0, 146, 146, 0, + 144, 0, 139, 0, 140, 146, 0, 139, 143, 144, + 143, 0, 0, 145, 0, 144, 147, 147, 144, 148, + 148, 0, 145, 146, 147, 0, 0, 148, 0, 0, + 148, 149, 149, 148, 0, 150, 150, 146, 0, 149, + 151, 151, 147, 150, 0, 148, 0, 0, 151, 0, + 152, 152, 156, 156, 147, 153, 153, 149, 152, 0, - 151, 151, 149, 150, 0, 149, 148, 147, 151, 0, - 0, 152, 152, 0, 153, 153, 0, 149, 148, 152, - 0, 150, 153, 0, 156, 156, 151, 0, 153, 0, - 0, 151, 156, 157, 157, 150, 0, 152, 159, 159, - 153, 157, 0, 158, 158, 0, 159, 0, 152, 0, - 156, 158, 160, 160, 0, 161, 161, 162, 162, 157, - 160, 157, 0, 161, 159, 162, 156, 163, 163, 158, - 0, 158, 0, 0, 0, 163, 164, 164, 160, 0, - 160, 161, 0, 162, 164, 0, 0, 0, 165, 165, - 166, 166, 0, 163, 0, 161, 165, 0, 166, 167, + 156, 150, 0, 153, 0, 150, 151, 157, 157, 153, + 151, 149, 158, 158, 0, 157, 152, 0, 156, 0, + 158, 153, 159, 159, 161, 161, 0, 152, 160, 160, + 159, 0, 161, 157, 156, 157, 160, 0, 158, 162, + 162, 163, 163, 165, 165, 164, 164, 162, 159, 163, + 161, 165, 158, 164, 160, 0, 160, 0, 166, 166, + 167, 167, 168, 168, 161, 162, 166, 163, 167, 165, + 168, 164, 171, 171, 0, 172, 172, 0, 0, 163, + 171, 164, 0, 172, 166, 0, 167, 0, 168, 166, + 167, 173, 173, 0, 174, 174, 0, 0, 171, 173, - 167, 0, 164, 170, 170, 163, 0, 167, 0, 0, - 0, 170, 164, 0, 165, 0, 166, 0, 171, 171, - 165, 166, 172, 172, 0, 167, 171, 0, 0, 170, - 172, 173, 173, 174, 174, 170, 0, 167, 0, 173, - 0, 174, 0, 0, 171, 175, 175, 0, 172, 0, - 176, 176, 172, 175, 177, 177, 0, 173, 176, 174, - 0, 0, 177, 0, 178, 178, 179, 179, 173, 182, - 182, 175, 178, 0, 179, 0, 176, 182, 0, 0, - 177, 182, 0, 175, 0, 183, 183, 0, 0, 0, - 178, 0, 179, 183, 0, 182, 178, 184, 184, 177, + 168, 172, 174, 171, 172, 0, 175, 175, 176, 176, + 177, 177, 0, 0, 175, 0, 176, 173, 177, 0, + 174, 178, 178, 0, 0, 173, 0, 179, 179, 178, + 0, 174, 175, 0, 176, 179, 177, 180, 180, 0, + 183, 183, 184, 184, 0, 180, 176, 178, 183, 0, + 184, 0, 183, 179, 185, 185, 0, 0, 179, 0, + 0, 0, 185, 180, 186, 186, 183, 178, 184, 187, + 187, 0, 186, 184, 0, 180, 0, 187, 188, 188, + 185, 0, 185, 0, 189, 189, 188, 0, 190, 190, + 186, 0, 189, 193, 193, 187, 190, 0, 194, 194, - 185, 185, 186, 186, 179, 184, 187, 187, 185, 0, - 186, 183, 0, 0, 187, 0, 0, 183, 0, 188, - 188, 191, 191, 184, 0, 0, 185, 188, 186, 191, - 0, 0, 187, 0, 192, 192, 193, 193, 184, 0, - 185, 0, 192, 0, 193, 188, 0, 191, 0, 194, - 194, 187, 0, 195, 195, 0, 192, 194, 0, 188, - 192, 195, 193, 196, 196, 199, 199, 0, 0, 193, - 0, 196, 0, 199, 0, 194, 200, 200, 0, 195, - 194, 0, 201, 201, 200, 202, 202, 205, 205, 196, - 201, 199, 0, 202, 196, 205, 0, 199, 206, 206, + 0, 193, 0, 0, 188, 186, 194, 195, 195, 187, + 189, 0, 0, 0, 190, 195, 0, 196, 196, 193, + 194, 197, 197, 0, 194, 196, 198, 198, 190, 197, + 189, 199, 199, 195, 198, 0, 0, 202, 202, 199, + 203, 203, 0, 196, 195, 202, 0, 197, 203, 196, + 0, 197, 198, 0, 204, 204, 0, 199, 0, 205, + 205, 199, 204, 202, 206, 206, 203, 205, 202, 209, + 209, 0, 206, 203, 0, 210, 210, 209, 211, 211, + 204, 0, 206, 210, 0, 205, 211, 0, 212, 212, + 206, 0, 204, 205, 0, 209, 212, 213, 213, 0, - 0, 0, 200, 202, 207, 207, 206, 0, 201, 208, - 208, 202, 207, 205, 200, 0, 201, 208, 211, 211, - 0, 0, 0, 0, 206, 0, 211, 0, 0, 205, - 207, 212, 212, 0, 0, 208, 0, 0, 206, 212, - 0, 207, 213, 213, 211, 0, 208, 214, 214, 0, - 213, 217, 217, 218, 218, 214, 0, 212, 0, 217, - 0, 218, 0, 0, 219, 219, 0, 212, 213, 0, - 213, 0, 219, 214, 222, 222, 0, 217, 214, 218, - 0, 0, 222, 223, 223, 0, 225, 225, 0, 0, - 219, 223, 0, 0, 225, 218, 219, 225, 0, 0, + 0, 210, 0, 0, 211, 213, 0, 217, 217, 0, + 210, 209, 218, 218, 212, 217, 219, 219, 211, 0, + 218, 220, 220, 213, 219, 212, 0, 221, 221, 220, + 0, 0, 0, 217, 213, 221, 225, 225, 218, 0, + 226, 226, 219, 218, 225, 0, 0, 220, 226, 220, + 0, 0, 219, 221, 0, 227, 227, 221, 225, 228, + 228, 0, 225, 227, 0, 0, 226, 228, 232, 232, + 233, 233, 234, 234, 237, 237, 232, 0, 233, 0, + 234, 227, 237, 0, 0, 228, 0, 239, 239, 0, + 228, 238, 238, 0, 232, 239, 233, 227, 234, 238, - 222, 0, 0, 226, 226, 0, 222, 228, 228, 223, - 0, 226, 225, 0, 0, 228, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 223, 226, - 0, 0, 0, 228, 232, 232, 232, 232, 233, 233, - 233, 233, 235, 235, 235, 235, 236, 0, 236, 236, - 237, 237, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, + 237, 233, 238, 242, 242, 0, 0, 243, 243, 0, + 232, 242, 0, 239, 237, 243, 0, 238, 234, 246, + 246, 0, 249, 249, 250, 250, 0, 246, 0, 242, + 249, 0, 250, 243, 251, 251, 0, 242, 252, 252, + 0, 0, 251, 0, 249, 246, 252, 0, 249, 0, + 250, 0, 0, 0, 0, 250, 0, 0, 246, 0, + 251, 0, 0, 0, 252, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 251, 254, 254, 254, + 254, 254, 255, 255, 255, 255, 255, 257, 257, 257, + 257, 257, 258, 0, 0, 258, 258, 259, 259, 260, - 231, 231, 231, 231 + 0, 260, 260, 260, 253, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, + 253, 253, 253, 253, 253, 253, 253 } ; static yy_state_type yy_last_accepting_state; @@ -779,7 +795,7 @@ int yyline=1; #define def 2 -#line 780 "scanner.cpp" +#line 798 "scanner.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -927,12 +943,12 @@ YY_MALLOC_DECL YY_DECL { register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; + register char *yy_cp=NULL, *yy_bp=NULL; register int yy_act; #line 30 "scanner.l" -#line 933 "scanner.cpp" +#line 962 "scanner.cpp" if ( yy_init ) { @@ -983,13 +999,13 @@ yy_match: 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 >= 232 ) + if ( yy_current_state >= 254 ) 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] != 1353 ); + while ( yy_base[yy_current_state] != 1405 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1058,72 +1074,72 @@ YY_RULE_SETUP case 9: YY_RULE_SETUP #line 39 "scanner.l" -{ return TEXTURE_COORDINATE; } +{ return INDEXED_TRIANGLE_STRIP_SET; } YY_BREAK case 10: YY_RULE_SETUP #line 40 "scanner.l" -{ return TRANSFORM; } +{ return TEXTURE_COORDINATE; } YY_BREAK case 11: YY_RULE_SETUP #line 41 "scanner.l" -{ return MATRIX_TRANSFORM; } +{ return TRANSFORM; } YY_BREAK case 12: YY_RULE_SETUP #line 42 "scanner.l" -{ return DOBLE_CARA; } +{ return MATRIX_TRANSFORM; } YY_BREAK case 13: YY_RULE_SETUP #line 43 "scanner.l" -{ return MATRIX; } +{ return TWO_SIDED; } YY_BREAK case 14: YY_RULE_SETUP #line 44 "scanner.l" -{ return A_POINT; } +{ return MATRIX; } YY_BREAK case 15: YY_RULE_SETUP #line 45 "scanner.l" -{ BEGIN cindex;return COORD_INDEX; } +{ return A_POINT; } YY_BREAK case 16: YY_RULE_SETUP #line 46 "scanner.l" -{ BEGIN cindex;return TEXTURE_COORD_INDEX; } +{ BEGIN cindex;return COORD_INDEX; } YY_BREAK case 17: YY_RULE_SETUP #line 47 "scanner.l" -{ BEGIN cindex;return NORMAL_INDEX; } +{ BEGIN cindex;return TEXTURE_COORD_INDEX; } YY_BREAK case 18: YY_RULE_SETUP #line 48 "scanner.l" -{ return VECTOR; } +{ BEGIN cindex;return NORMAL_INDEX; } YY_BREAK case 19: YY_RULE_SETUP #line 49 "scanner.l" -{ return FINPOLY; } +{ return VECTOR; } YY_BREAK case 20: YY_RULE_SETUP #line 50 "scanner.l" -{ BEGIN INITIAL; return ']'; } +{ return FINPOLY; } YY_BREAK case 21: YY_RULE_SETUP #line 51 "scanner.l" -{ BEGIN def;return USE; } +{ BEGIN INITIAL; return ']'; } YY_BREAK case 22: YY_RULE_SETUP #line 52 "scanner.l" -{ return VRML_HEADER; } +{ BEGIN def;return USE; } YY_BREAK case 23: YY_RULE_SETUP @@ -1133,19 +1149,16 @@ YY_RULE_SETUP case 24: YY_RULE_SETUP #line 54 "scanner.l" - +{ return VRML_HEADER; } YY_BREAK case 25: YY_RULE_SETUP #line 55 "scanner.l" -{ - yylval.f_value=strtod(yytext,NULL); - return FLOAT; -} + YY_BREAK case 26: YY_RULE_SETUP -#line 59 "scanner.l" +#line 56 "scanner.l" { yylval.f_value=strtod(yytext,NULL); return FLOAT; @@ -1153,7 +1166,7 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 63 "scanner.l" +#line 60 "scanner.l" { yylval.f_value=strtod(yytext,NULL); return FLOAT; @@ -1161,46 +1174,54 @@ YY_RULE_SETUP YY_BREAK case 28: YY_RULE_SETUP -#line 67 "scanner.l" +#line 64 "scanner.l" { - yylval.f_value=(float)strtol(yytext,NULL,10); + yylval.f_value=strtod(yytext,NULL); return FLOAT; } YY_BREAK case 29: YY_RULE_SETUP -#line 71 "scanner.l" +#line 68 "scanner.l" +{ + yylval.f_value=(float)strtol(yytext,NULL,10); + return FLOAT; +} + YY_BREAK +case 30: +YY_RULE_SETUP +#line 72 "scanner.l" { yylval.i_value=strtol(yytext,NULL,10); return INT; } YY_BREAK -case 30: -YY_RULE_SETUP -#line 75 "scanner.l" -{ return yytext[0]; } - YY_BREAK case 31: YY_RULE_SETUP #line 76 "scanner.l" - +{ return yytext[0]; } YY_BREAK case 32: YY_RULE_SETUP #line 77 "scanner.l" -{ BEGIN INITIAL;yylval.s_value=strdup(yytext);return STRING; } + YY_BREAK case 33: YY_RULE_SETUP #line 78 "scanner.l" -{ yylval.s_value=strdup(yytext+1);yylval.s_value[strlen(yylval.s_value)-1]=0;return QUOTED_STRING; } +{ BEGIN INITIAL;yylval.s_value=strdup(yytext);return STRING; } YY_BREAK case 34: YY_RULE_SETUP -#line 80 "scanner.l" +#line 79 "scanner.l" +{ yylval.s_value=strdup(yytext+1);yylval.s_value[strlen(yylval.s_value)-1]=0;return QUOTED_STRING; } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 81 "scanner.l" ECHO; YY_BREAK -#line 1201 "scanner.cpp" +#line 1235 "scanner.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(cindex): case YY_STATE_EOF(def): @@ -1494,7 +1515,7 @@ static yy_state_type yy_get_previous_state() 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 >= 232 ) + if ( yy_current_state >= 254 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1529,11 +1550,11 @@ yy_state_type yy_current_state; 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 >= 232 ) + if ( yy_current_state >= 254 ) 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 == 231); + yy_is_jam = (yy_current_state == 253); return yy_is_jam ? 0 : yy_current_state; } @@ -2088,7 +2109,7 @@ int main() return 0; } #endif -#line 80 "scanner.l" +#line 81 "scanner.l" int yywrap(void) diff --git a/src/osgPlugins/iv/scanner.l b/src/osgPlugins/iv/scanner.l index 620775bc4..be00d9b0c 100644 --- a/src/osgPlugins/iv/scanner.l +++ b/src/osgPlugins/iv/scanner.l @@ -36,10 +36,11 @@ Texture2 { return TEXTURE2; } Separator { return SEPARATOR; } Material { return UN_MATERIAL; } IndexedFaceSet { return INDEXED_FACE_SET; } +IndexedTriangleStripSet { return INDEXED_TRIANGLE_STRIP_SET; } TextureCoordinate2 { return TEXTURE_COORDINATE; } Transform { return TRANSFORM; } MatrixTransform { return MATRIX_TRANSFORM; } -DobleCara { return DOBLE_CARA; } +TwoSided { return TWO_SIDED; } matrix { return MATRIX; } point { return A_POINT; } coordIndex { BEGIN cindex;return COORD_INDEX; } @@ -50,7 +51,7 @@ vector { return VECTOR; } \] { BEGIN INITIAL; return ']'; } USE { BEGIN def;return USE; } "#VRML\ V1.0 ascii" { return VRML_HEADER; } -"#Inventor\ V2.0 ascii" { return VRML_HEADER; } +"#Inventor\ V2."." ascii" { return VRML_HEADER; } #[^\n\r]* "-"?{DIGIT}+"."{DIGIT}* { yylval.f_value=strtod(yytext,NULL);