PageRenderTime 18ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/src/tools/semantics/code/liberty_assertion.e

http://github.com/tybor/Liberty
Specman e | 58 lines | 37 code | 7 blank | 14 comment | 1 complexity | 296f92db9fb125ad26fce7a1d5688117 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_ASSERTION
16
17insert
18   LIBERTY_REACHABLE
19
20create {LIBERTY_BUILDER_TOOLS, LIBERTY_ASSERTION}
21   make
22
23feature {ANY}
24   tag: FIXED_STRING
25   assertion: LIBERTY_EXPRESSION
26
27feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER}
28   mark_reachable_code (mark: INTEGER) is
29      do
30         assertion.mark_reachable_code(mark)
31      end
32
33feature {LIBERTY_ASSERTIONS}
34   specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
35      require
36         a_type /= Void
37      local
38         a: like assertion
39      do
40         a := assertion.specialized_in(a_type)
41         if a = assertion then
42            Result := Current
43         else
44            create Result.make(tag, a)
45         end
46      end
47
48feature {}
49   make (a_tag: like tag; a_assertion: like assertion) is
50      do
51         tag := a_tag
52         assertion := a_assertion
53      ensure
54         tag = a_tag
55         assertion = a_assertion
56      end
57
58end