/src/lib/parse/eiffel/eiffel_left_associative_expression.e
Specman e | 71 lines | 42 code | 6 blank | 23 comment | 0 complexity | ad3fa4fc9d1b1a16819dbbf1f0e030a4 MD5 | raw file
1-- This file is part of a Liberty Eiffel library. 2-- See the full copyright at the end. 3-- 4expanded class EIFFEL_LEFT_ASSOCIATIVE_EXPRESSION 5 6feature {EIFFEL_GRAMMAR} 7 expression_name: FIXED_STRING 8 right_node: EIFFEL_NODE 9 operator_nodes: COLLECTION[EIFFEL_NODE] 10 11 set (a_expression_name: like expression_name; a_operator_names: like operator_names; 12 a_right_node: like right_node; a_operator_nodes: like operator_nodes) is 13 require 14 a_operator_names.for_all(agent (o: ABSTRACT_STRING): BOOLEAN is do Result := o /= Void end) 15 do 16 expression_name := a_expression_name 17 operator_names := a_operator_names 18 right_node := a_right_node 19 operator_nodes := a_operator_nodes 20 ensure 21 expression_name = a_expression_name 22 operator_names = a_operator_names 23 right_node = a_right_node 24 operator_nodes = a_operator_nodes 25 end 26 27 append_operators_in (operators: COLLECTION[FIXED_STRING]) is 28 require 29 operators /= Void 30 local 31 i: INTEGER 32 do 33 from 34 i := operator_names.lower 35 until 36 i > operator_names.upper 37 loop 38 operators.add_last(operator_names.item(i).intern) 39 i := i + 1 40 end 41 end 42 43 operator_names_out: STRING is 44 do 45 Result := operator_names.out 46 end 47 48feature {} 49 operator_names: COLLECTION[ABSTRACT_STRING] 50 51end -- class EIFFEL_LEFT_ASSOCIATIVE_EXPRESSION 52-- 53-- Copyright (c) 2009 by all the people cited in the AUTHORS file. 54-- 55-- Permission is hereby granted, free of charge, to any person obtaining a copy 56-- of this software and associated documentation files (the "Software"), to deal 57-- in the Software without restriction, including without limitation the rights 58-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 59-- copies of the Software, and to permit persons to whom the Software is 60-- furnished to do so, subject to the following conditions: 61-- 62-- The above copyright notice and this permission notice shall be included in 63-- all copies or substantial portions of the Software. 64-- 65-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 66-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 67-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 68-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 69-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 70-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 71-- THE SOFTWARE.