home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / feature_name.e < prev    next >
Text File  |  1999-06-05  |  3KB  |  129 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 FEATURE_NAME
  17.    --
  18.    -- Root of SIMPLE_FEATURE_NAME, INFIX_NAME, PREFIX_NAME and 
  19.    --                      FROZEN_FEATURE_NAME.
  20.    --
  21.  
  22. inherit NAME;
  23.  
  24. feature
  25.  
  26.    is_manifest_string: BOOLEAN is false;
  27.  
  28.    is_result: BOOLEAN is false;
  29.  
  30.    is_void: BOOLEAN is false;
  31.  
  32.    c_simple: BOOLEAN is true;
  33.  
  34. feature
  35.  
  36.    is_frozen: BOOLEAN is
  37.       deferred
  38.       end;
  39.  
  40.    mapping_c_in(str: STRING) is
  41.       deferred
  42.       end;
  43.  
  44.    frozen origin_base_class: BASE_CLASS is
  45.          -- Void or the BASE_CLASS where Current is written in.
  46.       local
  47.          sp: like start_position;
  48.       do
  49.          sp := start_position;
  50.          if sp /= Void then
  51.             Result := sp.base_class;
  52.          end;
  53.       end;
  54.  
  55. feature
  56.  
  57.    name_in(sc: BASE_CLASS): FEATURE_NAME is
  58.          --                 ************
  59.          -- ***             like Current
  60.          --                 ************
  61.          -- Using the `start_position', compute possible renaming
  62.          -- when starting look_up from `sc'.
  63.       require
  64.          origin_base_class = sc or else
  65.          sc.is_subclass_of(origin_base_class)
  66.       local
  67.          bc: BASE_CLASS;
  68.       do
  69.          bc := origin_base_class
  70.          if bc = sc then
  71.             Result := Current;
  72.          else
  73.             Result := sc.new_name_of(bc,Current);
  74.          end;
  75.       ensure
  76.          Result /= Void
  77.       end;
  78.  
  79.    is_freeop: BOOLEAN is
  80.       do
  81.          inspect
  82.             to_string @ 1
  83.          when '@', '#', '|', '&' then
  84.             Result := true;
  85.          else
  86.          end;
  87.       end;
  88.  
  89.    declaration_in(str: STRING) is
  90.       require
  91.          str /= Void
  92.       deferred
  93.       end
  94.  
  95.    declaration_pretty_print is
  96.       deferred
  97.       end;
  98.  
  99.    short is
  100.       deferred
  101.       end;
  102.  
  103.    frozen afd_check is
  104.       do
  105.       end;
  106.  
  107. feature {E_FEATURE}
  108.  
  109.    undefine_in(bc: BASE_CLASS) is
  110.       require
  111.          bc /= Void
  112.       do
  113.          if is_frozen then
  114.             error(start_position,
  115.                   "A frozen feature must not be undefined (VDUS).");
  116.             bc.fatal_undefine(Current);
  117.          end;
  118.       end;
  119.  
  120. feature {RUN_FEATURE,FEATURE_NAME}
  121.  
  122.    put_cpp_tag is
  123.       deferred
  124.       end;
  125.  
  126. end -- FEATURE_NAME
  127.  
  128.  
  129.