Changeset ea1d4f6 in tol
- Timestamp:
- Jan 26, 2009, 3:58:42 PM (18 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 75f1ea4
- Parents:
- d0b30d4
- File:
-
- 1 edited
-
tol/btol/bgrammar/nameblock.cpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/bgrammar/nameblock.cpp
rd0b30d4 rea1d4f6 84 84 BNameBlock::BNameBlock() 85 85 //-------------------------------------------------------------------- 86 : BObject(), 87 public_(), 88 private_(), 89 evLevel_(BGrammar::Level()), 90 level_(-999999999), 91 father_(current_) 86 : BObject (), 87 public_ (), 88 private_ (), 89 set_ (), 90 evLevel_ (BGrammar::Level()), 91 level_ (-999999999), 92 father_ (current_), 93 localName_() 92 94 { 93 95 SetEmptyKey(public_ ,NULL); … … 96 98 97 99 //-------------------------------------------------------------------- 98 BNameBlock::BNameBlock(const BText& fullName) 99 //-------------------------------------------------------------------- 100 : BObject (fullName), 101 public_ (), 102 private_(), 103 set_ (), 104 father_ (current_) 100 BNameBlock::BNameBlock(const BText& fullName, const BText& localName) 101 //-------------------------------------------------------------------- 102 : BObject (fullName), 103 public_ (), 104 private_ (), 105 set_ (), 106 evLevel_ (BGrammar::Level()), 107 level_ (-999999999), 108 father_ (current_), 109 localName_(localName) 105 110 { 106 111 SetEmptyKey(public_ ,NULL); 107 112 SetEmptyKey(private_,NULL); 108 } 109 //-------------------------------------------------------------------- 110 BNameBlock::~BNameBlock() 111 //-------------------------------------------------------------------- 112 { 113 short isAssigned = BObject::IsAssigned(); 114 createdWithNew_ = isAssigned!=-1; 113 115 } 114 116 … … 116 118 BNameBlock::BNameBlock(const BNameBlock& ns) 117 119 //-------------------------------------------------------------------- 118 : BObject (ns.Name ()), 119 public_ (ns.Public ()), 120 private_(ns.Private ()), 121 set_ (ns.Set ()), 122 father_ (ns.Father ()) 123 { 120 : BObject (ns.Name ()), 121 public_ (ns.Public ()), 122 private_ (ns.Private ()), 123 set_ (ns.Set ()), 124 father_ (ns.Father ()), 125 localName_(ns.LocalName()) 126 { 127 short isAssigned = BObject::IsAssigned(); 128 createdWithNew_ = isAssigned!=-1; 124 129 //VBR: La copia de NameBlock tiene un problema si los miembros 125 130 //referenciados en ambos son los mismos, ¿cuál es su padre? … … 127 132 128 133 //-------------------------------------------------------------------- 134 BNameBlock::~BNameBlock() 135 //-------------------------------------------------------------------- 136 { 137 } 138 139 //-------------------------------------------------------------------- 129 140 BNameBlock& BNameBlock:: operator= (const BNameBlock& ns) 130 141 //-------------------------------------------------------------------- 131 142 { 132 143 PutName(ns.Name()); 133 set_ = ns.Set(); 134 father_ = ns.Father(); 135 public_ = ns.Public(); 136 private_ = ns.Private(); 144 set_ = ns.Set(); 145 father_ = ns.Father(); 146 public_ = ns.Public(); 147 private_ = ns.Private(); 148 localName_ = ns.LocalName(); 137 149 //VBR: La copia de NameBlock tiene un problema si los miembros 138 150 //referenciados en ambos son los mismos, ¿cuál es su padre? 139 151 return(*this); 152 } 153 154 //-------------------------------------------------------------------- 155 short BNameBlock::EnsureIsAssigned() const 156 //-------------------------------------------------------------------- 157 { 158 if(createdWithNew_) { return(BObject::IsAssigned()); } 159 else { return(true); } 140 160 } 141 161 … … 211 231 BNameBlock& newNameBlock = ns_result->Contens(); 212 232 newNameBlock.PutName(fullName); 233 newNameBlock.PutLocalName(name); 213 234 //BNameBlock::current_ = &newNameBlock; 214 235 int oldErr = (int)TOLErrorNumber().Value(); … … 312 333 BUserCode* uCode = UCode(obj); 313 334 BOperator* opr = GetOperator(uCode); 314 opr->PutNameBlock(this); 335 if(!opr->System() && !opr->NameBlock()) 336 { 337 opr->PutNameBlock(this); 338 } 315 339 } 316 340 } … … 564 588 565 589 //-------------------------------------------------------------------- 590 void BNameBlock::RebuildFullNameDeep(BText parentFullName) 591 //-------------------------------------------------------------------- 592 { 593 //Std(BText("\n")+"BNameBlock::SelectMembersDeep Exploring NameBlock "+Name()); 594 BSyntaxObject* obj; 595 BUserNameBlock* unb; 596 BObjByNameHash::const_iterator iter; 597 if(parentFullName.HasName()) 598 { 599 parentFullName = parentFullName+"::"+LocalName(); 600 } 601 else 602 { 603 parentFullName = LocalName(); 604 } 605 PutName(parentFullName); 606 for(iter=public_.begin(); iter!=public_.end(); iter++) 607 { 608 obj = iter->second; 609 if((obj->Grammar()==GraNameBlock()) && (obj->Mode()==BOBJECTMODE)) 610 { 611 unb = (BUserNameBlock*)obj; 612 unb->Contens().RebuildFullNameDeep(parentFullName); 613 } 614 } 615 } 616 617 618 //-------------------------------------------------------------------- 566 619 BList* BNameBlock::Select(BList* lst, const BObjClassify& oc) 567 620 //-------------------------------------------------------------------- … … 674 727 { 675 728 const BText& name = BEqualOperator::CreatingName(); 676 contens_.PutName(name); 729 BText fullName = name; 730 BText currentFullName = ""; 731 if(BNameBlock::Current()) 732 { 733 currentFullName = BNameBlock::Current()->Name(); 734 fullName = currentFullName+"::"+name; 735 } 736 else 737 { 738 currentFullName = ""; 739 fullName = name; 740 } 741 contens_.PutName(fullName); 742 contens_.PutLocalName(name); 677 743 contens_.Fill(set); 744 contens_.RebuildFullNameDeep(currentFullName); 678 745 } 679 746 }
Note: See TracChangeset
for help on using the changeset viewer.
