PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/tools/semantics/code/expressions/liberty_string_manifest.e

http://github.com/tybor/Liberty
Specman e | 75 lines | 48 code | 9 blank | 18 comment | 0 complexity | 4763f57b0690e37e5612e047ebbe2146 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_STRING_MANIFEST
16
17inherit
18   LIBERTY_TYPED_MANIFEST[STRING]
19      rename
20         make as typed_make
21      redefine
22         mark_reachable_code
23      end
24
25create {LIBERTY_BUILDER_TOOLS}
26   make
27
28feature {ANY}
29   is_once: BOOLEAN
30
31feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER}
32   mark_reachable_code (mark: INTEGER) is
33      do
34         Precursor(mark)
35         storage_type.mark_reachable_code(mark)
36      end
37
38feature {}
39   make (a_type: like result_type; a_storage_type: like storage_type; a_manifest: like manifest; a_once: like is_once; a_position: like position) is
40      require
41         a_type /= Void
42         -- a_type is STRING
43         a_storage_type /= Void
44         -- a_storage_type is NATIVE_ARRAY[CHARACTER]
45         a_position /= Void
46      do
47         typed_make(a_type, a_manifest, a_position)
48         storage_type := a_storage_type
49         is_once := a_once
50      ensure
51         result_type = a_type
52         storage_type = a_storage_type
53         manifest = a_manifest
54         is_once = a_once
55         position = a_position
56      end
57
58   storage_type: LIBERTY_ACTUAL_TYPE
59
60feature {ANY}
61   accept (v: VISITOR) is
62      local
63         v0: LIBERTY_STRING_MANIFEST_VISITOR
64      do
65         v0 ::= v
66         v0.visit_liberty_string_manifest(Current)
67      end
68
69invariant
70   result_type /= Void
71      -- result_type is STRING
72   storage_type /= Void
73      -- storage_type is NATIVE_ARRAY[CHARACTER]
74
75end