Changeset 1773


Ignore:
Timestamp:
Jun 9, 2005, 7:29:51 AM (16 years ago)
Author:
orlov
Message:
  • A lot of runtime changes towards interfaces simplification.
Location:
to-imperative/trunk
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/compiler/rfp_asail.rf

    r1711 r1773  
    173173      <RFP-Extract-Qualifiers t.name> :: (e.qualifiers) e.name,
    174174      <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      },
    177182      <Namespace-Control e.qualifiers>
    178183      (e.linkage 'Expr ' e.cpp-name ';');
  • to-imperative/trunk/library/Box/Box.cc

    r1725 r1773  
    1515
    1616RF_FUNC (Box, (RF_ARG _e;;), (RF_RES _box;;))
    17   _box = Expr::create<rftype::Box>(_e);
     17  _box = Expr::create_sym<BoxContents>(Expr(_e));
    1818RF_END
    1919
  • to-imperative/trunk/library/Box/get.cc

    r1508 r1773  
    11#include <rf_core.hh>
    2 
    3 #include <typeinfo>
    4 
    5 using namespace rfrt;
    62
    73namespace refal
    84{
     5
     6using namespace rfrt;
    97
    108namespace Box
     
    1614  if (_box.get_len() == 1) {
    1715    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>());
    2118    } else {
    22       FATAL("Box::?(): Symbol does not have a box type");
     19      RF_LIB_ERROR(L"Invalid argument");
    2320    }
    2421  } else {
     
    2825
    2926}
     27
    3028}
  • to-imperative/trunk/library/Box/store.cc

    r1643 r1773  
    11#include <rf_core.hh>
    2 
    3 #include <typeinfo>
    4 
    5 using namespace rfrt;
    62
    73namespace refal
    84{
     5
     6using namespace rfrt;
    97
    108namespace Box
     
    1614  if (_box.get_len() == 1) {
    1715    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;
    2118    } else {
    22       FATAL("Box::Store(): Symbol does not have a box type");
     19      RF_LIB_ERROR(L"Invalid argument");
    2320    }
    2421  } else {
  • to-imperative/trunk/library/Class/box_q.cc

    r1591 r1773  
    1717RF_FUNC (Box_q_, (RF_ARG e_Exp;;), RF_VOID)
    1818  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;
    2221  }
    23   else
    24     RF_RETFAIL;
     22  RF_RETFAIL;
    2523RF_END
    2624
  • to-imperative/trunk/library/Dir/Makefile

    r1744 r1773  
    77
    88MODULES = \
     9  dir_symbol \
    910  open_dir \
    1011  close_dir \
  • to-imperative/trunk/library/Dir/file_list

    r1733 r1773  
     1dir_symbol
    12open_dir
    23close_dir
  • to-imperative/trunk/library/Lexer/Lexer.cc

    r1679 r1773  
    18121812static void init_ ()
    18131813{
    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>();
    18161816  _c_0 = Integer::create_expr ("1");
    18171817  _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);
    18191819  _c_2 = Char::create_expr (" ");
    18201820  _c_3 = Char::create_expr ("\t");
  • to-imperative/trunk/library/Static/Static.cc

    r1685 r1773  
    2020    RF_RETFAIL;
    2121  }
    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;
    3427  }
    35   RF_RETFAIL;
     28  _v_res1 = Expr::create<Word>(name, length);
    3629RF_END
    3730
  • to-imperative/trunk/library/StdIO/prim_open_file.cc

    r1604 r1773  
    11#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>
    55#include <ctype.h>
    66
     
    3535  mode[0] = tolower(mode[0]);
    3636  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  }
    3843RF_END
    3944
  • to-imperative/trunk/library/Stream/Stream.cc

    r1747 r1773  
    746746{
    747747  StdIO::init_StdIn.invoke();
    748   StdIStream_m_Box = new rftype::Box ();
     748  StdIStream_m_Box = Expr::create_sym<BoxContents> ();
    749749  _c_0 = Word::create_expr ("Stream") + Word::create_expr ("Stream");
    750750  _c_1 = Word::create_expr ("Arg 1 is not a Function");
  • to-imperative/trunk/library/Stream/StreamErr.cc

    r1643 r1773  
    135135static void init_ ()
    136136{
    137   Error_m_Box = new rftype::Box ();
     137  Error_m_Box = Expr::create_sym<BoxContents> ();
    138138  _c_4 = Integer::create_expr ("0") + Integer::create_expr ("0");
    139139  _c_0 = (empty) () + (_c_4) ();
Note: See TracChangeset for help on using the changeset viewer.