[184] | 1 | #pragma once
|
---|
| 2 |
|
---|
[206] | 3 | #include <option.h>
|
---|
| 4 | #include <Program.h>
|
---|
| 5 | #include <Class.h>
|
---|
| 6 | #include <Procedure.h>
|
---|
| 7 | #include <Parameter.h>
|
---|
| 8 | #include <Variable.h>
|
---|
[225] | 9 | #include <CodeGenerator.h>
|
---|
[266] | 10 | #include <Source.h>
|
---|
[184] | 11 |
|
---|
[206] | 12 | class CClass;
|
---|
[353] | 13 | class Interface;
|
---|
[206] | 14 | class CMethod;
|
---|
| 15 |
|
---|
[208] | 16 | class Procedure : public Symbol
|
---|
[184] | 17 | {
|
---|
| 18 | public:
|
---|
[206] | 19 | // 種類
|
---|
| 20 | enum Kind{
|
---|
| 21 | Sub,
|
---|
| 22 | Function,
|
---|
| 23 | };
|
---|
| 24 |
|
---|
| 25 | private:
|
---|
| 26 | Kind kind;
|
---|
| 27 |
|
---|
| 28 | bool isCdecl;
|
---|
| 29 | mutable bool isUsing;
|
---|
| 30 |
|
---|
| 31 | protected:
|
---|
| 32 |
|
---|
| 33 | // パラメータ
|
---|
| 34 | Parameters params;
|
---|
| 35 |
|
---|
| 36 | // 戻り値の型
|
---|
| 37 | Type returnType;
|
---|
| 38 |
|
---|
| 39 | // ソースコードの位置
|
---|
| 40 | int codePos;
|
---|
| 41 |
|
---|
| 42 | // XMLシリアライズ用
|
---|
| 43 | private:
|
---|
| 44 | friend class boost::serialization::access;
|
---|
[208] | 45 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
[184] | 46 | {
|
---|
[206] | 47 | trace_for_serialize( "serializing - Procedure" );
|
---|
| 48 |
|
---|
[208] | 49 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
|
---|
[206] | 50 | ar & BOOST_SERIALIZATION_NVP( kind );
|
---|
| 51 | ar & BOOST_SERIALIZATION_NVP( isCdecl );
|
---|
| 52 | ar & BOOST_SERIALIZATION_NVP( isUsing );
|
---|
| 53 | ar & BOOST_SERIALIZATION_NVP( params );
|
---|
| 54 | ar & BOOST_SERIALIZATION_NVP( returnType );
|
---|
| 55 | ar & BOOST_SERIALIZATION_NVP( codePos );
|
---|
[184] | 56 | }
|
---|
[206] | 57 |
|
---|
| 58 | public:
|
---|
[208] | 59 | Procedure( const NamespaceScopes &namespaceScopes, const string &name, Kind kind, bool isCdecl )
|
---|
| 60 | : Symbol( namespaceScopes, name )
|
---|
[206] | 61 | , kind( kind )
|
---|
| 62 | , isCdecl( isCdecl )
|
---|
| 63 | , isUsing( false )
|
---|
| 64 | , codePos( -1 )
|
---|
| 65 | {
|
---|
| 66 | }
|
---|
| 67 | Procedure()
|
---|
| 68 | {
|
---|
| 69 | }
|
---|
| 70 | ~Procedure(){
|
---|
| 71 | BOOST_FOREACH( Parameter *pParam, params ){
|
---|
| 72 | delete pParam;
|
---|
| 73 | }
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | bool IsSub() const
|
---|
| 77 | {
|
---|
| 78 | return ( kind == Sub );
|
---|
| 79 | }
|
---|
| 80 | bool IsFunction() const
|
---|
| 81 | {
|
---|
| 82 | return ( kind == Function );
|
---|
| 83 | }
|
---|
| 84 |
|
---|
| 85 | bool IsCdecl() const
|
---|
| 86 | {
|
---|
| 87 | return isCdecl;
|
---|
| 88 | }
|
---|
| 89 | void Using() const
|
---|
| 90 | {
|
---|
| 91 | isUsing = true;
|
---|
| 92 | }
|
---|
| 93 | bool IsUsing() const
|
---|
| 94 | {
|
---|
| 95 | return isUsing;
|
---|
| 96 | }
|
---|
| 97 |
|
---|
| 98 | int GetCodePos() const
|
---|
| 99 | {
|
---|
| 100 | return codePos;
|
---|
| 101 | }
|
---|
| 102 |
|
---|
| 103 | const Parameters &Params() const
|
---|
| 104 | {
|
---|
| 105 | return params;
|
---|
| 106 | }
|
---|
| 107 | const Type &ReturnType() const
|
---|
| 108 | {
|
---|
| 109 | return returnType;
|
---|
| 110 | }
|
---|
[184] | 111 | };
|
---|
| 112 |
|
---|
[206] | 113 | class UserProc : public Procedure, public Jenga::Common::ObjectInHashmap<UserProc>
|
---|
[184] | 114 | {
|
---|
| 115 | public:
|
---|
[206] | 116 | string _paramStr;
|
---|
[184] | 117 |
|
---|
[206] | 118 | private:
|
---|
| 119 | NamespaceScopesCollection importedNamespaces;
|
---|
[184] | 120 |
|
---|
[206] | 121 | // 親クラスと対応するメソッド
|
---|
| 122 | const CClass *pParentClass;
|
---|
[353] | 123 | const Interface *pInterface;
|
---|
[206] | 124 | CMethod *pMethod;
|
---|
| 125 |
|
---|
| 126 | bool isMacro;
|
---|
| 127 |
|
---|
| 128 | // パラメータの追加情報
|
---|
| 129 | int secondParmNum;
|
---|
| 130 | Parameters realParams;
|
---|
| 131 | int realSecondParmNum;
|
---|
| 132 |
|
---|
| 133 | // 各種フラグ
|
---|
| 134 | bool isExport;
|
---|
| 135 | mutable bool isSystem;
|
---|
| 136 | mutable bool isAutoGeneration;
|
---|
| 137 | mutable bool isCompiled;
|
---|
| 138 |
|
---|
| 139 | mutable DWORD beginOpAddress;
|
---|
| 140 | mutable DWORD endOpAddress;
|
---|
| 141 |
|
---|
| 142 | // ローカル変数
|
---|
| 143 | mutable Variables localVars;
|
---|
| 144 |
|
---|
| 145 | // 識別ID
|
---|
| 146 | int id;
|
---|
| 147 |
|
---|
[224] | 148 | // ネイティブコード
|
---|
| 149 | NativeCode nativeCode;
|
---|
| 150 |
|
---|
[206] | 151 | // XMLシリアライズ用
|
---|
| 152 | private:
|
---|
| 153 | friend class boost::serialization::access;
|
---|
| 154 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
[184] | 155 | {
|
---|
[206] | 156 | trace_for_serialize( "serializing - UserProc" );
|
---|
| 157 |
|
---|
| 158 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
|
---|
| 159 | ar & BOOST_SERIALIZATION_NVP( _paramStr );
|
---|
| 160 | ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
|
---|
| 161 | ar & boost::serialization::make_nvp("pParentClass", const_cast<CClass *&>(pParentClass) );
|
---|
[353] | 162 | ar & boost::serialization::make_nvp("pInterface", const_cast<Interface *&>(pInterface) );
|
---|
[206] | 163 | ar & BOOST_SERIALIZATION_NVP( pMethod );
|
---|
| 164 | ar & BOOST_SERIALIZATION_NVP( isMacro );
|
---|
| 165 | ar & BOOST_SERIALIZATION_NVP( secondParmNum );
|
---|
| 166 | ar & BOOST_SERIALIZATION_NVP( realParams );
|
---|
| 167 | ar & BOOST_SERIALIZATION_NVP( realSecondParmNum );
|
---|
| 168 | ar & BOOST_SERIALIZATION_NVP( isExport );
|
---|
| 169 | ar & BOOST_SERIALIZATION_NVP( isSystem );
|
---|
| 170 | ar & BOOST_SERIALIZATION_NVP( isAutoGeneration );
|
---|
| 171 | ar & BOOST_SERIALIZATION_NVP( isCompiled );
|
---|
| 172 | ar & BOOST_SERIALIZATION_NVP( beginOpAddress );
|
---|
| 173 | ar & BOOST_SERIALIZATION_NVP( endOpAddress );
|
---|
| 174 | ar & BOOST_SERIALIZATION_NVP( localVars );
|
---|
| 175 | ar & BOOST_SERIALIZATION_NVP( id );
|
---|
[224] | 176 | ar & BOOST_SERIALIZATION_NVP( nativeCode );
|
---|
[184] | 177 | }
|
---|
| 178 |
|
---|
[206] | 179 | public:
|
---|
| 180 |
|
---|
[511] | 181 | UserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport )
|
---|
[208] | 182 | : Procedure( namespaceScopes, name, kind, isCdecl )
|
---|
[206] | 183 | , importedNamespaces( importedNamespaces )
|
---|
| 184 | , pParentClass( NULL )
|
---|
[353] | 185 | , pInterface( NULL )
|
---|
[206] | 186 | , pMethod( NULL )
|
---|
| 187 | , isMacro( isMacro )
|
---|
[511] | 188 | , secondParmNum( 0 )
|
---|
| 189 | , realSecondParmNum( 1 )
|
---|
[206] | 190 | , isExport( isExport )
|
---|
| 191 | , isSystem( false )
|
---|
| 192 | , isAutoGeneration( false )
|
---|
| 193 | , isCompiled( false )
|
---|
| 194 | , beginOpAddress( 0 )
|
---|
| 195 | , endOpAddress( 0 )
|
---|
| 196 | {
|
---|
[511] | 197 | static int id_base=0;
|
---|
| 198 | id = ( id_base ++ );
|
---|
[206] | 199 | }
|
---|
| 200 | UserProc()
|
---|
| 201 | {
|
---|
| 202 | }
|
---|
| 203 | ~UserProc()
|
---|
| 204 | {
|
---|
| 205 | BOOST_FOREACH( Parameter *pParam, realParams ){
|
---|
| 206 | delete pParam;
|
---|
| 207 | }
|
---|
| 208 | }
|
---|
| 209 |
|
---|
[511] | 210 | void SetReturnType( const Type &newReturnType )
|
---|
| 211 | {
|
---|
| 212 | returnType = newReturnType;
|
---|
| 213 | }
|
---|
| 214 |
|
---|
[206] | 215 | virtual const std::string &GetKeyName() const
|
---|
| 216 | {
|
---|
| 217 | return GetName();
|
---|
| 218 | }
|
---|
| 219 |
|
---|
[209] | 220 | virtual bool IsDuplication( const UserProc *pUserProc ) const
|
---|
| 221 | {
|
---|
[326] | 222 | if( this->GetParentClassPtr() == pUserProc->GetParentClassPtr() // 親クラスが等しい
|
---|
[353] | 223 | && this->pInterface == pUserProc->pInterface // インターフェイスが等しい
|
---|
[326] | 224 | && pUserProc->IsEqualSymbol( *this ) // 名前空間及び名前が等しい
|
---|
| 225 | && this->Params().Equals( pUserProc->Params() ) // パラメータが等しい
|
---|
| 226 | && this->returnType.Equals( pUserProc->returnType ) ) // 戻り値が等しい
|
---|
[209] | 227 | {
|
---|
| 228 | return true;
|
---|
| 229 | }
|
---|
| 230 | return false;
|
---|
| 231 | }
|
---|
| 232 |
|
---|
[382] | 233 | /*!
|
---|
| 234 | @brief オーバーライド用に関数同士が等しいかどうかをチェックする
|
---|
| 235 | @param actualTypeParametersForThisProc thisオブジェクトで保有するメソッドを対象とした実型パラメータ
|
---|
| 236 | pUserProc 照らし合わせる関数
|
---|
| 237 | */
|
---|
| 238 | bool IsEqualForOverride( const Types &actualTypeParametersForThisProc, const UserProc *pUserProc ) const;
|
---|
[351] | 239 |
|
---|
[206] | 240 | bool IsMacro() const
|
---|
| 241 | {
|
---|
| 242 | return isMacro;
|
---|
| 243 | }
|
---|
| 244 |
|
---|
| 245 | int GetSecondParmNum() const
|
---|
| 246 | {
|
---|
| 247 | return secondParmNum;
|
---|
| 248 | }
|
---|
| 249 | const Parameters &RealParams() const
|
---|
| 250 | {
|
---|
| 251 | return realParams;
|
---|
| 252 | }
|
---|
[511] | 253 | void SetRealParams( const Parameters ¶ms )
|
---|
| 254 | {
|
---|
| 255 | realParams = params;
|
---|
| 256 | }
|
---|
[206] | 257 | int GetRealSecondParmNum() const
|
---|
| 258 | {
|
---|
| 259 | return realSecondParmNum;
|
---|
| 260 | }
|
---|
| 261 |
|
---|
| 262 | void ExportOff(){
|
---|
| 263 | isExport = false;
|
---|
| 264 | }
|
---|
| 265 | bool IsExport() const
|
---|
| 266 | {
|
---|
| 267 | return isExport;
|
---|
| 268 | }
|
---|
| 269 | void ThisIsSystemProc() const
|
---|
| 270 | {
|
---|
| 271 | isSystem = true;
|
---|
| 272 | }
|
---|
| 273 | bool IsSystem() const
|
---|
| 274 | {
|
---|
| 275 | return isSystem;
|
---|
| 276 | }
|
---|
| 277 | void ThisIsAutoGenerationProc() const
|
---|
| 278 | {
|
---|
| 279 | isAutoGeneration = true;
|
---|
| 280 | }
|
---|
| 281 | bool IsAutoGeneration() const
|
---|
| 282 | {
|
---|
| 283 | return isAutoGeneration;
|
---|
| 284 | }
|
---|
| 285 | void CompleteCompile() const
|
---|
| 286 | {
|
---|
| 287 | isCompiled = true;
|
---|
| 288 | }
|
---|
| 289 | void KillCompileStatus() const
|
---|
| 290 | {
|
---|
| 291 | isCompiled = false;
|
---|
| 292 | }
|
---|
| 293 | bool IsCompiled() const
|
---|
| 294 | {
|
---|
| 295 | return isCompiled;
|
---|
| 296 | }
|
---|
| 297 | bool IsDestructor() const
|
---|
| 298 | {
|
---|
| 299 | return ( GetName()[0] == '~' );
|
---|
| 300 | }
|
---|
| 301 |
|
---|
| 302 | // バイナリコード位置とサイズ
|
---|
| 303 | DWORD GetBeginOpAddress() const
|
---|
| 304 | {
|
---|
| 305 | return beginOpAddress;
|
---|
| 306 | }
|
---|
| 307 | void SetBeginOpAddress( DWORD beginOpAddress ) const
|
---|
| 308 | {
|
---|
| 309 | this->beginOpAddress = beginOpAddress;
|
---|
| 310 | }
|
---|
| 311 | DWORD GetEndOpAddress() const
|
---|
| 312 | {
|
---|
| 313 | return endOpAddress;
|
---|
| 314 | }
|
---|
| 315 | void SetEndOpAddress( DWORD endOpAddress ) const
|
---|
| 316 | {
|
---|
| 317 | this->endOpAddress = endOpAddress;
|
---|
| 318 | }
|
---|
| 319 | int GetCodeSize() const
|
---|
| 320 | {
|
---|
| 321 | return endOpAddress - beginOpAddress;
|
---|
| 322 | }
|
---|
| 323 |
|
---|
[208] | 324 | virtual const NamespaceScopes &GetNamespaceScopes() const;
|
---|
[206] | 325 | const NamespaceScopesCollection &GetImportedNamespaces() const;
|
---|
| 326 |
|
---|
| 327 | Variables &GetLocalVars() const
|
---|
| 328 | {
|
---|
| 329 | return localVars;
|
---|
| 330 | }
|
---|
| 331 |
|
---|
| 332 | int GetId() const
|
---|
| 333 | {
|
---|
| 334 | return id;
|
---|
| 335 | }
|
---|
| 336 |
|
---|
[257] | 337 | const NativeCode &GetNativeCode() const
|
---|
| 338 | {
|
---|
| 339 | return nativeCode;
|
---|
| 340 | }
|
---|
[225] | 341 | NativeCode &GetNativeCode()
|
---|
| 342 | {
|
---|
| 343 | return nativeCode;
|
---|
| 344 | }
|
---|
| 345 |
|
---|
[206] | 346 | std::string GetFullName() const;
|
---|
[350] | 347 | bool IsCastOperator() const;
|
---|
[206] | 348 |
|
---|
| 349 | bool IsVirtual() const;
|
---|
| 350 |
|
---|
| 351 | void SetParentClass( const CClass *pParentClass ){
|
---|
| 352 | this->pParentClass = pParentClass;
|
---|
| 353 | }
|
---|
| 354 | const CClass *GetParentClassPtr() const
|
---|
| 355 | {
|
---|
| 356 | return pParentClass;
|
---|
| 357 | }
|
---|
| 358 | const CClass &GetParentClass() const
|
---|
| 359 | {
|
---|
| 360 | return *pParentClass;
|
---|
| 361 | }
|
---|
| 362 | bool HasParentClass() const
|
---|
| 363 | {
|
---|
| 364 | return ( pParentClass != NULL );
|
---|
| 365 | }
|
---|
[208] | 366 | bool IsGlobalProcedure() const
|
---|
| 367 | {
|
---|
| 368 | return ( pParentClass == NULL );
|
---|
| 369 | }
|
---|
[353] | 370 | void SetInterface( const Interface *pInterface )
|
---|
| 371 | {
|
---|
| 372 | this->pInterface = pInterface;
|
---|
| 373 | }
|
---|
[206] | 374 | void SetMethod( CMethod *pMethod ){
|
---|
| 375 | this->pMethod = pMethod;
|
---|
| 376 | }
|
---|
[336] | 377 | const CMethod &GetMethod() const;
|
---|
[206] | 378 |
|
---|
| 379 | bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine, bool isStatic );
|
---|
| 380 |
|
---|
| 381 |
|
---|
| 382 |
|
---|
| 383 | /////////////////////////////////////////////////////////////////
|
---|
| 384 | // コンパイル中の関数を管理
|
---|
| 385 | /////////////////////////////////////////////////////////////////
|
---|
| 386 | private:
|
---|
| 387 | static const UserProc *pCompilingUserProc;
|
---|
| 388 | public:
|
---|
[364] | 389 | static const UserProc *pGlobalProc;
|
---|
[206] | 390 | static void CompileStartForGlobalArea(){
|
---|
| 391 | pCompilingUserProc = NULL;
|
---|
| 392 | }
|
---|
| 393 | static void CompileStartForUserProc( const UserProc *pUserProc ){
|
---|
| 394 | pCompilingUserProc = pUserProc;
|
---|
| 395 | }
|
---|
| 396 | static bool IsGlobalAreaCompiling(){
|
---|
| 397 | return ( pCompilingUserProc == NULL );
|
---|
| 398 | }
|
---|
| 399 | static bool IsLocalAreaCompiling(){
|
---|
| 400 | return ( pCompilingUserProc != NULL );
|
---|
| 401 | }
|
---|
| 402 | static const UserProc &CompilingUserProc(){
|
---|
| 403 | return *pCompilingUserProc;
|
---|
| 404 | }
|
---|
[184] | 405 | };
|
---|
| 406 |
|
---|
[206] | 407 | class UserProcs : public Jenga::Common::Hashmap<UserProc>
|
---|
[184] | 408 | {
|
---|
[206] | 409 | // XMLシリアライズ用
|
---|
| 410 | private:
|
---|
| 411 | friend class boost::serialization::access;
|
---|
| 412 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 413 | {
|
---|
| 414 | trace_for_serialize( "serializing - UserProcs" );
|
---|
| 415 |
|
---|
| 416 | ar & boost::serialization::make_nvp("Hashmap_UserProcImpl",
|
---|
| 417 | boost::serialization::base_object<Jenga::Common::Hashmap<UserProc>>(*this));
|
---|
| 418 | }
|
---|
| 419 |
|
---|
| 420 |
|
---|
[184] | 421 | public:
|
---|
[206] | 422 | UserProcs()
|
---|
[184] | 423 | {
|
---|
| 424 | }
|
---|
[206] | 425 | ~UserProcs()
|
---|
| 426 | {
|
---|
| 427 | }
|
---|
[184] | 428 |
|
---|
[206] | 429 | bool Insert( UserProc *pUserProc, int nowLine );
|
---|
| 430 |
|
---|
| 431 | void EnumGlobalProcs( const char *simpleName, const char *localName, std::vector<const UserProc *> &subs );
|
---|
| 432 | };
|
---|
| 433 |
|
---|
[209] | 434 | class DllProc : public Procedure, public Jenga::Common::ObjectInHashmap<DllProc>
|
---|
[206] | 435 | {
|
---|
| 436 | string dllFileName;
|
---|
| 437 | string alias;
|
---|
| 438 | int lookupAddress;
|
---|
| 439 |
|
---|
| 440 | // XMLシリアライズ用
|
---|
| 441 | private:
|
---|
| 442 | friend class boost::serialization::access;
|
---|
| 443 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 444 | {
|
---|
| 445 | trace_for_serialize( "serializing - DllProc" );
|
---|
| 446 |
|
---|
| 447 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
|
---|
| 448 | ar & BOOST_SERIALIZATION_NVP( dllFileName );
|
---|
| 449 | ar & BOOST_SERIALIZATION_NVP( alias );
|
---|
| 450 | ar & BOOST_SERIALIZATION_NVP( lookupAddress );
|
---|
| 451 | }
|
---|
| 452 |
|
---|
| 453 | public:
|
---|
[210] | 454 | DllProc( const NamespaceScopes &namespaceScopes, const string &name, Kind kind, bool isCdecl, const string &dllFileName, const string &alias )
|
---|
| 455 | : Procedure( namespaceScopes, name, kind, isCdecl )
|
---|
| 456 | , dllFileName( dllFileName )
|
---|
| 457 | , alias( alias )
|
---|
| 458 | , lookupAddress( 0 )
|
---|
[206] | 459 | {
|
---|
| 460 | }
|
---|
[210] | 461 | DllProc()
|
---|
| 462 | {
|
---|
| 463 | }
|
---|
[209] | 464 | ~DllProc()
|
---|
| 465 | {
|
---|
| 466 | }
|
---|
[206] | 467 |
|
---|
[209] | 468 | virtual const std::string &GetKeyName() const
|
---|
| 469 | {
|
---|
| 470 | return GetName();
|
---|
| 471 | }
|
---|
| 472 |
|
---|
| 473 | virtual bool IsDuplication( const DllProc *pDllProc ) const
|
---|
| 474 | {
|
---|
| 475 | if( pDllProc->IsEqualSymbol( *this )
|
---|
| 476 | && this->Params().Equals( pDllProc->Params() ) )
|
---|
| 477 | {
|
---|
| 478 | return true;
|
---|
| 479 | }
|
---|
| 480 | return false;
|
---|
| 481 | }
|
---|
| 482 |
|
---|
[206] | 483 | const string &GetDllFileName() const
|
---|
| 484 | {
|
---|
| 485 | return dllFileName;
|
---|
| 486 | }
|
---|
| 487 | const string &GetAlias() const
|
---|
| 488 | {
|
---|
| 489 | return alias;
|
---|
| 490 | }
|
---|
| 491 |
|
---|
| 492 | void SetLookupAddress( int lookupAddress ){
|
---|
| 493 | this->lookupAddress = lookupAddress;
|
---|
| 494 | }
|
---|
| 495 | int GetLookupAddress() const
|
---|
| 496 | {
|
---|
| 497 | return lookupAddress;
|
---|
| 498 | }
|
---|
| 499 |
|
---|
| 500 | bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine );
|
---|
[184] | 501 | };
|
---|
[209] | 502 | class DllProcs : public Jenga::Common::Hashmap<DllProc>
|
---|
| 503 | {
|
---|
| 504 | // XMLシリアライズ用
|
---|
| 505 | private:
|
---|
| 506 | friend class boost::serialization::access;
|
---|
| 507 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 508 | {
|
---|
| 509 | trace_for_serialize( "serializing - DllProcs" );
|
---|
[184] | 510 |
|
---|
[209] | 511 | ar & boost::serialization::make_nvp("Hashmap_DllProc",
|
---|
| 512 | boost::serialization::base_object<Jenga::Common::Hashmap<DllProc>>(*this));
|
---|
| 513 | }
|
---|
| 514 |
|
---|
| 515 | public:
|
---|
| 516 | void Add(const NamespaceScopes &namespaceScopes, char *buffer,int nowLine);
|
---|
| 517 | };
|
---|
| 518 |
|
---|
[206] | 519 | class ProcPointer : public Procedure
|
---|
[184] | 520 | {
|
---|
[206] | 521 | // XMLシリアライズ用
|
---|
| 522 | private:
|
---|
| 523 | friend class boost::serialization::access;
|
---|
| 524 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 525 | {
|
---|
| 526 | trace_for_serialize( "serializing - ProcPointer" );
|
---|
| 527 |
|
---|
| 528 | ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
|
---|
| 529 | }
|
---|
| 530 |
|
---|
[184] | 531 | public:
|
---|
[206] | 532 | ProcPointer( Kind kind )
|
---|
[208] | 533 | : Procedure( NamespaceScopes(), std::string(), kind, false )
|
---|
[184] | 534 | {
|
---|
| 535 | }
|
---|
[206] | 536 | ProcPointer()
|
---|
| 537 | {
|
---|
| 538 | }
|
---|
| 539 | ~ProcPointer(){}
|
---|
[184] | 540 |
|
---|
| 541 | virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine );
|
---|
| 542 | };
|
---|
| 543 |
|
---|
[206] | 544 | class ProcPointers : public vector<ProcPointer *>
|
---|
[184] | 545 | {
|
---|
[206] | 546 | // XMLシリアライズ用
|
---|
| 547 | private:
|
---|
| 548 | friend class boost::serialization::access;
|
---|
| 549 | template<class Archive> void serialize(Archive& ar, const unsigned int version)
|
---|
| 550 | {
|
---|
| 551 | trace_for_serialize( "serializing - ProcPointers" );
|
---|
| 552 |
|
---|
| 553 | ar & boost::serialization::make_nvp("vector_ProcPointer",
|
---|
| 554 | boost::serialization::base_object<vector<ProcPointer *>>(*this));
|
---|
| 555 | }
|
---|
| 556 |
|
---|
[184] | 557 | public:
|
---|
[206] | 558 | ProcPointers()
|
---|
[184] | 559 | {
|
---|
| 560 | }
|
---|
[206] | 561 | ~ProcPointers()
|
---|
[184] | 562 | {
|
---|
| 563 | Clear();
|
---|
| 564 | }
|
---|
| 565 |
|
---|
[271] | 566 | int Add( const string &typeExpression );
|
---|
| 567 | void Clear();
|
---|
| 568 | void PullOutAll()
|
---|
| 569 | {
|
---|
| 570 | clear();
|
---|
| 571 | }
|
---|
[184] | 572 | };
|
---|