fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / ScanParseSkel / OSGScanParseLexer.h
blobdb5847f6fdefc896722a074db9a5dba31ecf1fc4
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGSCANPARSELEXER_H_
40 #define _OSGSCANPARSELEXER_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 //---------------------------------------------------------------------------
46 // Includes
47 //---------------------------------------------------------------------------
49 #include "OSGConfig.h"
51 #if __GNUC__ >= 4 || __GNUC_MINOR__ >=3
52 #pragma GCC diagnostic push
53 #pragma GCC diagnostic ignored "-Weffc++"
54 #endif
56 // We have to prevent double inclusion of the scanner header file
57 #ifndef TOK_HEADER
58 #include "OSGScanParseSkelParser.hpp"
59 #endif
63 #ifndef yyFlexLexer
64 #ifdef OSG_USE_OSG2_NAMESPACE
65 # define yyFlexLexer OSG2ScanParseSkel_FlexLexer
66 #else
67 # define yyFlexLexer OSGScanParseSkel_FlexLexer
68 #endif
69 #ifdef OSG_PREBUILD_SCANPARSE
70 #include "OSGScanParseSkelScanner_FlexLexer.h"
71 #else
72 #include "FlexLexer.h"
73 #endif
74 #undef yyFlexLexer
75 #endif
77 #if __GNUC__ >= 4 || __GNUC_MINOR__ >=3
78 #pragma GCC diagnostic pop
79 #endif
81 #include "OSGBaseTypes.h"
83 // OSG_BEGIN_NAMESPACE
85 //---------------------------------------------------------------------------
86 // Forward References
87 //---------------------------------------------------------------------------
89 //---------------------------------------------------------------------------
90 // Types
91 //---------------------------------------------------------------------------
93 #ifdef OSG_USE_OSG2_NAMESPACE
94 # define OSGScanParseLexer OSG2ScanParseLexer
95 # define OSGScanParseSkel_FlexLexer OSG2ScanParseSkel_FlexLexer
96 #endif
98 //---------------------------------------------------------------------------
99 // Class
100 //---------------------------------------------------------------------------
102 /*! \ingroup GrpSystemFileIOScanParse
103 \ingroup GrpLibOSGSystem
106 class OSGScanParseLexer : public OSGScanParseSkel_FlexLexer
108 private:
110 //-----------------------------------------------------------------------
111 // types
112 //-----------------------------------------------------------------------
114 typedef OSGScanParseSkel_FlexLexer Inherited;
116 public:
118 //-----------------------------------------------------------------------
119 // types
120 //-----------------------------------------------------------------------
122 //-----------------------------------------------------------------------
123 // constants
124 //-----------------------------------------------------------------------
126 //-----------------------------------------------------------------------
127 // enums
128 //-----------------------------------------------------------------------
130 private:
132 //-----------------------------------------------------------------------
133 // enums
134 //-----------------------------------------------------------------------
136 //-----------------------------------------------------------------------
137 // types
138 //-----------------------------------------------------------------------
140 //-----------------------------------------------------------------------
141 // friend classes
142 //-----------------------------------------------------------------------
144 //-----------------------------------------------------------------------
145 // friend functions
146 //-----------------------------------------------------------------------
148 //-----------------------------------------------------------------------
149 // class variables
150 //-----------------------------------------------------------------------
152 //-----------------------------------------------------------------------
153 // class functions
154 //-----------------------------------------------------------------------
156 //-----------------------------------------------------------------------
157 // instance variables
158 //-----------------------------------------------------------------------
160 //-----------------------------------------------------------------------
161 // instance functions
162 //-----------------------------------------------------------------------
164 //! prohibit default function (move to 'public' if needed)
165 OSGScanParseLexer(const OSGScanParseLexer &source);
166 //! prohibit default function (move to 'public' if needed)
167 void operator =(const OSGScanParseLexer &source);
169 virtual int yylex();
171 protected:
173 //-----------------------------------------------------------------------
174 // enums
175 //-----------------------------------------------------------------------
177 //-----------------------------------------------------------------------
178 // types
179 //-----------------------------------------------------------------------
181 //-----------------------------------------------------------------------
182 // class variables
183 //-----------------------------------------------------------------------
185 //-----------------------------------------------------------------------
186 // class functions
187 //-----------------------------------------------------------------------
189 //-----------------------------------------------------------------------
190 // instance variables
191 //-----------------------------------------------------------------------
193 YYSTYPE *lvalp;
195 std::string tmpStr;
196 OSG::Int32 expectToken;
197 OSG::Int32 imageIntsExpected;
199 //-----------------------------------------------------------------------
200 // instance functions
201 //-----------------------------------------------------------------------
203 public :
205 //-----------------------------------------------------------------------
206 // class functions
207 //-----------------------------------------------------------------------
209 //-----------------------------------------------------------------------
210 // instance functions
211 //-----------------------------------------------------------------------
213 OSGScanParseLexer(std::istream *arg_yyin = 0,
214 std::ostream *arg_yyout = 0);
216 virtual ~OSGScanParseLexer(void);
218 /*------------------------- your_category -------------------------------*/
220 inline int yylex(YYSTYPE *plval)
222 this->lvalp = plval;
223 return yylex();
226 /*------------------------- your_operators ------------------------------*/
228 inline void expectType(OSG::Int32 iType)
229 { expectToken = iType; }
231 inline void expectImageInts(OSG::Int32 iImageIntsExpected)
232 { this->imageIntsExpected = iImageIntsExpected; }
234 /*------------------------- assignment ----------------------------------*/
236 /*------------------------- comparison ----------------------------------*/
239 //OSG_END_NAMESPACE
241 #endif /* _OSGSCANPARSESKELLEXER_H_ */