Changeset 7333f89 in tol


Ignore:
Timestamp:
Jul 21, 2009, 11:33:53 AM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
1e7e8f0
Parents:
d57f819
Message:

New member const NameBlock* building_ and related methods to store address of NameBlock that is being built at this moment

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1183 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tol/btol/bgrammar
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/bgrammar/nameblock.cpp

    rd57f819 r7333f89  
    4949BTraceInit("nameblock.cpp");
    5050
    51 const BNameBlock*         BNameBlock::current_ = NULL;
    52       BNameBlock*         BNameBlock::unknown_ = NULL;
     51const BNameBlock*         BNameBlock::current_  = NULL;
     52const BNameBlock*         BNameBlock::building_ = NULL;
     53      BNameBlock*         BNameBlock::unknown_  = NULL;
    5354      BObjClassify        BObjClassify::null_;
    5455      BObjByNameHash      BNameBlock::using_;
    … …  
    278279  const BNameBlock* old = current_;
    279280  current_ = ns;
    280   return(current_);
    281 }
     281  return(ns);
     282}
     283
     284//--------------------------------------------------------------------
     285  const BNameBlock* BNameBlock::Building()
     286//--------------------------------------------------------------------
     287{
     288  if(building_ &&
     289     building_->createdWithNew_ &&
     290     !(BFSMEM_Hndlr->IsAssigned(building_,building_->_bfsm_PageNum__)))
     291  {
     292    BFSMEM_Hndlr->IsAssigned(building_,building_->_bfsm_PageNum__);
     293    building_ = NULL;
     294  }
     295  return(building_);
     296}
     297
     298//--------------------------------------------------------------------
     299  const BNameBlock* BNameBlock::SetBuilding(const BNameBlock* ns)
     300//--------------------------------------------------------------------
     301{
     302  const BNameBlock* old = building_;
     303  building_ = ns;
     304  return(ns);
     305}
     306
     307
     308
    282309
    283310//--------------------------------------------------------------------
    … …  
    324351    newNameBlock.PutName(fullName);
    325352    newNameBlock.PutLocalName(name);
     353    const BNameBlock* oldBuilding = BNameBlock::SetBuilding(&newNameBlock);
    326354    int oldErr = (int)TOLErrorNumber().Value();
    327355    BSyntaxObject* set_result = NULL;
    … …  
    378406        {
    379407          BMember* mbr = newNameBlock.member_[n]->member_;
    380         //Std(BText("\nTRACE BNameBlock::EvaluateTree member ")+
    381         // fullName+"::"+newNameBlock.member_[n]->member_->name_);
     408          Std(BText("\nTRACE BNameBlock::EvaluateTree member ")+
     409            fullName+"::"+newNameBlock.member_[n]->member_->name_);
    382410          BSyntaxObject* obj = GraAnything()->EvaluateTree(mbr->branch_);
    383411          if(!obj)
    … …  
    437465      DESTROY(set_result);
    438466    }
     467    BNameBlock::SetBuilding(oldBuilding);
    439468  }
    440469  return(ns_result);
  • tol/btol/bgrammar/tol_bnameblock.h

    rd57f819 r7333f89  
    5353  BClass* class_;
    5454  static const BNameBlock* current_;
     55  static const BNameBlock* building_;
    5556  static BNameBlock* unknown_;
    5657  static BObjByNameHash using_;
    … …  
    6970  static const BNameBlock* Current();
    7071  static const BNameBlock* SetCurrent(const BNameBlock* ns);
     72  static const BNameBlock* Building();
     73  static const BNameBlock* SetBuilding(const BNameBlock* ns);
    7174  static BSyntaxObject* EvaluateTree(const List* tre);
    7275  static bool Using  (const BSyntaxObject* uns);
Note: See TracChangeset for help on using the changeset viewer.