/src/tools/semantics/code/expressions/liberty_infix_operator.e
Specman e | 66 lines | 44 code | 8 blank | 14 comment | 0 complexity | 4729fa2bc83a053c1af9b770ffee064a 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_INFIX_OPERATOR 16 17inherit 18 LIBERTY_INFIX_CALL 19 rename 20 make as infix_make 21 end 22 23create {LIBERTY_BUILDER_TOOLS} 24 make 25 26create {LIBERTY_INFIX_OPERATOR} 27 new 28 29feature {} 30 make (a_left, a_right: LIBERTY_EXPRESSION; a_entity: like entity; a_position: like position) is 31 require 32 a_left /= Void 33 a_right /= Void 34 a_entity.feature_name.is_infix 35 a_position /= Void 36 do 37 target := a_left 38 actuals_list := {FAST_ARRAY[LIBERTY_EXPRESSION] << a_right >> } 39 entity := a_entity 40 position := a_position 41 ensure 42 target = a_left 43 actuals.first = a_right 44 position = a_position 45 end 46 47 the_infix_name: FIXED_STRING is 48 do 49 check False end 50 end 51 52 make_new (a_target: like target; a_entity: like entity; a_actuals: like actuals_list; a_position: like position): like Current is 53 do 54 create Result.new(a_target, a_entity, a_actuals, a_position) 55 end 56 57feature {ANY} 58 accept (v: VISITOR) is 59 local 60 v0: LIBERTY_INFIX_OPERATOR_VISITOR 61 do 62 v0 ::= v 63 v0.visit_liberty_infix_operator(Current) 64 end 65 66end