/src/tools/semantics/code/entities/liberty_result.e
Specman e | 76 lines | 51 code | 11 blank | 14 comment | 1 complexity | e0127f053f3b45c6ef747dc30feaac17 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_RESULT 16 17inherit 18 LIBERTY_WRITABLE 19 redefine out_in_tagged_out_memory 20 end 21 22create {LIBERTY_TYPE} 23 make 24 25feature {ANY} 26 name: FIXED_STRING is 27 once 28 Result := "Result".intern 29 end 30 31 result_type: LIBERTY_TYPE 32 33 out_in_tagged_out_memory is 34 do 35 tagged_out_memory.append(name) 36 end 37 38 specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is 39 do 40 Result := result_type.specialized_in(a_type).result_entity 41 end 42 43feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER} 44 mark_reachable_code (mark: INTEGER) is 45 do 46 if result_type.is_known and then result_type.known_type.is_runtime_category_set and then result_type.known_type.is_expanded then 47 result_type.mark_reachable_code(mark) 48 end 49 end 50 51feature {} 52 make (a_result_type: like result_type; a_position: like position) is 53 require 54 a_result_type /= Void 55 a_position /= Void 56 do 57 result_type := a_result_type 58 position := a_position 59 ensure 60 result_type = a_result_type 61 position = a_position 62 end 63 64feature {ANY} 65 accept (v: VISITOR) is 66 local 67 v0: LIBERTY_RESULT_VISITOR 68 do 69 v0 ::= v 70 v0.visit_liberty_result(Current) 71 end 72 73invariant 74 result_type /= Void 75 76end