Index

Package: Operators

Description

package Expressions.Operators is

Classes

Binary_Operator (abstract)

type Binary_Operator is abstract new Expression with private;

Ancestors:

Immediate Children:

Expressions.Operators.Add_Op
Expressions.Operators.And_Op
Expressions.Operators.Divide_Op
Expressions.Operators.Equals_Op
Expressions.Operators.Greater_Equals_Op
Expressions.Operators.Greater_Op
Expressions.Operators.Less_Equals_Op
Expressions.Operators.Less_Op
Expressions.Operators.Mod_Op
Expressions.Operators.Multiply_Op
Expressions.Operators.Not_Equals_Op
Expressions.Operators.Or_Op
Expressions.Operators.Subtract_Op

Primitive operations:

Construct
Delete (overriding Objects.Delete)
Expressions.Construct (Inherited)
Expressions.Evaluate (Inherited)
Objects.Construct (Inherited)
Objects.To_String (Inherited)
A Binary_Operator has two operands upon which it operates. Evaluating it produces a single resultant value. Relative order of operations (highest priority first) * / % | Multiplication, division, modulo + - | Addition, subtraction = != < <= > >= | Comparators && || | Logical operators

Unary_Operator (abstract)

type Unary_Operator is abstract new Expression with private;

Ancestors:

Immediate Children:

Expressions.Operators.Negate_Op
Expressions.Operators.Not_Op

Primitive operations:

Delete (overriding Objects.Delete)
Expressions.Construct (Inherited)
Expressions.Evaluate (Inherited)
Objects.Construct (Inherited)
Objects.To_String (Inherited)
A Unary_Operator has only one operand upon which it operates. Evaluating it produces a single resultant value.

Types

A_Binary_Operator

type A_Binary_Operator is access all Binary_Operator'Class;

A_Unary_Operator

type A_Unary_Operator is access all Unary_Operator'Class;

Subprograms & Entries

Create_Binary_Operator

function Create_Binary_Operator
( token: not null A_Token ) return A_Binary_Operator;
Creates a new Binary_Operator of a concrete type depending on 'token'.

Get_Precedence

function Get_Precedence
( this: not null access Binary_Operator'Class ) return Positive;

Set_Operands

procedure Set_Operands
( this: not null access Binary_Operator'Class;
left, right: in out A_Expression );
Sets the 'left' and 'right' operands of the operator.

Is_Binary

function Is_Binary
( tokenType: Token_Type ) return Boolean;
Returns True if the token type represents a binary operator.

Create_Unary_Operator

function Create_Unary_Operator
( token: not null A_Token ) return A_Unary_Operator;
Creates a new Unary_Operator of a concrete type depending on 'token'.

Set_Operand

procedure Set_Operand
( this: not null access Unary_Operator'Class;
right: in out A_Expression );
Sets the 'right' (and only) operand of the operator.

Is_Unary

function Is_Unary
( tokenType: Token_Type ) return Boolean;
Returns True if the token type represents a unary operator.