Ignore:
Timestamp:
May 6, 2008, 8:31:52 PM (16 years ago)
Author:
dai_9181
Message:

Variables::DuplicateCheck、Variables::BackSearchメソッドにnowScopeLevelパラメータを追加した。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Variable.cpp

    r523 r570  
    4343
    4444
    45 bool Variables::DuplicateCheck( const Symbol &symbol ) const
     45bool Variables::DuplicateCheck( const Symbol &symbol, int nowScopeLevel ) const
    4646{
    4747    //レキシカルスコープを考慮して重複判定
    4848    for( int i=(int)this->size()-1; i>=0 ; i-- ){
    4949        const Variable *pVar = (*this)[i];
    50         if( pVar->isLiving                                          //現在のスコープで有効なもの
    51             && pVar->GetScopeLevel() == compiler.codeGenerator.lexicalScopes.GetNowLevel()  //現在のスコープと同一レベル
     50        if( pVar->isLiving                                  //現在のスコープで有効なもの
     51            && pVar->GetScopeLevel() == nowScopeLevel       //現在のスコープと同一レベル
    5252            )
    5353        {
     
    6060}
    6161
    62 const Variable *Variables::BackSearch( const Symbol &symbol ) const
     62const Variable *Variables::BackSearch( const Symbol &symbol, int nowScopeLevel ) const
    6363{
    6464    //レキシカルスコープを考慮してバックサーチ
    6565    for( int i=(int)this->size()-1; i>=0 ; i-- ){
    6666        const Variable *pVar = (*this)[i];
    67         if( pVar->isLiving                                          //現在のスコープで有効なもの
    68             && pVar->GetScopeLevel() <= compiler.codeGenerator.lexicalScopes.GetNowLevel()  //現在のスコープレベルを超さないもの(Returnによる解放処理中を考慮)
     67        if( pVar->isLiving                                  //現在のスコープで有効なもの
     68            && pVar->GetScopeLevel() <= nowScopeLevel       //現在のスコープレベルを超さないもの(Returnによる解放処理中を考慮)
    6969            ){
    7070                if( pVar->IsEqualSymbol( symbol ) ){
Note: See TracChangeset for help on using the changeset viewer.