Changeset 67 in dev for BasicCompiler_Common


Ignore:
Timestamp:
Mar 11, 2007, 3:25:42 AM (17 years ago)
Author:
dai_9181
Message:

[32bit Compiler]op_push_value → op_push_V
Nothingに対応。

Location:
BasicCompiler_Common
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/Class.cpp

    r64 r67  
    118118        pobj_c=pobj_DBClass->Iterator_GetNext();
    119119
     120        int i=0;
    120121        foreach( CMember *member, pobj_c->staticMembers ){
    121122            char temporary[VN_SIZE];
     
    137138                OpBuffer=(char *)HeapReAlloc(hHeap,0,OpBuffer,obp_AllocSize); //matea
    138139            }
     140            i++;
    139141        }
    140142    }
     
    671673}
    672674
    673 CDBClass::CDBClass(){
    674     memset(this,0,sizeof(CDBClass));
     675CDBClass::CDBClass():
     676    pStringClass( NULL ),
     677    pObjectClass( NULL ),
     678    pCompilingClass( NULL ),
     679    pCompilingMethod( NULL ),
     680    ppobj_IteClass( NULL ),
     681    iIteMaxNum( 0 ),
     682    iIteNextNum( 0 )
     683{
     684    memset( pobj_ClassHash, 0, MAX_CLASS_HASH * sizeof(CClass *) );
    675685}
    676686CDBClass::~CDBClass(){
     
    731741        //Stringクラス
    732742        pobj_StringClass=pobj_c;
     743    }
     744    if( lstrcmp( name, "Object" ) == 0 ){
     745        pObjectClass = pobj_c;
    733746    }
    734747
     
    14211434}
    14221435
    1423 void CDBClass::GetObjectClassInfo(void){
     1436void CDBClass::GetAllClassInfo(void){
    14241437    //ループ継承チェック用のクラス
    14251438    pobj_LoopRefCheck=new CLoopRefCheck();
     
    14301443    delete pobj_LoopRefCheck;
    14311444    pobj_LoopRefCheck=0;
     1445}
     1446
     1447CClass *CDBClass::GetStringClass() const
     1448{
     1449    if( !pStringClass ){
     1450        SetError();
     1451        return NULL;
     1452    }
     1453    return pStringClass;
     1454}
     1455CClass *CDBClass::GetObjectClass() const
     1456{
     1457    if( !pObjectClass ){
     1458        SetError();
     1459        return NULL;
     1460    }
     1461    return pObjectClass;
    14321462}
    14331463
  • BasicCompiler_Common/Class.h

    r64 r67  
    229229    void InitNames(void);
    230230    void GetClass_recur(const char *lpszInheritsClass);
    231     void GetObjectClassInfo(void);
     231    void GetAllClassInfo(void);
     232
     233
     234    /////////////////////////////
     235    // 特殊クラス
     236    /////////////////////////////
     237    CClass *pStringClass;
     238    CClass *pObjectClass;
     239    CClass *GetStringClass() const;
     240    CClass *GetObjectClass() const;
    232241
    233242
  • BasicCompiler_Common/Intermediate_Step1.cpp

    r64 r67  
    872872                case 'n':
    873873                case 'N':
    874                     if(lstrcmpi(temporary+i3,"Not")==0){
     874                    if(lstrcmpi(temporary+i3,"New")==0){
     875                        i2=i3;
     876                        temporary[i2++]=1;
     877                        temporary[i2]=ESC_NEW;
     878                    }
     879                    else if(lstrcmpi(temporary+i3,"Not")==0){
    875880                        i2=i3;
    876881                        temporary[i2++]=1;
    877882                        temporary[i2]=ESC_NOT;
    878                     }
    879                     else if(lstrcmpi(temporary+i3,"New")==0){
    880                         i2=i3;
    881                         temporary[i2++]=1;
    882                         temporary[i2]=ESC_NEW;
    883883                    }
    884884                    break;
  • BasicCompiler_Common/NumOpe_GetType.cpp

    r64 r67  
    492492
    493493
     494                    // Nothing
     495                    if( lstrcmp( term, "Nothing" ) == 0 ){
     496                        type[sp] = DEF_OBJECT;
     497                        if( pBaseType && pBaseType->type == DEF_OBJECT ){
     498                            index_stack[sp] = pBaseType->u.lpIndex;
     499                        }
     500                        else{
     501                            index_stack[sp] = (LONG_PTR)pobj_DBClass->GetObjectClass();
     502                        }
     503                        bLiteralCalculation = 0;
     504                        sp++;
     505                        break;
     506                    }
     507
     508
    494509                    i2=GetVarType(term,&index_stack[sp],0);
    495510                    if(i2!=-1){
  • BasicCompiler_Common/Variable.cpp

    r64 r67  
    10291029        if(pTypeInfo->type==-1){
    10301030            SetError(3,temporary,cp);
    1031             return 0;
     1031            pTypeInfo->type=DEF_LONG;
    10321032        }
    10331033
  • BasicCompiler_Common/preprocessor.cpp

    r55 r67  
    142142CDefine *pobj_define;
    143143
    144 int Search_endif(char *buffer,int i){
     144int Search_endif(char *buffer,int i, int *pLine = 0){
    145145    for(;;i++){
    146146        if(buffer[i]=='\0') break;
    147147
     148        if( buffer[i] == '\n' ){
     149            if( pLine ){
     150                (*pLine)++;
     151            }
     152        }
     153
    148154        if(buffer[i-1]=='\n'){
    149155            if(_memicmp(buffer+i,"#ifdef",6)==0||_memicmp(buffer+i,"#ifndef",7)==0){
    150                 i=Search_endif(buffer,i+6);
     156                i=Search_endif(buffer,i+6, pLine);
    151157                if(buffer[i]=='\0') break;
    152158                continue;
     
    229235                if(i2==0||buffer[i2-1]=='\n'){
    230236                    if(_memicmp(buffer+i2,"#ifdef",6)==0||_memicmp(buffer+i2,"#ifndef",7)==0){
    231                         i2=Search_endif(buffer,i2+6);
     237                        i2=Search_endif(buffer,i2+6, &i3 );
    232238                        if(buffer[i2]=='\0') break;
    233239                        continue;
     
    256262            if(i2==0||buffer[i2-1]=='\n'){
    257263                if(_memicmp(buffer+i2,"#ifdef",6)==0||_memicmp(buffer+i2,"#ifndef",7)==0){
    258                     i2=Search_endif(buffer,i2+6);
     264                    i2=Search_endif(buffer,i2+6, &i3 );
    259265                    if(buffer[i2]=='\0') break;
    260266                    continue;
Note: See TracChangeset for help on using the changeset viewer.