/tutorial/backtracking/logigram/exprs/expr_item.e

http://github.com/tybor/Liberty · Specman e · 47 lines · 22 code · 7 blank · 18 comment · 0 complexity · 116e277cd4626f0821294a0d5bb7465d MD5 · raw file

  1. -- See the Copyright notice at the end of this file.
  2. --
  3. class EXPR_ITEM
  4. inherit
  5. EXPR
  6. creation {ANY}
  7. make
  8. feature {ANY}
  9. item: ITEM
  10. make (it: ITEM) is
  11. require
  12. it.is_like_integer
  13. do
  14. item := it
  15. end
  16. to_integer: INTEGER is
  17. do
  18. Result := item.to_integer
  19. end
  20. get_items (collector: ITEM_COLLECTOR) is
  21. do
  22. collector.put(item)
  23. end
  24. end -- class EXPR_ITEM
  25. --
  26. -- ------------------------------------------------------------------------------------------------------------------------------
  27. -- Copyright notice below. Please read.
  28. --
  29. -- This file is free software, which comes along with SmartEiffel. This software is distributed in the hope that it will be
  30. -- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  31. -- You can modify it as you want, provided this footer is kept unaltered, and a notification of the changes is added.
  32. -- You are allowed to redistribute it and sell it, alone or as a part of another product.
  33. --
  34. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  35. -- Copyright(C) 2003-2005: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  36. --
  37. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  38. --
  39. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  40. -- ------------------------------------------------------------------------------------------------------------------------------