home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_se / feature_clause_list.e < prev    next >
Text File  |  1999-06-05  |  3KB  |  112 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 FEATURE_CLAUSE_LIST
  17.  
  18. inherit GLOBALS;
  19.  
  20. creation {BASE_CLASS}
  21.    make
  22.  
  23. feature {NONE}
  24.  
  25.    list: ARRAY[FEATURE_CLAUSE] ;
  26.  
  27. feature {NONE}
  28.  
  29.    make(l: like list) is
  30.       require
  31.          l.lower = 1;
  32.          not l.empty;
  33.       do
  34.          list := l;
  35.       ensure
  36.          list = l;
  37.       end;
  38.  
  39. feature
  40.  
  41.    pretty_print is
  42.       local
  43.          i: INTEGER;
  44.       do
  45.          from
  46.             i := 1;
  47.          until
  48.             i > list.upper
  49.          loop
  50.             fmt.set_indent_level(0);
  51.             fmt.indent;
  52.             if not fmt.zen_mode then
  53.                fmt.skip(1);
  54.             end;
  55.             list.item(i).pretty_print;
  56.             i := i + 1;
  57.          end;
  58.       ensure
  59.          fmt.indent_level = 0;
  60.       end;
  61.  
  62. feature {SHORT}
  63.  
  64.    for_short(bcn: CLASS_NAME; sort: BOOLEAN;
  65.              rf_list: FIXED_ARRAY[RUN_FEATURE]; rc: RUN_CLASS) is
  66.       local
  67.          i: INTEGER;
  68.          fc: FEATURE_CLAUSE;
  69.       do
  70.          from
  71.             i := 1;
  72.          until
  73.             i > list.upper
  74.          loop
  75.             fc := list.item(i);
  76.             fc.for_short(bcn,sort,rf_list,rc);
  77.             i := i + 1;
  78.          end;
  79.       end;
  80.  
  81. feature {BASE_CLASS}
  82.  
  83.    get_started(fd: DICTIONARY[E_FEATURE,STRING]) is
  84.       local
  85.          i: INTEGER;
  86.       do
  87.          from
  88.             i := 1;
  89.          until
  90.             i > list.upper
  91.          loop
  92.             list.item(i).add_into(fd);
  93.             i := i + 1;
  94.          end;
  95.       end;
  96.  
  97.    add_last(fc: FEATURE_CLAUSE) is
  98.       require
  99.          fc /= Void;
  100.       do
  101.          list.add_last(fc);
  102.       end;
  103.  
  104. invariant
  105.  
  106.    list.lower = 1;
  107.  
  108.    not list.empty;
  109.  
  110. end -- FEATURE_CLAUSE_LIST
  111.  
  112.