PageRenderTime 24ms CodeModel.GetById 17ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/src/tools/semantics/code/assertions/liberty_assertions.e

http://github.com/tybor/Liberty
Specman e | 52 lines | 28 code | 6 blank | 18 comment | 0 complexity | f8dbe7a3a3381961fa668cf2cc8fb906 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--
15deferred class LIBERTY_ASSERTIONS
16
17insert
18   LIBERTY_REACHABLE
19   VISITABLE
20
21feature {LIBERTY_BUILDER_TOOLS}
22   infix "and then" (other: LIBERTY_ASSERTIONS): LIBERTY_ASSERTIONS is
23         -- Considering that `Current' is the parent, adds an "and then" assertions block. Used by "require
24         -- then", "ensure then", and "invariant".
25      do
26         create {LIBERTY_ASSERTIONS_AND_THEN} Result.make(Current, other)
27      ensure
28         Result /= Void
29      end
30
31   infix "or else" (other: LIBERTY_ASSERTIONS): LIBERTY_ASSERTIONS is
32         -- Considering that `Current' is the parent, adds an "or else" assertions block. Used by "require
33         -- else".
34      do
35         create {LIBERTY_ASSERTIONS_OR_ELSE} Result.make(Current, other)
36      ensure
37         Result /= Void
38      end
39
40feature {LIBERTY_FEATURE, LIBERTY_ASSERTIONS}
41   specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
42      require
43         a_type /= Void
44      deferred
45      ensure
46         Result /= Void
47      end
48
49feature {}
50   assertions_marker: LIBERTY_REACHABLE_COLLECTION_MARKER[LIBERTY_ASSERTION]
51
52end