Difference between revisions of "Syntax diagrams"
(Reverted edit of Cadrian, changed back to last version by Colnet) |
(typos + details about class name of formal parameter types) |
||
Line 45: | Line 45: | ||
Inside the comment, the convention to denote Eiffel entities (i.e. variables, |
Inside the comment, the convention to denote Eiffel entities (i.e. variables, |
||
arguments or other features as well) is to enclose the corresponding name |
arguments or other features as well) is to enclose the corresponding name |
||
− | between ` and ' as |
+ | between ` and ' as follows: |
-- Here `my_variable' is supposed to be bla bla bla ... |
-- Here `my_variable' is supposed to be bla bla bla ... |
||
This convention allows some tools like [[Eiffeldoc]] or [[Short]] or emacs |
This convention allows some tools like [[Eiffeldoc]] or [[Short]] or emacs |
||
as well to use a different character font or color to emphasize the fact that |
as well to use a different character font or color to emphasize the fact that |
||
− | <TT>my_variable</TT> |
+ | <TT>my_variable</TT> refers to some existing entity of the Eiffel code. |
Also note that an URL inside the comment is also made automatically clickable |
Also note that an URL inside the comment is also made automatically clickable |
||
Line 122: | Line 122: | ||
A class name must start with a letter, an upper case letter as all other letters used in |
A class name must start with a letter, an upper case letter as all other letters used in |
||
that name. |
that name. |
||
− | The usage is not to use two consecutive '_' underscore character. |
+ | The usage is not to use two consecutive '_' underscore character, nor to end by an underscore character (by convention we keep simple names with a trailing underscore character, like <TT>O_</TT> as a formal parameter type of a generic type). |
− | Some examples of valid class |
+ | Some examples of valid class names: |
<TT>ARRAY</TT>, |
<TT>ARRAY</TT>, |
||
<TT>ANY</TT>, |
<TT>ANY</TT>, |
Revision as of 09:11, 24 June 2005
Syntax diagrams for the whole Eiffel language.
All items in alphabetical order: Assignment, Binary, Call, Class_declaration, Class_name, Clients, Comment, Compound, Creation_clause, Else_part, Entity_declaration_list, Expression, Feature_clause, Feature_declaration, Feature_name, Formal_generic_list, Infix_operator, Instruction, Loop, Manifest_string, New_export_item, Parent_list, Prefix_operator, Routine, Routine_body, Type, Unary, Unqualified_call, When_part.
Comment
A comment is made of one or more line segments, each beginning with two consecutive dash characters -- and extending to the end of the line:
Inside the comment, the convention to denote Eiffel entities (i.e. variables, arguments or other features as well) is to enclose the corresponding name between ` and ' as follows:
-- Here `my_variable' is supposed to be bla bla bla ...
This convention allows some tools like Eiffeldoc or Short or emacs as well to use a different character font or color to emphasize the fact that my_variable refers to some existing entity of the Eiffel code.
Also note that an URL inside the comment is also made automatically clickable by Eiffeldoc. This way, each time some class of our library needs a long explanation that does not reasonably fit in the Eiffel comment itself, we just add the URL into the comment. As an example, the following comment displayed by Eiffeldoc would bring you back here :
-- See also http://smarteiffel.loria.fr/wiki/en/index.php/Syntax_diagrams#Comment
Class declaration
Related items: Assertion, Class_name, Creation_clause, Feature_clause, Formal_generic_list, Manifest_string, Parent_list.
Parent list
New export item
Creation clause
Feature clause
Clients
Feature declaration
Routine
Entity declaration list
Class name
A class name must use only upper case letters plus the '_' underscore character. A class name must start with a letter, an upper case letter as all other letters used in that name. The usage is not to use two consecutive '_' underscore character, nor to end by an underscore character (by convention we keep simple names with a trailing underscore character, like O_ as a formal parameter type of a generic type). Some examples of valid class names: ARRAY, ANY, LINKED_LIST.
Type
Binary
Instruction
Infix operator
Prefix operator