mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-08 15:52:26 +01:00
Created version for 17.01.
git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1789 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -0,0 +1,508 @@
|
||||
[[Property:title|Eiffel programming language reserved words]]
|
||||
[[Property:link_title|Reserved words]]
|
||||
[[Property:weight|1]]
|
||||
[[Property:uuid|047ce062-45de-f25c-f356-ee8ec0fc2d1d]]
|
||||
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 <code>do</code> and <code>end</code>. Non-keyword reserved words are those that do carry semantic value, such as <code>True</code> and <code>Current</code>.}}
|
||||
|
||||
|
||||
{{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 between standard ECMA-367 and Eiffel Software implementation|"differences" chapter of the online documentation]] for information on these variances.}}
|
||||
|
||||
|
||||
==Reserved words==
|
||||
|
||||
===across===
|
||||
|
||||
Introduces an [[ET: Instructions#Loop|iteration]].
|
||||
|
||||
===agent===
|
||||
|
||||
Used to specify an [[ET: Agents|agent]].
|
||||
|
||||
:[[Eiffel programming language syntax#Agents|Syntax.]]
|
||||
|
||||
|
||||
===alias===
|
||||
|
||||
Used to identify an alternative or alias feature name.
|
||||
|
||||
:[[Eiffel programming language syntax#Feature names|Syntax.]]
|
||||
|
||||
[[ET: The Dynamic Structure: Execution Model#Infix and prefix notations|Usage for infix/prefix notations.]]
|
||||
|
||||
[[ET: The Static Picture: System Organization#External software|Usage in interfaces to external software.]]
|
||||
|
||||
:[[Eiffel programming language syntax#External routines|Syntax.]]
|
||||
|
||||
|
||||
===all===
|
||||
|
||||
Used in [[ET: Inheritance#Changing the export status|export adaptation]] to indicate that a chosen export status applies to all features inherited from a given parent.
|
||||
|
||||
:[[Eiffel programming language syntax#Export adaptation|Syntax.]]
|
||||
|
||||
|
||||
===and===
|
||||
|
||||
The logical conjunction [[Eiffel programming language syntax#Operators|operator]]. Strict when used alone, nonstrict when used with [[#then|then]].
|
||||
|
||||
|
||||
===as===
|
||||
|
||||
Used when [[ET: Inheritance#Multiple inheritance and renaming|renaming]] features in descendant classes.
|
||||
|
||||
:[[Eiffel programming language syntax#Rename clauses|Syntax.]]
|
||||
|
||||
|
||||
===assign===
|
||||
|
||||
Used to designate [[ET: The Dynamic Structure: Execution Model#Abstraction|assigner commands]].
|
||||
|
||||
:[[Eiffel programming language syntax#Assigner marks|Syntax.]]
|
||||
|
||||
|
||||
===attribute===
|
||||
|
||||
Introduces an attribute body, as in [[Void-safety: Background, definition, and tools#Self-initializing attributes|self-initializing attributes]].
|
||||
|
||||
:[[Eiffel programming language syntax#Attribute bodies|Syntax.]]
|
||||
|
||||
|
||||
===check===
|
||||
|
||||
Identifies a [[ET: Other Mechanisms#Check|check instruction]].
|
||||
|
||||
:[[Eiffel programming language syntax#Check instructions|Syntax.]]
|
||||
|
||||
|
||||
===class===
|
||||
|
||||
Used in a class header in the declaration of a [[ET: The Dynamic Structure: Execution Model#A simple class|class]].
|
||||
|
||||
:[[Eiffel programming language syntax#Class headers|Class header syntax.]]
|
||||
|
||||
|
||||
===convert===
|
||||
|
||||
Used in converter clauses.
|
||||
|
||||
:[[Eiffel programming language syntax#Converter clauses|Syntax.]]
|
||||
|
||||
Used in feature names for operator aliases, supporting mixed type expressions causing a conversion of the target (8.5.14).
|
||||
|
||||
:[[Eiffel programming language syntax#Feature names|Syntax.]]
|
||||
|
||||
|
||||
===create===
|
||||
|
||||
In the creators part of a class, introduces those procedures which can be used to [[ET: The Dynamic Structure: Execution Model#Creating and initializing objects|initialize instances]].
|
||||
|
||||
:[[Eiffel programming language syntax#Creators parts|Syntax.]]
|
||||
|
||||
Introduces a [[ET: The Dynamic Structure: Execution Model#Creating and initializing objects|creation instruction]].
|
||||
|
||||
:[[Eiffel programming language syntax#Creation instructions|Syntax.]]
|
||||
|
||||
Introduces a creation expression (8.20.18)
|
||||
|
||||
:[[Eiffel programming language syntax#Creation expressions|Syntax.]]
|
||||
|
||||
In [[ET: Inheritance#Constrained genericity|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)
|
||||
|
||||
:[[Eiffel programming language syntax#Generic constraints|Syntax.]]
|
||||
|
||||
|
||||
===Current===
|
||||
|
||||
A predefined entity indicating the current object.
|
||||
|
||||
:[[Eiffel programming language syntax#Entities and variables|Entity syntax.]]
|
||||
|
||||
:[[Eiffel programming language syntax#Types|Anchored types syntax.]]
|
||||
|
||||
|
||||
===debug===
|
||||
|
||||
Introduces a [[ET: Other Mechanisms#Debug|debug instruction]].
|
||||
|
||||
:[[Eiffel programming language syntax#Debug Instructions|Syntax.]]
|
||||
|
||||
|
||||
===deferred===
|
||||
|
||||
Used in class header to indicate a [[ET: Inheritance#Deferred features and classes|deferred class]].
|
||||
|
||||
:[[Eiffel programming language syntax#Class headers|Syntax.]]
|
||||
|
||||
Used in routine body to indicate a [[ET: Inheritance#Deferred features and classes|deferred feature]].
|
||||
|
||||
:[[Eiffel programming language syntax#Routine bodies|Syntax.]]
|
||||
|
||||
|
||||
===do===
|
||||
|
||||
Introduces a sequence of instructions as a routine body, as shown in the [[ET: Hello World|Hello World]] example.
|
||||
|
||||
:[[Eiffel programming language syntax#Routine bodies|Syntax.]]
|
||||
|
||||
|
||||
===else===
|
||||
|
||||
Used in [[ET: Other Mechanisms#Conditional|conditional]] and [[ET: Other Mechanisms#Multi-branch|multi-branch]] instructions to introduce a sequence of instructions to be executed in the case that no specified conditions are met.
|
||||
|
||||
:[[Eiffel programming language syntax#Conditionals|Conditional syntax.]]
|
||||
|
||||
:[[Eiffel programming language syntax#Multi-branch instructions|Multi-branch syntax.]]
|
||||
|
||||
Used as part of the double reserved word <code>or else</code>, the semi-strict disjunction operator.
|
||||
|
||||
:[[Eiffel programming language syntax#Operators|Syntax.]]
|
||||
|
||||
Used after the reserved word [[#require|<code>require</code>]] as a precondition extension, allowing the weakening of an inherited precondition (8.10.3).
|
||||
|
||||
:[[Eiffel programming language syntax#Assertions|Syntax.]]
|
||||
|
||||
|
||||
===elseif===
|
||||
|
||||
Used in [[ET: Other Mechanisms#Conditional|conditional]] instructions to effect a "multi-branch" choice instruction.
|
||||
|
||||
:[[Eiffel programming language syntax#Conditionals|Syntax.]]
|
||||
|
||||
|
||||
===end===
|
||||
|
||||
Serves to terminate several Eiffel programming language constructs.
|
||||
|
||||
:Syntax for:
|
||||
::[[Eiffel programming language syntax#Class declarations|Class declarations]]
|
||||
::[[Eiffel programming language syntax#Feature bodies|Feature bodies]]
|
||||
::[[Eiffel programming language syntax#Inheritance parts|Inheritance parts]]
|
||||
::[[Eiffel programming language syntax#Check instructions|Check instructions]]
|
||||
::[[Eiffel programming language syntax#Generic constraints|Generic constraints: renaming and constraint creators]]
|
||||
::[[Eiffel programming language syntax#Conditionals|Conditional instructions]]
|
||||
::[[Eiffel programming language syntax#Multi-branch instructions|Multi-branch instructions]]
|
||||
::[[Eiffel programming language syntax#Loops|Loops]]
|
||||
::[[Eiffel programming language syntax#Debug instructions|Debug instructions]]
|
||||
|
||||
|
||||
===ensure===
|
||||
|
||||
Introduces a [[ET: Design by Contract (tm), Assertions and Exceptions#Expressing assertions|postcondition]].
|
||||
|
||||
When followed by the reserved word [[#then|<code>then</code>]] denotes a postcondition extension, allowing the strengthening of an inherited postcondition (8.10.3).
|
||||
|
||||
:[[Eiffel programming language syntax#Assertions|Syntax.]]
|
||||
|
||||
|
||||
===expanded===
|
||||
|
||||
Used in a class header to indicate that a class is [[ET: The Dynamic Structure: Execution Model#Type categories|expanded]].
|
||||
|
||||
:[[Eiffel programming language syntax#Class headers|Syntax.]]
|
||||
|
||||
|
||||
===export===
|
||||
|
||||
Used to [[ET: Inheritance#Changing the export status|change the export status]] (availability to clients) of inherited features.
|
||||
|
||||
:[[Eiffel programming language syntax#Export adaptation|Syntax.]]
|
||||
|
||||
|
||||
===external===
|
||||
|
||||
Denotes an [[ET: The Static Picture: System Organization#External software|external routine]]. External routines are commonly defined to interface with [[C externals|C external routines]] and [[C++ Externals|C++ external routines]].
|
||||
|
||||
:[[Eiffel programming language syntax#External routines|Syntax]]
|
||||
|
||||
|
||||
===False===
|
||||
|
||||
Boolean manifest constant.
|
||||
|
||||
:[[Eiffel programming language syntax#Manifest constants|Syntax.]]
|
||||
|
||||
|
||||
===feature===
|
||||
|
||||
Introduces a [[ET: Hello World|feature clause]].
|
||||
|
||||
:[[Eiffel programming language syntax#Feature parts|Syntax.]]
|
||||
|
||||
|
||||
===from===
|
||||
|
||||
Used in [[ET: Other Mechanisms#Loop|loop]] initialization.
|
||||
|
||||
:[[Eiffel programming language syntax#Loops|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).
|
||||
|
||||
:[[Eiffel programming language syntax#Class headers|Syntax.]]
|
||||
|
||||
Used in a feature declaration to mark a feature as frozen. A frozen feature cannot be redefined by heir classes.
|
||||
|
||||
:[[Eiffel programming language syntax#New feature lists|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)
|
||||
|
||||
:[[Eiffel programming language syntax#Formal generic parameters|Syntax.]]
|
||||
|
||||
|
||||
===if===
|
||||
|
||||
Introduces a [[ET: Other Mechanisms#Conditional|conditional]].
|
||||
|
||||
:[[Eiffel programming language syntax#Conditionals|Syntax.]]
|
||||
|
||||
|
||||
===implies===
|
||||
|
||||
The semi-strict logical implication [[Eiffel programming language syntax#Operators|operator]].
|
||||
|
||||
|
||||
===inherit===
|
||||
|
||||
Used in an [[ET: Inheritance|inherit]] clause.
|
||||
|
||||
:[[Eiffel programming language syntax#Inheritance parts|Syntax.]]
|
||||
|
||||
|
||||
===inspect===
|
||||
|
||||
Introduces a [[ET: Other Mechanisms#Multi-branch|multi-branch]] instruction.
|
||||
|
||||
:[[Eiffel programming language syntax#Multi-branch instructions|Syntax.]]
|
||||
|
||||
|
||||
===invariant===
|
||||
|
||||
Used to introduce an invariant assertion as a [[ET: Design by Contract (tm), Assertions and Exceptions#Class invariants|class invariant]] or [[ET: Instructions#Loop|loop invariant]].
|
||||
|
||||
:[[Eiffel programming language syntax#Assertions|Assertions syntax.]]
|
||||
|
||||
:[[Eiffel programming language syntax#Class declarations|Syntax of class declaration including class invariant.]]
|
||||
|
||||
:[[Eiffel programming language syntax#Loops|Syntax of loop including loop invariant.]]
|
||||
|
||||
|
||||
===like===
|
||||
|
||||
Used in the declaration of an [[ET: Inheritance#Covariance and anchored declarations|anchored]] entity.
|
||||
|
||||
:[[Eiffel programming language syntax#Types|Syntax.]]
|
||||
|
||||
|
||||
===local===
|
||||
|
||||
Introduces the [[ET: The Dynamic Structure: Execution Model#Entities|local variable]] declarations in a feature body.
|
||||
|
||||
:[[Eiffel programming language syntax#Feature bodies|Feature bodies syntax.]]
|
||||
|
||||
:[[Eiffel programming language syntax#Local variables|Local variable declarations syntax.]]
|
||||
|
||||
|
||||
===loop===
|
||||
|
||||
Introduces a [[ET: Other Mechanisms#Loop|loop]] body.
|
||||
|
||||
:[[Eiffel programming language syntax#Loops|Syntax.]]
|
||||
|
||||
|
||||
===not===
|
||||
|
||||
The logical negation [[Eiffel programming language syntax#Operators|operator]].
|
||||
|
||||
|
||||
===note===
|
||||
|
||||
Used to begin a Notes part, in a [[Eiffel programming language syntax#Class declarations|class declaration]], a [[Eiffel programming language syntax#Feature declarations|feature declaration]], or a [[Eiffel programming language syntax#Check instructions|check instruction]].
|
||||
|
||||
:[[Eiffel programming language syntax#Notes|Syntax.]]
|
||||
|
||||
|
||||
===obsolete===
|
||||
|
||||
Used to mark [[ET: Other Mechanisms#Obsolete features and classes|obsolete features and classes]].
|
||||
|
||||
:[[Eiffel programming language syntax#Feature declarations|Feature declarations syntax.]]
|
||||
|
||||
:[[Eiffel programming language syntax#Class declarations|Class declarations declarations syntax.]]
|
||||
|
||||
:[[Eiffel programming language syntax#Obsolete marks|Obsolete mark syntax.]]
|
||||
|
||||
|
||||
===old===
|
||||
|
||||
Introduces an ''old expression''. Old expressions are valid only in the [[ET: Design by Contract (tm), Assertions and Exceptions#Postconditions|postconditions]] of routines.
|
||||
|
||||
:[[Eiffel programming language syntax#Old postcondition expressions|Syntax.]]
|
||||
|
||||
|
||||
===once===
|
||||
|
||||
Used to introduce [[ET: Other Mechanisms#Once routines and shared objects|once routines]] and once string expressions.
|
||||
|
||||
:[[Eiffel programming language syntax#Routine bodies|Once routine syntax.]]
|
||||
|
||||
:[[Eiffel programming language syntax#Expressions|Once string syntax.]]
|
||||
|
||||
|
||||
===only===
|
||||
|
||||
Used in an ''only postcondition clause''. (8.9.11)
|
||||
|
||||
:[[Eiffel programming language syntax#"Old" postcondition expressions|Syntax.]]
|
||||
|
||||
|
||||
===or===
|
||||
|
||||
The logical disjunction [[Eiffel programming language syntax#Operators|operator]]. Strict when used alone, nonstrict when used with [[#else|else]].
|
||||
|
||||
|
||||
===Precursor===
|
||||
|
||||
Allows a redefined routine to access the routine it redefines, i.e, its [[ET: Inheritance#Redefinition|precursor]].
|
||||
|
||||
:[[Eiffel programming language syntax#Precursor|Syntax.]]
|
||||
|
||||
|
||||
===redefine===
|
||||
|
||||
Used in an [[Eiffel programming language syntax#Inheritance parts|inheritance part]] of a [[Eiffel programming language syntax#Class declarations|class declaration]] to list those inherited features which, in the heir class, will receive new implementations, specifications, or both, i.e, those features being [[ET: Inheritance#Redefinition|redefined]].
|
||||
|
||||
:[[Eiffel programming language syntax#Redefinition|Redefine syntax.]]
|
||||
|
||||
|
||||
===rename===
|
||||
|
||||
Used in an [[Eiffel programming language syntax#Inheritance parts|inheritance part]] of a [[Eiffel programming language syntax#Class declarations|class declaration]] to [[ET: Inheritance#Multiple inheritance and renaming|provide alternative names]] for inherited features in an heir class.
|
||||
|
||||
Used to rename features in a [[Eiffel programming language syntax#Generic constraints|generic constraint]]. (8.12.8).
|
||||
|
||||
:[[Eiffel programming language syntax#Rename clauses|Syntax.]]
|
||||
|
||||
|
||||
===require===
|
||||
|
||||
Introduces a [[ET: Design by Contract (tm), Assertions and Exceptions#Expressing assertions|precondition]].
|
||||
|
||||
When followed by the reserved word [[#else|<code>else</code>]] denotes a precondition extension, allowing the weakening of an inherited precondition (8.10.3).
|
||||
|
||||
:[[Eiffel programming language syntax#Assertions|Syntax.]]
|
||||
|
||||
|
||||
|
||||
===rescue===
|
||||
|
||||
Introduces a [[ET: Design by Contract (tm), Assertions and Exceptions#Exception handling|rescue clause]] in a [[Eiffel programming language syntax#Feature bodies|feature body]].
|
||||
|
||||
:[[Eiffel programming language syntax#Rescue clauses|Syntax.]]
|
||||
|
||||
|
||||
===Result===
|
||||
|
||||
A predefined [[ET: The Dynamic Structure: Execution Model#Entities|entity]] used to represent the final result of a function.
|
||||
|
||||
:[[Eiffel programming language syntax#Entities and variables|Syntax.]]
|
||||
|
||||
|
||||
===retry===
|
||||
|
||||
An [[Eiffel programming language syntax#Instructions|instruction]] valid only in [[Eiffel programming language syntax#Rescue clauses|rescue clauses]] and used to [[ET: Design by Contract (tm), Assertions and Exceptions#Exception handling|re-execute the routine]] in which it appears.
|
||||
|
||||
:[[Eiffel programming language syntax#Rescue clauses|Syntax.]]
|
||||
|
||||
|
||||
===select===
|
||||
|
||||
Used in an [[Eiffel programming language syntax#Inheritance parts|inheritance part]] of a [[Eiffel programming language syntax#Class declarations|class declaration]] to resolve possible ambiguities related to polymorphism and dynamic binding in the presence of [[ET: Inheritance#Repeated inheritance and selection|repeated inheritance]].
|
||||
|
||||
:[[Eiffel programming language syntax#Select clauses|Syntax.]]
|
||||
|
||||
|
||||
===separate===
|
||||
|
||||
Reserved for future use.
|
||||
|
||||
{{Note|Used in EiffelStudio implementations version 6.8 and later to support [[Concurrent programming with SCOOP]].}}
|
||||
|
||||
|
||||
===then===
|
||||
|
||||
Used in [[ET: Other Mechanisms#Conditional|conditional]] and [[ET: Other Mechanisms#Multi-branch|multi-branch]] instructions to introduce a sequence of instructions to be executed in the case that a condition is met.
|
||||
|
||||
:[[Eiffel programming language syntax#Conditionals|Conditional syntax.]]
|
||||
|
||||
:[[Eiffel programming language syntax#Multi-branch instructions|Multi-branch syntax.]]
|
||||
|
||||
Used as part of the double reserved word <code>and then</code>, the semi-strict conjunction operator.
|
||||
|
||||
:[[Eiffel programming language syntax#Operators|Syntax.]]
|
||||
|
||||
Used after the reserved word [[#ensure|<code>ensure</code>]] as a postcondition extension, allowing the strengthening of an inherited postcondition (8.10.3).
|
||||
|
||||
:[[Eiffel programming language syntax#Assertions|Syntax.]]
|
||||
|
||||
|
||||
===True===
|
||||
|
||||
Boolean manifest constant.
|
||||
|
||||
:[[Eiffel programming language syntax#Manifest constants|Syntax.]]
|
||||
|
||||
|
||||
===TUPLE===
|
||||
|
||||
Denotes a [[ET: Other Mechanisms#Tuple types|TUPLE type]].
|
||||
|
||||
:[[Eiffel programming language syntax#Tuple types|Syntax.]]
|
||||
|
||||
|
||||
===undefine===
|
||||
|
||||
Used in an [[Eiffel programming language syntax#Inheritance parts|inheritance part]] of a [[Eiffel programming language syntax#Class declarations|class declaration]] to [[ET: Inheritance#Joining and uneffecting|uneffect]] an inherited feature.
|
||||
|
||||
:[[Eiffel programming language syntax#Undefine clauses|Syntax.]]
|
||||
|
||||
|
||||
===until===
|
||||
|
||||
Used in [[ET: Other Mechanisms#Loop|loop]] initialization.
|
||||
|
||||
:[[Eiffel programming language syntax#Loops|Syntax.]]
|
||||
|
||||
|
||||
===variant===
|
||||
|
||||
Introduces a [[ET: Instructions#Loop|loop variant]].
|
||||
|
||||
:[[Eiffel programming language syntax#Variants|Syntax.]]
|
||||
|
||||
|
||||
===Void===
|
||||
|
||||
A predefined entity name representing a [[ET: The Dynamic Structure: Execution Model#Basic operations|void (a.k.a., null) reference]].
|
||||
|
||||
|
||||
===when===
|
||||
|
||||
Used in a [[ET: Other Mechanisms#Multi-branch|multi-branch instruction]] to introduce cases.
|
||||
|
||||
:[[Eiffel programming language syntax#Multi-branch instructions|Syntax.]]
|
||||
|
||||
|
||||
===xor===
|
||||
|
||||
The exclusive disjunction [[Eiffel programming language syntax#Operators|operator]].
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,765 @@
|
||||
[[Property:title|Eiffel programming language syntax]]
|
||||
[[Property:link_title|Syntax]]
|
||||
[[Property:weight|0]]
|
||||
[[Property:uuid|4CB56AD5-1586-41F6-9E81-085F47E992DC]]
|
||||
The syntax specification shown here is a less complete and less formal version of that which is in the Eiffel ISO/ECMA standard document. The format is BNF-E. The Language Specification section of the standard document includes an overview of BNF-E.
|
||||
|
||||
There are a few parts of the syntax that are either non-production or non-representable in BNF-E. Some of these have been omitted from the following specification. These omitted parts of the syntax definition add to the precision of the specification, but knowledge of them is not always vital for developers.
|
||||
|
||||
In the BNF-E representation, generally non-terminals which are defined in the same group of productions in which they are used are not linked. However when a non-terminal is defined outside a group in which it is used, it is linked to the group in which it is defined.
|
||||
|
||||
__TOC__
|
||||
|
||||
The following section contains those non-production elements of the specification that are used later in the BNF-E specification.
|
||||
|
||||
==Eiffel non-production elements==
|
||||
|
||||
===Identifiers===
|
||||
|
||||
An '''identifier''' is a sequence of one or more alphanumeric [[#Characters|characters]] of which the first is a letter.
|
||||
|
||||
The definition is augmented by the rule that Identifiers are not valid if they are the same as one of the language's reserved words.
|
||||
|
||||
===Characters===
|
||||
|
||||
Characters are either:
|
||||
|
||||
* All 32-bit, corresponding to Unicode and to the Eiffel type CHARACTER_32.
|
||||
* All 8-bit, corresponding to 8-bit extended ASCII and to the Eiffel type CHARACTER_8
|
||||
|
||||
===Reals===
|
||||
|
||||
A real -- specimen of Real -- is made of the following elements, in the order given:
|
||||
|
||||
* An optional decimal [[#Integers|Integer]], giving the integral part.
|
||||
* A required "." (dot).
|
||||
* An optional decimal [[#Integers|Integer]], giving the fractional part.
|
||||
* An optional exponent, which is the letter ''e'' or ''E'' followed by an optional [[#Manifest constants|Sign]] and a decimal [[#Integers|Integer]].
|
||||
|
||||
No intervening character (blank or otherwise) is permitted between these elements. The integral and fractional parts may not both be absent.
|
||||
|
||||
===Strings===
|
||||
|
||||
A string -- specimen of construct String -- is a sequence of zero or more manifest characters.
|
||||
|
||||
===Simple strings===
|
||||
|
||||
A simple string -- specimen of Simple_string -- is a [[#Strings|String]] consisting of at most one line (that is to say, containing no embedded new-line manifest character), possibly containing [[#Special characters|codes for special characters]].
|
||||
|
||||
===Special characters===
|
||||
|
||||
{| border="2"
|
||||
|+ Special Characters and Their Codes
|
||||
|-
|
||||
! Character
|
||||
! Code
|
||||
! Mnemonic name
|
||||
|-
|
||||
| @ || %A || At-sign
|
||||
|-
|
||||
| BS || %B || Backspace
|
||||
|-
|
||||
| ^ || %C || Circumflex
|
||||
|-
|
||||
| $ || %D || Dollar
|
||||
|-
|
||||
| FF || %F || Form feed
|
||||
|-
|
||||
| \ || %H || Backslash
|
||||
|-
|
||||
| ~ || %L || Tilde
|
||||
|-
|
||||
| NL (LF) || %N || Newline
|
||||
|-
|
||||
| `` ` `` || %Q || Backquote
|
||||
|-
|
||||
| CR || %R || Carriage return
|
||||
|-
|
||||
| # || %S || Sharp
|
||||
|-
|
||||
| HT || %T || Horizontal tab
|
||||
|-
|
||||
| NUL || %U || Null
|
||||
|-
|
||||
| | || %V || Vertical bar
|
||||
|-
|
||||
| % || %% || Percent
|
||||
|-
|
||||
| ' || %' || Single quote
|
||||
|-
|
||||
| " || %" || Double quote
|
||||
|-
|
||||
| [ || %( || Opening bracket
|
||||
|-
|
||||
| ] || %) || Closing bracket
|
||||
|-
|
||||
| { || %< || Opening brace
|
||||
|-
|
||||
| } || %> || Closing brace
|
||||
|}
|
||||
|
||||
* %/123/ represents the character with decimal code 123 .
|
||||
|
||||
===Line wrapping parts===
|
||||
|
||||
A sequence of characters consisting of the following, in order:
|
||||
* % (percent character)
|
||||
* Zero or more blanks or tabs
|
||||
* New line (Line feed)
|
||||
* Zero or more blanks or tabs
|
||||
* % (percent character)
|
||||
|
||||
Line wrapping parts are used as separators between one [[#Simple strings|Simple_string]] and the next in a [[#Manifest strings|Basic_manifest_string]] so that the string can be split across lines.
|
||||
|
||||
|
||||
|
||||
==Eiffel BNF-E Syntax==
|
||||
|
||||
|
||||
===Class names ===
|
||||
Class_name ::= [[#Identfiers|Identifier]]
|
||||
|
||||
===Class declarations ===
|
||||
Class_declaration ::= <nowiki>[</nowiki>[[#Notes|Notes]]<nowiki>]</nowiki>
|
||||
[[#Class headers|Class_header]] <nowiki>[</nowiki>[[#Formal generic parameters|Formal_generics]]<nowiki>]</nowiki>
|
||||
|
||||
<nowiki>[</nowiki>[[#Obsolete marks|Obsolete]]<nowiki>]</nowiki>
|
||||
|
||||
<nowiki>[</nowiki>[[#Inheritance parts|Inheritance]]<nowiki>]</nowiki>
|
||||
|
||||
<nowiki>[</nowiki>[[#Creators parts|Creators]]<nowiki>]</nowiki>
|
||||
|
||||
<nowiki>[</nowiki>[[#Converter clauses|Converters]]<nowiki>]</nowiki>
|
||||
|
||||
<nowiki>[</nowiki>[[#Feature parts|Features]]<nowiki>]</nowiki>
|
||||
|
||||
<nowiki>[</nowiki>[[#Notes|Notes]]<nowiki>]</nowiki>
|
||||
|
||||
<nowiki>[</nowiki>[[#Assertions|Invariant]]<nowiki>]</nowiki>
|
||||
|
||||
<nowiki>[</nowiki>[[#Notes|Notes]]<nowiki>]</nowiki>
|
||||
|
||||
<code>end</code>
|
||||
|
||||
===Notes ===
|
||||
Notes ::= <code>note</code> Note_list
|
||||
|
||||
Note_list ::= {Note_entry ";" ...}*
|
||||
|
||||
Note_entry ::= Note_name Note_values
|
||||
|
||||
Note_name ::= [[#Identifiers|Identifier]] ":"
|
||||
|
||||
Note_values ::= {Note_item ","...}+
|
||||
|
||||
Note_item ::= [[#Identifiers|Identifier]] | [[#Manifest constants|Manifest_constant]]
|
||||
|
||||
===Class headers ===
|
||||
Class_header ::= <nowiki>[Header_mark]</nowiki> <code>class</code> [[#Class names|Class_name]]
|
||||
|
||||
Header_mark ::= <code>deferred</code> | <code>expanded</code> | <code>frozen</code>
|
||||
|
||||
===Obsolete marks ===
|
||||
Obsolete ::= <code>obsolete</code> Message
|
||||
|
||||
Message ::= [[#Manifest strings|Manifest_string]]
|
||||
|
||||
===Feature parts ===
|
||||
Features ::= Feature_clause+
|
||||
|
||||
Feature_clause ::= <code>feature</code> <nowiki>[</nowiki>[[#Clients|Clients]]<nowiki>]</nowiki> <nowiki>[</nowiki>[[#Feature parts|Header_comment]]<nowiki>]</nowiki> Feature_declaration_list
|
||||
|
||||
Feature_declaration_list ::= {[[#Feature declarations|Feature_declaration]] ";" ...}*
|
||||
|
||||
Header_comment ::= [[#Comments|Comment]]
|
||||
|
||||
===Feature declarations ===
|
||||
Feature_declaration ::= [[#New feature lists|New_feature_list]] Declaration_body
|
||||
|
||||
Declaration_body ::= <nowiki>[</nowiki>[[#Formal argument and entity declarations|Formal_arguments]]<nowiki>] [Query_mark] [Feature_value] </nowiki>
|
||||
|
||||
Query_mark ::= Type_mark <nowiki>[</nowiki>[[#Assigner marks|Assigner_mark]]<nowiki>]</nowiki>
|
||||
|
||||
Type_mark ::= ":" [[#Types|Type]]
|
||||
|
||||
Feature_value ::= <nowiki>[Explicit_value] </nowiki>
|
||||
<nowiki>[</nowiki>[[#Obsolete parts|Obsolete]]<nowiki>]</nowiki>
|
||||
<nowiki>[</nowiki>[[#Feature parts|Header_comment]]<nowiki>]</nowiki>
|
||||
<nowiki>[</nowiki>[[#Feature bodies|Attribute_or_routine]]<nowiki>]</nowiki>
|
||||
|
||||
Explicit_value ::= "=" [[#Manifest constants|Manifest_constant]]
|
||||
|
||||
|
||||
===New feature lists ===
|
||||
New_feature_list ::= {New_feature "," ...}+
|
||||
|
||||
New_feature ::= <nowiki>[</nowiki><code>frozen</code><nowiki>]</nowiki> [[#Feature names|Extended_feature_name]]
|
||||
|
||||
|
||||
===Feature bodies ===
|
||||
Attribute_or_routine ::= <nowiki>[</nowiki>[[#Assertions|Precondition]]<nowiki>]</nowiki>
|
||||
<nowiki>[</nowiki>[[#Local variable declarations|Local_declarations]]<nowiki>]</nowiki>
|
||||
Feature_body
|
||||
<nowiki>[</nowiki>[[#Assertions|Postcondition]]<nowiki>]</nowiki>
|
||||
<nowiki>[</nowiki>[[#Rescue clauses|Rescue]]<nowiki>]</nowiki>
|
||||
<code>end</code>
|
||||
|
||||
Feature_body ::= [[#Routine bodies|Deferred]] | [[#Routine bodies|Effective_routine]] | [[#Attribute bodies|Attribute]]
|
||||
|
||||
|
||||
===Feature names ===
|
||||
Extended_feature_name ::= Feature_name <nowiki>[Alias]</nowiki>
|
||||
|
||||
Feature_name ::= [[#Identfiers|Identifier]]
|
||||
|
||||
Alias ::= <code>alias</code> '"' Alias_name '"' <nowiki>[</nowiki><code>convert</code><nowiki>]</nowiki>
|
||||
|
||||
Alias_name ::= [[#Operators|Operator]] | Bracket
|
||||
|
||||
Bracket ::= "<nowiki>[ ]</nowiki>"
|
||||
|
||||
|
||||
===Operators ===
|
||||
Operator ::= Unary | Binary
|
||||
|
||||
Unary ::= <code>not</code> | "+" | "-" | Free_unary
|
||||
|
||||
Binary ::= <nowiki>"+" | "-" | "*" | "/" | "//" | "\\" | "^" | ".." | "<" | ">" | "<=" | ">=" |</nowiki> <code>and</code> | <code>or</code> | <code>xor</code> | <code>and</code> <code>then</code> | <code>or</code> <code>else</code> | <code>implies</code> | Free_binary
|
||||
|
||||
{{note| Free_unary and Free_binary are free operators that are distinct from (respectively) the ''standard'' unary and binary operators (one- or two-character symbols) explicitly listed in the Unary and Binary productions. See ''Definition: Free operator'' in the standard for more precision.}}
|
||||
|
||||
|
||||
===Assigner marks ===
|
||||
Assigner_mark ::= <code>assign</code> [[#Feature names|Feature_name]]
|
||||
|
||||
|
||||
===Inheritance parts ===
|
||||
Inheritance ::= Inherit_clause+
|
||||
|
||||
Inherit_clause ::= <code>inherit</code> <nowiki>[Non_conformance]</nowiki> Parent_list
|
||||
|
||||
Non_conformance ::= "{" NONE "}"
|
||||
|
||||
Parent_list ::= {Parent ";" ...}+
|
||||
|
||||
Parent ::= [[#Types|Class_type]] <nowiki>[Feature_adaptation]</nowiki>
|
||||
|
||||
Feature_adaptation ::= <nowiki>[</nowiki>[[#Undefine clauses|Undefine]]<nowiki>]</nowiki>
|
||||
<nowiki>[</nowiki>[[#Redefinition|Redefine]]<nowiki>]</nowiki>
|
||||
<nowiki>[</nowiki>[[#Rename clauses|Rename]]<nowiki>]</nowiki>
|
||||
<nowiki>[</nowiki>[[#Export adaptation|New_exports]]<nowiki>]</nowiki>
|
||||
<nowiki>[</nowiki>[[#Select clauses|Select]]<nowiki>]</nowiki>
|
||||
<code>end</code>
|
||||
|
||||
|
||||
|
||||
===Rename clauses ===
|
||||
Rename ::= <code>rename</code> Rename_list
|
||||
|
||||
Rename_list ::= {Rename_pair "," ...}+
|
||||
|
||||
Rename_pair ::= [[#Feature names|Feature_name]] <code>as</code> [[#Feature names|Extended_feature_name]]
|
||||
|
||||
|
||||
===Clients ===
|
||||
Clients ::= "{" Class_list "}"
|
||||
|
||||
Class_list ::= {[[#Class names|Class_name]] "," ...}+
|
||||
|
||||
|
||||
|
||||
===Export adaptation ===
|
||||
New_exports ::= <code>export</code> New_export_list
|
||||
|
||||
New_export_list ::= {New_export_item ";" ...}+
|
||||
|
||||
New_export_item ::= [[#Clients|Clients]] <nowiki>[</nowiki>[[#Feature parts|Header_comment]]<nowiki>]</nowiki> Feature_set
|
||||
|
||||
Feature_set ::= Feature_list | <code>all</code>
|
||||
|
||||
Feature_list ::= {[[#Feature names|Feature_name]] "," ...}+
|
||||
|
||||
|
||||
|
||||
===Formal argument and entity declarations ===
|
||||
Formal_arguments ::= "(" [[#Formal argument and entity declarations|Entity_declaration_list]] ")"
|
||||
|
||||
Entity_declaration_list ::= {Entity_declaration_group ";" ...}+
|
||||
|
||||
Entity_declaration_group ::= Identifier_list [[#Feature declarations|Type_mark]]
|
||||
|
||||
Identifier_list ::= {[[#Identfiers|Identifier]] "," ...}+
|
||||
|
||||
|
||||
===Routine bodies ===
|
||||
Deferred ::= <code>deferred</code>
|
||||
|
||||
Effective_routine ::= Internal | [[#External routines|External]]
|
||||
|
||||
Internal ::= Routine_mark [[#Instructions|Compound]]
|
||||
|
||||
Routine_mark ::= <code>do</code> | Once
|
||||
|
||||
Once ::= <code>once</code> <nowiki>[</nowiki> "("Key_list ")" <nowiki>]</nowiki>
|
||||
|
||||
Key_list ::= {[[#Manifest strings|Manifest_string]] "," ...}+
|
||||
|
||||
|
||||
===Local variable declarations ===
|
||||
Local_declarations ::= <code>local</code> <nowiki>[</nowiki>[[#Formal argument and entity declarations|Entity_declaration_list]]<nowiki>]</nowiki>
|
||||
|
||||
|
||||
===Instructions ===
|
||||
Compound ::= {Instruction ";" ...}*
|
||||
|
||||
Instruction ::= [[#Creation instructions|Creation_instruction]] | [[#Feature calls|Call]] | [[#Assignments|Assignment]] | [[#Assigner calls|Assigner_call]] | [[#Conditionals|Conditional]] | [[#Multi-branch instructions|Multi_branch]]
|
||||
| [[#Loops|Loop]] | [[#Debug instructions|Debug]] | [[#Precursor|Precursor]] | [[#Check instructions|Check]] | [[#Rescue clauses|Retry]]
|
||||
|
||||
|
||||
===Assertions ===
|
||||
Precondition ::= <code>require</code> <nowiki>[</nowiki><code>else</code><nowiki>]</nowiki> Assertion
|
||||
|
||||
Postcondition ::= <code>ensure</code> <nowiki>[</nowiki><code>then</code><nowiki>]</nowiki> Assertion <nowiki>[</nowiki>[[#"Only" postcondition clauses|Only]]<nowiki>]</nowiki>
|
||||
|
||||
Invariant ::= <code>invariant</code> Assertion
|
||||
|
||||
Assertion ::= {Assertion_clause ";" ...}*
|
||||
|
||||
Assertion_clause ::= <nowiki>[</nowiki>Tag_mark<nowiki>]</nowiki> Unlabeled_assertion_clause
|
||||
|
||||
Unlabeled_assertion_clause ::= [[#Expressions|Boolean_expression]] | [[#Comments|Comment]]
|
||||
|
||||
Tag_mark ::= Tag ":"
|
||||
|
||||
Tag ::= [[#Identfiers|Identifier]]
|
||||
|
||||
|
||||
==="Old" postcondition expressions ===
|
||||
Old ::= <code>old</code> [[#Expressions|Expression]]
|
||||
|
||||
|
||||
==="Only" postcondition clauses ===
|
||||
Only ::= <code>only</code> <nowiki>[</nowiki>[[#Export adaptation|Feature_list]]<nowiki>]</nowiki>
|
||||
|
||||
|
||||
===Check instructions ===
|
||||
Check ::= <code>check</code> [[#Assertions|Assertion]] <nowiki>[</nowiki>[[#Notes|Notes]]<nowiki>]</nowiki> <code>end</code>
|
||||
|
||||
|
||||
===Variants ===
|
||||
Variant ::= <code>variant</code> <nowiki>[</nowiki>[[#Assertions|Tag_mark]]<nowiki>]</nowiki> [[#Expressions|Expression]]
|
||||
|
||||
|
||||
===Precursor ===
|
||||
Precursor ::= <code>Precursor</code> [Parent_qualification] <nowiki>[</nowiki>[[#Actual arguments|Actuals]]<nowiki>]</nowiki>
|
||||
|
||||
Parent_qualification ::= "{" [[#Class names|Class_name]] "}"
|
||||
|
||||
|
||||
===Redefinition ===
|
||||
Redefine ::= <code>redefine</code> [[#Export adaptation|Feature_list]]
|
||||
|
||||
|
||||
===Undefine clauses ===
|
||||
Undefine ::= <code>undefine</code> [[#Export adaptation|Feature_list]]
|
||||
|
||||
|
||||
===Types ===
|
||||
Type ::= Class_or_tuple_type | [[#Formal generic parameters|Formal_generic_name]] | Anchored
|
||||
|
||||
Class_or_tuple_type ::= Class_type | [[#Tuple types|Tuple_type]]
|
||||
|
||||
Class_type ::= [Attachment_mark] [[#Class names|Class_name]] <nowiki>[</nowiki>[[#Actual generic parameters|Actual_generics]]<nowiki>]</nowiki>
|
||||
|
||||
Attachment_mark ::= "?" | "!"
|
||||
|
||||
Anchored ::= [Attachment_mark] <code>like</code> Anchor
|
||||
|
||||
Anchor ::= [[#Feature names|Feature_name]] | <code>Current</code>
|
||||
|
||||
|
||||
===Actual generic parameters ===
|
||||
Actual_generics ::= <nowiki>"[" Type_list "]"</nowiki>
|
||||
|
||||
Type_list ::= {[[#Types|Type]] "," ...}+
|
||||
|
||||
|
||||
===Formal generic parameters ===
|
||||
Formal_generics ::= <nowiki>"[" Formal_generic_list "]"</nowiki>
|
||||
|
||||
Formal_generic_list ::= {Formal_generic ","...}+
|
||||
|
||||
Formal_generic ::= <nowiki>[</nowiki><code>frozen</code><nowiki>]</nowiki> Formal_generic_name <nowiki>[</nowiki>[[#Generic constraints|Constraint]]<nowiki>]</nowiki>
|
||||
|
||||
Formal_generic_name ::= <nowiki>[?]</nowiki> [[#Identfiers|Identifier]]
|
||||
|
||||
|
||||
===Generic constraints ===
|
||||
Constraint ::= "->" Constraining_types <nowiki>[Constraint_creators]</nowiki>
|
||||
|
||||
Constraining_types ::= Single_constraint | Multiple_constraint
|
||||
|
||||
Single_constraint ::= [[#Types|Type]] [Renaming]
|
||||
|
||||
Renaming ::= [[#Rename clauses|Rename]] <code>end</code>
|
||||
|
||||
Multiple_constraint ::= "{" Constraint_list "}"
|
||||
|
||||
Constraint_list ::= {Single_constraint "," ...}+
|
||||
|
||||
Constraint_creators ::= <code>create</code> [[#Export adaptation|Feature_list]] <code>end</code>
|
||||
|
||||
|
||||
===Tuple types ===
|
||||
Tuple_type ::= <code>TUPLE</code> <nowiki>[Tuple_parameter_list]</nowiki>
|
||||
|
||||
Tuple_parameter_list ::= <nowiki>"[" Tuple_parameters "]"</nowiki>
|
||||
|
||||
Tuple_parameters ::= [[#Actual generic parameters|Type_list]] | [[#Formal argument and entity declarations|Entity_declaration_list]]
|
||||
|
||||
|
||||
===Manifest tuples ===
|
||||
Manifest_tuple ::= <nowiki>"[" Expression_list "]"</nowiki>
|
||||
|
||||
Expression_list ::= {[[#Expressions|Expression]] "," ...}*
|
||||
|
||||
|
||||
===Converter clauses ===
|
||||
Converters ::= <code>convert</code> Converter_list
|
||||
|
||||
Converter_list ::= {Converter ","...}+
|
||||
|
||||
Converter ::= Conversion_procedure | Conversion_query
|
||||
|
||||
Conversion_procedure ::= [[#Feature names|Feature_name]] "(" "{" [[#Actual generic parameters|Type_list]] "}" ")"
|
||||
|
||||
Conversion_query ::= [[#Feature names|Feature_name]] ":" "{" [[#Actual generic parameters|Type_list]] "}"
|
||||
|
||||
|
||||
===Select clauses ===
|
||||
Select ::= <code>select</code> [[#Export adaptation|Feature_list]]
|
||||
|
||||
|
||||
===Conditionals ===
|
||||
Conditional ::= <code>if</code> Then_part_list <nowiki>[Else_part]</nowiki> <code>end</code>
|
||||
|
||||
Then_part_list ::= {Then_part <code>elseif</code> ...}+
|
||||
|
||||
Then_part ::= [[#Expressions|Boolean_expression]] <code>then</code> [[#Instructions|Compound]]
|
||||
|
||||
Else_part ::= <code>else</code> [[#Instructions|Compound]]
|
||||
|
||||
|
||||
===Multi-branch instructions ===
|
||||
Multi_branch ::= <code>inspect</code> [[#Expressions|Expression]] <nowiki>[When_part_list] [Else_part]</nowiki> <code>end</code>
|
||||
|
||||
When_part_list ::= When_part+
|
||||
|
||||
When_part ::= <code>when</code> Choices <code>then</code> [[#Instructions|Compound]]
|
||||
|
||||
Choices ::= {Choice "," ...}+
|
||||
|
||||
Choice ::= [[#Constants|Constant]] | [[#Manifest constants|Manifest_type]] | Constant_interval | Type_interval
|
||||
|
||||
Constant_interval ::= [[#Constants|Constant]] ".." [[#Constants|Constant]]
|
||||
|
||||
Type_interval ::= [[#Manifest constants|Manifest_type]] ".." [[#Manifest constants|Manifest_type]]
|
||||
|
||||
|
||||
===Loops ===
|
||||
Loop ::=<br/>
|
||||
<nowiki>[</nowiki>Iteration<nowiki>]</nowiki><br/>
|
||||
<nowiki>[</nowiki>Initialization<nowiki>]</nowiki><br/>
|
||||
<nowiki>[</nowiki>[[#Assertions|Invariant]]<nowiki>]</nowiki><br/>
|
||||
<nowiki>[</nowiki>Exit_condition<nowiki>]</nowiki><br/>
|
||||
Loop_body<br/>
|
||||
<nowiki>[</nowiki>[[#Variants|Variant]]<nowiki>]</nowiki><br/>
|
||||
<code>end</code>
|
||||
|
||||
Iteration ::= <code>across</code> [[#Expressions|Expression]] <code>as</code> [[#Identfiers|Identifier]]
|
||||
|
||||
Initialization ::= <code>from</code> [[#Instructions|Compound]]
|
||||
|
||||
Exit_condition ::= <code>until</code> [[#Expressions|Boolean_expression]]
|
||||
|
||||
Loop_body ::=<br/>
|
||||
<code>loop</code> [[#Instructions|Compound]] |<br/>
|
||||
<code>all</code> [[#Expressions|Boolean_expression]] |<br/>
|
||||
<code>some</code> [[#Expressions|Boolean_expression]]
|
||||
|
||||
|
||||
===Debug instructions ===
|
||||
Debug ::= <code>debug</code> <nowiki>[</nowiki> "("[[#Routine_bodies|Key_list]] ")" ] [[#Instructions|Compound]] <code>end</code>
|
||||
|
||||
|
||||
===Attribute bodies ===
|
||||
Attribute ::= <code>attribute</code> [[#Instructions|Compound]]
|
||||
|
||||
|
||||
===Entities and variables ===
|
||||
Entity ::= Variable | Read_only
|
||||
|
||||
Variable ::= Variable_attribute | Local
|
||||
|
||||
Variable_attribute ::= [[#Feature names|Feature_name]]
|
||||
|
||||
Local ::= [[#Identfiers|Identifier]] | <code>Result</code>
|
||||
|
||||
Read_only ::= Formal | Constant_attribute | <code>Current</code>
|
||||
|
||||
Formal ::= [[#Identfiers|Identifier]]
|
||||
|
||||
Constant_attribute ::= [[#Feature names|Feature_name]]
|
||||
|
||||
|
||||
===Creators parts ===
|
||||
Creators ::= Creation_clause+
|
||||
|
||||
Creation_clause ::= <code>create</code> <nowiki>[</nowiki>[[#Clients|Clients]]<nowiki>]</nowiki> <nowiki>[</nowiki>[[#Feature parts|Header_comment]]<nowiki>]</nowiki> Creation_procedure_list
|
||||
|
||||
Creation_procedure_list ::= {Creation_procedure ","...}+
|
||||
|
||||
Creation_procedure ::= [[#Feature names|Feature_name]]
|
||||
|
||||
|
||||
===Creation instructions ===
|
||||
Creation_instruction ::= <code>create</code> <nowiki>[Explicit_creation_type]</nowiki> Creation_call
|
||||
|
||||
Explicit_creation_type ::= "{" [[#Types|Type]] "}"
|
||||
|
||||
Creation_call ::= [[#Entities and variables|Variable]] [Explicit_creation_call]
|
||||
|
||||
Explicit_creation_call ::= "." [[#Feature calls|Unqualified_call]]
|
||||
|
||||
|
||||
===Creation expressions ===
|
||||
Creation_expression ::= <code>create</code> [[#Creation instructions|Explicit_creation_type]] <nowiki>[</nowiki>[[#Creation instructions|Explicit_creation_call]]<nowiki>]</nowiki>
|
||||
|
||||
|
||||
===Equality expressions ===
|
||||
Equality ::= [[#Expressions|Expression]] Comparison [[#Expressions|Expression]]
|
||||
|
||||
Comparison ::= "=" | "/=" | "~" | "/~"
|
||||
|
||||
|
||||
===Assignments ===
|
||||
Assignment ::= [[#Entities and variables|Variable]] ":=" [[#Expressions|Expression]]
|
||||
|
||||
|
||||
===Assigner calls ===
|
||||
Assigner_call ::= [[#Expressions|Expression]] ":=" [[#Expressions|Expression]]
|
||||
|
||||
|
||||
===Feature calls ===
|
||||
Call ::= Object_call | Non_object_call
|
||||
|
||||
Object_call ::= <nowiki>[Target "."] Unqualified_call </nowiki>
|
||||
|
||||
Unqualified_call ::= [[#Feature names|Feature_name]] <nowiki>[</nowiki>[[#Actual arguments|Actuals]]<nowiki>]</nowiki>
|
||||
|
||||
Target ::= [[#Entities and variables|Local]] | [[#Entities and variables|Read_only]] | Call | Parenthesized_target
|
||||
|
||||
Parenthesized_target ::= "( |" [[#Expressions|Expression]] "| )"
|
||||
|
||||
Non_object_call ::= "{" [[#Types|Type]] "}" "." Unqualified_call
|
||||
|
||||
|
||||
===Actual arguments ===
|
||||
Actuals ::= "(" Actual_list ")"
|
||||
|
||||
Actual_list ::= {[[#Expressions|Expression]] "," ...}+
|
||||
|
||||
|
||||
===Object test ===
|
||||
Object_test ::= "{" [[#Identfiers|Identifier]] ":" [[#Types|Type]] "}" [[#Expressions|Expression]]
|
||||
|
||||
|
||||
===Rescue clauses ===
|
||||
Rescue ::= <code>rescue</code> [[#Instructions|Compound]]
|
||||
|
||||
Retry ::= <code>retry</code>
|
||||
|
||||
|
||||
===Agents ===
|
||||
Agent ::= Call_agent | Inline_agent
|
||||
|
||||
Call_agent ::= <code>agent</code> [[#Call agent bodies|Call_agent_body]]
|
||||
|
||||
Inline_agent ::= <code>agent</code> <nowiki>[</nowiki>[[#Formal argument and entity declarations|Formal_arguments]]<nowiki>]</nowiki> <nowiki>[</nowiki>[[#Feature declarations|Type_mark]]<nowiki>]</nowiki> <nowiki>[</nowiki>[[#Feature bodies|Attribute_or_routine]]<nowiki>]</nowiki> <nowiki>[</nowiki>[[#Call agent bodies|Agent_actuals]]<nowiki>]</nowiki>
|
||||
|
||||
|
||||
===Call agent bodies ===
|
||||
Call_agent_body ::= Agent_qualified | Agent_unqualified
|
||||
|
||||
Agent_qualified ::= Agent_target ". " Agent_unqualified
|
||||
|
||||
Agent_unqualified ::= [[#Feature names|Feature_name]] [Agent_actuals]
|
||||
|
||||
Agent_target ::= Entity | Parenthesized | [[#Manifest constants|Manifest_type]]
|
||||
|
||||
Agent_actuals ::= "(" Agent_actual_list ")"
|
||||
|
||||
Agent_actual_list ::= {Agent_actual "," ...}+
|
||||
|
||||
Agent_actual ::= [[#Expressions|Expression]] | Placeholder
|
||||
|
||||
Placeholder ::= <nowiki>[</nowiki>[[#Manifest constants|Manifest_type]]<nowiki>]</nowiki> "?"
|
||||
|
||||
|
||||
===Expressions ===
|
||||
Expression ::= Basic_expression | Special_expression
|
||||
|
||||
Basic_expression ::= [[#Entities and variables|Read_only]] | [[#Entities and variables|Local]] | [[#Feature calls|Call]] | [[#Precursor|Precursor]] | [[#Equality expressions|Equality]] | Parenthesized | [[#"Old" postcondition expressions|Old]] |
|
||||
[[#Operator expressions|Operator_expression]] | [[#Bracket expressions|Bracket_expression]] | [[#Creation expression|Creation_expression]]
|
||||
|
||||
Special_expression ::= [[#Manifest constants|Manifest_constant]] | [[#Manifest tuples|Manifest_tuple]] | [[#Agents|Agent]] | [[#Object test|Object_test]] | Once_string |
|
||||
Address
|
||||
|
||||
Parenthesized ::= "(" Expression ")"
|
||||
|
||||
Address ::= "$" [[#Entities and variables|Variable]]
|
||||
|
||||
Once_string ::= <code>once</code> [[#Manifest strings|Manifest_string]]
|
||||
|
||||
Boolean_expression ::= Basic_expression | [[#Manifest constants|Boolean_constant]] | [[#Object test|Object_test]]
|
||||
|
||||
|
||||
===Operator expressions ===
|
||||
Operator_expression ::= Unary_expression | Binary_expression
|
||||
|
||||
Unary_expression ::= Unary Expression
|
||||
|
||||
Binary_expression ::= [[#Expressions|Expression]] [[#Operators|Binary]] [[#Expressions|Expression]]
|
||||
|
||||
|
||||
===Bracket expressions ===
|
||||
Bracket_expression ::= Bracket_target "[" [[#Actual arguments|Actuals]] "]"
|
||||
|
||||
Bracket_target ::= [[#Feature calls|Target]] | [[#Expressions|Once_string]] | [[#Manifest constants|Manifest_constant]] | [[#Manifest tuples|Manifest_tuple]]
|
||||
|
||||
|
||||
===Constants ===
|
||||
Constant ::= [[#Manifest constants|Manifest_constant]] | Constant_attribute
|
||||
|
||||
Constant_attribute ::= [[#Feature names|Feature_name]]
|
||||
|
||||
|
||||
===Manifest constants ===
|
||||
Manifest_constant ::= [Manifest_type] Manifest_value
|
||||
|
||||
Manifest_type ::= "{" [[#Types|Type]] "}"
|
||||
|
||||
Manifest_value ::= Boolean_constant |
|
||||
Character_constant |
|
||||
Integer_constant |
|
||||
Real_constant |
|
||||
[[#Manifest strings|Manifest_string]] |
|
||||
Manifest_type
|
||||
|
||||
Sign ::= "+" | "-"
|
||||
|
||||
Integer_constant ::= <nowiki>[Sign]</nowiki> [[#Integers|Integer]]
|
||||
|
||||
Character_constant ::= " ' " [[#Characters|Character]] " ' "
|
||||
|
||||
Boolean_constant ::= <code>True</code> | <code>False</code>
|
||||
|
||||
Real_constant ::= <nowiki>[Sign]</nowiki> [[#Reals|Real]]
|
||||
|
||||
|
||||
===Manifest strings ===
|
||||
Manifest_string ::= Basic_manifest_string | Verbatim_string
|
||||
|
||||
Basic_manifest_string ::= ' " ' String_content ' " '
|
||||
|
||||
String_content ::= {[[#Simple strings|Simple_string]] [[#Line wrapping parts|Line_wrapping_part]] ...}+
|
||||
|
||||
Verbatim_string ::= Verbatim_string_opener Line_sequence Verbatim_string_closer
|
||||
|
||||
Verbatim_string_opener ::= ' " ' <nowiki>[</nowiki>[[#Simple strings|Simple_string]]<nowiki>]</nowiki> Open_bracket
|
||||
|
||||
Verbatim_string_closer ::= Close_bracket <nowiki>[</nowiki>[[#Simple strings|Simple_string]]<nowiki>]</nowiki> ' " '
|
||||
|
||||
Open_bracket ::= <nowiki>"[" | "{"</nowiki>
|
||||
|
||||
Close_bracket ::= "]" | "}"Verbatim_string ::= Verbatim_string_opener Line_sequence Verbatim_string_closer
|
||||
|
||||
Verbatim_string_opener ::= ' " ' <nowiki>[</nowiki>[[#Simple strings|Simple_string]]<nowiki>]</nowiki> Open_bracket
|
||||
|
||||
Verbatim_string_closer ::= Close_bracket <nowiki>[</nowiki>[[#Simple strings|Simple_string]]<nowiki>]</nowiki> ' " '
|
||||
|
||||
Open_bracket ::= <nowiki>"[" | "{" </nowiki>
|
||||
|
||||
Close_bracket ::= <nowiki>"]" | "}" </nowiki>
|
||||
|
||||
|
||||
===External routines ===
|
||||
External ::= <code>external</code> External_language <nowiki>[External_name]</nowiki>
|
||||
|
||||
External_language ::= Unregistered_language | [[#Registered languages|Registered_language]]
|
||||
|
||||
Unregistered_language ::= [[#Manifest strings|Manifest_string]]
|
||||
|
||||
External_name ::= <code>alias</code> [[#Manifest strings|Manifest_string]]
|
||||
{{note|If the `inline` keyword is used in the Registered_language part, then External_name part is the inline code on the specified language.}}
|
||||
|
||||
|
||||
===Registered languages ===
|
||||
Registered_language ::= [[#C externals|C_external]] | [[#C++ externals|C++_external]] | [[#DLL externals|DLL_external]]
|
||||
|
||||
|
||||
===External signatures ===
|
||||
External_signature ::= <code>signature</code> <nowiki>[External_argument_types] [: External_type]</nowiki>
|
||||
|
||||
External_argument_types ::= "(" External_type_list ")"
|
||||
|
||||
External_type_list ::= {External_type "," ...}*
|
||||
|
||||
External_type ::= [[#Simple strings|Simple_string]]
|
||||
|
||||
|
||||
===External file use ===
|
||||
External_file_use ::= <code>use</code> External_file_list
|
||||
|
||||
External_file_list ::= {External_file "," <nowiki>... }+ </nowiki>
|
||||
|
||||
External_file ::= External_user_file | External_system_file
|
||||
|
||||
External_user_file ::= ' " ' [[#Simple strings|Simple_string]] ' " '
|
||||
|
||||
External_system_file ::= <nowiki>"<"</nowiki> [[#Simple strings|Simple_string]] <nowiki>">"</nowiki>
|
||||
|
||||
===C externals ===
|
||||
C_external ::= ' " ' <code>C</code> <nowiki>[</nowiki><code>inline</code>] <nowiki>[</nowiki> [[#External signatures |External_signature]] <nowiki>] [</nowiki> [[#External file use |External_file_use]] <nowiki>] ' " '</nowiki>
|
||||
|
||||
|
||||
===C++ externals ===
|
||||
C++_external ::= ' " ' <code>C++</code> <code>inline</code> <nowiki>[</nowiki> [[#External signatures |External_signature]] <nowiki>] [</nowiki> [[#External file use |External_file_use]] <nowiki>] ' " '</nowiki>
|
||||
|
||||
|
||||
===DLL externals ===
|
||||
DLL_external ::= ' " ' <code>dll</code> <nowiki>[</nowiki><code>windows</code><nowiki>] DLL_identifier [DLL_index] [[</nowiki> [[#External signatures |External_signature]] <nowiki>] [</nowiki> [[#External file use |External_file_use]] <nowiki>] ' " ' </nowiki>
|
||||
|
||||
DLL_identifier ::= [[#Simple strings|Simple_string]]
|
||||
|
||||
DLL_index ::= [[#Integers|Integer]]
|
||||
|
||||
|
||||
===Comments ===
|
||||
Comment ::= "- -" <nowiki>{</nowiki>[[#Simple strings|Simple_string]] Comment_break ...}*
|
||||
|
||||
Comment_break ::= New_line <nowiki>[Blanks_or_tabs] "- -"</nowiki>
|
||||
|
||||
===Integers ===
|
||||
Integer ::= <nowiki>[Integer_base]</nowiki> Digit_sequence
|
||||
|
||||
Integer_base ::= "0" Integer_base_letter
|
||||
|
||||
Integer_base_letter ::= "b" | "c" | "x" | "B" | "C" | "X"
|
||||
|
||||
Digit_sequence ::= Digit+
|
||||
|
||||
Digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" |
|
||||
"a" | "b" | "c" | "d" | "e" | "f" |
|
||||
"A" | "B" | "C" | "D" | "E" | "F" | "_"
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
[[Property:title|Quick reference to the Eiffel programming language]]
|
||||
[[Property:link_title|Language Quick Reference]]
|
||||
[[Property:weight|4]]
|
||||
[[Property:uuid|4f61365d-59f6-a394-678b-144bad8ec12f]]
|
||||
The Quick Reference to the Eiffel programming language provides an informal guide to the syntax and reserved words of the language. The Eiffel programming language is described in detail in the ISO/ECMA standard document, available [http://www.ecma-international.org/publications/standards/Ecma-367.htm online].
|
||||
|
||||
Sometimes there are differences between the language as defined by the standard and that which is implemented by Eiffel Software. These differences are documented in the online documentation.
|
||||
|
||||
So, the final authority on Eiffel as implemented by Eiffel Software is the content of the standard document, amended by those variances cited in the [[Differences between standard ECMA-367 and Eiffel Software implementation|"differences" chapter of the online documentation]].
|
||||
|
||||
This reference is based on the June 2006 ISO/ECMA standard document.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user