/src/lib/backtracking/node/backtracking_node_binary.e

http://github.com/tybor/Liberty · Specman e · 82 lines · 45 code · 9 blank · 28 comment · 0 complexity · 22f6e4a5f86383828df8a2f1838e7d24 MD5 · raw file

  1. -- This file is part of a Liberty Eiffel library.
  2. -- See the full copyright at the end.
  3. --
  4. deferred class BACKTRACKING_NODE_BINARY
  5. --
  6. -- Node for a sequence of 2 nodes
  7. --
  8. inherit
  9. BACKTRACKING_NODE
  10. undefine
  11. fill_tagged_out_memory
  12. end
  13. insert
  14. BACKTRACKING_NODE_FILL
  15. feature {ANY}
  16. first: BACKTRACKING_NODE
  17. -- first node of the sequence
  18. second: BACKTRACKING_NODE
  19. -- second node of the sequence
  20. make (frst, scnd: BACKTRACKING_NODE)
  21. require
  22. first_not_void: frst /= Void
  23. second_not_void: scnd /= Void
  24. do
  25. first := frst
  26. second := scnd
  27. ensure
  28. definition: first = frst and second = scnd
  29. first_not_void: first /= Void
  30. second_not_void: second /= Void
  31. end
  32. set_first (value: BACKTRACKING_NODE)
  33. require
  34. value_not_void: value /= Void
  35. do
  36. first := value
  37. ensure
  38. definition: first = value
  39. first_not_void: first /= Void
  40. end
  41. set_second (value: BACKTRACKING_NODE)
  42. require
  43. value_not_void: value /= Void
  44. do
  45. second := value
  46. ensure
  47. definition: second = value
  48. second_not_void: second /= Void
  49. end
  50. invariant
  51. first_not_void: first /= Void
  52. second_not_void: second /= Void
  53. end -- class BACKTRACKING_NODE_BINARY
  54. --
  55. -- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
  56. --
  57. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  58. -- of this software and associated documentation files (the "Software"), to deal
  59. -- in the Software without restriction, including without limitation the rights
  60. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  61. -- copies of the Software, and to permit persons to whom the Software is
  62. -- furnished to do so, subject to the following conditions:
  63. --
  64. -- The above copyright notice and this permission notice shall be included in
  65. -- all copies or substantial portions of the Software.
  66. --
  67. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  68. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  69. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  70. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  71. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  72. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  73. -- THE SOFTWARE.