note legal: "See notice at end of class." status: "See notice at end of class." class BIN_XOR_B inherit BOOL_BINARY_B redefine is_commutative, print_register, built_in_enlarged end create default_create, make feature -- Visitor process (v: BYTE_NODE_VISITOR) -- Process current element. do v.process_bin_xor_b (Current) end feature -- Enlarging built_in_enlarged: EXPR_B -- Enlarge node. Try to get rid of useless code if possible. local l_left_val, l_right_val: VALUE_I do left := left.enlarged right := right.enlarged if context.final_mode then l_left_val := left.evaluate l_right_val := right.evaluate if l_left_val.is_boolean and then l_left_val.same_type (l_right_val) then create {BOOL_CONST_B} Result.make (not l_left_val.is_equivalent (l_right_val)) else access := access.enlarged_on (context.real_type (left.type)) Result := Current end else access := access.enlarged_on (context.real_type (left.type)) Result := Current end end feature is_commutative: BOOLEAN = True; -- Operation is commutative. print_register -- Print the expression local buf: GENERATION_BUFFER do buf := buffer buf.put_string ("(("); left.print_register; buf.put_string (") != ("); right.print_register; buf.put_string ("))"); end; note copyright: "Copyright (c) 1984-2020, Eiffel Software" license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)" licensing_options: "http://www.eiffel.com/licensing" copying: "[ This file is part of Eiffel Software's Eiffel Development Environment. Eiffel Software's Eiffel Development Environment is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License (available at the URL listed under "license" above). Eiffel Software's Eiffel Development Environment is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Eiffel Software's Eiffel Development Environment; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ]" source: "[ Eiffel Software 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end