PageRenderTime 19ms CodeModel.GetById 11ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/lib/backtracking/low_level/backtracking_alternative.e

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