PageRenderTime 15ms CodeModel.GetById 9ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/tools/configuration/etc/liberty_etc_list.e

http://github.com/tybor/Liberty
Specman e | 60 lines | 38 code | 8 blank | 14 comment | 0 complexity | b0fa19a1931d18c81f4f5cd2591a781f MD5 | raw file
 1-- This file is part of Liberty Eiffel.
 2--
 3-- Liberty Eiffel is free software: you can redistribute it and/or modify
 4-- it under the terms of the GNU General Public License as published by
 5-- the Free Software Foundation, version 3 of the License.
 6--
 7-- Liberty Eiffel is distributed in the hope that it will be useful,
 8-- but WITHOUT ANY WARRANTY; without even the implied warranty of
 9-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10-- GNU General Public License for more details.
11--
12-- You should have received a copy of the GNU General Public License
13-- along with Liberty Eiffel.  If not, see <http://www.gnu.org/licenses/>.
14--
15class LIBERTY_ETC_LIST
16
17inherit
18   EIFFEL_LIST_NODE
19
20insert
21   EIFFEL_LIST_NODE_IMPL
22      rename
23         make as impl_make
24      export
25         {} all
26      redefine
27         accept
28      end
29
30create {LIBERTY_ETC_FACTORY}
31   make
32
33feature {ANY}
34   accept (a_visitor: VISITOR) is
35      local
36         v: LIBERTY_ETC_VISITOR
37      do
38         v ::= a_visitor
39         visitor.call([v, Current])
40      end
41
42feature {}
43   make (a_name: FIXED_STRING; a_visitor: like visitor) is
44      require
45         a_name /= Void
46         a_visitor /= Void
47      do
48         impl_make(a_name)
49         visitor := a_visitor
50      ensure
51         name = a_name
52         visitor = a_visitor
53      end
54
55   visitor: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_LIST]]
56
57invariant
58   visitor /= Void
59
60end -- class LIBERTY_ETC_LIST