Changeset 632 in dev for trunk/ab5.0/abdev/ab_common/include/Lexical
- Timestamp:
- Jun 5, 2008, 10:04:39 PM (16 years ago)
- Location:
- trunk/ab5.0/abdev/ab_common/include/Lexical
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/ab_common/include/Lexical/Class.h
r603 r632 2 2 3 3 class UserProc; 4 class UserProcs; 4 5 class Delegate; 6 class Classes; 5 7 6 8 class ClassPrototype : public Prototype, public DynamicMethodsPrototype … … 78 80 //アラインメント値 79 81 int fixedAlignment; 82 83 public: 84 ActiveBasic::Common::Lexical::ExpandedTemplateClasses expandedTemplateClasses; 80 85 81 86 // XMLシリアライズ用 … … 101 106 ar & BOOST_SERIALIZATION_NVP( staticMethods ); 102 107 ar & BOOST_SERIALIZATION_NVP( fixedAlignment ); 108 ar & BOOST_SERIALIZATION_NVP( expandedTemplateClasses ); 103 109 } 104 110 … … 106 112 public: 107 113 108 CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name ) 109 : ClassPrototype( namespaceScopes, name ) 110 , importedNamespaces( importedNamespaces ) 111 , classType( Class ) 112 , pSuperClass( NULL ) 113 , blittableType( Type() ) 114 , isReady( false ) 115 , fixedAlignment( 0 ) 116 , ConstructorMemberSubIndex( -1 ) 117 , DestructorMemberSubIndex( -1 ) 118 , vtblNum( 0 ) 119 , vtbl_offset( -1 ) 120 , comVtblOffset( 0 ) 121 , isCompilingConstructor( false ) 122 , isCompilingDestructor( false ) 123 , cacheSize( 0 ) 124 { 125 } 126 CClass() 127 : ClassPrototype() 128 , importedNamespaces() 129 , classType() 130 , pSuperClass( NULL ) 131 , blittableType( Type() ) 132 , isReady( false ) 133 , fixedAlignment( 0 ) 134 , ConstructorMemberSubIndex( -1 ) 135 , DestructorMemberSubIndex( -1 ) 136 , vtblNum( 0 ) 137 , vtbl_offset( -1 ) 138 , comVtblOffset( 0 ) 139 , isCompilingConstructor( false ) 140 , isCompilingDestructor( false ) 141 , cacheSize( 0 ) 142 { 143 } 144 ~CClass() 145 { 146 // 動的メンバ 147 BOOST_FOREACH( Member *member, dynamicMembers ) 148 { 149 delete member; 150 } 151 152 // 静的メンバ 153 BOOST_FOREACH( Member *member, staticMembers ) 154 { 155 delete member; 156 } 157 158 // インターフェイス 159 BOOST_FOREACH( ::Interface *pInterface, interfaces ) 160 { 161 delete pInterface; 162 } 163 } 114 CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name ); 115 CClass( const NamespaceScopes &namespaceScopes, 116 const NamespaceScopesCollection &importedNamespaces, 117 const std::string &name, ClassType classType, 118 const GenericTypes &formalGenericTypes, 119 const Types &superClassActualTypeParameters, 120 int ConstructorMemberSubIndex, 121 int DestructorMemberSubIndex, 122 int vtblNum, 123 int fixedAlignment ); 124 CClass(); 125 ~CClass(); 164 126 165 127 virtual const std::string &GetKeyName() const … … 273 235 this->classType = classType; 274 236 } 237 ClassType GetClassType() const 238 { 239 return classType; 240 } 275 241 276 242 … … 314 280 return interfaces; 315 281 } 282 Interfaces &GetInterfaces() 283 { 284 return interfaces; 285 } 316 286 bool IsInheritsInterface( const CClass *pInterfaceClass ) const; 317 287 … … 372 342 this->ConstructorMemberSubIndex = constructorMemberSubIndex; 373 343 } 344 int GetConstructorMemberSubIndex() const 345 { 346 return ConstructorMemberSubIndex; 347 } 374 348 375 349 //デストラクタ メソッドを取得 … … 382 356 { 383 357 this->DestructorMemberSubIndex = destructorMemberSubIndex; 358 } 359 int GetDestructorMemberSubIndex() const 360 { 361 return DestructorMemberSubIndex; 384 362 } 385 363 -
trunk/ab5.0/abdev/ab_common/include/Lexical/Member.h
r603 r632 33 33 34 34 int source_code_address; 35 36 Member( Prototype::Accessibility accessibility, const std::string &name, const Type &newType, bool isConst, const Subscripts &subscripts, const std::string &initializeExpression, const std::string &constructParameter ); 37 Member( const Member &member, const Type &actualType ); 38 Member( const Member &member ); 39 Member(); 40 ~Member(); 35 41 36 42 const std::string &GetName() const … … 70 76 return constructParameter; 71 77 } 72 73 Member( Prototype::Accessibility accessibility, const std::string &name, const Type &newType, bool isConst, const Subscripts &subscripts, const std::string &initializeExpression, const std::string &constructParameter )74 : MemberPrototype( accessibility )75 , name( name )76 , type( newType )77 , isConst( isConst )78 , subscripts( subscripts )79 , initializeExpression( initializeExpression )80 , constructParameter( constructParameter )81 {82 }83 Member::Member(Member &member)84 : MemberPrototype( member.GetAccessibility() )85 , name( member.GetName() )86 , type( member.GetType() )87 , isConst( member.IsConst() )88 , subscripts( member.GetSubscripts() )89 {90 //ソースコードの位置91 source_code_address=member.source_code_address;92 }93 Member()94 {95 }96 ~Member()97 {98 }99 78 }; 100 79 typedef std::vector<Member *> Members; -
trunk/ab5.0/abdev/ab_common/include/Lexical/ObjectModule.h
r603 r632 4 4 { 5 5 public: 6 // オブジェクトモジュール名 7 std::string name; 8 6 9 // メタ情報 7 10 Meta meta; … … 29 32 trace_for_serialize( "serializing - objectModule" ); 30 33 34 ar & BOOST_SERIALIZATION_NVP( name ); 31 35 ar & BOOST_SERIALIZATION_NVP( meta ); 32 36 ar & BOOST_SERIALIZATION_NVP( globalNativeCode ); … … 39 43 void StaticLink( ObjectModule &objectModule ); 40 44 45 const std::string &GetName() const 46 { 47 return name; 48 } 49 void SetName( const std::string &name ) 50 { 51 this->name = name; 52 } 41 53 int GetCurrentSourceIndex() const 42 54 { -
trunk/ab5.0/abdev/ab_common/include/Lexical/Parameter.h
r603 r632 26 26 27 27 public: 28 Parameter( const std::string &varName, const Type &type, bool isRef = false, const std::string initValue = "" ): 29 Type( type ), 30 varName( varName ), 31 isRef( isRef ), 32 isArray( false ), 33 initValue( initValue ) 34 { 35 } 36 Parameter( const Parameter ¶m ): 37 Type( param ), 38 varName( param.varName ), 39 isRef( param.isRef ), 40 isArray( param.isArray ), 41 subscripts( param.subscripts ), 42 initValue( param.initValue ) 43 { 44 } 45 Parameter() 46 { 47 } 48 ~Parameter(){} 28 Parameter( const std::string &varName, const Type &type, bool isRef = false, const std::string initValue = "" ); 29 Parameter( const Parameter ¶m, const Type &type ); 30 Parameter( const Parameter ¶m ); 31 Parameter(); 32 ~Parameter(); 49 33 50 34 void SetArray( const Subscripts &subscripts ){ -
trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h
r604 r632 24 24 Type returnType; 25 25 26 private: 26 27 // ソースコードの位置 27 int codePos;28 SourceCodePosition sourceCodePosition; 28 29 29 30 // XMLシリアライズ用 … … 40 41 ar & BOOST_SERIALIZATION_NVP( params ); 41 42 ar & BOOST_SERIALIZATION_NVP( returnType ); 42 ar & BOOST_SERIALIZATION_NVP( codePos);43 ar & BOOST_SERIALIZATION_NVP( sourceCodePosition ); 43 44 } 44 45 … … 49 50 , isCdecl( isCdecl ) 50 51 , isUsing( false ) 51 , codePos( -1 )52 52 { 53 53 } … … 83 83 } 84 84 85 int GetCodePos() const86 { 87 return codePos;88 } 89 void Set CodePos( int codePos)90 { 91 this-> codePos = codePos;85 const SourceCodePosition &GetSourceCodePosition() const 86 { 87 return sourceCodePosition; 88 } 89 void SetSourceCodePosition( const SourceCodePosition &sourceCodePosition ) 90 { 91 this->sourceCodePosition = sourceCodePosition; 92 92 } 93 93 … … 178 178 public: 179 179 180 UserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ) 181 : Procedure( namespaceScopes, name, kind, isCdecl ) 182 , importedNamespaces( importedNamespaces ) 183 , pParentClass( NULL ) 184 , pInterface( NULL ) 185 , pMethod( NULL ) 186 , isMacro( isMacro ) 187 , secondParmNum( 0 ) 188 , realSecondParmNum( 1 ) 189 , isExport( isExport ) 190 , isSystem( false ) 191 , isAutoGeneration( false ) 192 , isCompiled( false ) 193 , beginOpAddress( 0 ) 194 , endOpAddress( 0 ) 195 { 196 static int id_base=0; 197 id = ( id_base ++ ); 198 } 199 UserProc() 200 { 201 } 202 ~UserProc() 203 { 204 BOOST_FOREACH( Parameter *pParam, realParams ){ 205 delete pParam; 206 } 207 } 180 UserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ); 181 UserProc( const UserProc &userProc, const CClass *pParentClass ); 182 UserProc(); 183 ~UserProc(); 208 184 209 185 void SetReturnType( const Type &newReturnType ) -
trunk/ab5.0/abdev/ab_common/include/Lexical/Source.h
r603 r632 253 253 }; 254 254 typedef std::vector<BasicSource> BasicSources; 255 256 class SourceCodePosition 257 { 258 std::string objectModuleName; 259 int pos; 260 261 // XMLシリアライズ用 262 private: 263 friend class boost::serialization::access; 264 template<class Archive> void serialize(Archive& ar, const unsigned int version) 265 { 266 trace_for_serialize( "serializing - IncludedFilesRelation" ); 267 268 ar & BOOST_SERIALIZATION_NVP( objectModuleName ); 269 ar & BOOST_SERIALIZATION_NVP( pos ); 270 } 271 272 public: 273 SourceCodePosition( const std::string &objectModuleName, int pos ) 274 : objectModuleName( objectModuleName ) 275 , pos( pos ) 276 { 277 } 278 SourceCodePosition() 279 : pos( -1 ) 280 { 281 } 282 283 const std::string &GetObjectModuleName() const 284 { 285 return objectModuleName; 286 } 287 int GetPos() const 288 { 289 return pos; 290 } 291 }; -
trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h
r603 r632 136 136 void PtrLevelDown(){ 137 137 PTR_LEVEL_DOWN( basicType ); 138 } 139 void SetPtrLevel( int level ) 140 { 141 basicType = MAKE_PTR_TYPE( NATURAL_TYPE( basicType ), level ); 138 142 } 139 143 … … 166 170 bool IsReal() const; 167 171 bool Is64() const; 172 bool IsValueType() const; 168 173 bool IsProcPtr() const; 169 174 bool IsStruct() const; … … 233 238 static int GetBasicTypeFromSimpleName( const char *variable ); 234 239 }; 235 typedef std::vector<Type> Types; 240 241 class Types 242 : public std::vector<Type> 243 { 244 // XMLシリアライズ用 245 private: 246 friend class boost::serialization::access; 247 template<class Archive> void serialize(Archive& ar, const unsigned int version) 248 { 249 ar & boost::serialization::make_nvp("vector_Type", boost::serialization::base_object<vector<Type>>(*this)); 250 } 251 252 public: 253 bool IsEquals( const Types &Types ) const; 254 }; 236 255 237 256 /*! -
trunk/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h
r603 r632 59 59 60 60 void Add( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, int nowLine ); 61 int GetIndex( const Symbol &symbol ) const;61 const TypeDef *Find( const Symbol &symbol ) const; 62 62 };
Note:
See TracChangeset
for help on using the changeset viewer.