/src/tools/semantics/code/instructions/liberty_check_instruction.e
Specman e | 69 lines | 46 code | 9 blank | 14 comment | 1 complexity | 6af1d7e4ed83f7f7160dc78653a9578d 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_CHECK_INSTRUCTION 16 17inherit 18 LIBERTY_INSTRUCTION 19 20create {LIBERTY_BUILDER_TOOLS, LIBERTY_CHECK_INSTRUCTION} 21 make 22 23feature {ANY} 24 checks: LIBERTY_CHECK 25 26 specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is 27 local 28 c: like checks 29 do 30 c := checks.specialized_in(a_type) 31 if c = checks then 32 Result := Current 33 else 34 create Result.make(c, position) 35 end 36 end 37 38feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER} 39 mark_reachable_code (mark: INTEGER) is 40 do 41 checks.mark_reachable_code(mark) 42 end 43 44feature {} 45 make (a_checks: like checks; a_position: like position) is 46 require 47 a_checks /= Void 48 a_position /= Void 49 do 50 checks := a_checks 51 position := a_position 52 ensure 53 checks = a_checks 54 position = a_position 55 end 56 57feature {ANY} 58 accept (v: VISITOR) is 59 local 60 v0: LIBERTY_CHECK_INSTRUCTION_VISITOR 61 do 62 v0 ::= v 63 v0.visit_liberty_check_instruction(Current) 64 end 65 66invariant 67 checks /= Void 68 69end