doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TypeInfoGen.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #ifndef __TYPEINFOGEN_H__
30 #define __TYPEINFOGEN_H__
31 
32 /*
33 ===================================================================================
34 
35  Type Info Generator
36 
37  - template classes are commented out (different instantiations are not identified)
38  - bit fields are commented out (cannot get the address of bit fields)
39  - multiple inheritance is not supported (only tracks a single super type)
40 
41 ===================================================================================
42 */
43 
45 public:
49 };
50 
52 public:
54  int value;
55 };
56 
58 public:
61  bool unnamed;
62  bool isTemplate;
64 };
65 
67 public:
70  int bits;
71 };
72 
74 public:
78  bool unnamed;
79  bool isTemplate;
81 };
82 
84 public:
85  idTypeInfoGen( void );
86  ~idTypeInfoGen( void );
87 
88  void AddDefine( const char *define );
89  void CreateTypeInfo( const char *path );
90  void WriteTypeInfo( const char *fileName ) const;
91 
92 private:
94 
98 
102 
103  int GetInheritance( const char *typeName ) const;
104  int EvaluateIntegerString( const idStr &string );
105  float EvaluateFloatString( const idStr &string );
106  idConstantInfo * FindConstant( const char *name );
107  int GetIntegerConstant( const char *scope, const char *name, idParser &src );
108  float GetFloatConstant( const char *scope, const char *name, idParser &src );
109  int ParseArraySize( const char *scope, idParser &src );
110  void ParseConstantValue( const char *scope, idParser &src, idStr &value );
111  idEnumTypeInfo * ParseEnumType( const char *scope, bool isTemplate, bool typeDef, idParser &src );
112  idClassTypeInfo * ParseClassType( const char *scope, const char *templateArgs, bool isTemplate, bool typeDef, idParser &src );
113  void ParseScope( const char *scope, bool isTemplate, idParser &src, idClassTypeInfo *typeInfo );
114 };
115 
116 #endif /* !__TYPEINFOGEN_H__ */
idList< idEnumValueInfo > values
Definition: TypeInfoGen.h:63
GLsizei const GLfloat * value
Definition: glext.h:3614
idEnumTypeInfo * ParseEnumType(const char *scope, bool isTemplate, bool typeDef, idParser &src)
idList< idClassTypeInfo * > classes
Definition: TypeInfoGen.h:97
void ParseScope(const char *scope, bool isTemplate, idParser &src, idClassTypeInfo *typeInfo)
idConstantInfo * FindConstant(const char *name)
void WriteTypeInfo(const char *fileName) const
int EvaluateIntegerString(const idStr &string)
Definition: TypeInfoGen.cpp:78
GLuint src
Definition: glext.h:5390
idStr maxInheritanceClass
Definition: TypeInfoGen.h:101
idClassTypeInfo * ParseClassType(const char *scope, const char *templateArgs, bool isTemplate, bool typeDef, idParser &src)
float EvaluateFloatString(const idStr &string)
Definition: TypeInfoGen.cpp:95
idList< idConstantInfo * > constants
Definition: TypeInfoGen.h:95
idTypeInfoGen(void)
Definition: TypeInfoGen.cpp:40
const char * path
Definition: sws.c:117
void AddDefine(const char *define)
idStrList defines
Definition: TypeInfoGen.h:93
int ParseArraySize(const char *scope, idParser &src)
void ParseConstantValue(const char *scope, idParser &src, idStr &value)
int GetInheritance(const char *typeName) const
Definition: TypeInfoGen.cpp:59
const GLcharARB * name
Definition: glext.h:3629
~idTypeInfoGen(void)
Definition: TypeInfoGen.cpp:48
Definition: Str.h:116
idList< idClassVariableInfo > variables
Definition: TypeInfoGen.h:80
idList< idEnumTypeInfo * > enums
Definition: TypeInfoGen.h:96
void CreateTypeInfo(const char *path)
float GetFloatConstant(const char *scope, const char *name, idParser &src)
int GetIntegerConstant(const char *scope, const char *name, idParser &src)