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