home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / e_precursor_procedure.e < prev    next >
Text File  |  1999-06-05  |  3KB  |  83 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. class E_PRECURSOR_PROCEDURE
  17.    --
  18.    -- Handling of the pseudo variable "Current".
  19.    --
  20.  
  21. inherit
  22.    E_PRECURSOR
  23.       redefine run_feature
  24.       end;
  25.    INSTRUCTION;
  26.  
  27. creation make
  28.  
  29. feature {E_PRECURSOR}
  30.  
  31.    run_feature: RUN_FEATURE_10;
  32.  
  33. feature
  34.  
  35.    end_mark_comment: BOOLEAN is false;
  36.  
  37.    is_pre_computable: BOOLEAN is false;
  38.  
  39. feature
  40.  
  41.    collect_c_tmp is
  42.       do
  43.          if arguments /= Void then
  44.             arguments.collect_c_tmp;
  45.          end;
  46.       end;
  47.  
  48.    to_runnable(ct: TYPE): like Current is
  49.       local
  50.          wrf: RUN_FEATURE;
  51.          super: EFFECTIVE_ROUTINE;
  52.          pn: PRECURSOR_NAME;
  53.       do
  54.          if current_type = Void then
  55.             current_type := ct;
  56.             Result := Current;
  57.             wrf := small_eiffel.top_rf;
  58.             if wrf.result_type /= Void then
  59.                eh.add_position(start_position);
  60.                fatal_error("Inside a function, a Precursor call must %
  61.                            %be a function call (not a procedure call).");
  62.             end;
  63.             super := super_feature(wrf);
  64.             pn := precursor_name(wrf.name,super)
  65.             !!run_feature.make(ct,pn,super);
  66.             prepare_arguments(ct);
  67.          else
  68.             !!Result.make(start_position,parent,arguments);
  69.             Result := Result.to_runnable(ct);
  70.          end;
  71.       end;
  72.  
  73. feature {NONE}
  74.  
  75.    put_semi_colon is
  76.       do
  77.          if fmt.semi_colon_flag then
  78.             fmt.put_character(';');
  79.          end;
  80.       end;
  81.  
  82. end -- E_PRECURSOR_PROCEDURE
  83.