Changeset 1000
- Timestamp:
- Jul 10, 2003, 10:05:21 PM (18 years ago)
- Location:
- to-imperative/trunk/library/Table
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
to-imperative/trunk/library/Table/bind.cc
r970 r1000 14 14 RF_FUNC (Bind, (RF_ARG _table, _key, _val), ()) 15 15 16 if (_table.get_len() ==1) {16 if (_table.get_len() == 1) { 17 17 Term* p = _table.get_first(); 18 if (p->get_type() == type_table) { 19 rftype::Table* _t=p->cast_to<rftype::Table>(type_table); 20 if (!_t) 21 RF_LIB_ERROR("Invalid argument1"); 22 _t -> Bind(_key,_val); 23 } else 24 RF_LIB_ERROR("Invalid argument2"); 25 } else 26 RF_LIB_ERROR("Invalid argument3"); 18 rftype::Table* _t = p->cast_to<rftype::Table>(type_table); 19 if (!_t) 20 RF_LIB_ERROR("Invalid argument"); 21 _t -> Bind(_key,_val); 22 } else 23 RF_LIB_ERROR("Invalid argument"); 27 24 28 25 RF_END -
to-imperative/trunk/library/Table/domain.cc
r970 r1000 15 15 16 16 if (_table.get_len()==1) { 17 Term* p = _table.get_first(); 18 if (p->get_type() == type_table) { 19 rftype::Table* t=p->cast_to<rftype::Table>(type_table); 20 if (!t) 21 RF_LIB_ERROR("Invalid argument"); 22 _res=t->Domain(); 23 } else 24 RF_LIB_ERROR("Invalid argument"); 17 Term* p = _table.get_first(); 18 rftype::Table* t = p->cast_to<rftype::Table>(type_table); 19 if (!t) 20 RF_LIB_ERROR("Invalid argument"); 21 _res=t->Domain(); 25 22 } else 26 23 RF_LIB_ERROR("Invalid argument"); -
to-imperative/trunk/library/Table/in_table.cc
r970 r1000 14 14 RF_FUNC (In_m_Table_q_, (RF_ARG _table, _key), ()) 15 15 16 if (_table.get_len() ==1) {16 if (_table.get_len() == 1) { 17 17 Term* p = _table.get_first(); 18 if (p->get_type() == type_table) { 19 rftype::Table* _t=p->cast_to<rftype::Table>(type_table); 20 if (!_t) 21 RF_LIB_ERROR("Invalid argument"); 22 if (!(_t->InTable(_key))) 23 retfail; 24 } else 25 RF_LIB_ERROR("Invalid argument"); 18 rftype::Table* _t = p->cast_to<rftype::Table>(type_table); 19 if (!_t) 20 RF_LIB_ERROR("Invalid argument"); 21 if (!(_t->InTable(_key))) 22 retfail; 26 23 } else 27 24 RF_LIB_ERROR("Invalid argument"); -
to-imperative/trunk/library/Table/lookup.cc
r970 r1000 16 16 Expr result; 17 17 if (_table.get_len()==1) { 18 Term* p = _table.get_first(); 19 if (p->get_type() == type_table) { 20 rftype::Table* _t = p->cast_to<rftype::Table>(type_table); 21 if (!_t) 22 RF_LIB_ERROR("Invalid argument"); 23 if (!(_t->Lookup(_key, result))) 24 retfail; 25 _val=result; 26 } else 27 RF_LIB_ERROR("Invalid argument"); 18 Term* p = _table.get_first(); 19 rftype::Table* _t = p->cast_to<rftype::Table>(type_table); 20 if (!_t) 21 RF_LIB_ERROR("Invalid argument"); 22 if (!(_t->Lookup(_key, result))) 23 retfail; 24 _val=result; 28 25 } else 29 26 RF_LIB_ERROR("Invalid argument"); -
to-imperative/trunk/library/Table/replace_table.cc
r970 r1000 15 15 16 16 if (_target.get_len()==1) { 17 Term* p = _target.get_first(); 18 if (p->get_type() == type_table) { 19 rftype::Table* target = p->cast_to<rftype::Table>(type_table); 20 if (!target) 17 Term* p = _target.get_first(); 18 rftype::Table* target = p->cast_to<rftype::Table>(type_table); 19 if (!target) 20 RF_LIB_ERROR("Invalid argument"); 21 if (_source.get_len() == 1) { 22 Term* t = _source.get_first(); 23 rftype::Table* source = t->cast_to<rftype::Table>(type_table); 24 if (!source) 21 25 RF_LIB_ERROR("Invalid argument"); 22 if (_source.get_len()==1) { 23 Term* t = _source.get_first(); 24 if (t->get_type() == type_table) { 25 rftype::Table* source=t->cast_to<rftype::Table>(type_table); 26 if (!source) 27 RF_LIB_ERROR("Invalid argument"); 28 target->ReplaceTable(*source); 29 } else 30 RF_LIB_ERROR("Invalid argument"); 31 } else 32 RF_LIB_ERROR("Invalid argument"); 26 target->ReplaceTable(*source); 33 27 } else 34 28 RF_LIB_ERROR("Invalid argument"); -
to-imperative/trunk/library/Table/table_copy.cc
r970 r1000 18 18 if (_table.get_len() == 1) { 19 19 Term* p = _table.get_first(); 20 if (p->get_type() == type_table) { 21 rftype::Table* t = p->cast_to<rftype::Table>(type_table); 22 if (!t) 23 RF_LIB_ERROR("Invalid argument"); 24 rftype::Table* copy = new rftype::Table(); 25 t->TableCopy(*copy); 26 _tabcopy = Expr (new rftype::Table(*copy)); 27 } else 28 RF_LIB_ERROR("Invalid argument"); 20 rftype::Table* t = p->cast_to<rftype::Table>(type_table); 21 if (!t) 22 RF_LIB_ERROR("Invalid argument"); 23 rftype::Table* copy = new rftype::Table(); 24 t->TableCopy(*copy); 25 _tabcopy = Expr (new rftype::Table(*copy)); 29 26 } else 30 27 RF_LIB_ERROR("Invalid argument"); -
to-imperative/trunk/library/Table/unbind.cc
r970 r1000 16 16 if (_table.get_len() == 1) { 17 17 Term* p = _table.get_first(); 18 if (p->get_type() == type_table) { 19 rftype::Table* t = p->cast_to<rftype::Table>(type_table); 20 if (!t) 21 RF_LIB_ERROR("Invalid argument"); 22 t -> Unbind(_key); 23 } else 24 RF_LIB_ERROR("Invalid argument"); 18 rftype::Table* t = p->cast_to<rftype::Table>(type_table); 19 if (!t) 20 RF_LIB_ERROR("Invalid argument"); 21 t -> Unbind(_key); 25 22 } else 26 23 RF_LIB_ERROR("Invalid argument");
Note: See TracChangeset
for help on using the changeset viewer.