/src/lib/backtracking/low_level/backtracking_sequence.e

http://github.com/tybor/Liberty · Specman e · 59 lines · 24 code · 6 blank · 29 comment · 0 complexity · 7187489964944a413002b7b651c0af67 MD5 · raw file

  1. -- This file is part of a Liberty Eiffel library.
  2. -- See the full copyright at the end.
  3. --
  4. class BACKTRACKING_SEQUENCE
  5. --
  6. -- A single node sequence.
  7. --
  8. inherit
  9. ABSTRACT_BACKTRACKING_SEQUENCE
  10. rename pool as pool_of_sequence
  11. end
  12. insert
  13. BACKTRACKING_GLOBALS
  14. feature {ABSTRACT_BACKTRACKING}
  15. next: BACKTRACKING_NODE
  16. -- next node
  17. set_next (value: BACKTRACKING_NODE)
  18. require
  19. value_not_void: value /= Void
  20. do
  21. next := value
  22. ensure
  23. definition: next = value
  24. next_not_void: next /= Void
  25. end
  26. next_sequence (explorer: BACKTRACKING)
  27. do
  28. -- Tell to evaluate 'next' now.
  29. explorer.set_current_node(next)
  30. -- Sequence is off, remove it.
  31. explorer.pop_sequence
  32. end
  33. end -- class BACKTRACKING_SEQUENCE
  34. --
  35. -- Copyright (C) 2009-2017: by all the people cited in the AUTHORS file.
  36. --
  37. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  38. -- of this software and associated documentation files (the "Software"), to deal
  39. -- in the Software without restriction, including without limitation the rights
  40. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  41. -- copies of the Software, and to permit persons to whom the Software is
  42. -- furnished to do so, subject to the following conditions:
  43. --
  44. -- The above copyright notice and this permission notice shall be included in
  45. -- all copies or substantial portions of the Software.
  46. --
  47. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  48. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  49. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  50. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  51. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  52. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  53. -- THE SOFTWARE.