/tutorial/backtracking/logigram/item.e

http://github.com/tybor/Liberty · Specman e · 57 lines · 30 code · 9 blank · 18 comment · 0 complexity · 41191f3699c05d7b41e484d72f619187 MD5 · raw file

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