home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / run_feature_7.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  4.2 KB  |  191 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://www.loria.fr/SmallEiffel
  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 {EXTERNAL_PROCEDURE} make
  21.    
  22. feature 
  23.    
  24.    base_feature: EXTERNAL_PROCEDURE;
  25.    
  26.    is_pre_computable: BOOLEAN is false;
  27.    
  28.    is_static: BOOLEAN is false;
  29.    
  30.    static_value_mem: INTEGER is do end;
  31.  
  32.    local_vars: LOCAL_VAR_LIST is do end;
  33.    
  34.    can_be_dropped: BOOLEAN is false;
  35.    
  36.    afd_check is
  37.       do
  38.      routine_afd_check;
  39.       end;
  40.  
  41.    mapping_c is
  42.       local
  43.      bf: like base_feature;
  44.      native: NATIVE;
  45.      bcn: STRING;
  46.      bfuc: BOOLEAN;
  47.       do
  48.      bf := base_feature;
  49.      native := bf.native;
  50.      bcn := bf.base_class.base_class_name.to_string;
  51.      native.c_mapping_procedure(Current,bcn,bf.first_name.to_string);
  52.       end;
  53.    
  54.    c_define is 
  55.       local
  56.      bf: like base_feature;
  57.      native: NATIVE;
  58.      bcn: STRING;
  59.       do
  60.      bf := base_feature;
  61.      native := bf.native;
  62.      bcn := bf.base_class.base_class_name.to_string;
  63.      native.c_define_procedure(Current,bcn,bf.first_name.to_string);
  64.       end;
  65.  
  66. feature {NONE}   
  67.    
  68.    tmp_string: STRING is
  69.       once
  70.      !!Result.make(80);
  71.       end;
  72.  
  73. feature {NONE}   
  74.  
  75.    initialize is
  76.       do
  77.      arguments := base_feature.arguments;
  78.      if arguments /= Void and then arguments.count > 0 then
  79.         arguments := arguments.to_runnable(current_type);
  80.      end;
  81.      if run_control.require_check then
  82.         if us_copy = name.to_string
  83.            and then current_type.is_expanded 
  84.          then
  85.         else
  86.            require_assertion := base_feature.run_require(Current);
  87.         end;
  88.      end;
  89.      if run_control.ensure_check then
  90.         ensure_assertion := base_feature.run_ensure(Current);
  91.      end;
  92.       end;
  93.    
  94.    compute_use_current is
  95.       do
  96.      if base_feature.use_current then
  97.         use_current_state := ucs_true;
  98.      else
  99.         std_compute_use_current;
  100.      end;
  101.       end;
  102.  
  103. feature {NATIVE}
  104.  
  105.    c_define_with_body(body: STRING) is
  106.       require
  107.      body /= Void
  108.       do
  109.      define_prototype;
  110.      define_opening;
  111.      cpp.put_string(body);
  112.      define_closing;
  113.      cpp.put_string(fz_12);
  114.       end;
  115.  
  116. feature {NATIVE}
  117.  
  118.    c_prototype is
  119.       do
  120.      external_prototype(base_feature);
  121.       end;
  122.  
  123.    jvm_opening is
  124.       do
  125.      method_info_start;
  126.      jvm_define_opening;
  127.       end;
  128.  
  129.    jvm_closing is
  130.       do
  131.      jvm_define_closing;
  132.      code_attribute.opcode_return;
  133.      method_info.finish;
  134.       end;
  135.  
  136. feature {RUN_CLASS}
  137.  
  138.    jvm_field_or_method is
  139.       local
  140.      native: NATIVE;
  141.      bcn: STRING;
  142.       do
  143.      native := base_feature.native;
  144.      bcn := base_feature.base_class.base_class_name.to_string;
  145.      native.jvm_add_method_for_procedure(Current,bcn,name.to_string);
  146.       end;
  147.  
  148. feature
  149.  
  150.    mapping_jvm is
  151.       local
  152.      bf: like base_feature;
  153.      native: NATIVE;
  154.      bcn: STRING;
  155.       do
  156.      bf := base_feature;
  157.      native := bf.native;
  158.      bcn := bf.base_class.base_class_name.to_string;
  159.      native.jvm_mapping_procedure(Current,bcn,bf.first_name.to_string);
  160.       end;
  161.  
  162. feature {JVM}
  163.  
  164.    jvm_define is
  165.       local
  166.      bf: like base_feature;
  167.      native: NATIVE;
  168.      bcn: STRING;
  169.       do
  170.      bf := base_feature;
  171.      native := bf.native;
  172.      bcn := bf.base_class.base_class_name.to_string;
  173.      native.jvm_define_procedure(Current,bcn,bf.first_name.to_string);
  174.       end;
  175.    
  176. feature {NONE}
  177.  
  178.    update_tmp_jvm_descriptor is
  179.       do
  180.      routine_update_tmp_jvm_descriptor;
  181.       end;
  182.  
  183. invariant
  184.    
  185.    result_type = Void;
  186.    
  187.    routine_body = Void;
  188.  
  189. end -- RUN_FEATURE_7
  190.  
  191.