home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / run_feature_7.e < prev    next >
Text File  |  1999-06-05  |  5KB  |  236 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_7
  17.  
  18. inherit RUN_FEATURE redefine base_feature end;
  19.  
  20. creation make
  21.  
  22. feature
  23.  
  24.    base_feature: EXTERNAL_PROCEDURE;
  25.  
  26.    arguments: FORMAL_ARG_LIST;
  27.  
  28.    require_assertion: RUN_REQUIRE;
  29.  
  30.    ensure_assertion: E_ENSURE;
  31.  
  32. feature
  33.  
  34.    is_pre_computable: BOOLEAN is false;
  35.  
  36.    is_static: BOOLEAN is false;
  37.  
  38.    static_value_mem: INTEGER is 0;
  39.  
  40.    can_be_dropped: BOOLEAN is false;
  41.  
  42.    is_once_function: BOOLEAN is false;
  43.  
  44. feature
  45.  
  46.    arg_count: INTEGER is
  47.       do
  48.          if arguments /= Void then
  49.             Result := arguments.count;
  50.          end;
  51.       end;
  52.  
  53.    result_type: TYPE is
  54.       do
  55.       end;
  56.  
  57.    local_vars: LOCAL_VAR_LIST is
  58.       do
  59.       end;
  60.  
  61.    routine_body: COMPOUND is
  62.       do
  63.       end;
  64.  
  65.    rescue_compound: COMPOUND is
  66.       do
  67.       end;
  68.  
  69.    afd_check is
  70.       do
  71.          routine_afd_check;
  72.       end;
  73.  
  74.    mapping_c is
  75.       local
  76.          bf: like base_feature;
  77.          native: NATIVE;
  78.          bcn: STRING;
  79.       do
  80.          bf := base_feature;
  81.          native := bf.native;
  82.          bcn := bf.base_class.name.to_string;
  83.          native.c_mapping_procedure(Current,bcn,bf.first_name.to_string);
  84.       end;
  85.  
  86.    c_define is
  87.       local
  88.          bf: like base_feature;
  89.          native: NATIVE;
  90.          bcn: STRING;
  91.       do
  92.          bf := base_feature;
  93.          native := bf.native;
  94.          bcn := bf.base_class.name.to_string;
  95.          native.c_define_procedure(Current,bcn,bf.first_name.to_string);
  96.       end;
  97.  
  98. feature {NONE}
  99.  
  100.    jvm_result_store is
  101.       do
  102.       end;
  103.  
  104.    tmp_string: STRING is
  105.       once
  106.          !!Result.make(80);
  107.       end;
  108.  
  109. feature {CALL_PROC_CALL}
  110.  
  111.    collect_c_tmp is
  112.       do
  113.       end;
  114.  
  115. feature {ADDRESS_OF_POOL}
  116.  
  117.    address_of_c_define(caller: ADDRESS_OF) is
  118.       do
  119.       end;
  120.  
  121. feature {ADDRESS_OF}
  122.  
  123.    address_of_c_mapping is
  124.       do
  125.       end;
  126.  
  127. feature {NONE}
  128.  
  129.    initialize is
  130.       local
  131.          n: STRING;
  132.       do
  133.          n := base_feature.first_name.to_string;
  134.          arguments := base_feature.arguments;
  135.          if arguments /= Void then
  136.             if not arguments.is_runnable(current_type) then
  137.                !!arguments.with(arguments,current_type);
  138.             end;
  139.          end;
  140.          if run_control.require_check then
  141.             if as_copy = name.to_string
  142.                and then current_type.is_expanded
  143.              then
  144.             else
  145.                require_assertion := run_require;
  146.             end;
  147.          end;
  148.          if run_control.ensure_check then
  149.             ensure_assertion := run_ensure;
  150.          end;
  151.          if as_raise_exception = n then
  152.             exceptions_handler.set_used;
  153.          end;
  154.       end;
  155.  
  156.    compute_use_current is
  157.       do
  158.          if base_feature.use_current then
  159.             use_current_state := ucs_true;
  160.          else
  161.             std_compute_use_current;
  162.          end;
  163.       end;
  164.  
  165. feature {NATIVE}
  166.  
  167.    c_prototype is
  168.       do
  169.          external_prototype(base_feature);
  170.       end;
  171.  
  172.    jvm_opening is
  173.       do
  174.          method_info_start;
  175.          jvm_define_opening;
  176.       end;
  177.  
  178.    jvm_closing is
  179.       do
  180.          jvm_define_closing;
  181.          code_attribute.opcode_return;
  182.          method_info.finish;
  183.       end;
  184.  
  185. feature {RUN_CLASS}
  186.  
  187.    jvm_field_or_method is
  188.       local
  189.          bf: like base_feature;
  190.          native: NATIVE;
  191.          bcn: STRING;
  192.       do
  193.          bf := base_feature;
  194.          native := bf.native;
  195.          bcn := bf.base_class.name.to_string;
  196.          native.jvm_add_method_for_procedure(Current,bcn,bf.first_name.to_string);
  197.       end;
  198.  
  199. feature
  200.  
  201.    mapping_jvm is
  202.       local
  203.          bf: like base_feature;
  204.          native: NATIVE;
  205.          bcn: STRING;
  206.       do
  207.          bf := base_feature;
  208.          native := bf.native;
  209.          bcn := bf.base_class.name.to_string;
  210.          native.jvm_mapping_procedure(Current,bcn,bf.first_name.to_string);
  211.       end;
  212.  
  213. feature {JVM}
  214.  
  215.    jvm_define is
  216.       local
  217.          bf: like base_feature;
  218.          native: NATIVE;
  219.          bcn: STRING;
  220.       do
  221.          bf := base_feature;
  222.          native := bf.native;
  223.          bcn := bf.base_class.name.to_string;
  224.          native.jvm_define_procedure(Current,bcn,bf.first_name.to_string);
  225.       end;
  226.  
  227. feature {NONE}
  228.  
  229.    update_tmp_jvm_descriptor is
  230.       do
  231.          routine_update_tmp_jvm_descriptor;
  232.       end;
  233.  
  234. end -- RUN_FEATURE_7
  235.  
  236.