package Scripting.Expressions.Operators is
type Binary_Operator is abstract new Expression with private;
type A_Binary_Operator is access all Binary_Operator'Class;
function Create_Binary_Operator( token : not null A_Token ) return A_Binary_Operator;
function Get_Precedence( this : not null access Binary_Operator'Class ) return Positive;
procedure Set_Operands( this : not null access Binary_Operator'Class;
left, right : in out A_Expression );
pragma Precondition( left /= null );
pragma Precondition( right /= null );
pragma Postcondition( left = null );
pragma Postcondition( right = null );
function Is_Binary( tokenType : Token_Type ) return Boolean;
type Unary_Operator is abstract new Expression with private;
type A_Unary_Operator is access all Unary_Operator'Class;
function Create_Unary_Operator( token : not null A_Token ) return A_Unary_Operator;
procedure Set_Operand( this : not null access Unary_Operator'Class;
right : in out A_Expression );
pragma Precondition( right /= null );
pragma Postcondition( right = null );
function Is_Unary( tokenType : Token_Type ) return Boolean;
private
type Binary_Operator is abstract new Expression with
record
precedence : Positive;
left : A_Expression;
right : A_Expression;
end record;
procedure Construct( this : access Binary_Operator;
loc : Token_Location;
precedence : Positive );
procedure Delete( this : in out Binary_Operator );
type Unary_Operator is abstract new Expression with
record
right : A_Expression;
end record;
procedure Delete( this : in out Unary_Operator );
end Scripting.Expressions.Operators;