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

/src/tools/semantics/code/instructions/liberty_debug.e

http://github.com/tybor/Liberty
Specman e | 74 lines | 51 code | 9 blank | 14 comment | 1 complexity | 1a8931e5086dfad106a711ecca73dcc5 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_DEBUG
16
17inherit
18   LIBERTY_INSTRUCTION
19
20create {LIBERTY_BUILDER_TOOLS, LIBERTY_DEBUG}
21   make
22
23feature {ANY}
24   keys: TRAVERSABLE[FIXED_STRING]
25   instruction: LIBERTY_INSTRUCTION
26
27   specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
28      local
29         i: like instruction
30      do
31         i := instruction.specialized_in(a_type)
32         if i = instruction then
33            Result := Current
34         else
35            create Result.make(keys, i, position)
36         end
37      end
38
39feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER}
40   mark_reachable_code (mark: INTEGER) is
41      do
42         instruction.mark_reachable_code(mark)
43      end
44
45feature {}
46   make (a_keys: like keys; a_instruction: like instruction; a_position: like position) is
47      require
48         a_keys /= Void
49         a_instruction /= Void
50         a_position /= Void
51      do
52         keys := a_keys
53         instruction := a_instruction
54         position := a_position
55      ensure
56         keys = a_keys
57         instruction = a_instruction
58         position = a_position
59      end
60
61feature {ANY}
62   accept (v: VISITOR) is
63      local
64         v0: LIBERTY_DEBUG_VISITOR
65      do
66         v0 ::= v
67         v0.visit_liberty_debug(Current)
68      end
69
70invariant
71   keys /= Void
72   instruction /= Void
73
74end