home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / dev / ppcsmalleiffel / lib_se / argument_name1.e < prev    next >
Encoding:
Text File  |  1998-01-16  |  2.0 KB  |  68 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 ARGUMENT_NAME1
  17.    --
  18.    -- An argument name in some declaration list.
  19.    --
  20.  
  21. inherit ARGUMENT_NAME;
  22.  
  23. creation {TMP_NAME} make
  24.  
  25. creation {ARGUMENT_NAME1} make_runnable
  26.  
  27. feature
  28.    
  29.    to_runnable(ct: TYPE): like Current is
  30.       local
  31.      t1, t2: TYPE;
  32.       do
  33.      t1 := result_type;
  34.      t2 := t1.to_runnable(ct);
  35.      if t2 = Void then
  36.         eh.add_position(t1.start_position);
  37.         error(start_position,em_ba);
  38.      end;
  39.      if current_type = Void then
  40.         current_type := ct;
  41.         result_type := t2;
  42.         Result := Current;
  43.      else
  44.         !!Result.make_runnable(Current,ct,t2);
  45.      end;
  46.       end;
  47.  
  48. feature {DECLARATION_LIST}
  49.  
  50.    name_clash is
  51.       local
  52.      rf: RUN_FEATURE;
  53.      rc: RUN_CLASS;
  54.       do
  55.      if base_class_written.has_feature(to_string) then
  56.         rc := current_type.run_class;
  57.         rf := rc.get_feature_with(to_string);
  58.         if rf /= Void then
  59.            eh.add_position(rf.start_position);
  60.         end;
  61.         error(start_position,
  62.           "Conflict between argument/feature name (VRFA).");
  63.      end;
  64.       end;
  65.  
  66. end -- ARGUMENT_NAME1
  67.  
  68.