Changeset 700 in dev for trunk/ab5.0/abdev/compiler_x86


Ignore:
Timestamp:
Jul 21, 2008, 1:04:12 AM (16 years ago)
Author:
イグトランス (egtra)
Message:

CRequireFilesの管理をhash_setベースへ。保存時にFileIndexの記録を行っていなかった問題を修正。rev.669でコミットし忘れのcompiler_x86/NumOpe.cppを追加。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/compiler_x86/NumOpe.cpp

    r676 r700  
    353353bool _TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, bool &isNeedHeapFreeStructure, bool *pIsClassName, bool isProcedureCallOnly, bool &isVariable, RELATIVE_VAR &relativeVar, bool isWriteAccess )
    354354{
     355    extern void GetWithName(std::string&);
     356
    355357    char parameter[VN_SIZE];
    356 
    357358    // Withを解決
    358     char termFull[VN_SIZE];
     359    std::string termFull;
    359360    if(term[0]=='.'){
    360361        GetWithName(termFull);
    361         lstrcat(termFull,term);
    362     }
    363     else lstrcpy(termFull,term);
    364 
    365     char termLeft[VN_SIZE];
    366     lstrcpy(termLeft,termFull);
     362        termFull.insert(termFull.end(),term,term+strlen(term));
     363    }
     364    else termFull.assign(term,term+strlen(term));
     365
     366    std::vector<char> termLeft(termFull.begin(), termFull.end());
     367    termLeft.push_back('\0');
    367368
    368369    // パース
    369370    char member[VN_SIZE];
    370371    ReferenceKind refType;
    371     if( SplitMemberName( termFull, termLeft, member, refType ) ){
     372    if( SplitMemberName( termFull.c_str(), &termLeft[0], member, refType ) ){
    372373        ///////////////////////////////////////////////////////////////////
    373374        // オブジェクトとメンバに分解できるとき
     
    380381        bool isClassName = false;
    381382        Type leftType;
    382         if( GetTermType( termLeft, Type(), leftType, isLiteral, &isClassName ) ){
     383        if( GetTermType( &termLeft[0], Type(), leftType, isLiteral, &isClassName ) ){
    383384            if( isClassName == false && compiler.GetObjectModule().meta.GetBlittableTypes().IsExist( leftType ) ){
    384385                // 左側のオブジェクト部分がBlittable型のとき
    385 
     386/*
    386387                char temporary[VN_SIZE];
    387388                lstrcpy( temporary, termLeft );
     
    389390                    compiler.GetObjectModule().meta.GetBlittableTypes().Find( leftType ).GetCreateStaticMethodFullName().c_str(),
    390391                    temporary );
    391             }
    392         }
    393 
    394         if( !TermOpe( termLeft, baseType, leftType, isLiteral, isNeedHeapFreeStructure, &isClassName ) ){
     392*/
     393                std::vector<char> temporary;
     394                const std::string& staticMethodFullName = compiler.GetObjectModule().meta.GetBlittableTypes().Find( leftType ).GetCreateStaticMethodFullName();
     395                temporary.reserve(VN_SIZE);
     396                temporary.assign(staticMethodFullName.begin(), staticMethodFullName.end());
     397                temporary.push_back('(');
     398                temporary.insert(temporary.end(), termLeft.begin(), termLeft.end());
     399                temporary.push_back(')');
     400                temporary.swap(termLeft);
     401            }
     402        }
     403
     404        if( !TermOpe( &termLeft[0], baseType, leftType, isLiteral, isNeedHeapFreeStructure, &isClassName ) ){
    395405            goto globalArea;
    396406        }
     
    410420        }
    411421
    412         return TermMemberOpe( leftType, isNeedHeapFreeStructure, baseType, resultType, termFull, termLeft, member, isVariable, relativeVar );
     422        return TermMemberOpe( leftType, isNeedHeapFreeStructure, baseType, resultType, termFull.c_str(), &termLeft[0], member, isVariable, relativeVar );
    413423    }
    414424globalArea:
     
    420430
    421431    if( pIsClassName ){
    422         if( compiler.GetObjectModule().meta.FindClassSupportedTypeDef( LexicalAnalyzer::FullNameToSymbol( termFull ) ) ){
     432        if( compiler.GetObjectModule().meta.FindClassSupportedTypeDef( LexicalAnalyzer::FullNameToSymbol( termFull.c_str() ) ) ){
    423433            *pIsClassName = true;
    424434            return true;
     
    434444
    435445
    436     if(lstrcmpi(termFull,"This")==0 && isProcedureCallOnly == false ){
     446    if(lstrcmpi(termFull.c_str(),"This")==0 && isProcedureCallOnly == false ){
    437447        if( !compiler.IsCompilingClass() )
    438448        {
     
    458468    char temporary[8192];
    459469
    460     int i2=GetCallProcName(termFull,procName);
     470    int i2=GetCallProcName(termFull.c_str(),procName);
    461471    if(termFull[i2]=='('){
    462         int i4=GetStringInPare_RemovePare(parameter,termFull+i2+1);
     472        int i4=GetStringInPare_RemovePare(parameter,termFull.c_str()+i2+1);
    463473
    464474        void *pInfo;
     
    557567
    558568    char VarName[VN_SIZE],ArrayElements[VN_SIZE];
    559     GetArrayElement(termFull,VarName,ArrayElements);
     569    GetArrayElement(termFull.c_str(),VarName,ArrayElements);
    560570    if(ArrayElements[0]){
    561571        Type classType;
     
    579589        false,  //エラー表示なし
    580590        isWriteAccess,
    581         termFull,
     591        termFull.c_str(),
    582592        &relativeVar,resultType)){
    583593        //////////
     
    599609
    600610    //配列要素を排除
    601     GetArrayElement(termFull,VarName,ArrayElements);
     611    GetArrayElement(termFull.c_str(),VarName,ArrayElements);
    602612
    603613    if(GetSubHash(VarName,0)){
    604614
    605615        {
    606             CallPropertyMethod(termFull,NULL,resultType);
     616            CallPropertyMethod(termFull.c_str(),NULL,resultType);
    607617
    608618            //大きな型への暗黙の変換
     
    636646    if( isProcedureCallOnly )
    637647    {
    638         compiler.errorMessenger.Output(3, termFull, cp );
     648        compiler.errorMessenger.Output(3, termFull.c_str(), cp );
    639649    }
    640650
Note: See TracChangeset for help on using the changeset viewer.