home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / proc_call_0.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  2.6 KB  |  102 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 PROC_CALL_0
  17.    --
  18.    -- For procedure calls without argument (only Current).
  19.    --   
  20.    
  21. inherit PROC_CALL;
  22.  
  23. creation make
  24.  
  25. feature
  26.  
  27.    arg_count: INTEGER is 0;
  28.      
  29. feature 
  30.    
  31.    make(t: like target; fn: like feature_name) is
  32.       require
  33.      t /= Void;
  34.      fn /= Void;
  35.       do
  36.      target := t;
  37.      feature_name := fn;
  38.       end;
  39.  
  40. feature
  41.    
  42.    arguments: EFFECTIVE_ARG_LIST is
  43.       do
  44.       end;
  45.  
  46.    to_runnable(rc: like run_compound): like Current is
  47.       do
  48.      if run_compound = Void then
  49.         to_runnable_0(rc);
  50.         if nb_errors = 0 and then run_feature.arg_count > 0 then
  51.            eh.add_position(feature_name.start_position);
  52.            error(run_feature.start_position,
  53.              "Feature found has argument(s).");
  54.         end;
  55.         if nb_errors = 0 then
  56.            Result := Current;
  57.         end;
  58.      else
  59.         !!Result.make(target,feature_name);
  60.         Result := Result.to_runnable(rc);
  61.      end;
  62.       end;
  63.    
  64.    compile_to_jvm is
  65.       do
  66.      call_proc_call_c2jvm;
  67.       end;
  68.  
  69.    pretty_print is
  70.       do
  71.      target.print_as_target;
  72.      fmt.put_string(feature_name.to_string);
  73.      if fmt.semi_colon_flag then
  74.         fmt.put_character(';');
  75.      end;
  76.       end;
  77.       
  78. feature {CREATION_CALL}
  79.  
  80.    make_runnable(rc: like run_compound; 
  81.          w: like target; a: like arguments;
  82.          rf: RUN_FEATURE): like Current is
  83.       do
  84.      if run_compound = Void then
  85.         Result := Current;
  86.         Result.make(w,feature_name);
  87.         run_compound := rc;
  88.         run_feature := rf;
  89.      else
  90.         !!Result.make(w,feature_name);
  91.         Result.set_run_compound(rc);
  92.         Result.set_run_feature(rf);
  93.      end;
  94.       end;
  95.  
  96. invariant
  97.    
  98.    arguments = Void;
  99.    
  100. end -- PROC_CALL_0
  101.  
  102.