/src/tools/semantics/tags/liberty_typed_tag.e
Specman e | 56 lines | 33 code | 9 blank | 14 comment | 0 complexity | 9b2d6b16836fec07138c9babff3a279e 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_TYPED_TAG[T_] 16 17inherit 18 LIBERTY_TAG 19 20create {LIBERTY_TAG_REF} 21 make 22 23feature {ANY} 24 id: FIXED_STRING is 25 do 26 Result := ref.id 27 end 28 29 value: T_ 30 31feature {LIBERTY_TAG_REF} 32 set (a_value: like value) is 33 do 34 value := a_value 35 ensure 36 value = a_value 37 end 38 39feature {} 40 make (a_ref: like ref; a_value: like value) is 41 require 42 a_ref /= Void 43 do 44 ref := a_ref 45 value := a_value 46 ensure 47 ref = a_ref 48 value = a_value 49 end 50 51 ref: LIBERTY_TAG_REF[T_] 52 53invariant 54 ref /= Void 55 56end