home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / writable_attribute.e < prev   
Encoding:
Text File  |  1998-01-16  |  2.1 KB  |  74 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 WRITABLE_ATTRIBUTE
  17. --
  18. -- For instance variables (ordinary attribute).
  19. --
  20.  
  21. inherit
  22.    ATTRIBUTE
  23.       rename make_e_feature as make
  24.       export {ANY} make
  25.       end;
  26.  
  27. creation make
  28.    
  29. feature 
  30.    
  31.    to_run_feature(t: TYPE; fn: FEATURE_NAME): RUN_FEATURE_2 is
  32.       do
  33.      !!Result.make(t,fn,Current);
  34.       end;
  35.    
  36. feature {C_PRETTY_PRINTER}
  37.  
  38.    stupid_switch(up_rf: RUN_FEATURE; r: ARRAY[RUN_CLASS]): BOOLEAN is
  39.       local
  40.      offset1, offset2, i: INTEGER;
  41.      dyn_rf2: RUN_FEATURE_2;
  42.      dyn_rc: RUN_CLASS;
  43.       do
  44.      from
  45.         i := r.upper;
  46.         dyn_rc := r.item(i);
  47.         dyn_rf2 ?= dyn_rc.dynamic(up_rf);
  48.         if dyn_rf2 /= Void then
  49.            offset1 := dyn_rc.offset_of(dyn_rf2);
  50.            Result := true;
  51.            i := i - 1;
  52.         end;
  53.      until
  54.         not Result or else i = 0
  55.      loop
  56.         dyn_rc := r.item(i);
  57.         dyn_rf2 ?= dyn_rc.dynamic(up_rf);
  58.         if dyn_rf2 /= Void then
  59.            offset2 := dyn_rc.offset_of(dyn_rf2);
  60.            Result := offset1 = offset2;
  61.            i := i - 1;
  62.         else
  63.            Result := false;
  64.         end;
  65.      end;
  66.       end;
  67.  
  68. feature {NONE}
  69.    
  70.    pretty_tail is do end;
  71.  
  72. end -- WRITABLE_ATTRIBUTE
  73.  
  74.