home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / call_0.e < prev    next >
Text File  |  1999-06-05  |  3KB  |  95 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 CALL_0
  17.    --
  18.    -- For calls without argument (only Current).
  19.    --
  20.  
  21. inherit CALL redefine to_integer end;
  22.  
  23. feature
  24.  
  25.    arg_count: INTEGER is 0;
  26.  
  27. feature
  28.  
  29.    run_feature: RUN_FEATURE;
  30.  
  31. feature
  32.  
  33.    frozen arguments: EFFECTIVE_ARG_LIST is
  34.       do
  35.       end;
  36.  
  37.    frozen result_type: TYPE is
  38.       do
  39.          Result := run_feature.result_type;
  40.          if Result.is_like_current then
  41.             Result := run_feature.current_type;
  42.          end;
  43.       end;
  44.  
  45.    frozen to_integer: INTEGER is
  46.       local
  47.          rf1: RUN_FEATURE_1;
  48.       do
  49.          rf1 ?= run_feature;
  50.          if rf1 = Void then
  51.             error(start_position,fz_iinaiv);
  52.          else
  53.             Result := rf1.value.to_integer;
  54.          end;
  55.       end;
  56.  
  57.    frozen assertion_check(tag: CHARACTER) is
  58.       do
  59.          if tag = 'R' then
  60.             run_feature.vape_check_from(start_position);
  61.          end;
  62.          target.assertion_check(tag);
  63.       end;
  64.  
  65.    frozen can_be_dropped: BOOLEAN is
  66.       do
  67.          if target.can_be_dropped then
  68.             Result := run_feature.can_be_dropped;
  69.          end;
  70.       end;
  71.  
  72.    frozen run_feature_match is
  73.       do
  74.          run_feature_has_result;
  75.          if run_feature.arguments /= Void then
  76.             eh.add_position(feature_name.start_position);
  77.             eh.add_position(run_feature.start_position);
  78.             fatal_error("Feature found has arguments.");
  79.          end;
  80.       end;
  81.  
  82. feature {RUN_FEATURE_3,RUN_FEATURE_4}
  83.  
  84.    frozen finalize is
  85.       local
  86.          rc: RUN_CLASS;
  87.          rf: RUN_FEATURE;
  88.       do
  89.          rf := run_feature;
  90.          rc := rf.current_type.run_class;
  91.          run_feature := rc.running.first.dynamic(rf);
  92.       end;
  93.  
  94. end -- CALL_0
  95.