home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / call_n.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  3.3 KB  |  144 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_N
  17. --
  18. -- For calls with more than one argument : "bar.foo(...)".
  19. -- For other calls, use CALL_0 or CALL_1.
  20. --  
  21.  
  22. inherit CALL;
  23.    
  24. creation make
  25.    
  26. feature 
  27.    
  28.    arguments: EFFECTIVE_ARG_LIST;
  29.    
  30.    make(t: like target; sn: like feature_name; a: like arguments) is
  31.       require
  32.      t /= void;
  33.      sn /= void;
  34.      a.count > 1;
  35.       do
  36.      target := t;
  37.      feature_name := sn;
  38.      arguments := a;
  39.       end;
  40.    
  41. feature
  42.  
  43.    is_pre_computable: BOOLEAN is false;
  44.    
  45.    is_static: BOOLEAN is
  46.       do
  47.      Result := call_is_static;
  48.       end;
  49.  
  50.    isa_dca_inline_argument: INTEGER is
  51.      -- *** FAIRE ***
  52.       do
  53.       end;
  54.  
  55.    dca_inline_argument(formal_arg_type: TYPE) is
  56.      -- *** FAIRE ***
  57.       do
  58.       end;
  59.  
  60.    arg_count: INTEGER is
  61.       do
  62.      Result := arguments.count;
  63.       end;
  64.    
  65.    can_be_dropped: BOOLEAN is do end;
  66.    
  67.    to_runnable(ct: TYPE): like Current is
  68.       local
  69.      a: like arguments;
  70.      tla: TYPE_LIKE_ARGUMENT;
  71.      e: EXPRESSION;
  72.       do
  73.      if current_type = Void then
  74.         to_runnable_0(ct);
  75.         a := arguments.to_runnable(ct);
  76.         if a = Void then
  77.            error(arguments.start_position,fz_bad_arguments);
  78.         else
  79.            arguments := a;
  80.         end;
  81.         if nb_errors = 0 then 
  82.            arguments.match_with(run_feature); 
  83.         end;
  84.         if nb_errors = 0 then
  85.            tla ?= result_type;
  86.            if tla /= Void then
  87.           e := arguments.expression(tla.rank);
  88.           result_type := e.result_type.run_type;
  89.            end;
  90.         end;
  91.         if nb_errors = 0 then
  92.            Result := Current;
  93.         end;
  94.      else
  95.         Result := twin;
  96.         Result.set_current_type(Void);
  97.         Result := Result.to_runnable(ct);
  98.      end;
  99.       end;
  100.    
  101.    frozen bracketed_pretty_print, frozen pretty_print is
  102.       do
  103.      target.print_as_target;
  104.      fmt.put_string(feature_name.to_string);
  105.      fmt.level_incr;
  106.      arguments.pretty_print;
  107.      fmt.level_decr;
  108.       end;
  109.  
  110.    short is
  111.       do
  112.      target.short_target;
  113.      feature_name.short;
  114.      arguments.short;
  115.       end;
  116.    
  117.    short_target is
  118.       do
  119.      short;
  120.      short_print.a_dot;
  121.       end;
  122.  
  123.    compile_to_jvm is
  124.       do
  125.      call_proc_call_c2jvm;
  126.       end;
  127.    
  128.    jvm_branch_if_false: INTEGER is
  129.       do
  130.      Result := jvm_standard_branch_if_false;
  131.       end;
  132.  
  133.    jvm_branch_if_true: INTEGER is
  134.       do
  135.      Result := jvm_standard_branch_if_true;
  136.       end;
  137.    
  138. invariant
  139.    
  140.    arguments.count > 1
  141.    
  142. end -- CALL_N
  143.  
  144.