/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. --
  15. class LIBERTY_ETC_LIST
  16. inherit
  17. EIFFEL_LIST_NODE
  18. insert
  19. EIFFEL_LIST_NODE_IMPL
  20. rename
  21. make as impl_make
  22. export
  23. {} all
  24. redefine
  25. accept
  26. end
  27. create {LIBERTY_ETC_FACTORY}
  28. make
  29. feature {ANY}
  30. accept (a_visitor: VISITOR) is
  31. local
  32. v: LIBERTY_ETC_VISITOR
  33. do
  34. v ::= a_visitor
  35. visitor.call([v, Current])
  36. end
  37. feature {}
  38. make (a_name: FIXED_STRING; a_visitor: like visitor) is
  39. require
  40. a_name /= Void
  41. a_visitor /= Void
  42. do
  43. impl_make(a_name)
  44. visitor := a_visitor
  45. ensure
  46. name = a_name
  47. visitor = a_visitor
  48. end
  49. visitor: PROCEDURE[TUPLE[LIBERTY_ETC_VISITOR, LIBERTY_ETC_LIST]]
  50. invariant
  51. visitor /= Void
  52. end -- class LIBERTY_ETC_LIST