Eiffel programming language reserved words

In the Eiffel programming language, there are certain words that are considered "reserved". These words have specific meanings recognized by the compiler. As such, it is invalid to attempt to use a reserved word as an ordinary language identifier.

The reserved words listed in the ISO/ECMA standard are shown below with a brief explanation of their meanings. Links are given where appropriate to the syntax definitions and to descriptions in the online documentation. Occasionally, references to the June 2006 standard document are used and are recognizable as clause numbers in parentheses, i.e., three integers separated by dots, for example: (8.14.1)

Info: The list below includes all the Eiffel reserved words. Some of these words are considered language keywords while others are not. The distinction is that language keywords are reserved words that are used only as syntactical markers, and have no inherent semantic value. Examples are the keywords do and end. Non-keyword reserved words are those that do carry semantic value, such as True and Current.

Note: The set of reserved words supported by the Eiffel Software implementation may vary somewhat from those specified in the current standard. See the "differences" chapter of the online documentation for information on these variances.

Reserved words

across

Introduces an iteration.

agent

Used to specify an agent.

Syntax.

alias

Used to identify an alternative or alias feature name.

Syntax.

Usage for infix/prefix notations.

Usage in interfaces to external software.

Syntax.

all

Used in export adaptation to indicate that a chosen export status applies to all features inherited from a given parent.

Syntax.

and

The logical conjunction operator. Strict when used alone, nonstrict when used with then.

as

Used when renaming features in descendant classes.

Syntax.

assign

Used to designate assigner commands.

Syntax.

attribute

Introduces an attribute body, as in self-initializing attributes.

Syntax.

check

Identifies a check instruction.

Syntax.

class

Used in a class header in the declaration of a class.

Class header syntax.

convert

Used in converter clauses.

Syntax.

Used in feature names for operator aliases, supporting mixed type expressions causing a conversion of the target (8.5.14).

Syntax.

create

In the creators part of a class, introduces those procedures which can be used to initialize instances.

Syntax.

Introduces a creation instruction.

Syntax.

Introduces a creation expression (8.20.18)

Syntax.

In constrained genericity, introduces a list of names of features which can be used as creation procedures with a generic class for a particular formal generic parameter. (8.12.10)

Syntax.

Current

A predefined entity indicating the current object.

Entity syntax.

Anchored types syntax.

debug

Introduces a debug instruction.

Syntax.

deferred

Used in class header to indicate a deferred class.

Syntax.

Used in routine body to indicate a deferred feature.

Syntax.

do

Introduces a sequence of instructions as a routine body, as shown in the Hello World example.

Syntax.

else

Used in conditional and multi-branch instructions to introduce a sequence of instructions to be executed in the case that no specified conditions are met.

Conditional syntax.

Multi-branch syntax.

Used in a conditional expression to compute a value in the case that no specified conditions are met.

Conditional expression syntax.

Used as part of the double reserved word or else, the semi-strict disjunction operator.

Syntax.

Used after the reserved word require as a precondition extension, allowing the weakening of an inherited precondition (8.10.3).

Syntax.

elseif

Used in conditional instructions to effect a "multi-branch" choice instruction.

Syntax.

Used in a conditional expression to effect a "multi-branch" choice to compute of a value.

Conditional expression syntax.

end

Serves to terminate several Eiffel programming language constructs.

Syntax for:

Class declarations Feature bodies Inheritance parts Check instructions Generic constraints: renaming and constraint creators Conditional instructions Multi-branch instructions Conditional expressions Loops Debug instructions

ensure

Introduces a postcondition.

When followed by the reserved word then denotes a postcondition extension, allowing the strengthening of an inherited postcondition (8.10.3).

Syntax.

expanded

Used in a class header to indicate that a class is expanded.

Syntax.

export

Used to change the export status (availability to clients) of inherited features.

Syntax.

external

Denotes an external routine. External routines are commonly defined to interface with C external routines and C++ external routines.

Syntax

False

Boolean manifest constant.

Syntax.

feature

Introduces a feature clause.

Syntax.

from

Used in loop initialization.

Syntax.

frozen

Used in a class header to mark a class explicitly as frozen. A frozen class prohibits it from serving as a "conforming parent" to other classes. (8.4.5).

Syntax.

Used in a feature declaration to mark a feature as frozen. A frozen feature cannot be redefined by heir classes.

Syntax.

Used with a formal generic parameter to indicate that conformance of generic derivations of the class require identical actual generic parameters. (8.12.3)

Syntax.

if

Used to introduce a conditional.

Conditional syntax.

Used to introduce a Conditional expression.

Conditional expression syntax.

implies

The semi-strict logical implication operator.

inherit

Used in an inherit clause.

Syntax.

inspect

Introduces a multi-branch instruction.

Syntax.

invariant

Used to introduce an invariant assertion as a class invariant or loop invariant.

Assertions syntax.

Syntax of class declaration including class invariant.

Syntax of loop including loop invariant.

like

Used in the declaration of an anchored entity.

Syntax.

local

Introduces the local variable declarations in a feature body.

Feature bodies syntax.

Local variable declarations syntax.

loop

Introduces a loop body.

Syntax.

not

The logical negation operator.

note

Used to begin a Notes part, in a class declaration, a feature declaration, or a check instruction.

Syntax.

obsolete

Used to mark obsolete features and classes.

Feature declarations syntax.

Class declarations declarations syntax.

Obsolete mark syntax.

old

Introduces an old expression. Old expressions are valid only in the postconditions of routines.

Syntax.

once

Used to introduce once routines and once string expressions.

Once routine syntax.

Once string syntax.

only

Used in an only postcondition clause. (8.9.11)

Syntax.

or

The logical disjunction operator. Strict when used alone, nonstrict when used with else.

Precursor

Allows a redefined routine to access the routine it redefines, i.e, its precursor.

Syntax.

redefine

Used in an inheritance part of a class declaration to list those inherited features which, in the heir class, will receive new implementations, specifications, or both, i.e, those features being redefined.

Redefine syntax.

rename

Used in an inheritance part of a class declaration to provide alternative names for inherited features in an heir class.

Used to rename features in a generic constraint. (8.12.8).

Syntax.

require

Introduces a precondition.

When followed by the reserved word else denotes a precondition extension, allowing the weakening of an inherited precondition (8.10.3).

Syntax.

rescue

Introduces a rescue clause in a feature body.

Syntax.

Result

A predefined entity used to represent the final result of a function.

Syntax.

retry

An instruction valid only in rescue clauses and used to re-execute the routine in which it appears.

Syntax.

select

Used in an inheritance part of a class declaration to resolve possible ambiguities related to polymorphism and dynamic binding in the presence of repeated inheritance.

Syntax.

separate

Used to support Concurrent programming with SCOOP.

then

Used in conditional and multi-branch instructions to introduce a sequence of instructions to be executed in the case that a condition is met.

Conditional syntax.

Multi-branch syntax.

Used in a conditional expression to compute of a value in the case that a condition is met.

Conditional expression syntax.

Used as part of the double reserved word and then, the semi-strict conjunction operator.

Syntax.

Used after the reserved word ensure as a postcondition extension, allowing the strengthening of an inherited postcondition (8.10.3).

Syntax.

True

Boolean manifest constant.

Syntax.

TUPLE

Denotes a TUPLE type.

Syntax.

undefine

Used in an inheritance part of a class declaration to uneffect an inherited feature.

Syntax.

until

Used in loop initialization.

Syntax.

variant

Introduces a loop variant.

Syntax.

Void

A predefined entity name representing a void (a.k.a., null) reference.

when

Used in a multi-branch instruction to introduce cases.

Syntax.

xor

The exclusive disjunction operator.

cached: 03/19/2024 2:12:24.000 AM