home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / call_0_c.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  3.2 KB  |  130 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 CALL_0_C
  17.    -- Other calls without argument.
  18.  
  19. inherit CALL_0;
  20.  
  21. creation make
  22.  
  23. feature
  24.  
  25.    short is
  26.       do
  27.      target.short_target;
  28.      feature_name.short;
  29.       end;
  30.  
  31.    short_target is
  32.       do
  33.      short;
  34.      short_print.a_dot;
  35.       end;
  36.  
  37.    bracketed_pretty_print, pretty_print is
  38.       do
  39.      target.print_as_target;
  40.      fmt.put_string(feature_name.to_string);
  41.       end;
  42.    
  43.    is_pre_computable: BOOLEAN is
  44.       do
  45.      if target.is_current then
  46.         Result := run_feature.is_pre_computable;
  47.      end;
  48.       end;
  49.  
  50.    is_static: BOOLEAN is
  51.       local
  52.      name: STRING;
  53.      tt: TYPE;
  54.      tb: TYPE_BIT;
  55.       do
  56.      if run_feature /= Void then
  57.         tt := target.result_type;
  58.         name := run_feature.name.to_string;
  59.         if us_is_expanded_type = name then
  60.            Result := true;
  61.            if tt.is_expanded then
  62.           static_value_mem := 1;
  63.            end;
  64.         elseif us_is_basic_expanded_type = name then
  65.            Result := true;
  66.            if tt.is_basic_eiffel_expanded then
  67.           static_value_mem := 1;
  68.            end;
  69.         elseif us_count = name and then tt.is_bit then
  70.            Result := true;
  71.            tb ?= tt;
  72.            static_value_mem := tb.nb;
  73.         elseif target.is_current then
  74.            if run_feature.is_static then
  75.           Result := true;
  76.           static_value_mem := run_feature.static_value_mem;
  77.            else
  78.           Result := call_is_static;
  79.            end;
  80.         else
  81.            Result := call_is_static;
  82.         end;
  83.      end;
  84.       end;
  85.  
  86.    isa_dca_inline_argument: INTEGER is
  87.       -- *** A FAIRE ??? ***
  88.       do
  89.       end;
  90.  
  91.    dca_inline_argument(formal_arg_type: TYPE) is
  92.      -- *** FAIRE ***
  93.       do
  94.       end;
  95.  
  96.    compile_to_jvm is
  97.       local
  98.      n: STRING;
  99.       do
  100.      n := feature_name.to_string;
  101.      if us_is_expanded_type = n then
  102.         if target.result_type.is_expanded then
  103.            code_attribute.opcode_iconst_1;
  104.         else
  105.            code_attribute.opcode_iconst_0;
  106.         end;
  107.      elseif us_is_basic_expanded_type = n then
  108.         if target.result_type.is_basic_eiffel_expanded then
  109.            code_attribute.opcode_iconst_1;
  110.         else
  111.            code_attribute.opcode_iconst_0;
  112.         end;
  113.      else
  114.         call_proc_call_c2jvm;
  115.      end;
  116.       end;
  117.    
  118.    jvm_branch_if_false: INTEGER is
  119.       do
  120.      Result := jvm_standard_branch_if_false;
  121.       end;
  122.  
  123.    jvm_branch_if_true: INTEGER is
  124.       do
  125.      Result := jvm_standard_branch_if_true;
  126.       end;
  127.    
  128. end -- CALL_0_C
  129.  
  130.