home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / precursor_name.e < prev    next >
Text File  |  1999-06-05  |  3KB  |  100 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 PRECURSOR_NAME
  17.    --
  18.    -- The name of a Precursor RUN_FEATURE (RUN_FEATURE_10 | RUN_FEATURE_11).
  19.    --
  20.  
  21. inherit FEATURE_NAME;
  22.  
  23. creation {E_PRECURSOR} refer_to
  24.  
  25. feature {NONE}
  26.  
  27.    enclosing: FEATURE_NAME;
  28.          -- Name of the enclosing RUN_FEATURE which contains the
  29.          -- Precursor call.
  30.  
  31.    to_key: STRING;
  32.  
  33. feature {NONE}
  34.  
  35.    refer_to(id: INTEGER; e: like enclosing) is
  36.          -- Where `id' is the base class id of the Precursor routine.
  37.       require
  38.          e /= Void
  39.       do
  40.          enclosing := e;
  41.          !!to_key.make(8 + enclosing.to_key.count);
  42.          to_key.extend('_');
  43.          id.append_in(to_key);
  44.          to_key.extend('P');
  45.          to_key.append(enclosing.to_key);
  46.          to_key := string_aliaser.item(to_key);
  47.       ensure
  48.          enclosing = e;
  49.       end;
  50.  
  51. feature
  52.  
  53.    to_string: STRING is
  54.       do
  55.          Result := enclosing.to_string;
  56.       end;
  57.  
  58.    start_position: POSITION is
  59.       do
  60.          Result := enclosing.start_position;
  61.       end;
  62.  
  63.    is_frozen: BOOLEAN is
  64.       do
  65.          Result := enclosing.is_frozen;
  66.       end;
  67.  
  68.    mapping_c_in(str: STRING) is
  69.       do
  70.          str.append(to_key);
  71.       end;
  72.  
  73.    declaration_in(str: STRING) is
  74.       do
  75.       end;
  76.  
  77.    pretty_print is
  78.       do
  79.          fmt.put_string(as_precursor);
  80.       end;
  81.  
  82.    declaration_pretty_print is
  83.       do
  84.       end;
  85.  
  86.    short is
  87.       do
  88.       end;
  89.  
  90. feature {RUN_FEATURE,FEATURE_NAME}
  91.  
  92.    put_cpp_tag is
  93.       do
  94.          cpp.put_string(as_precursor);
  95.          cpp.put_character(' ');
  96.       end;
  97.  
  98. end
  99.  
  100.