home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / call_1.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  2.5 KB  |  105 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. deferred class CALL_1
  17.    --
  18.    -- For calls with only one argument.
  19.    --   
  20.  
  21. inherit CALL;
  22.    
  23. feature 
  24.    
  25.    arguments: EFFECTIVE_ARG_LIST;
  26.    
  27. feature 
  28.    
  29.    make(t: like target; fn: like feature_name; a: like arguments) is
  30.       require
  31.      t /= Void;
  32.      fn /= Void;
  33.      a /= Void;
  34.       do
  35.      target := t;
  36.      feature_name := fn;
  37.      arguments := a;
  38.       ensure
  39.      target = t;
  40.      feature_name = fn;
  41.      arguments = a;
  42.       end;
  43.    
  44. feature 
  45.  
  46.    can_be_dropped: BOOLEAN is do end;
  47.    -- ******************************* VERIFIER CA ???
  48.  
  49.    is_pre_computable: BOOLEAN is false;
  50.    
  51.    arg1: EXPRESSION is
  52.       do
  53.      Result := arguments.first;
  54.       end;
  55.    
  56.    arg_count: INTEGER is 1;
  57.    
  58.    to_runnable(ct: TYPE): like Current is
  59.       local
  60.      a: like arguments;
  61.      tla: TYPE_LIKE_ARGUMENT;
  62.       do
  63.      if current_type = Void then
  64.         to_runnable_0(ct);
  65.         a := arguments.to_runnable(ct);
  66.         if a = Void then
  67.            error(arg1.start_position,fz_bad_argument);
  68.         else
  69.            arguments := a;
  70.         end;
  71.         if nb_errors = 0 then 
  72.            arguments.match_with(run_feature); 
  73.         end;
  74.         if nb_errors = 0 then
  75.            tla ?= result_type;
  76.            if tla /= Void then
  77.           result_type := arg1.result_type.run_type;
  78.            end;
  79.         end;
  80.         if nb_errors = 0 then
  81.            Result := Current;
  82.         end;
  83.      else
  84.         Result := twin;
  85.         Result.set_current_type(Void);
  86.         Result := Result.to_runnable(ct);
  87.      end;
  88.       end;
  89.    
  90. feature {NONE}
  91.    
  92.    with_target(t: like target) is
  93.       require
  94.      t.is_checked;
  95.       do
  96.      target := t;
  97.       end;
  98.    
  99. invariant
  100.    
  101.    arguments.count = 1
  102.    
  103. end -- CALL_1
  104.  
  105.