Changeset 1773
- Timestamp:
- Jun 9, 2005, 7:29:51 AM (16 years ago)
- Location:
- to-imperative/trunk
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
to-imperative/trunk/compiler/rfp_asail.rf
r1711 r1773 173 173 <RFP-Extract-Qualifiers t.name> :: (e.qualifiers) e.name, 174 174 <Rfp2Cpp e.name> :: e.cpp-name, 175 <Put &Const-Exprs (e.cpp-name 176 ('new rftype::StaticObject<rftype::' s1 <To-Lower e2> '>(L"'e.name'")'))>, 175 { 176 s.tag : BOX = 177 <Put &Const-Exprs (e.cpp-name 178 ('Expr::create_sym< NamedObject<BoxContents> >(L"'e.name'")'))>; 179 <Put &Const-Exprs (e.cpp-name 180 ('new rftype::StaticObject<rftype::' s1 <To-Lower e2> '>(L"'e.name'")'))>; 181 }, 177 182 <Namespace-Control e.qualifiers> 178 183 (e.linkage 'Expr ' e.cpp-name ';'); -
to-imperative/trunk/library/Box/Box.cc
r1725 r1773 15 15 16 16 RF_FUNC (Box, (RF_ARG _e;;), (RF_RES _box;;)) 17 _box = Expr::create <rftype::Box>(_e);17 _box = Expr::create_sym<BoxContents>(Expr(_e)); 18 18 RF_END 19 19 -
to-imperative/trunk/library/Box/get.cc
r1508 r1773 1 1 #include <rf_core.hh> 2 3 #include <typeinfo>4 5 using namespace rfrt;6 2 7 3 namespace refal 8 4 { 5 6 using namespace rfrt; 9 7 10 8 namespace Box … … 16 14 if (_box.get_len() == 1) { 17 15 Term* t = _box.get_first(); 18 rftype::Box* b = t->cast_to<rftype::Box>(type_box); 19 if (b) { 20 _expr = b->get(); 16 if (t->is_instance_of<BoxContents>()) { 17 _expr = *(t->get_obj_ptr<BoxContents>()); 21 18 } else { 22 FATAL("Box::?(): Symbol does not have a box type");19 RF_LIB_ERROR(L"Invalid argument"); 23 20 } 24 21 } else { … … 28 25 29 26 } 27 30 28 } -
to-imperative/trunk/library/Box/store.cc
r1643 r1773 1 1 #include <rf_core.hh> 2 3 #include <typeinfo>4 5 using namespace rfrt;6 2 7 3 namespace refal 8 4 { 5 6 using namespace rfrt; 9 7 10 8 namespace Box … … 16 14 if (_box.get_len() == 1) { 17 15 Term* t = _box.get_first(); 18 rftype::Box* b = t->cast_to<rftype::Box>(type_box); 19 if (b) { 20 b->put(_expr); 16 if (t->is_instance_of<BoxContents>()) { 17 *(t->get_obj_ptr<BoxContents>()) = _expr; 21 18 } else { 22 FATAL("Box::Store(): Symbol does not have a box type");19 RF_LIB_ERROR(L"Invalid argument"); 23 20 } 24 21 } else { -
to-imperative/trunk/library/Class/box_q.cc
r1591 r1773 17 17 RF_FUNC (Box_q_, (RF_ARG e_Exp;;), RF_VOID) 18 18 if (e_Exp.get_len() == 1) { 19 Term* p = e_Exp.get_first(); 20 if (p->get_type() != type_box) 21 RF_RETFAIL; 19 if (e_Exp.get_first()->is_instance_of<BoxContents>()) 20 return true; 22 21 } 23 else 24 RF_RETFAIL; 22 RF_RETFAIL; 25 23 RF_END 26 24 -
to-imperative/trunk/library/Dir/Makefile
r1744 r1773 7 7 8 8 MODULES = \ 9 dir_symbol \ 9 10 open_dir \ 10 11 close_dir \ -
to-imperative/trunk/library/Dir/file_list
r1733 r1773 1 dir_symbol 1 2 open_dir 2 3 close_dir -
to-imperative/trunk/library/Lexer/Lexer.cc
r1679 r1773 1812 1812 static void init_ () 1813 1813 { 1814 Case_m_Insensitive = new rftype::Box();1815 Parenth_m_Level = new rftype::Box();1814 Case_m_Insensitive = Expr::create_sym<BoxContents>(); 1815 Parenth_m_Level = Expr::create_sym<BoxContents>(); 1816 1816 _c_0 = Integer::create_expr ("1"); 1817 1817 _c_1 = Integer::create_expr ("0"); 1818 Collect_m_Errors_m_Box = new rftype::Box(_c_1);1818 Collect_m_Errors_m_Box = Expr::create_sym<BoxContents>(_c_1); 1819 1819 _c_2 = Char::create_expr (" "); 1820 1820 _c_3 = Char::create_expr ("\t"); -
to-imperative/trunk/library/Static/Static.cc
r1685 r1773 20 20 RF_RETFAIL; 21 21 } 22 Term* first = _v_arg1.get_first(); 23 ObjectRef* ref = first->cast_to<ObjectRef>(); 24 if (ref) { 25 try { 26 wchar_t const* name; 27 size_t length = ref->get_obj_ptr()->get_name(&name); 28 _v_res1 = Expr::create<Word>(name, length - 1); 29 return true; 30 } 31 catch (Object::InvalidParameter&) { 32 RF_RETFAIL; 33 } 22 wchar_t const* name; 23 size_t length = _v_arg1.get_first()->get_name(&name); 24 if ((size_t)-1 == length) 25 { 26 RF_RETFAIL; 34 27 } 35 RF_RETFAIL;28 _v_res1 = Expr::create<Word>(name, length); 36 29 RF_END 37 30 -
to-imperative/trunk/library/StdIO/prim_open_file.cc
r1604 r1773 1 1 #include <rf_core.hh> 2 //#include <pxx_string.ih>3 //#include <stdio.h>4 //#include <errno.h>2 #include <pxx_string.ih> 3 #include <stdio.h> 4 #include <errno.h> 5 5 #include <ctype.h> 6 6 … … 35 35 mode[0] = tolower(mode[0]); 36 36 bool res = ch->open(fname, mode); 37 if (!res) RF_RETFAIL; 37 if (!res) { 38 RF_RETFAIL; 39 // throw Expr::create<Word>(L"Open-File") + 40 // Expr::create<Word>(L"Can't open file") + _fname + _mode + 41 // Expr::create<Integer>(errno); 42 } 38 43 RF_END 39 44 -
to-imperative/trunk/library/Stream/Stream.cc
r1747 r1773 746 746 { 747 747 StdIO::init_StdIn.invoke(); 748 StdIStream_m_Box = new rftype::Box();748 StdIStream_m_Box = Expr::create_sym<BoxContents> (); 749 749 _c_0 = Word::create_expr ("Stream") + Word::create_expr ("Stream"); 750 750 _c_1 = Word::create_expr ("Arg 1 is not a Function"); -
to-imperative/trunk/library/Stream/StreamErr.cc
r1643 r1773 135 135 static void init_ () 136 136 { 137 Error_m_Box = new rftype::Box();137 Error_m_Box = Expr::create_sym<BoxContents> (); 138 138 _c_4 = Integer::create_expr ("0") + Integer::create_expr ("0"); 139 139 _c_0 = (empty) () + (_c_4) ();
Note: See TracChangeset
for help on using the changeset viewer.