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