home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / tag_name.e < prev    next >
Text File  |  1999-06-05  |  2KB  |  72 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 TAG_NAME
  17.  
  18. inherit GLOBALS;
  19.  
  20. creation make
  21.  
  22. feature
  23.  
  24.    to_string: STRING;
  25.  
  26.    start_position: POSITION;
  27.  
  28. feature {NONE}
  29.  
  30.    make(n: STRING; sp: like start_position) is
  31.       require
  32.          n = string_aliaser.item(n)
  33.       do
  34.          to_string := n;
  35.          start_position := sp;
  36.       ensure
  37.          to_string = n;
  38.          start_position = sp
  39.       end;
  40.  
  41. feature
  42.  
  43.    to_key: STRING is
  44.       do
  45.          Result := to_string;
  46.       end;
  47.  
  48.    short is
  49.       local
  50.          i: INTEGER;
  51.          c: CHARACTER;
  52.       do
  53.          short_print.hook("Btag");
  54.          from
  55.             i := 1;
  56.          until
  57.             i > to_string.count
  58.          loop
  59.             c := to_string.item(i);
  60.             if c = '_' then
  61.                short_print.hook_or("Utag","_");
  62.             else
  63.                short_print.a_character(c);
  64.             end;
  65.             i := i + 1;
  66.          end;
  67.          short_print.hook("Atag");
  68.       end;
  69.  
  70. end -- TAG_NAME
  71.  
  72.