Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGScanParseSkel.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef _OSGSCANPARSESKEL_H_
00040 #define _OSGSCANPARSESKEL_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 
00046 #include <OSGSystemDef.h>
00047 #include <OSGBaseTypes.h>
00048 #include <OSGScanParseSkel.tab.h>
00049 #include <OSGScanParseSkelBase.h>
00050 
00051 #ifdef OSG_FLEX_USE_IOSTREAM_INPUT
00052 #include <iosfwd>
00053 #endif
00054 
00055 class OSGScanParseLexer;
00056 
00057 OSG_BEGIN_NAMESPACE
00058 
00061 
00062 class OSG_SYSTEMLIB_DLLMAPPING ScanParseSkel : public ScanParseSkelBase
00063 {
00064     /*==========================  PUBLIC  =================================*/
00065   public:
00066 
00067     enum BuildInFieldType
00068     {
00069         OSGsfBool     = TOK_SFBOOL,
00070         OSGsfColor    = TOK_SFCOLOR,
00071         OSGsfFloat    = TOK_SFFLOAT,
00072         OSGsfImage    = TOK_SFIMAGE,
00073         OSGsfInt32    = TOK_SFINT32,
00074         OSGsfNode     = TOK_SFNODE,
00075         OSGsfRotation = TOK_SFROTATION,
00076         OSGsfString   = TOK_SFSTRING,
00077         OSGsfTime     = TOK_SFTIME,
00078         OSGsfVec2f    = TOK_SFVEC2F,
00079         OSGsfVec3f    = TOK_SFVEC3F,
00080         OSGmfColor    = TOK_MFCOLOR,
00081         OSGmfFloat    = TOK_MFFLOAT,
00082         OSGmfInt32    = TOK_MFINT32,
00083         OSGmfNode     = TOK_MFNODE,
00084         OSGmfRotation = TOK_MFROTATION,
00085         OSGmfString   = TOK_MFSTRING,
00086         OSGmfTime     = TOK_MFTIME,
00087         OSGmfVec2f    = TOK_MFVEC2F,
00088         OSGmfVec3f    = TOK_MFVEC3F,
00089 
00090         OSGmfColor4f  = TOK_MFCOLOR4F,
00091         OSGmfColor4i  = TOK_MFCOLOR4I,
00092         OSGmfColor3f  = TOK_MFCOLOR3F,
00093         OSGmfMatrix   = TOK_MFMATRIX,
00094         OSGmfPnt2f    = TOK_MFPNT2F,
00095         OSGmfPnt3f    = TOK_MFPNT3F,
00096         OSGmfPnt4f    = TOK_MFPNT4F,
00097         OSGmfVec4f    = TOK_MFVEC4F,
00098         OSGmfPlane    = TOK_MFPLANE,
00099         OSGsfColor4f  = TOK_SFCOLOR4F,
00100         OSGsfColor4i  = TOK_SFCOLOR4I,
00101         OSGsfColor3f  = TOK_SFCOLOR3F,
00102         OSGsfMatrix   = TOK_SFMATRIX,
00103         OSGsfPnt2f    = TOK_SFPNT2F,
00104         OSGsfPnt3f    = TOK_SFPNT3F,
00105         OSGsfPnt4f    = TOK_SFPNT4F,
00106         OSGsfVec4f    = TOK_SFVEC4F,
00107         OSGsfPlane    = TOK_SFPLANE,
00108         OSGsfVolume   = TOK_SFVOLUME
00109     };
00110 
00111     enum
00112     {
00113         LastOption = 0x0001
00114     };
00115 
00116     /*---------------------------------------------------------------------*/
00120     ScanParseSkel(void);
00121 
00123     /*---------------------------------------------------------------------*/
00127     virtual ~ScanParseSkel(void);
00128 
00130     /*---------------------------------------------------------------------*/
00134 #ifdef OSG_FLEX_USE_IOSTREAM_INPUT
00135     virtual       void   scanStream (      std::istream &is        );
00136 #endif
00137 
00138     virtual       void   scanFile   (const Char8        *szFilename);
00139 
00140     virtual       Int32  lex        (      void                    );
00141     virtual const Char8 *getText    (      void                    );
00142 
00143                   void   expectType (      Int32        iNextType  ); 
00144 
00145     virtual       void   handleError(const Char8       *szErrorText);
00146 
00148     /*---------------------------------------------------------------------*/
00152     virtual bool verifyHeader             (const Char8 *szHeader);
00153 
00154     virtual void beginProto               (const Char8 *szProtoname);
00155     virtual void endProto                 (void);
00156 
00157     virtual void beginExternProto         (const Char8 *szProtoname);
00158     virtual void endExternProtoInterface  (void                    );
00159     virtual void endExternProto           (void                    );
00160 
00161     virtual void beginScript              (const Char8 *szProtoname);
00162     virtual void endScript                (void);
00163 
00164     virtual void beginEventInDecl         (const Char8  *szEventType,
00165                                            const UInt32  uiFieldTypeId,
00166                                            const Char8  *szEventName);
00167 
00168     virtual void beginEventOutDecl        (const Char8  *szEventType,
00169                                            const UInt32  uiFieldTypeId,
00170                                            const Char8  *szEventName);
00171 
00172     virtual void endEventDecl             (void);
00173 
00174     virtual void beginFieldDecl           (const Char8  *szFieldType,
00175                                            const UInt32  uiFieldTypeId,
00176                                            const Char8  *szFieldName);
00177 
00178     virtual void endFieldDecl             (void);
00179 
00180     virtual void beginExposedFieldDecl    (const Char8  *szFieldType,
00181                                            const UInt32  uiFieldTypeId,
00182                                            const Char8  *szFieldName);
00183 
00184     virtual void endExposedFieldDecl      (void);
00185 
00186 
00187     virtual void addExternEventInDecl     (const Char8  *szEventType,
00188                                            const UInt32  uiFieldTypeId,
00189                                            const Char8  *szEventName);
00190 
00191     virtual void addExternEventOutDecl    (const Char8  *szEventType,
00192                                            const UInt32  uiFieldTypeId,
00193                                            const Char8  *szEventName);
00194 
00195     virtual void addExternFieldDecl       (const Char8  *szFieldType,
00196                                            const UInt32  uiFieldTypeId,
00197                                            const Char8  *szFieldName);
00198 
00199     virtual void addExternExposedFieldDecl(const Char8  *szFieldType,
00200                                            const UInt32  uiFieldTypeId,
00201                                            const Char8  *szFieldName);
00202 
00204     /*---------------------------------------------------------------------*/
00208     virtual void beginField(const Char8  *szFieldname,
00209                             const UInt32  uiFieldTypeId);
00210 
00211     virtual void endField  (void);
00212 
00214     /*---------------------------------------------------------------------*/
00218     virtual void beginNode(const Char8 *szNodeTypename,
00219                            const Char8 *szNodename);
00220 
00221     virtual void endNode  (void);
00222 
00223     virtual void use      (const Char8 *szName);
00224     virtual void is       (const Char8 *szName);
00225 
00227     /*---------------------------------------------------------------------*/
00231     virtual void addFieldValue(const Char8 *szFieldVal);
00232 
00233     virtual void addRoute     (const Char8 *szOutNodename,
00234                                const Char8 *szOutFieldname,
00235                                const Char8 *szInNodename,
00236                                const Char8 *szInFieldname);
00237 
00238     virtual void profileElement   (const Char8 *szProfileName);
00239 
00240     virtual void componentElement (const Char8 *szComponentName);
00241 
00242     virtual void metaElement      (const Char8 *szMetaKey,
00243                                                        const Char8 *szMetaValue);
00244 
00245     virtual void importElement    (const Char8 *szInlineName,
00246                                    const Char8 *szNodeName,
00247                                    const Char8 *szImportAs   );
00248 
00249     virtual void exportElement    (const Char8 *szNodeName,
00250                                    const Char8 *szExportAs   );
00251 
00253     /*---------------------------------------------------------------------*/
00257     bool           getMapFieldTypes  (void);
00258 
00259     virtual Int32  mapExtIntFieldType(const Char8 *szFieldname,
00260                                       const Int32  iFieldTypeId);
00261 
00262     virtual UInt32 getFieldType      (const Char8 *szFieldname);
00263 
00265     /*=========================  PROTECTED  ===============================*/
00266   protected:
00267 
00268     /*---------------------------------------------------------------------*/
00272     bool               _bMapTypeIds;
00273     Char8             *_szReferenceHeader;
00274     OSGScanParseLexer *_pLexer;
00275 
00276     void reset             (      void);
00277 
00278     void setMapTypeIds     (      bool   bVal);
00279 
00280     void setReferenceHeader(const Char8 *szReferenceHeader);
00281 
00283     /*==========================  PRIVATE  ================================*/
00284   private:
00285 
00287     ScanParseSkel(const ScanParseSkel &source);
00289     void operator =(const ScanParseSkel &source);
00290 };
00291 
00292 //---------------------------------------------------------------------------
00293 //   Exported Types
00294 //---------------------------------------------------------------------------
00295 
00296 OSG_END_NAMESPACE
00297 
00298 #define OSGSCANPARSESKEL_HEADER_CVSID "@(#)$Id: $"
00299 
00300 #endif /* _OSGSCANPARSESKEL_H_ */
00301 

Generated on Thu Aug 25 04:09:07 2005 for OpenSG by  doxygen 1.4.3