-- File: BinaryExpression.cdl -- Created: Thu Jan 10 12:27:32 1991 -- Author: Arnaud BOUZY -- ---Copyright: Matra Datavision 1991 deferred class BinaryExpression from Expr inherits GeneralExpression from Expr ---Purpose: Defines all binary expressions. The order of the two -- operands is significant. uses NamedUnknown from Expr raises OutOfRange from Standard, NumericError from Standard, InvalidOperand from Expr is FirstOperand(me) ---C++: inline ---C++: return const & ---Level : Internal returns any GeneralExpression is static; SecondOperand(me) ---C++: inline ---C++: return const & ---Level : Internal returns any GeneralExpression is static; SetFirstOperand(me : mutable; exp : GeneralExpression) ---Purpose: Sets first operand of -- Raises InvalidOperand if exp = me ---Level : Internal raises InvalidOperand is static; SetSecondOperand(me : mutable; exp : GeneralExpression) ---Purpose: Sets second operand of -- Raises InvalidOperand if contains . ---Level : Internal raises InvalidOperand is static; CreateFirstOperand(me : mutable; exp : GeneralExpression) ---Purpose: Sets first operand of ---Level : Internal is static protected; CreateSecondOperand(me : mutable; exp : GeneralExpression) ---Purpose: Sets second operand of -- Raises InvalidOperand if contains . ---Level : Internal is static protected; NbSubExpressions(me) ---Purpose: returns the number of sub-expressions contained -- in ( >= 0) returns Integer is static; SubExpression(me; I : Integer) ---Purpose: returns the -th sub-expression of -- raises OutOfRange if > NbSubExpressions(me) ---C++: return const & returns any GeneralExpression raises OutOfRange is static; ContainsUnknowns(me) ---Purpose: Does contain NamedUnknown ? returns Boolean is static; Contains(me; exp : GeneralExpression) ---Purpose: Tests if contains . returns Boolean is static; Replace(me : mutable ; var : NamedUnknown ; with : GeneralExpression) ---Purpose: Replaces all occurences of with in . -- Raises InvalidOperand if contains . raises InvalidOperand is static; Simplified(me) ---Purpose: Returns a GeneralExpression after replacement of -- NamedUnknowns by an associated expression and after -- values computation. returns any GeneralExpression raises NumericError; fields myFirstOperand : GeneralExpression; mySecondOperand : GeneralExpression; end BinaryExpression;