Index

Package: Operators

Description

package Scripting.Expressions.Operators is
Copyright (c) 2012 Kevin Wellwood All rights reserved. This source code is distributed under the Modified BSD License. For terms and conditions, see license.txt.

Classes

Binary_Operator (abstract)

type Binary_Operator is abstract new Expression with private;

Ancestors:

Immediate Children:

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

Primitive operations:

Construct
Delete (overriding Objects.Delete)
Objects.Construct (Inherited)
Objects.To_String (Inherited)
Scripting.Expressions.Construct (Inherited)
Scripting.Expressions.Evaluate (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:

Scripting.Expressions.Operators.Negate_Op
Scripting.Expressions.Operators.Not_Op

Primitive operations:

Delete (overriding Objects.Delete)
Objects.Construct (Inherited)
Objects.To_String (Inherited)
Scripting.Expressions.Construct (Inherited)
Scripting.Expressions.Evaluate (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.