Changeset 1778
- Timestamp:
- Jun 15, 2005, 11:45:12 AM (16 years ago)
- Location:
- to-imperative/trunk
- Files:
-
- 3 added
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
to-imperative/trunk/bootstrap/compiler/rfp-filt.cc
r1774 r1778 116 116 _c_0 = Expr::create<Integer>("1"); 117 117 _c_1 = Char::create_expr ("-r"); 118 _c_2 = Expr (To_m_Rfp);119 _c_3 = Expr (To_m_Cpp);118 _c_2 = Expr::create_sym<Func> (To_m_Rfp); 119 _c_3 = Expr::create_sym<Func> (To_m_Cpp); 120 120 } 121 121 -
to-imperative/trunk/bootstrap/compiler/rfp_as2as.cc
r1712 r1778 2344 2344 _c_15 = Expr::create<Word>("ERROR"); 2345 2345 _c_16 = Expr::create<Word>("arg"); 2346 _c_18 = Expr (Old_m_Var_q_);2347 _c_19 = Expr (Rename);2348 _c_20 = Expr (Rename_m_Vars);2346 _c_18 = Expr::create_sym<Func> (Old_m_Var_q_); 2347 _c_19 = Expr::create_sym<Func> (Rename); 2348 _c_20 = Expr::create_sym<Func> (Rename_m_Vars); 2349 2349 _c_21 = Expr::create<Word>("_"); 2350 2350 _c_23 = Expr::create<Word>("SVAR"); -
to-imperative/trunk/bootstrap/compiler/rfp_asail.cc
r1774 r1778 241 241 static Expr _c_84; 242 242 243 static Expr _c_85; 244 245 static Expr _c_86; 246 247 static Expr _c_87; 248 249 static Expr _c_88; 250 251 static Expr _c_89; 252 253 static Expr _c_90; 254 255 static Expr _c_91; 256 257 static Expr _c_92; 258 259 static Expr _c_93; 260 261 static Expr _c_94; 262 263 static Expr _c_95; 264 265 static Expr _c_96; 266 267 static Expr _c_97; 268 269 static Expr _c_98; 270 271 static Expr _c_99; 272 273 static Expr _c_100; 274 275 static Expr _c_101; 276 277 static Expr _c_102; 278 279 static Expr _c_103; 280 281 static Expr _c_104; 282 283 static Expr _c_105; 284 285 static Expr _c_106; 286 287 static Expr _c_107; 288 289 static Expr _c_108; 290 291 static Expr _c_109; 292 293 static Expr _c_110; 294 295 static Expr _c_111; 296 297 static Expr _c_112; 298 299 static Expr _c_113; 300 301 static Expr _c_114; 302 303 static Expr _c_115; 304 305 static Expr _c_116; 306 307 static Expr _c_117; 308 309 static Expr _c_118; 310 311 static Expr _c_119; 312 313 static Expr _c_120; 314 315 static Expr _c_121; 316 317 static Expr _c_122; 318 319 static Expr _c_123; 320 321 static Expr _c_124; 322 323 static Expr _c_125; 324 325 static Expr _c_126; 326 327 static Expr _c_128; 328 329 static Expr _c_127; 330 331 static Expr _c_129; 332 333 static Expr _c_130; 334 243 335 static Expr _c_131; 244 245 static Expr _c_85;246 247 static Expr _c_86;248 249 static Expr _c_87;250 251 static Expr _c_88;252 253 static Expr _c_89;254 255 static Expr _c_90;256 257 static Expr _c_91;258 259 static Expr _c_92;260 261 static Expr _c_93;262 263 static Expr _c_94;264 265 static Expr _c_95;266 267 static Expr _c_96;268 269 static Expr _c_97;270 271 static Expr _c_98;272 273 static Expr _c_99;274 275 static Expr _c_100;276 277 static Expr _c_101;278 279 static Expr _c_102;280 281 static Expr _c_103;282 283 static Expr _c_104;284 285 static Expr _c_105;286 287 static Expr _c_106;288 289 static Expr _c_107;290 291 static Expr _c_108;292 293 static Expr _c_109;294 295 static Expr _c_110;296 297 static Expr _c_111;298 299 static Expr _c_112;300 301 static Expr _c_113;302 303 static Expr _c_114;304 305 static Expr _c_115;306 307 static Expr _c_116;308 309 static Expr _c_117;310 311 static Expr _c_118;312 313 static Expr _c_119;314 315 static Expr _c_120;316 317 static Expr _c_121;318 319 static Expr _c_122;320 321 static Expr _c_123;322 323 static Expr _c_124;324 325 static Expr _c_125;326 327 static Expr _c_126;328 329 static Expr _c_128;330 331 static Expr _c_127;332 333 static Expr _c_129;334 335 static Expr _c_130;336 336 337 337 static Expr _c_134; … … 3794 3794 _c_79 = Expr::create<Word>("INFIX"); 3795 3795 _c_80 = Char::create_expr ("empty"); 3796 _c_81 = Expr (Term_m_Ref_m_To_m_CPP);3796 _c_81 = Expr::create_sym<Func> (Term_m_Ref_m_To_m_CPP); 3797 3797 _c_82 = Expr::create<Word>("+"); 3798 3798 _c_83 = Expr (_c_48, 1, 1); 3799 3799 _c_84 = Expr (_c_53, 5, 3); 3800 _c_131 = Char::create_expr (" + Expr ("); 3801 _c_85 = Expr (_c_131, 3, 6); 3800 _c_85 = Char::create_expr ("Expr ("); 3802 3801 _c_86 = Expr::create<Word>("REF"); 3803 3802 _c_87 = Expr::create<Word>("ERROR-EXPR"); … … 3808 3807 _c_92 = Char::create_expr ("pxx_max ("); 3809 3808 _c_93 = Char::create_expr ("pxx_min ("); 3810 _c_94 = Expr (Expr_m_Int_m_To_m_CPP);3809 _c_94 = Expr::create_sym<Func> (Expr_m_Int_m_To_m_CPP); 3811 3810 _c_95 = Expr::create<Word>("CALL"); 3812 3811 _c_96 = Char::create_expr ("RF_CALL ("); … … 3823 3822 _c_107 = Expr::create<Word>("NOT"); 3824 3823 _c_108 = Char::create_expr ("!"); 3825 _c_109 = Expr (Cond_m_To_m_CPP);3824 _c_109 = Expr::create_sym<Func> (Cond_m_To_m_CPP); 3826 3825 _c_110 = Expr::create<Word>("&&"); 3827 3826 _c_111 = Expr::create<Word>("||"); … … 3845 3844 _c_129 = Char::create_expr (") ()"); 3846 3845 _c_130 = Char::create_expr (" + ("); 3846 _c_131 = Char::create_expr (" + Expr::create_sym<Func> ("); 3847 3847 _c_134 = Char::create_expr (" + Expr::create<Word>(\""); 3848 3848 _c_132 = Expr (_c_134, 20, 3); -
to-imperative/trunk/bootstrap/compiler/rfp_clashes.cc
r1774 r1778 2137 2137 _c_1 = Expr::create<Integer>("0"); 2138 2138 _c_2 = Expr::create<Integer>("-1"); 2139 _c_3 = Expr (Add_m_Clash_m_To_m_Var);2139 _c_3 = Expr::create_sym<Func> (Add_m_Clash_m_To_m_Var); 2140 2140 _c_4 = Compute_m_Length + Unknown_m_Lengths; 2141 2141 _c_5 = Expr::create<Integer>("1"); … … 2148 2148 _c_11 = (_c_1) () + (_c_1) (); 2149 2149 _c_12 = Expr::create<Word>("LEFT"); 2150 _c_13 = Expr (rfp__helper::L_m_);2150 _c_13 = Expr::create_sym<Func> (rfp__helper::L_m_); 2151 2151 _c_14 = Expr::create<Word>("RIGHT"); 2152 _c_15 = Expr (rfp__helper::R_m_);2152 _c_15 = Expr::create_sym<Func> (rfp__helper::R_m_); 2153 2153 _c_16 = (empty) (); 2154 2154 _c_17 = (Expr::create<Word>("VAR")) (); … … 2160 2160 _c_23 = Expr::create<Word>("compose"); 2161 2161 _c_24 = Expr::create<Word>("EXPR"); 2162 _c_25 = Expr (Not_m_Idx);2163 _c_26 = Expr (Not_m_Instantiated_m_Var);2162 _c_25 = Expr::create_sym<Func> (Not_m_Idx); 2163 _c_26 = Expr::create_sym<Func> (Not_m_Instantiated_m_Var); 2164 2164 _c_27 = Expr::create<Word>("LSPLIT"); 2165 2165 _c_28 = Expr::create<Word>("lsplit_"); 2166 2166 _c_29 = Expr::create<Word>("RSPLIT"); 2167 2167 _c_30 = Expr::create<Word>("rsplit_"); 2168 _c_31 = Expr (Reclassify_m_Clash);2168 _c_31 = Expr::create_sym<Func> (Reclassify_m_Clash); 2169 2169 _c_32 = Expr::create<Word>("FUNC"); 2170 2170 _c_33 = Expr::create<Word>("Length"); -
to-imperative/trunk/bootstrap/compiler/rfp_compile.cc
r1774 r1778 6059 6059 _c_13 = Expr::create<Word>("OBJ") + Expr::create<Word>("LOCAL"); 6060 6060 _c_12 = Expr (_c_13, 1, 1); 6061 _c_14 = Expr (Gener_m_Stub);6061 _c_14 = Expr::create_sym<Func> (Gener_m_Stub); 6062 6062 _c_15 = Expr::create<Word>("stub"); 6063 6063 _c_16 = Expr::create<Word>("STUB"); … … 6072 6072 _c_21 = ((_c_139) ()) () + (_c_140) (); 6073 6073 _c_22 = Expr::create<Word>("res"); 6074 _c_23 = Expr (rfp__vars::Set_m_Var_m_);6074 _c_23 = Expr::create_sym<Func> (rfp__vars::Set_m_Var_m_); 6075 6075 _c_141 = Expr::create<Word>("Instantiated?") + Expr::create<Word>("True"); 6076 6076 _c_24 = (_c_141) (); … … 6145 6145 _c_92 = Expr (_c_93, 0, 1); 6146 6146 _c_94 = Expr::create<Word>("aux"); 6147 _c_95 = Expr (Get_m_Vars);6148 _c_96 = Expr (Max_m_Require);6149 _c_97 = Expr (Subst_m_Aux_m_Var);6150 _c_98 = Expr (Extract_m_Assigns);6147 _c_95 = Expr::create_sym<Func> (Get_m_Vars); 6148 _c_96 = Expr::create_sym<Func> (Max_m_Require); 6149 _c_97 = Expr::create_sym<Func> (Subst_m_Aux_m_Var); 6150 _c_98 = Expr::create_sym<Func> (Extract_m_Assigns); 6151 6151 _c_125 = Expr::create<Word>("Clashes"); 6152 6152 _c_99 = (_c_125) (); … … 6176 6176 _c_123 = Expr::create<Word>("INFIX") + Expr::create<Word>("/"); 6177 6177 _c_124 = Expr::create<Word>("Length"); 6178 _c_126 = Expr (rfp__clashes::Reclassify_m_Clash);6178 _c_126 = Expr::create_sym<Func> (rfp__clashes::Reclassify_m_Clash); 6179 6179 _c_127 = Expr::create<Word>("INFIX") + Expr::create<Word>("||"); 6180 6180 _c_128 = Expr::create<Word>("LENGTH"); -
to-imperative/trunk/bootstrap/compiler/rfp_const.cc
r1774 r1778 1015 1015 _c_10 = Expr::create<Word>("SUBEXPR"); 1016 1016 _c_11 = Expr::create<Word>("CONSTEXPR") + Expr::create<Word>("LOCAL"); 1017 _c_12 = Expr (Bind_m_Static);1018 _c_13 = Expr (Static_m_To_m_Constexprs);1017 _c_12 = Expr::create_sym<Func> (Bind_m_Static); 1018 _c_13 = Expr::create_sym<Func> (Static_m_To_m_Constexprs); 1019 1019 } 1020 1020 -
to-imperative/trunk/bootstrap/compiler/rfp_format.cc
r1774 r1778 2700 2700 _c_11 = (_c_7) (); 2701 2701 _c_12 = (empty) (); 2702 _c_13 = Expr (MSG_m_Exprs);2702 _c_13 = Expr::create_sym<Func> (MSG_m_Exprs); 2703 2703 _c_15 = (Expr::create<Word>("TVAR")) (); 2704 2704 _c_16 = Expr::create<Integer>("1"); -
to-imperative/trunk/bootstrap/compiler/rfp_src.cc
r1712 r1778 355 355 RFP_m_Sources = new rftype::StaticObject<rftype::Table>(L"RFP-Sources"); 356 356 _c_0 = Expr::create<Word>("r"); 357 _c_1 = Expr::create<Word>("FILE") + Expr (RFP_m_Get_m_Line_m_From_m_File);357 _c_1 = Expr::create<Word>("FILE") + Expr::create_sym<Func> (RFP_m_Get_m_Line_m_From_m_File); 358 358 _c_2 = Expr (_c_1, 0, 1); 359 _c_4 = Expr::create<Word>("STDIN") + Expr (RFP_m_Get_m_Line_m_From_m_File) + (Char::create_expr ("StdIN")) () + (empty) ();359 _c_4 = Expr::create<Word>("STDIN") + Expr::create_sym<Func> (RFP_m_Get_m_Line_m_From_m_File) + (Char::create_expr ("StdIN")) () + (empty) (); 360 360 _c_3 = Expr (_c_4, 0, 1); 361 361 _c_5 = Expr::create<Integer>("1"); -
to-imperative/trunk/bootstrap/compiler/rfp_vars.cc
r1774 r1778 2531 2531 _c_12 = (Expr::create<Word>("Instantiated?") + Expr::create<Word>("True")) (); 2532 2532 _c_13 = Expr::create<Word>("LENGTH"); 2533 _c_14 = Expr (Reset_m_Var);2533 _c_14 = Expr::create_sym<Func> (Reset_m_Var); 2534 2534 _c_15 = Expr::create<Word>("Decl"); 2535 _c_16 = Expr (Print_m_Var);2536 _c_17 = Expr (Decl_m_Var);2535 _c_16 = Expr::create_sym<Func> (Print_m_Var); 2536 _c_17 = Expr::create_sym<Func> (Decl_m_Var); 2537 2537 _c_18 = Expr::create<Word>("DECL") + Expr::create<Word>("Expr"); 2538 2538 _c_19 = Expr::create<Word>("Declare"); -
to-imperative/trunk/compiler/rfp_asail.rf
r1773 r1778 397 397 ' + ' <Rfp2Cpp t.item>; 398 398 (FUNC t.name) = 399 ' + Expr (' <Name-To-CPP t.name> ')';399 ' + Expr::create_sym<Func> (' <Name-To-CPP t.name> ')'; 400 400 s.sym, { 401 401 <Int? s.sym> = -
to-imperative/trunk/library/Apply/apply.cc
r1679 r1778 12 12 13 13 RF_FUNC (Apply, (RF_ARG _func, _arg;;), (RF_RES _res;;)) 14 if (_func.get_len() == 1) { 15 Term* t = _func.get_first(); 16 Func* f = t->cast_to<Func>(); 17 if (f) { 18 RF_TAILCALL(f, _arg, _res) 19 } 14 assert (_func.get_len() == 1); 15 Term* t = _func.get_first(); 16 if (t->is_instance_of<Func>()) 17 { 18 RF_TAILCALL(t->get_obj_ptr<Func>(), _arg, _res) 19 } 20 if (t->is_instance_of<Closure>()) 21 { 22 RF_TAILAPPLY(t->get_obj_ptr<Closure>(), _arg, _res) 20 23 } 21 24 RF_LIB_ERROR("Invalid argument"); -
to-imperative/trunk/library/Class/func_q.cc
r1591 r1778 17 17 RF_FUNC (Func_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_func) 19 if (!e_Exp.get_first()->is_instance_of<Func>()) 21 20 RF_RETFAIL; 22 21 } -
to-imperative/trunk/library/CppMangle/CppMangle.cc
r1704 r1778 1006 1006 _c_13 = Expr (_c_11, 0, 1); 1007 1007 _c_14 = Expr::create<Word>("OBJ"); 1008 _c_15 = Expr (Qualifier2Cpp);1008 _c_15 = Expr::create_sym<Func> (Qualifier2Cpp); 1009 1009 _c_16 = Char::create_expr ("_r_"); 1010 1010 _c_17 = Char::create_expr ("::"); 1011 _c_18 = Expr (A_m_Char2Cpp);1011 _c_18 = Expr::create_sym<Func> (A_m_Char2Cpp); 1012 1012 _c_19 = Char::create_expr ("?!"); 1013 1013 _c_20 = Char::create_expr ("b"); -
to-imperative/trunk/library/Lexer/Lexer.cc
r1773 r1778 1820 1820 _c_3 = Char::create_expr ("\t"); 1821 1821 _c_4 = Char::create_expr ("\n"); 1822 _c_5 = Expr::create <ObjectRef>(Blank_q___0);1822 _c_5 = Expr::create_sym<Func> (Blank_q___0); 1823 1823 _c_6 = Char::create_expr ("*"); 1824 1824 _c_7 = Char::create_expr ("/"); … … 1829 1829 _c_12 = Word::create_expr ("Unexpected end of file"); 1830 1830 _c_13 = Char::create_expr ("$"); 1831 _c_14 = Expr::create <ObjectRef>(Class::Letter_q___0);1831 _c_14 = Expr::create_sym<Func> (Class::Letter_q___0); 1832 1832 _c_15 = Char::create_expr ("box"); 1833 1833 _c_16 = Word::create_expr ("BOX"); … … 1868 1868 _c_51 = Char::create_expr ("+"); 1869 1869 _c_52 = Char::create_expr ("-"); 1870 _c_53 = Expr::create <ObjectRef>(Class::Digit_q___0);1870 _c_53 = Expr::create_sym<Func> (Class::Digit_q___0); 1871 1871 _c_54 = Word::create_expr ("NUMBER"); 1872 1872 _c_55 = Expr (_c_45, 1, 1); … … 1879 1879 _c_62 = Word::create_expr ("TVAR"); 1880 1880 _c_63 = Char::create_expr ("."); 1881 _c_64 = Expr::create <ObjectRef>(Var_m_Sym_q___0);1882 _c_65 = Expr::create <ObjectRef>(Fun_m_Sym_q___0);1881 _c_64 = Expr::create_sym<Func> (Var_m_Sym_q___0); 1882 _c_65 = Expr::create_sym<Func> (Fun_m_Sym_q___0); 1883 1883 _c_66 = Word::create_expr ("WORD"); 1884 1884 _c_67 = Char::create_expr ("\""); -
to-imperative/trunk/library/List/List.cc
r1703 r1778 707 707 static void init_ () 708 708 { 709 _c_0 = Expr (Deparen_m_Term__0);710 _c_1 = Expr (Paren_m_Term__0);709 _c_0 = Expr::create_sym<Func> (Deparen_m_Term__0); 710 _c_1 = Expr::create_sym<Func> (Paren_m_Term__0); 711 711 _c_2 = Expr::create<Integer>("0"); 712 712 _c_3 = Expr::create<Integer>("1"); -
to-imperative/trunk/library/RF_Stack/RF_Stack.cc
r1701 r1778 40 40 } 41 41 if (depth > stack->get_depth()) RF_RETFAIL; 42 _v_res1 = Expr::create <ObjectRef>(stack->get_func(depth));42 _v_res1 = Expr::create_sym<rftype::Func>(stack->get_func(depth)); 43 43 RF_END 44 44 -
to-imperative/trunk/library/StdIO/StdIO.cc
r1743 r1778 407 407 _c_1 = Word::create_expr ("Arg 1 is not a Channel"); 408 408 _c_2 = Word::create_expr ("Arg 3 is not a Word"); 409 _c_3 = Expr::create <ObjectRef>(Prim_m_Read__0);409 _c_3 = Expr::create_sym<Func> (Prim_m_Read__0); 410 410 _c_4 = Word::create_expr ("StdIO") + Word::create_expr ("Close-Channel"); 411 411 _c_5 = Word::create_expr ("StdIO") + Word::create_expr ("EOF?"); -
to-imperative/trunk/library/Stream/Stream.cc
r1773 r1778 750 750 _c_1 = Word::create_expr ("Arg 1 is not a Function"); 751 751 _c_2 = (empty) (); 752 _c_3 = Expr::create <ObjectRef>(Read_m_Expr__0);752 _c_3 = Expr::create_sym<Func> (Read_m_Expr__0); 753 753 _c_4 = Word::create_expr ("R"); 754 _c_5 = Expr::create <ObjectRef>(Prim_m_Read__0);754 _c_5 = Expr::create_sym<Func> (Prim_m_Read__0); 755 755 _c_6 = Word::create_expr ("Stream") + Word::create_expr ("File-Close"); 756 756 _c_7 = Word::create_expr ("Arg 1 is not a Streamed File"); -
to-imperative/trunk/runtime/Makefile
r1772 r1778 16 16 rf_memory_chunk \ 17 17 rf_types \ 18 rf_func \ 18 19 rf_char \ 19 20 rf_word \ 20 21 rf_short_int \ 21 22 rf_integer \ 22 rf_func \23 23 rf_object \ 24 24 rf_static_object \ … … 30 30 31 31 RFRT_SOURCES = $(RFRT_MODULES:=.cc) 32 RFRT_ HEADERS = $(RFRT_MODULES:=.hh) rf_expr_constr.hh33 RFRT_ IHEADERS = $(RFRT_MODULES:=.ih)32 RFRT_IHEADERS = $(RFRT_MODULES:=.ih) rf_symbol.ih rf_closure.ih 33 RFRT_HEADERS = $(RFRT_IHEADERS:.ih=.hh) rf_expr_constr.hh rf_box.hh rf_parenth.hh 34 34 RFRT_OBJECTS = $(RFRT_MODULES:=.o) 35 35 -
to-imperative/trunk/runtime/rf_char.hh
r1763 r1778 29 29 #endif 30 30 31 static Expr create_expr (wchar_t const* _wstr, size_t _len = -1) ;32 31 static Expr create_expr (wchar_t const* _wstr, size_t _len = (size_t)-1) ; 32 33 33 static Expr create_expr (const WString& _wstr) ; 34 34 static Expr create_expr (const wchar_t _ch) ; -
to-imperative/trunk/runtime/rf_common.cc
r1772 r1778 33 33 bool use_rts = true; 34 34 bool trap_stack_on = false; 35 wchar_t temp_string[temp_string_len]; 35 36 #if DEBUG 36 37 uintptr_t empty_copy = 0; -
to-imperative/trunk/runtime/rf_common.hh
r1772 r1778 9 9 #include "pxx_heap_allocator.hh" 10 10 #include "pxx_chunk_allocator.hh" 11 12 #include "assert.h" 11 13 12 14 namespace rfrt … … 30 32 extern bool use_rts ; 31 33 extern bool trap_stack_on ; 34 35 static const unsigned temp_string_len = 128; 36 extern wchar_t temp_string[]; 32 37 33 38 #if UINTPTR_MAX == UINT32_MAX -
to-imperative/trunk/runtime/rf_core.cc
r1772 r1778 80 80 81 81 pxx::HeapAllocator* allocator = null ; 82 pxx::ChunkAllocator<ExprWrapper>* expr_allocator = null ; 82 83 83 84 const Expr empty ; … … 187 188 188 189 RF_REGISTER_SYMBOL(Expr); 189 //TypeRegister rftype::Parenth::reg(&Parenth::funcs, type_parenth) ;190 190 TypeRegister rftype::ObjectRef::reg(&ObjectRef::funcs, type_object) ; 191 191 TypeRegister rftype::Char::reg(&Char::funcs, type_char) ; … … 202 202 ObjectRegister rftype::String::reg(type_string) ; 203 203 ObjectRegister rftype::Table::reg(type_table) ; 204 ObjectRegister rftype::Func::reg(type_func) ; 205 204 205 RF_REGISTER_SYMBOL(Func); 206 RF_REGISTER_SYMBOL(Closure); 206 207 RF_REGISTER_SYMBOL(BoxContents); 207 208 RF_REGISTER_SYMBOL_VARIANT(NamedObject<BoxContents>, BoxContents); … … 241 242 new pxx::ChunkAllocator<Integer::MpzContainer>(*allocator); 242 243 #endif // !defined RFRT_WITHOUT_GMP 244 expr_allocator = new pxx::ChunkAllocator<ExprWrapper>(*allocator); 243 245 default_allocator.set(*allocator); 244 246 double start = clock (); … … 267 269 uintptr_t n = (q++)->cast_to<Integer>()->to_int(); 268 270 wchar_t const* fname; 269 (q++)-> cast_to<Func>()->get_name(&fname);271 (q++)->get_name(&fname); 270 272 printf("#%-2u %ls\n", n, fname); 271 273 // printf(q < e.get_last() ? ":\n" : "\n"); -
to-imperative/trunk/runtime/rf_core.hh
r1772 r1778 41 41 #include "rf_channel.ih" 42 42 #include "rf_func.ih" 43 #include "rf_closure.ih" 43 44 #include "rf_table.ih" 44 45 #include "rf_string.ih" -
to-imperative/trunk/runtime/rf_expr.hh
r1772 r1778 341 341 }; 342 342 343 344 struct ExprWrapper 345 { 346 uintptr_t ptr; 347 Expr expr; 348 }; 349 350 extern pxx::ChunkAllocator<ExprWrapper>* expr_allocator; 351 343 352 /// 344 353 /// A class representing a splitting of expression into two parts. This class -
to-imperative/trunk/runtime/rf_func.cc
r1678 r1778 1 #include "rf_func.ih" 1 #include "rf_core.hh" 2 #include <refal/CppMangle.hh> 3 4 namespace rftype 5 { 6 7 namespace FuncInternals 8 { 9 10 RF_FUNC (Codes2Rfp, (RF_ARG _v_arg1;;), (RF_RES _v_res1;;)) 11 #if 0 12 RF_CALL (refal::CppMangle::Codes2Rfp, _v_arg1, _v_res1); 13 #endif 14 static const Expr Conv_m_Table = (Char::create_expr ("!e")) () + (Char::create_expr ("?q")) () + (Char::create_expr ("_")) () + (Char::create_expr ("-m")) () + (Char::create_expr ("+p")) () + (Char::create_expr ("<lt")) () + (Char::create_expr (">gt")) () + (Char::create_expr ("=eq")) () + (Char::create_expr ("*a")) () + (Char::create_expr ("/s")) () + (Char::create_expr (" sp")) () + (Char::create_expr ("\\bs")) () + (Char::create_expr ("|bar")) () + (Char::create_expr ("~tilde")) () + (Char::create_expr ("@at")) () + (Char::create_expr ("#num")) () + (Char::create_expr ("$dollar")) () + (Char::create_expr ("%percnt")) () + (Char::create_expr ("^circ")) () + (Char::create_expr ("&")) () + (Char::create_expr ("(lpar")) () + (Char::create_expr (")rpar")) () + (Char::create_expr ("[lsqb")) () + (Char::create_expr ("]rsqb")) () + (Char::create_expr ("{lcub")) () + (Char::create_expr ("}rcub")) () + (Char::create_expr ("`grave")) () + (Char::create_expr ("'apos")) () + (Char::create_expr ("\"quot")) () + (Char::create_expr (",comma")) () + (Char::create_expr (".period")) () + (Char::create_expr (":colon")) () + (Char::create_expr (";semi")) (); 15 static const Expr _c_13 = Expr::create<Char> (L'_'); 16 static const Expr _c_32 = Expr::create<Char> (L'?'); 17 { 18 { 19 if ((_v_arg1.get_len () < 2)) 20 { 21 goto _block1__branch1; 22 } 23 if (!_c_13.term_eq (_v_arg1, 0)) 24 { 25 goto _block1__branch1; 26 } 27 Expr _v_subexpr__arg1 (_v_arg1, 1, (_v_arg1.get_len () - 1)); 28 lsplit (_v_subexpr__arg1, 0, _ve_code, _v_lsplit__arg1); 29 for ( ; ; iter(_v_subexpr__arg1)++) 30 { 31 { 32 if (!iter(_v_subexpr__arg1)) 33 { 34 goto _block1__branch1; 35 } 36 uintptr_t _v_len1 = _v_lsplit__arg1.get_len (); 37 uintptr_t _v_len2 = 1; 38 if ((_v_len1 < _v_len2)) 39 { 40 goto _block1__branch1; 41 } 42 uintptr_t _v_len__rest = (_v_len1 - _v_len2); 43 if (!_c_13.term_eq (_v_lsplit__arg1, 0)) 44 { 45 goto _continue1; 46 } 47 Expr _ve_rest (_v_lsplit__arg1, 1, _v_len__rest); 48 lsplit (Conv_m_Table, 0, _ve__e__e_tmp_m_CppManglerf_m_131_m_20, _v_lsplit__Conv_m_Table); 49 (void)_ve__e__e_tmp_m_CppManglerf_m_131_m_20; 50 for ( ; ; iter(Conv_m_Table)++) 51 { 52 { 53 if (!iter(Conv_m_Table)) 54 { 55 RF_RETFAIL; 56 } 57 uintptr_t _v_len3 = _v_lsplit__Conv_m_Table.get_len (); 58 uintptr_t _v_len4 = 1; 59 if ((_v_len3 < _v_len4)) 60 { 61 RF_RETFAIL; 62 } 63 uintptr_t _v_len___e__e_tmp_m_CppManglerf_m_131_m_38 = (_v_len3 - _v_len4); 64 if (_v_lsplit__Conv_m_Table.symbol_at (0)) 65 { 66 goto _continue2; 67 } 68 Expr _v_deref__lsplit__Conv_m_Table (_v_lsplit__Conv_m_Table, 0); 69 if ((_v_deref__lsplit__Conv_m_Table.get_len () != (_ve_code.get_len () + 1))) 70 { 71 goto _continue2; 72 } 73 if (!_v_deref__lsplit__Conv_m_Table.symbol_at (0)) 74 { 75 goto _continue2; 76 } 77 if (!_ve_code.eq (_v_deref__lsplit__Conv_m_Table, 1)) 78 { 79 goto _continue2; 80 } 81 Expr _ve__e__e_tmp_m_CppManglerf_m_131_m_38 (_v_lsplit__Conv_m_Table, 1, _v_len___e__e_tmp_m_CppManglerf_m_131_m_38); 82 Expr _vs_char (_v_deref__lsplit__Conv_m_Table, 0, 1); 83 Expr _v_Codes2Rfp1; 84 if (!RF_CALL (Codes2Rfp, _ve_rest, _v_Codes2Rfp1)) 85 { 86 RF_RETFAIL; 87 } 88 _v_res1 = (_vs_char + _v_Codes2Rfp1); 89 goto _exit2; 90 } 91 _continue2: {} 92 } 93 _exit2: {} 94 goto _exit1; 95 } 96 _continue1: {} 97 } 98 _exit1: {} 99 goto _block1; 100 } 101 _block1__branch1: {} 102 { 103 uintptr_t _v_len5 = _v_arg1.get_len (); 104 uintptr_t _v_len6 = 1; 105 if ((_v_len5 < _v_len6)) 106 { 107 goto _block1__branch2; 108 } 109 uintptr_t _v_len__rest2 = (_v_len5 - _v_len6); 110 if (!_v_arg1.symbol_at (0)) 111 { 112 goto _block1__branch2; 113 } 114 Expr _vs_char (_v_arg1, 0, 1); 115 Expr _ve_rest (_v_arg1, 1, _v_len__rest2); 116 { 117 if (_vs_char.get_first()->cast_to<Char>()->is_digit()) 118 { 119 goto _block2; 120 } 121 if (!_vs_char.get_first()->cast_to<Char>()->is_letter()) 122 { 123 RF_RETFAIL; 124 } 125 { 126 if (!_vs_char.term_eq (_c_32, 0)) 127 { 128 goto _negation1; 129 } 130 RF_RETFAIL; 131 } 132 _negation1: {} 133 } 134 _block2: {} 135 Expr _v_Codes2Rfp2; 136 if (!RF_CALL (Codes2Rfp, _ve_rest, _v_Codes2Rfp2)) 137 { 138 RF_RETFAIL; 139 } 140 _v_res1 = (_vs_char + _v_Codes2Rfp2); 141 goto _block1; 142 } 143 _block1__branch2: {} 144 if ((_v_arg1.get_len () != 0)) 145 { 146 RF_ERROR (Expr::create<Word>("FuncInternals") + Expr::create<Word>("Codes2Rfp") + unexpected_fail); 147 } 148 _v_res1 = empty; 149 } 150 _block1: {} 151 RF_END 152 153 } 154 155 } 156 -
to-imperative/trunk/runtime/rf_func.hh
r1678 r1778 4 4 #define __rf_func_hh__ 5 5 6 #include "rf_types.hh" 7 #include "rf_object.hh" 8 #include "rf_retval.hh" 6 #include "rf_symbol.hh" 7 8 namespace rfrt 9 { 10 class RetVal ; 11 typedef RetVal (*rf_func_t)() ; 12 } 9 13 10 14 namespace rftype 11 15 { 12 16 13 using namespace rfrt 17 using namespace rfrt; 14 18 15 class Func : 16 public Object 19 class Func 17 20 { 18 21 19 typedef RetVal (*rf_func_t)();22 rf_func_t func; 20 23 21 rf_func_t func ; 24 wchar_t* name; 25 size_t length; 22 26 23 // NO_COPY_CTOR(Func) 24 NO_ASSIGN(Func) 27 inline void name_to_rfp () ; 25 28 26 29 public: 27 30 28 static ObjectRegister reg ; 29 30 inline Func (rf_func_t _func) ; 31 inline Func (Func const& _func) ; 32 // inline Func& Func::operator = (Func const& _func) ; 33 34 inline unsigned get_type () const ; 35 36 inline pxx::WString to_string () const ; 31 inline Func (rf_func_t _func, wchar_t* _name) ; 37 32 38 33 inline RetVal operator () () const ; 34 35 inline size_t get_name (wchar_t const** _name) ; 36 inline pxx::WString to_string () ; 39 37 40 38 }; -
to-imperative/trunk/runtime/rf_func.ih
r1744 r1778 5 5 6 6 #include "rf_func.hh" 7 #include "rf_ object.ih"8 #include "rf_s tatic_object.hh"9 #include <refal/CppMangle.hh>7 #include "rf_retval.ih" 8 #include "rf_symbol.ih" 9 #include "rf_char.ih" 10 10 11 11 namespace rftype … … 14 14 using namespace rfrt ; 15 15 16 inline Func::Func (rf_func_t _func) : 17 func (_func) 16 namespace FuncInternals { RF_DECL (Codes2Rfp); } 17 18 inline Func::Func (rf_func_t _func, wchar_t* _name) : 19 func (_func), 20 name (_name), 21 length (0) 18 22 {} 19 20 inline Func::Func (Func const& _func) :21 Object(),22 func (_func.func)23 {}24 25 #if 026 inline Func& Func::operator = (Func const& _func)27 {28 if (this != &_func)29 {30 func = _func.func;31 }32 return self;33 }34 #endif35 36 inline unsigned Func::get_type () const37 {38 return reg.get_type();39 }40 41 inline pxx::WString Func::to_string () const42 {43 wchar_t buf[32];44 int n = swprintf(buf, sizeof(buf), L"[*%p]", func);45 if (n == -1) return pxx::WString(L"[<unknown func>]");46 return pxx::WString(buf, n);47 }48 23 49 24 inline RetVal Func::operator () () const … … 52 27 } 53 28 54 55 template <> 56 inline StaticObject<Func>::StaticObject ( 57 Func const& _obj, wchar_t const* _name, size_t _length 58 ) : 59 Func (_obj), 60 name (_name), 61 length (_length) 62 {} 63 64 template <> 65 inline StaticObject<Func>::~StaticObject () 29 inline void Func::name_to_rfp () 66 30 { 67 // if (name[0]) free(const_cast<wchar_t*>(name)); 68 FATAL("Static functions are never destructed"); 31 if (length) return; 32 // Expr e = Expr::create<Word>(name); 33 // RF_CALL(refal::CppMangle::Cpp2Rfp, e, e); 34 Expr e = Expr::create_seq<Char>(name, wcslen(name)); 35 RF_CALL(FuncInternals::Codes2Rfp, e, e); 36 pxx::WString str = e; 37 length = str.get_length() + 1; 38 name = static_cast<wchar_t*>(malloc((length + 1) * sizeof(wchar_t))); 39 if (!name) FATAL("Out of memory"); 40 wmemcpy(name + 1, str.get_data(), length); 41 name[0] = L'&'; 69 42 } 70 43 71 template <> 72 inline void* StaticObject<Func>::operator new (size_t _size) 44 inline size_t Func::get_name (wchar_t const** _name) 73 45 { 74 void* p = malloc(_size);75 if (!p) FATAL("Out of memory");76 return p;46 name_to_rfp(); 47 *_name = name + 1; 48 return length - 1; 77 49 } 78 50 79 //template <> 80 //inline void StaticObject<Func>::operator delete (void*) 81 //{ 82 // FATAL("Static functions are never deleted"); 83 //} 84 85 inline static size_t name_to_rfp ( 86 wchar_t const* _name, size_t _len, wchar_t** _dest 87 ) 51 inline pxx::WString Func::to_string () 88 52 { 89 Expr e = Expr::create<Word>(_name, _len); 90 RF_CALL(refal::CppMangle::Cpp2Rfp, e, e); 91 pxx::WString pstr = e; 92 size_t length = pstr.get_length() + 1; 93 *_dest = static_cast<wchar_t*>(malloc((length + 1) * sizeof(wchar_t))); 94 if (!*_dest) FATAL("Out of memory"); 95 wmemcpy((*_dest) + 1, pstr.get_data(), length); 96 **_dest = L'&'; 97 return length; 98 } 99 100 template <> 101 inline pxx::WString StaticObject<Func>::to_string () const 102 { 103 if (!name[0]) { 104 *const_cast<size_t*>(&length) = 105 name_to_rfp(name + 1, length - 1, const_cast<wchar_t**>(&name)); 106 } 53 name_to_rfp(); 107 54 return pxx::WString(name, length, pxx::const_data); 108 55 } 109 56 110 template <> 111 inline size_t StaticObject<Func>::get_name (wchar_t const** _name) const 57 58 RF_NEW_SYMBOL(Func, StaticTerm); 59 60 inline size_t RF_SYMBOL(Func)::get_name ( 61 RF_SYMBOL(Func) const* _s, wchar_t const** _name 62 ) 112 63 { 113 if (!name[0]) {114 *const_cast<size_t*>(&length) = 115 name_to_rfp(name + 1, length - 1, const_cast<wchar_t**>(&name)); 116 } 117 *_name = name + 1; 118 return length;64 return _s->get_obj_ptr()->get_name(_name); 65 } 66 67 inline pxx::WString RF_SYMBOL(Func)::to_string (RF_SYMBOL(Func) const* _s) 68 { 69 return _s->get_obj_ptr()->to_string(); 119 70 } 120 71 -
to-imperative/trunk/runtime/rf_macros.cc
r1772 r1778 1 #include "rf_expr.ih" 1 2 #include "rf_macros.hh" 2 3 … … 6 7 Expr* __rf_call_saved_top; 7 8 9 rftype::Closure* __rf_closure_to_call; 10 8 11 } -
to-imperative/trunk/runtime/rf_macros.hh
r1772 r1778 4 4 #define __rf_macros_hh__ 5 5 6 #include "rf_func.hh" 6 #include "rf_closure.hh" 7 #include "rf_retval.hh" 7 8 8 9 namespace rfrt … … 10 11 11 12 extern Expr* __rf_call_saved_top; 13 14 extern rftype::Closure* __rf_closure_to_call; 12 15 13 16 #ifndef RFRT_STINGY_STACK … … 154 157 155 158 159 #define RF_APPLY(f,args,ress) \ 160 rfrt::__rf_closure_to_call = f; \ 161 RF_CALL(f->get_func(), args, ress); 162 163 #define RF_TAILAPPLY(f,args,ress) \ 164 rfrt::__rf_closure_to_call = f; \ 165 RF_TAILCALL(f->get_func(), args, ress); 166 167 168 #define RF_FUNC(f,args,ress) \ 169 namespace rffunc { RetVal f##_func_ (void); } \ 170 rftype::Func* f = new rftype::Func(rffunc::f##_func_, WSTRPREFIX#f); \ 171 RetVal rffunc::f##_func_ (void) { \ 172 RF_start_args; \ 173 for args { \ 174 RF_start_ress; \ 175 for ress { \ 176 RF_stop_ress(f); 177 178 #define RF_END \ 179 return true; \ 180 } \ 181 } \ 182 } 183 184 #define RF_CLOSURE(f,params,args,ress) \ 185 RF_FUNC(f, args, ress) \ 186 for params { \ 187 rfrt::__rf_closure_to_call->pop_arg(); 188 189 #define RF_END_CLOSURE \ 190 RF_END \ 191 } 192 193 #if 0 156 194 #define RF_FUNC(f,args,ress) \ 157 195 namespace rffunc { \ … … 174 212 } \ 175 213 } 214 #endif 176 215 177 216 #if 0 … … 180 219 #endif 181 220 #define RF_DECL(f) \ 182 extern rftype:: StaticObject<rftype::Func>* f;221 extern rftype::Func* f; 183 222 184 223 #define RF_ARG rfrt::Arg … … 251 290 wchar_t const* fname; \ 252 291 size_t len = stack->get_func(stack->get_depth())->get_name(&fname); \ 253 throw Expr::create<Word>(fname, len - 1) + msg; \292 throw Expr::create<Word>(fname, len) + msg; \ 254 293 } while (0) 255 294 #else -
to-imperative/trunk/runtime/rf_retval.hh
r1772 r1778 25 25 26 26 #include "rf_expr.hh" 27 28 namespace rftype { 29 class Func; 30 } 27 #include "rf_func.hh" 31 28 32 29 namespace rfrt … … 34 31 35 32 class RetVal ; 36 //typedef RetVal (*rf_func_t)() ;33 typedef RetVal (*rf_func_t)() ; 37 34 38 35 class RetVal -
to-imperative/trunk/runtime/rf_stack.hh
r1772 r1778 24 24 25 25 #include "rf_expr.hh" 26 #include "rf_func.hh" 26 27 #include "pxx_heap.ih" 27 28 … … 89 90 inline void start_ress_mode () ; 90 91 91 inline void stop_ress_mode (rftype:: Objectconst* _f) ;92 inline void stop_ress_mode (rftype::Func const* _f) ; 92 93 93 94 inline void start_pop_mode () ; … … 109 110 inline size_t get_depth () const ; 110 111 111 inline rftype:: Object* get_func (size_t _depth) const ;112 inline rftype::Func* get_func (size_t _depth) const ; 112 113 113 114 inline int get_args (size_t _depth, Expr** _args) const ; 114 115 115 inline static rftype:: Object* getf (Expr const* _p) ;116 inline static rftype::Func* getf (Expr const* _p) ; 116 117 117 118 inline static int getn (Expr const* _p) ; -
to-imperative/trunk/runtime/rf_stack.ih
r1772 r1778 5 5 #include "rf_expr.ih" 6 6 #include "rf_integer.ih" 7 #include "rf_func.ih" 7 8 8 9 namespace rfrt … … 84 85 } 85 86 86 inline void Stack::stop_ress_mode (rftype:: Objectconst* _f)87 inline void Stack::stop_ress_mode (rftype::Func const* _f) 87 88 { 88 89 if (top > last) FATAL("Stack exhausted"); … … 152 153 } 153 154 154 inline rftype:: Object* Stack::get_func (size_t _depth) const155 inline rftype::Func* Stack::get_func (size_t _depth) const 155 156 { 156 157 uintptr_t* p = reinterpret_cast<uintptr_t*>(get_upper(depth - _depth) - 1); 157 return reinterpret_cast<rftype:: Object*>(*(p + 2));158 return reinterpret_cast<rftype::Func*>(*(p + 2)); 158 159 } 159 160 … … 165 166 } 166 167 167 inline rftype:: Object* Stack::getf (Expr const* _p)168 { 169 return reinterpret_cast<rftype:: Object*>(168 inline rftype::Func* Stack::getf (Expr const* _p) 169 { 170 return reinterpret_cast<rftype::Func*>( 170 171 *(reinterpret_cast<uintptr_t const*>(_p) + 2)); 171 172 } … … 195 196 while (_len--) 196 197 { 197 Expr s_f(getf(p));198 198 int n = getn(p); 199 199 Expr const* ap = geta(p); 200 200 Expr e_args; 201 201 while (n--) e_args = e_args + (*ap++)(); 202 e = e + (Expr::create<Integer>(depth--) + s_f + e_args)(); 202 e = e + (Expr::create<Integer>(depth--) + 203 Expr::create_sym<Func>(getf(p)) + e_args)(); 203 204 p = getup(p); 204 205 } -
to-imperative/trunk/runtime/rf_symbol.hh
r1772 r1778 52 52 53 53 template<class C> 54 class Symbol<C, StaticTerm> : 55 public Term 56 { 57 58 NO_COPY_CTOR(Symbol) 59 NO_ASSIGN(Symbol) 60 61 public: 62 63 inline Symbol (C* _p) ; 64 65 inline C* get_obj_ptr () const ; 66 67 static void ctor (Symbol* _to, Symbol const* _from) ; 68 static void dtor (Symbol* _term) ; 69 static bool eq (Symbol const* _term1, Symbol const* _term2) ; 70 static int compare (Symbol const* _term1, Symbol const* _term2) ; 71 static uint32_t hash (Symbol const* _term) ; 72 static pxx::WString to_string (Symbol const* _term) ; 73 static size_t get_name (Symbol const* _s, wchar_t const** _np) ; 74 75 static short_type_funcs_t funcs ; 76 77 static const TypeRegister reg ; 78 79 static inline unsigned get_type() ; 80 81 }; 82 83 template<class C> 54 84 class Symbol<C, ObjectTerm> : 55 85 public Term … … 83 113 static uint32_t hash (Symbol const* _term) ; 84 114 static pxx::WString to_string (Symbol const* _term) ; 115 static size_t get_name (Symbol const* _s, wchar_t const** _np) ; 85 116 86 117 static short_type_funcs_t funcs ; -
to-imperative/trunk/runtime/rf_symbol.ih
r1772 r1778 29 29 } 30 30 */ 31 32 33 template <class C> 34 inline Symbol<C, StaticTerm>::Symbol (C* _p) : 35 Term (get_type(), _p) 36 {} 37 38 template <class C> 39 inline C* Symbol<C, StaticTerm>::get_obj_ptr () const 40 { 41 return static_cast<C*>(ptr_data2); 42 } 43 44 template <class C> 45 void Symbol<C, StaticTerm>::ctor ( 46 Symbol<C, StaticTerm>* _to, Symbol<C, StaticTerm> const* _from 47 ) 48 { 49 _to->data1 = _from->data1; 50 _to->ptr_data2 = _from->ptr_data2; 51 } 52 53 template <class C> 54 void Symbol<C, StaticTerm>::dtor (Symbol<C, StaticTerm>*) 55 {} 56 57 template <class C> 58 bool Symbol<C, StaticTerm>::eq ( 59 Symbol<C, StaticTerm> const* _s1, Symbol<C, StaticTerm> const* _s2 60 ) 61 { 62 return _s1->get_obj_ptr() == _s2->get_obj_ptr(); 63 } 64 65 template <class C> 66 int Symbol<C, StaticTerm>::compare ( 67 Symbol<C, StaticTerm> const* _s1, Symbol<C, StaticTerm> const* _s2 68 ) 69 { 70 if (_s1->get_obj_ptr() > _s2->get_obj_ptr()) return 1; 71 if (_s1->get_obj_ptr() < _s2->get_obj_ptr()) return -1; 72 return 0; 73 } 74 75 template <class C> 76 pxx::WString Symbol<C, StaticTerm>::to_string ( 77 Symbol<C, StaticTerm> const* _s 78 ) 79 { 80 size_t max_len = hex_ptr_len + max_int_len + 4; 81 wchar_t* str = static_cast<wchar_t*>(alloca(max_len * sizeof(wchar_t))); 82 C* ptr = _s->get_obj_ptr(); 83 int len = swprintf(str, max_len, L"<%u|%p>", get_type(), ptr); 84 if (-1 == len) 85 FATAL("<%u|%p> is more then %u wide characters", get_type(), ptr, max_len); 86 return pxx::WString(str, len); 87 } 88 89 template <class C> 90 size_t Symbol<C, StaticTerm>::get_name ( 91 Symbol<C, StaticTerm> const* _s, wchar_t const** _np 92 ) 93 { 94 return (size_t)-1; 95 } 96 97 template <class C> 98 short_type_funcs_t Symbol<C, StaticTerm>::funcs = { 99 0, 100 (void (*)(Term*, Term const*)) (Symbol<C, StaticTerm>::ctor), 101 (void (*)(Term*)) (Symbol<C, StaticTerm>::dtor), 102 (bool (*)(Term const*, Term const*)) (Symbol<C, StaticTerm>::eq), 103 (int (*)(Term const*, Term const*)) (Symbol<C, StaticTerm>::compare), 104 null, // (uint32_t (*)(Term const*)) (Symbol<C, StaticTerm>::hash), 105 (pxx::WString (*)(Term const*)) (Symbol<C, StaticTerm>::to_string), 106 (size_t (*)(Term const*, wchar_t const**)) (Symbol<C, StaticTerm>::get_name) 107 }; 108 109 template <class C> 110 inline unsigned Symbol<C, StaticTerm>::get_type () 111 { 112 return reg.get_type(); 113 } 31 114 32 115 -
to-imperative/trunk/runtime/rf_term.hh
r1772 r1778 88 88 /// Constructor for empty term with given class and type 89 89 inline Term (unsigned _type) ; 90 /// 91 /// Constructor for pointer term of given type (to use for static terms) 92 inline Term (unsigned _type, void* _ptr) ; 90 93 /// 91 94 /// Create expression with specified length -
to-imperative/trunk/runtime/rf_term.ih
r1772 r1778 24 24 using namespace rftype ; 25 25 26 inline Term::Term (unsigned _type) 27 { 28 set_type(_type); 29 } 30 31 #if 0 32 inline Term::Term (uint16_t _c) : 33 uint_data2 (_c) 34 { 35 set_type(type_char); 36 } 37 #endif 26 inline Term::Term (unsigned _type) : 27 data1 (_type) 28 { 29 // set_type(_type); 30 } 31 32 inline Term::Term (unsigned _type, void* _ptr) : 33 data1 (_type), 34 ptr_data2 (_ptr) 35 {} 38 36 39 37 inline Term::~Term () -
to-imperative/trunk/runtime/rf_types.hh
r1772 r1778 90 90 } term_class_t ; 91 91 92 struct StaticTerm ; 92 93 struct FlatTerm ; 93 94 struct ShortTerm ; -
to-imperative/trunk/samples/Apply/Makefile
r1602 r1778 6 6 apply \ 7 7 apply2 \ 8 apply3 8 apply3 \ 9 apply_inv1 9 10 10 11 include $(TOPDIR)/samples/samples.mk
Note: See TracChangeset
for help on using the changeset viewer.