home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / run_feature_10.e < prev    next >
Text File  |  1999-06-05  |  4KB  |  189 lines

  1. --          This file is part of SmallEiffel The GNU Eiffel Compiler.
  2. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  3. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr
  4. --                       http://SmallEiffel.loria.fr
  5. -- SmallEiffel is  free  software;  you can  redistribute it and/or modify it
  6. -- under the terms of the GNU General Public License as published by the Free
  7. -- Software  Foundation;  either  version  2, or (at your option)  any  later
  8. -- version. SmallEiffel is distributed in the hope that it will be useful,but
  9. -- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. -- or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU General Public License
  11. -- for  more  details.  You  should  have  received a copy of the GNU General
  12. -- Public  License  along  with  SmallEiffel;  see the file COPYING.  If not,
  13. -- write to the  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. -- Boston, MA 02111-1307, USA.
  15. --
  16. class RUN_FEATURE_10
  17.    --
  18.    -- For some precursor procedure called feature.
  19.    --
  20.  
  21. inherit
  22.    RUN_FEATURE
  23.       redefine base_feature, fall_down
  24.       end;
  25.  
  26. creation {E_PRECURSOR_PROCEDURE} make
  27.  
  28. feature
  29.  
  30.    base_feature: EFFECTIVE_ROUTINE;
  31.  
  32.    arguments: FORMAL_ARG_LIST;
  33.  
  34.    require_assertion: RUN_REQUIRE;
  35.  
  36.    local_vars: LOCAL_VAR_LIST;
  37.  
  38.    routine_body: COMPOUND;
  39.  
  40.    rescue_compound: COMPOUND;
  41.  
  42.    ensure_assertion: E_ENSURE;
  43.  
  44. feature
  45.  
  46.    is_static: BOOLEAN is false;
  47.  
  48.    is_pre_computable: BOOLEAN is false;
  49.  
  50.    can_be_dropped: BOOLEAN is false;
  51.  
  52.    is_once_function: BOOLEAN is false;
  53.  
  54. feature
  55.  
  56.    fall_down is
  57.       do
  58.       end;
  59.  
  60.    result_type: TYPE is
  61.       do
  62.       end;
  63.  
  64.    static_value_mem: INTEGER is
  65.       do
  66.       end;
  67.  
  68.    afd_check is
  69.       do
  70.          routine_afd_check;
  71.       end;
  72.  
  73.    mapping_c is
  74.       do
  75.          default_mapping_procedure;
  76.       end;
  77.  
  78.    c_define is
  79.       do
  80.          if use_current then
  81.             cpp.incr_procedure_count;
  82.          else
  83.             cpp.incr_real_procedure_count;
  84.          end;
  85.          define_prototype;
  86.          c_define_opening;
  87.          if routine_body /= Void then
  88.             routine_body.compile_to_c;
  89.          end;
  90.          c_define_closing;
  91.          cpp.put_string(fz_12);
  92.          c_frame_descriptor;
  93.       end;
  94.  
  95. feature {RUN_CLASS}
  96.  
  97.    jvm_field_or_method is
  98.       do
  99.          jvm.add_method(Current);
  100.       end;
  101.  
  102. feature
  103.  
  104.    mapping_jvm is
  105.       do
  106.          routine_mapping_jvm;
  107.       end;
  108.  
  109. feature {JVM}
  110.  
  111.    jvm_define is
  112.       do
  113.          method_info_start;
  114.          jvm_define_opening;
  115.          if routine_body /= Void then
  116.             routine_body.compile_to_jvm;
  117.          end;
  118.          jvm_define_closing;
  119.          code_attribute.opcode_return;
  120.          method_info.finish;
  121.       end;
  122.  
  123. feature {NONE}
  124.  
  125.    jvm_result_store is
  126.       do
  127.       end;
  128.  
  129.    update_tmp_jvm_descriptor is
  130.       do
  131.          routine_update_tmp_jvm_descriptor;
  132.       end;
  133.  
  134. feature {CALL_PROC_CALL}
  135.  
  136.    collect_c_tmp is
  137.       do
  138.       end;
  139.  
  140. feature {ADDRESS_OF_POOL}
  141.  
  142.    address_of_c_define(caller: ADDRESS_OF) is
  143.       do
  144.       end;
  145.  
  146. feature {ADDRESS_OF}
  147.  
  148.    address_of_c_mapping is
  149.       do
  150.       end;
  151.  
  152. feature {NONE}
  153.  
  154.    compute_use_current is
  155.       do
  156.          std_compute_use_current;
  157.       end;
  158.  
  159.    initialize is
  160.       do
  161.          arguments := base_feature.arguments;
  162.          if arguments /= Void then
  163.             if not arguments.is_runnable(current_type) then
  164.                !!arguments.with(arguments,current_type);
  165.             end;
  166.          end;
  167.          local_vars := base_feature.local_vars;
  168.          if local_vars /= Void then
  169.             local_vars := local_vars.to_runnable(current_type);
  170.          end;
  171.          routine_body := base_feature.routine_body;
  172.          if routine_body /= Void then
  173.             routine_body := routine_body.to_runnable(current_type);
  174.          end;
  175.          if run_control.require_check then
  176.             require_assertion := run_require;
  177.          end;
  178.          if run_control.ensure_check then
  179.             ensure_assertion := run_ensure;
  180.          end;
  181.          rescue_compound := base_feature.rescue_compound;
  182.          if rescue_compound /= Void then
  183.             exceptions_handler.set_used;
  184.             rescue_compound := rescue_compound.to_runnable(current_type);
  185.          end;
  186.       end;
  187.  
  188. end -- RUN_FEATURE_10
  189.