PageRenderTime 23ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/tools/interpreter/debugger/liberty_interpreter_debugger_steps.e

http://github.com/tybor/Liberty
Specman e | 89 lines | 63 code | 12 blank | 14 comment | 6 complexity | 1e2d97e8124b5a131a516eea70305297 MD5 | raw file
 1-- This file is part of Liberty Eiffel.
 2--
 3-- Liberty Eiffel is free software: you can redistribute it and/or modify
 4-- it under the terms of the GNU General Public License as published by
 5-- the Free Software Foundation, version 3 of the License.
 6--
 7-- Liberty Eiffel is distributed in the hope that it will be useful,
 8-- but WITHOUT ANY WARRANTY; without even the implied warranty of
 9-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10-- GNU General Public License for more details.
11--
12-- You should have received a copy of the GNU General Public License
13-- along with Liberty Eiffel.  If not, see <http://www.gnu.org/licenses/>.
14--
15class LIBERTY_INTERPRETER_DEBUGGER_STEPS
16
17create {LIBERTY_INTERPRETER_DEBUGGER}
18   make
19
20feature {LIBERTY_INTERPRETER}
21   after (a_count: like count) is
22      require
23         a_count > 0
24      do
25         count := a_count
26      ensure
27         count = a_count
28      end
29
30   at_call_entry is
31      do
32         count := entry_count
33      ensure
34         count = entry_count
35      end
36
37   at_call_exit is
38      do
39         count := exit_count
40      ensure
41         count = exit_count
42      end
43
44   step is
45      do
46         if count > 0 then
47            count := count - 1
48            if count = 0 then
49               interpreter.break
50            end
51         end
52      end
53
54feature {LIBERTY_INTERPRETER_FEATURE_CALL}
55   enter_call is
56      do
57         if count = entry_count then
58            interpreter.break
59         end
60      end
61
62   exit_call is
63      do
64         if count = exit_count then
65            interpreter.break
66         end
67      end
68
69feature {}
70   make (a_interpreter: like interpreter) is
71      require
72         a_interpreter /= Void
73      do
74         interpreter := a_interpreter
75      ensure
76         interpreter = a_interpreter
77      end
78
79   interpreter: LIBERTY_INTERPRETER
80   count: INTEGER
81
82   entry_count: INTEGER is -13
83   exit_count: INTEGER is -31
84
85invariant
86   interpreter /= Void
87   count >= 0 or else count = entry_count or else count = exit_count
88
89end -- class LIBERTY_INTERPRETER_DEBUGGER_STEPS