Ignore:
Timestamp:
Jul 13, 2007, 4:22:02 AM (17 years ago)
Author:
dai_9181
Message:

DllProcsクラスを追加。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/include/Procedure.h

    r208 r209  
    205205    }
    206206
    207     bool IsMacro() const
    208     {
    209         return isMacro;
    210     }
    211 
    212     int GetSecondParmNum() const
    213     {
    214         return secondParmNum;
    215     }
    216     const Parameters &RealParams() const
    217     {
    218         return realParams;
    219     }
    220     int GetRealSecondParmNum() const
    221     {
    222         return realSecondParmNum;
    223     }
    224 
    225     void ExportOff(){
    226         isExport = false;
    227     }
    228     bool IsExport() const
    229     {
    230         return isExport;
    231     }
    232     void ThisIsSystemProc() const
    233     {
    234         isSystem = true;
    235     }
    236     bool IsSystem() const
    237     {
    238         return isSystem;
    239     }
    240     void ThisIsAutoGenerationProc() const
    241     {
    242         isAutoGeneration = true;
    243     }
    244     bool IsAutoGeneration() const
    245     {
    246         return isAutoGeneration;
    247     }
    248     void CompleteCompile() const
    249     {
    250         isCompiled = true;
    251     }
    252     void KillCompileStatus() const
    253     {
    254         isCompiled = false;
    255     }
    256     bool IsCompiled() const
    257     {
    258         return isCompiled;
    259     }
    260     bool IsDestructor() const
    261     {
    262         return ( GetName()[0] == '~' );
    263     }
    264 
    265     // バイナリコード位置とサイズ
    266     DWORD GetBeginOpAddress() const
    267     {
    268         return beginOpAddress;
    269     }
    270     void SetBeginOpAddress( DWORD beginOpAddress ) const
    271     {
    272         this->beginOpAddress = beginOpAddress;
    273     }
    274     DWORD GetEndOpAddress() const
    275     {
    276         return endOpAddress;
    277     }
    278     void SetEndOpAddress( DWORD endOpAddress ) const
    279     {
    280         this->endOpAddress = endOpAddress;
    281     }
    282     int GetCodeSize() const
    283     {
    284         return endOpAddress - beginOpAddress;
    285     }
    286 
    287     virtual const NamespaceScopes &GetNamespaceScopes() const;
    288     const NamespaceScopesCollection &GetImportedNamespaces() const;
    289 
    290     Variables &GetLocalVars() const
    291     {
    292         return localVars;
    293     }
    294 
    295     int GetId() const
    296     {
    297         return id;
    298     }
    299 
    300     std::string GetFullName() const;
    301 
    302207    virtual bool IsDuplication( const UserProc *pUserProc ) const
    303208    {
     
    311216    }
    312217
     218    bool IsMacro() const
     219    {
     220        return isMacro;
     221    }
     222
     223    int GetSecondParmNum() const
     224    {
     225        return secondParmNum;
     226    }
     227    const Parameters &RealParams() const
     228    {
     229        return realParams;
     230    }
     231    int GetRealSecondParmNum() const
     232    {
     233        return realSecondParmNum;
     234    }
     235
     236    void ExportOff(){
     237        isExport = false;
     238    }
     239    bool IsExport() const
     240    {
     241        return isExport;
     242    }
     243    void ThisIsSystemProc() const
     244    {
     245        isSystem = true;
     246    }
     247    bool IsSystem() const
     248    {
     249        return isSystem;
     250    }
     251    void ThisIsAutoGenerationProc() const
     252    {
     253        isAutoGeneration = true;
     254    }
     255    bool IsAutoGeneration() const
     256    {
     257        return isAutoGeneration;
     258    }
     259    void CompleteCompile() const
     260    {
     261        isCompiled = true;
     262    }
     263    void KillCompileStatus() const
     264    {
     265        isCompiled = false;
     266    }
     267    bool IsCompiled() const
     268    {
     269        return isCompiled;
     270    }
     271    bool IsDestructor() const
     272    {
     273        return ( GetName()[0] == '~' );
     274    }
     275
     276    // バイナリコード位置とサイズ
     277    DWORD GetBeginOpAddress() const
     278    {
     279        return beginOpAddress;
     280    }
     281    void SetBeginOpAddress( DWORD beginOpAddress ) const
     282    {
     283        this->beginOpAddress = beginOpAddress;
     284    }
     285    DWORD GetEndOpAddress() const
     286    {
     287        return endOpAddress;
     288    }
     289    void SetEndOpAddress( DWORD endOpAddress ) const
     290    {
     291        this->endOpAddress = endOpAddress;
     292    }
     293    int GetCodeSize() const
     294    {
     295        return endOpAddress - beginOpAddress;
     296    }
     297
     298    virtual const NamespaceScopes &GetNamespaceScopes() const;
     299    const NamespaceScopesCollection &GetImportedNamespaces() const;
     300
     301    Variables &GetLocalVars() const
     302    {
     303        return localVars;
     304    }
     305
     306    int GetId() const
     307    {
     308        return id;
     309    }
     310
     311    std::string GetFullName() const;
     312
    313313    bool IsVirtual() const;
    314314
     
    393393
    394394    void EnumGlobalProcs( const char *simpleName, const char *localName, std::vector<const UserProc *> &subs );
    395 
    396     static void CollectUserProcs( const BasicSource &source, UserProcs &userProcs );
    397 };
    398 
    399 class DllProc : public Procedure
     395};
     396
     397class DllProc : public Procedure, public Jenga::Common::ObjectInHashmap<DllProc>
    400398{
    401399    string dllFileName;
     
    428426    {
    429427    }
    430     ~DllProc(){}
     428    ~DllProc()
     429    {
     430    }
     431
     432    virtual const std::string &GetKeyName() const
     433    {
     434        return GetName();
     435    }
     436
     437    virtual bool IsDuplication( const DllProc *pDllProc ) const
     438    {
     439        if( pDllProc->IsEqualSymbol( *this )
     440            && this->Params().Equals( pDllProc->Params() ) )
     441        {
     442            return true;
     443        }
     444        return false;
     445    }
    431446
    432447    const string &GetDllFileName() const
     
    449464    bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine );
    450465};
     466class DllProcs : public Jenga::Common::Hashmap<DllProc>
     467{
     468    // XMLシリアライズ用
     469private:
     470    friend class boost::serialization::access;
     471    template<class Archive> void serialize(Archive& ar, const unsigned int version)
     472    {
     473        trace_for_serialize( "serializing - DllProcs" );
     474
     475        ar & boost::serialization::make_nvp("Hashmap_DllProc",
     476            boost::serialization::base_object<Jenga::Common::Hashmap<DllProc>>(*this));
     477    }
     478
     479public:
     480    void Add(const NamespaceScopes &namespaceScopes, char *buffer,int nowLine);
     481};
     482
     483void CollectProcedures( const BasicSource &source, UserProcs &userProcs, DllProcs &dllProcs );
    451484
    452485class ProcPointer : public Procedure
Note: See TracChangeset for help on using the changeset viewer.