Changeset 100 in dev for BasicCompiler_Common/Class.cpp


Ignore:
Timestamp:
Apr 24, 2007, 3:17:29 AM (17 years ago)
Author:
dai_9181
Message:

名前空間機能をグローバル関数に適用。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/Class.cpp

    r97 r100  
    118118
    119119
    120 CMethod::CMethod(CMethod *pobj){
    121     //コピーコンストラクタ
    122     memset(this,0,sizeof(CMethod));
    123 
    124     pUserProc=pobj->pUserProc;
    125 
    126     bAbstract=pobj->bAbstract;
    127 
    128     bVirtual=pobj->bVirtual;
    129 }
    130 CMethod::CMethod(){
    131     memset(this,0,sizeof(CMethod));
     120//コピーコンストラクタ
     121CMethod::CMethod(CMethod *pMethod)
     122    : pUserProc( pMethod->pUserProc )
     123    , dwAccess( pMethod->dwAccess )
     124    , bAbstract( pMethod->bAbstract )
     125    , bVirtual( pMethod->bVirtual )
     126    , isConst( pMethod->isConst )
     127    , isStatic( pMethod->isStatic )
     128{
     129}
     130
     131CMethod::CMethod( UserProc *pUserProc, DWORD dwAccess, BOOL bAbstract, BOOL bVirtual, bool isConst, bool isStatic )
     132    : pUserProc( pUserProc )
     133    , dwAccess( dwAccess )
     134    , bAbstract( bAbstract )
     135    , bVirtual( bVirtual )
     136    , isConst( isConst )
     137    , isStatic( isStatic )
     138    , pobj_InheritsClass( NULL )
     139{
    132140}
    133141CMethod::~CMethod(){
     
    330338}
    331339void CClass::AddMethod( UserProc *pUserProc,DWORD dwAccess, bool isConst, BOOL bAbstract, BOOL bVirtual ){
    332     CMethod *method = new CMethod();
    333     method->pUserProc = pUserProc;
    334     method->dwAccess = dwAccess;
    335     method->isConst = isConst;
    336     method->bAbstract = bAbstract;
    337     method->bVirtual = bVirtual;
    338     method->pobj_InheritsClass = 0;
     340    CMethod *method = new CMethod( pUserProc, dwAccess, bAbstract, bVirtual, isConst, false );
    339341
    340342    methods.push_back( method );
     
    344346}
    345347void CClass::AddStaticMethod(UserProc *pUserProc,DWORD dwAccess){
    346     CMethod *method = new CMethod();
    347     method->pUserProc=pUserProc;
    348     method->dwAccess=dwAccess;
    349     method->bAbstract=0;
    350     method->bVirtual=0;
    351     method->pobj_InheritsClass=0;
     348    CMethod *method = new CMethod( pUserProc, dwAccess, FALSE, FALSE, false, true );
    352349
    353350    staticMethods.push_back( method );
     
    421418}
    422419
    423 void CClass::EnumStaticMethod( const char *methodName, std::vector<UserProc *> &subs ) const
     420void CClass::EnumStaticMethod( const char *methodName, vector<UserProc *> &subs ) const
    424421{
    425422    foreach( CMethod *method, staticMethods ){
     
    430427}
    431428
    432 void CClass::EnumMethod( const char *methodName, std::vector<UserProc *> &subs ) const
     429void CClass::EnumMethod( const char *methodName, vector<UserProc *> &subs ) const
    433430{
    434431    //オブジェクトのメンバ関数の場合
     
    441438}
    442439
    443 void CClass::EnumMethod( const BYTE idOperatorCalc, std::vector<UserProc *> &subs ) const
     440void CClass::EnumMethod( const BYTE idOperatorCalc, vector<UserProc *> &subs ) const
    444441{
    445442    //オブジェクトのメンバ関数の場合
     
    603600
    604601    UserProc **ppsi;
    605     ppsi=(UserProc **)HeapAlloc(hHeap,0,vtbl_num*sizeof(UserProc *));
     602    ppsi=(UserProc **)HeapAlloc(hHeap,0,vtbl_num*sizeof(GlobalProc *));
    606603
    607604    //関数テーブルに値をセット
     
    642639    int i;
    643640    for(i=0;i<vtbl_num;i++){
    644         UserProc *pUserProc;
    645         pUserProc=(UserProc *)pVtbl[i];
     641        GlobalProc *pUserProc;
     642        pUserProc=(GlobalProc *)pVtbl[i];
    646643        if(!pUserProc) continue;
    647644        pVtbl[i]=pUserProc->beginOpAddress+ImageBase+MemPos_CodeSection;
     
    803800        }
    804801    }
    805     return 0;
     802    return NULL;
    806803}
    807804
     
    932929
    933930    //関数ハッシュへ登録
    934     UserProc *pUserProc;
    935     pUserProc=AddSubData(buffer,nowLine,bVirtual,pobj_c, (bStatic!=0) );
     931    GlobalProc *pUserProc;
     932    pUserProc=AddSubData( NamespaceScopes(), buffer,nowLine,bVirtual,pobj_c, (bStatic!=0) );
    936933    if(!pUserProc) return;
    937934
Note: See TracChangeset for help on using the changeset viewer.