home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / local_argument1.e < prev    next >
Text File  |  1999-06-05  |  2KB  |  87 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://SmallEiffel.loria.fr
  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 LOCAL_ARGUMENT1
  17.  
  18. inherit LOCAL_ARGUMENT;
  19.  
  20. feature
  21.  
  22.    to_string: STRING;
  23.  
  24.    result_type: TYPE;
  25.  
  26.    rank: INTEGER;
  27.  
  28. feature {DECLARATION_LIST}
  29.  
  30.    set_rank(r: like rank) is
  31.       require
  32.          r >= 1
  33.       do
  34.          rank := r;
  35.       ensure
  36.          rank = r
  37.       end;
  38.  
  39. feature {LOCAL_ARGUMENT1,DECLARATION_LIST,DECLARATION}
  40.  
  41.    set_result_type(rt: like result_type) is
  42.       require
  43.          rt /= Void
  44.       do
  45.          result_type := rt;
  46.       ensure
  47.          result_type = rt
  48.       end;
  49.  
  50. feature {DECLARATION_LIST}
  51.  
  52.    name_clash(ct: TYPE) is
  53.          -- Check name clash between argument/feature or name clash
  54.          -- between local/feature.
  55.          -- Note : clash between local/argument are checked during
  56.          --        parsing.
  57.       require
  58.          ct /= Void
  59.       deferred
  60.       end;
  61.  
  62. feature {NONE}
  63.  
  64.    name_clash_for(ct: TYPE; msg: STRING) is
  65.       require
  66.          ct /= Void;
  67.          msg /= Void
  68.       local
  69.          rf: RUN_FEATURE;
  70.          rc: RUN_CLASS;
  71.          bc: BASE_CLASS;
  72.       do
  73.          bc := base_class_written;
  74.          if bc.has_simple_feature_name(to_string) then
  75.             rc := ct.run_class;
  76.             rf := rc.get_feature_with(to_string);
  77.             if rf /= Void then
  78.                eh.add_position(rf.start_position);
  79.             end;
  80.             error(start_position,msg);
  81.          end;
  82.       end;
  83.  
  84. end --  LOCAL_ARGUMENT1
  85.  
  86.  
  87.