mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-07 07:12:25 +01:00
Update wikipage Eiffel programming language syntax. (Signed-off-by:jocelyn).
git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1603 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
@@ -121,16 +121,24 @@ 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>
|
||||
[[#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 ===
|
||||
@@ -143,32 +151,43 @@ Note_item ::= [[#Identifiers|Identifier]] | [[#Manifest constants|Manifest_const
|
||||
|
||||
===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]]
|
||||
|
||||
|
||||
@@ -179,20 +198,27 @@ 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.}}
|
||||
@@ -204,10 +230,15 @@ 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>
|
||||
@@ -219,38 +250,53 @@ Feature_adaptation ::= <nowiki>[</nowiki>[[#Undefine clauses|Undefine]]<nowiki>]
|
||||
|
||||
===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]] "," ...}+
|
||||
|
||||
|
||||
@@ -260,18 +306,26 @@ Local_declarations ::= <code>local</code> <nowiki>[</nowiki>[[#Formal argument a
|
||||
|
||||
===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> [<code>else</code>] Assertion
|
||||
|
||||
Postcondition ::= <code>ensure</code> [<code>then</code>] Assertion <nowiki>[</nowiki>[[#"Only" postcondition clauses|Only]]<nowiki>]</nowiki>
|
||||
|
||||
Invariant ::= <code>invariant</code> Assertion
|
||||
|
||||
Assertion ::= {Assertion_clause ";" ...}*
|
||||
|
||||
Assertion_clause ::= [Tag_mark] Unlabeled_assertion_clause
|
||||
|
||||
Unlabeled_assertion_clause ::= [[#Expressions|Boolean_expression]] | [[#Comments|Comment]]
|
||||
|
||||
Tag_mark ::= Tag ":"
|
||||
|
||||
Tag ::= [[#Identfiers|Identifier]]
|
||||
|
||||
|
||||
@@ -293,6 +347,7 @@ Variant ::= <code>variant</code> <nowiki>[</nowiki>[[#Assertions|Tag_mark]]<nowi
|
||||
|
||||
===Precursor ===
|
||||
Precursor ::= <code>Precursor</code> [Parent_qualification] <nowiki>[</nowiki>[[#Actual arguments|Actuals]]<nowiki>]</nowiki>
|
||||
|
||||
Parent_qualification ::= "{" [[#Class names|Class_name]] "}"
|
||||
|
||||
|
||||
@@ -306,51 +361,73 @@ 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]] "}"
|
||||
|
||||
|
||||
@@ -360,18 +437,27 @@ 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]]
|
||||
|
||||
|
||||
@@ -382,8 +468,11 @@ Exit_condition
|
||||
Loop_body
|
||||
<nowiki>[</nowiki>[[#Variants|Variant]]<nowiki>]</nowiki>
|
||||
<code>end</code>
|
||||
|
||||
Initialization ::= <code>from</code> [[#Instructions|Compound]]
|
||||
|
||||
Exit_condition ::= <code>until</code> [[#Expressions|Boolean_expression]]
|
||||
|
||||
Loop_body ::= <code>loop</code> [[#Instructions|Compound]]
|
||||
|
||||
|
||||
@@ -397,25 +486,37 @@ 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]]
|
||||
|
||||
|
||||
@@ -425,6 +526,7 @@ Creation_expression ::= <code>create</code> [[#Creation instructions|Explicit_cr
|
||||
|
||||
===Equality expressions ===
|
||||
Equality ::= [[#Expressions|Expression]] Comparison [[#Expressions|Expression]]
|
||||
|
||||
Comparison ::= "=" | "/=" | "~" | "/~"
|
||||
|
||||
|
||||
@@ -438,15 +540,21 @@ 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]] "," ...}+
|
||||
|
||||
|
||||
@@ -456,89 +564,130 @@ Object_test ::= "{" [[#Identfiers|Identifier]] ":" [[#Types|Type]] "}" [[#Expres
|
||||
|
||||
===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.}}
|
||||
|
||||
@@ -549,16 +698,23 @@ Registered_language ::= [[#C externals|C_external]] | [[#C++ externals|C++_exter
|
||||
|
||||
===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 ===
|
||||
@@ -571,23 +727,27 @@ C++_external ::= ' " ' <code>C++</code> <code>inline</code> <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" | "_"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user