Updated to upcoming 23.09

git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@2393 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
eifops
2023-09-25 09:13:12 +00:00
parent 246745930d
commit e2bb303f94
2975 changed files with 63910 additions and 342 deletions

View File

@@ -0,0 +1,24 @@
[[Property:title|Error wizard]]
[[Property:weight|2]]
[[Property:uuid|0c9686a0-2b9b-291f-4f01-930d9017810b]]
More often than wanted, Eiffel compilations are not successful. The good point is that when an error is detected by the compiler, it will not be a problem at run-time. The bad point is that you have to fix compilation errors before being able to launch and debug your system.
When an error occurs during an Eiffel compilation in EiffelStudio, the '''Output''' tab of the context tool displays a description of the error and its location, which looks more or less like this:
[[Image:error-message]]
In this case, the compiler tries to explain that the identifier "sessionid" is not a known identifier in the context where it was typed. This is a common error that mainly occurs when making typos in the code. Assuming the message does not make sense to you (which may happen in more complex cases), you can query more information about the encountered error.
To do this:
* [[Pick-and-drop mechanism|Pick]] the code of the error, in this case VEEN.
* [[Pick-and-drop mechanism|Drop]] it either in the editor or on the error help button [[Image:command-error-info-icon]] .
* A dialog is then popped up that describes extended information concerning this error type:
[[Image:error-description-dialog]]

View File

@@ -0,0 +1,60 @@
[[Property:title|External commands editor dialog]]
[[Property:weight|4]]
[[Property:uuid|9f8de904-3d17-7ce2-1df8-f4824fab5ae3]]
From EiffelStudio, you can define up to 10 external commands. Those commands will execute and display their output in the [[Console tool]]. You can execute them through the Tools menu. A typical usage is to use those external commands to integrate with your source control management solution (e.g. CVS, Visual SourceSafe,...)
==Defining external commands==
To define your own command, select "External commands..." in the Tools menu. Then the following dialog will appear:
[[Image:external-commands-dialog]]
With this dialog you can:
* add new commands
* edit existing commands
* delete existing commands
To add your first command, simply click on the "Add..." button and the following command editor will appear:
[[Image:external-commands-dialog-editor]]
In this dialog you can give a name to the command, this name will be displayed in the Tools menu. The index (0 thru 9) is the position among the external commands of the command in the Tools menu. The command line is the command you want to execute. In order to execute correctly, the application you will execute needs to be in your PATH environment variable or if it is not you must provide an absolute path to the external command. And you can specify the working directory for that command.
In addition to the external command name, you can pass as many options as you want. You can also use placeholders that will be translated before calling the external command. Some of those placeholders are:
* $class_name: this will be replaced by the name in lower case of the targeted class in editor
* $file_name: this will be replaced by the path to the targeted class in editor
* $file: this will be replaced by the simple file name without the path
* $directory_name: this will be replaced by the directory location of the targeted class in editor
* $group_name: this will be replaced by the group name of the targeted class in editor
* $line: this will be replaced by the line number of the cursor of the targeted class in editor
* $w_code: this will be replaced by the W_code directory of current system, if defined
* $f_code: this will be replaced by the F_code directory of current system, if defined
You can see the complete [[Console tool#Placeholders|list]] in the Console tool documentation.
==Executing external commands==
When you look at the EiffelStudio '''Tools''' menu, you will see that the external commands that you have added have also been added to the bottom of the menu. In the figure below, you see the command we added at index 4:
[[Image:External commands tools menu]]
To execute that command, you can select it from the '''Tools''' menu, or you can use the keyboard shortcut provided. In this case the keyboard shortcut is the default value of '''Alt+4'''.
The shortcuts for the command indexes can be changed in the EiffelStudio preferences by following the preference path:
<code>
shortcuts -> external_commands
</code>
External commands execute in the context of the [[Console tool]]. The Console tool should appear automatically, but you can make it visible by following the menu path:
<code lang="text">
View -> Tools -> Console
</code>
Then you can dock the console tool, if you would like to have it constantly visible.

View File

@@ -0,0 +1,5 @@
[[Property:title|Dialogs]]
[[Property:weight|1]]
[[Property:uuid|5d543cd3-8e54-e090-44d4-ee3b51009fe6]]

View File

@@ -0,0 +1,14 @@
[[Property:title|New feature dialog]]
[[Property:weight|0]]
[[Property:uuid|deb4901a-7b5a-f669-802e-de1efefcc1a0]]
The new feature dialog window lets you create simple Eiffel features using the coding standards described in [[Object-Oriented Software Construction, 2nd Edition]]. It automates the task of writing set-procedures for attributes and it makes it easy for you to find the right feature clause for a new feature. The new feature dialog can be invoked whenever you have a class open in a development window. It is also used by the diagram tool when creating a client-supplier link.
==Use it when...==
* You want to be introduced to the style rules for Eiffel code as described in [[Object-Oriented Software Construction, 2nd Edition]], chapter 26.5 (page 891).
* You want to create an attribute and you also want an invariant and/or a set-procedure generated for it.
* You want to add a feature in a feature clause that is not in your class yet, and you do not remember the feature clause order, or you want to add it in a feature clause that is in your class, but you cannot find it.
==Do not use it when...==
* You want to edit an existing feature. This is not possible, you can only create new features with it.
* You want to write a more advanced feature. With the feature wizard, you can enter only a single line of code.

View File

@@ -0,0 +1,45 @@
[[Property:title|New attribute layout]]
[[Property:weight|4]]
[[Property:uuid|b13c9004-c8a0-6628-5c70-42c3e2617c10]]
<div> [[Image:feature-wizard-attribute]] </div>
When clicking '''Attribute''', the window changes to the attribute layout. It has the following components:
* [[Feature clauses|Feature clause selection]]
* [[Name field|Feature name field]]
* [[Type selection|Type selection]]
* [[Header comment|Header comment field]]
* [[Invariant field|Invariant field]]
* [[Set-procedure|Set-procedure check box]]
==Example==
This dialog box:<br/>
<div> [[Image:feature-wizard-attribute-example]] </div><br/>
Produces this feature:<br/>
<code>
class
PRODUCT
feature {NONE} -- Access
price: DOUBLE
-- Cost in dollars.
feature -- Element change
set_price (a_price: DOUBLE)
-- Assign `a_price' to `price'.
require
a_price_non_negative: a_price >= 0.0
do
price := a_price
ensure
price_assigned: price = a_price
end
invariant
price_non_negative: price >= 0.0
end -- class PRODUCT</code>

View File

@@ -0,0 +1,23 @@
[[Property:title|Argument list]]
[[Property:weight|2]]
[[Property:uuid|f2d63c29-6be2-b3d9-a735-b18e08c5a678]]
For functions and procedures, you can build a formal argument list. You can do this by clicking on the '''New argument''' button as many times as you need arguments.
{{note|Even though this dialog always shows parentheses, if the list is empty, empty parentheses will not generated. In other words, the dialog will generate the correct Eiffel syntax. }}
<div> [[Image:feature-wizard-3-arguments]] </div><br/>
{{note|If you add arguments to a routine, it is not possible anymore to select routine type '''once'''. }}
For every attribute you selected, enter a name in the text box and a type using the [[Type selection|type selection]] .
<div> [[Image:feature-wizard-1-argument]] </div><br/>
The code that is generated:
<code>
set_name (s: STRING)
do
end</code>

View File

@@ -0,0 +1,35 @@
[[Property:title|Feature body]]
[[Property:weight|6]]
[[Property:uuid|8f9f0b70-e884-73f1-e270-f1b51ef672c6]]
What goes into the feature body field is dependent on what kind of feature you wish to generate.
* '''do''': this is the normal procedure type. Enter in the field below '''do''' a body for your feature.
<code>
do_something
do
a := b
end</code>
* '''once''': this is the type for a routine that is executed once per execution. As a once routine cannot have arguments, it is disabled when you added one or more arguments.
<code>
init
once
load
end</code>
* '''deferred''': this creates a routine of deferred type. The local and body fields gray out as they serve no use anymore.
<code>
do_something
deferred
end</code>
* '''external''': this creates an Eiffel wrap routine around a routine written in another language. Use the body field to enter a string containing the necessary information about the routine using the external syntax.
<code>
do_something
external
"C | %"location.h%""
end</code>

View File

@@ -0,0 +1,39 @@
[[Property:title|Feature clauses]]
[[Property:weight|0]]
[[Property:uuid|019ea318-e0e0-dae9-a818-e12232aa8431]]
The feature you create will be inserted in the feature clause you specified. If the feature clause was not already in your class, or not in the right place, EiffelStudio adds the feature clause to the class text based on the feature clause order specified in the [[Preferences Reference|preferences]] . By default, this is the order used by the Eiffel Software libraries, such as EiffelBase.
==Export status==
The export status is the class the feature is accessible for. Usually, this is <eiffel>ANY</eiffel> for public features, or <eiffel>NONE</eiffel> for implementation features, but you can specify any class here.
[[Image:feature-wizard-export]]
{{note|In the class text, you can export a feature to more than one class but (for simplicity) not with this dialog. }}
==Feature clause names==
For feature clause names it is recommended that you pick one from the standard ones, but it is also possible to create a new one. If you have introduced a special feature clause name in your project, add it to the feature clause order list in the [[Preferences Reference|preferences]] and it will also appear in this dialog.
[[Image:feature-wizard-clausenames]]
==Generated code==
The code that is inserted in your class as a result of the selections made for the feature clause, is of the form: <br/>
<code>
feature {EXPORT} -- Clause name</code><br/>
except if you specified <eiffel>ANY</eiffel> as export status, which has the same meaning as not specifying class names in the export status: <br/>
<code>
feature --Clause name</code>
<br/>
For example, if you specified a the "Initialization" feature clause name, and specified <eiffel>NONE</eiffel> as export status, you get: <br/>
<code>
feature {NONE} -- Initialization</code>

View File

@@ -0,0 +1,15 @@
[[Property:title|Header comment]]
[[Property:weight|3]]
[[Property:uuid|45ecda88-003d-fe59-5d4c-3a84d488b6a2]]
In the header comment field you can type a description of the feature. For style guidelines in writing a header comment, see [[Object-Oriented Software Construction, 2nd Edition]], chapter 26, section 4. The description should be informative, clear and terse.
For example, suppose you have an attribute <eiffel>count</eiffel>. You can enter the following header comment:
<div> [[Image:feature-wizard-comment]] </div><br/>
When clicking '''OK''' this code is generated: <br/>
<code>
count: INTEGER
-- Number of students in course</code>

View File

@@ -0,0 +1,5 @@
[[Property:title|New feature dialog: feature properties modification]]
[[Property:weight|5]]
[[Property:uuid|60825ef4-7bc2-d472-8b09-25769689bb34]]

View File

@@ -0,0 +1,24 @@
[[Property:title|Invariant field]]
[[Property:weight|9]]
[[Property:uuid|9f7ec967-0a45-4ad6-4393-521097467192]]
When creating an attribute, you can optionally enter or select an invariant for that feature. That invariant will be added to the end of the existing invariant clause. If the invariant clause did not exist before, it is now created.
[[Image:feature-wizard-invariant]]
If the attribute is of a reference type, you may select the invariant that the attribute may never be void. If it is of a basic expanded type, some other standard options may be chosen. For example, for <eiffel>INTEGER</eiffel> you may select that it should always be positive.
[[Image:feature-wizard-invariant-selected]]
The example above will generate the code:
<code>
invariant
count_positive: count > 0
</code>

View File

@@ -0,0 +1,13 @@
[[Property:title|Local variable]]
[[Property:weight|5]]
[[Property:uuid|423aa67d-99f4-0f81-3709-161a6be43af9]]
Enter a local variable in the <code>local</code> field. A local variable clause will be added to the feature:
<code>
...
local
n: INTEGER
...</code>

View File

@@ -0,0 +1,11 @@
[[Property:title|Name field]]
[[Property:weight|1]]
[[Property:uuid|850bd867-5cbf-34d0-f94c-97a75bfa244b]]
The feature name field is a text box that lets you enter a name for the feature. For help on how to choose the right name for a feature, see: [[Object-Oriented Software Construction, 2nd Edition]], chapter 26, section 2.
{{warning|EiffelStudio performs no validation on the name you choose. For example if you type a space in it, it will generate the code, and detect a syntax error only when compiling. }}

View File

@@ -0,0 +1,12 @@
[[Property:title|Postcondition]]
[[Property:weight|7]]
[[Property:uuid|b8196d6c-2a0f-c06e-855f-d9fe23cbe950]]
Enter a postcondition in the <code>ensure</code> field. A postcondition clause will be added to the feature:
<code>
...
ensure
n = count</code>

View File

@@ -0,0 +1,13 @@
[[Property:title|Precondition]]
[[Property:weight|4]]
[[Property:uuid|29b32f9e-799d-de91-d62d-79bdb509144b]]
Enter a precondition in the <code>require</code> field. A precondition clause will be added to the feature:
<code>
...
require
n >= 0
...</code>

View File

@@ -0,0 +1,32 @@
[[Property:title|Set-procedure]]
[[Property:weight|10]]
[[Property:uuid|46b84038-099b-070c-15d7-2b7884a50e01]]
When creating an attribute, it is common that you will also need a set-procedure for it. For example, for attribute <eiffel>property</eiffel> you need a procedure <eiffel>set_property</eiffel> to set it. This feature takes one argument of the same type as <eiffel>property</eiffel> or is anchored to it. The only thing you have to do with the feature wizard is check the button '''Generate set procedure'''.
[[Image:feature-wizard-setprocedure]]
The feature that is generated in addition to the attribute itself is placed in feature clause <code>Element change</code> and is exported to all classes. If you have selected or entered an invariant, the precondition will protect this invariant. Example of a generated set-procedure:
[[Image:feature-wizard-setprocedure-example]]
<code>
feature -- Element change
set_button (a_button: EV_BUTTON)
-- Assign `a_button' to `button'
require
a_button_not_void: a_button /= Void
do
button := a_button
ensure
button_assigned: button = a_button
end
</code>

View File

@@ -0,0 +1,45 @@
[[Property:title|Type selection]]
[[Property:weight|8]]
[[Property:uuid|b2bd8280-a738-dae4-73aa-c1e232245022]]
Whenever you need to give a type of something in the dialog, the type selection component is used. The type selection lets you type any class name or you can pick one from the list.
[[Image:feature-wizard-typeselection]]
When you select a class that is in the system and has formal generic parameters, the type selection component lets you specify an actual generic parameter in another type selection.
[[Image:feature-wizard-generictype]]
{{note|The window might grow in size because of the added component. }}
Since the actual generic type selection is also a type selection, you can select another class with generic parameters and nest them as deep as you need.
[[Image:feature-wizard-generictyperec]]
You can also select the type <eiffel>TUPLE</eiffel>, which is a special class that can have zero or more generic parameters. When you select it, it has no parameters, but you can add one by clicking on the '''Add parameter''' button. Click it as often as the number of generic parameters that you need.
[[Image:feature-wizard-tupletype2]]
{{warning|If you need a very complex type, it is better not to use the dialog, as the window might grow bigger than your screen. After you completed the feature, edit it manually in the class text. }}
The code generated for the selected type is quite straightforward, an example:
[[Image:feature-wizard-complextype]]
<code>
new_feature: FUNCTION [TUPLE [INTEGER], BOOLEAN]
</code>

View File

@@ -0,0 +1,17 @@
[[Property:title|New feature dialog overview]]
[[Property:weight|1]]
[[Property:uuid|c0708842-e5e0-5d5c-5746-0507d1709a3e]]
There are two parts in the window. The upper part allows you to choose what type of feature you want to create, a procedure, a function or an attribute.
[[Image:feature-wizard]]
The rest of the window is used to set the characteristics of the new feature. Information you will be asked depends on the type you chose. For more information, click on one of the links below:
* [[New procedure layout|New procedure layout]]
* [[New function layout|New function layout]]
* [[New attribute layout|New Attribute layout]]

View File

@@ -0,0 +1,40 @@
[[Property:title|New function layout]]
[[Property:weight|3]]
[[Property:uuid|ae292b6e-7274-47a5-59f1-0f625493474f]]
<div> [[Image:feature-wizard-function]] </div>
When clicking '''Function''', the dialog changes to the function layout. It has the following components:
* [[Feature clauses|Feature clause selection]]
* [[Name field|Feature name field]]
* [[Argument list|Argument list]]
* [[Type selection|Type selection]]
* [[Header comment|Header comment field]]
* [[Precondition|Precondition field]]
* [[Local variable|Local variable field]]
* [[Feature body|Selection for: normal, once, deferred or external routine]]
* [[Postcondition|Postcondition field]]
==Example==
This dialog box:<br/>
<div> [[Image:feature-wizard-function-example]] </div><br/>
Produces this feature:<br/>
<code>
class
PRODUCT
feature -- Status report
order_price (quantity: INTEGER): DOUBLE
-- Total price when ordering `quantity'.
require
quantity_non_negative: quantity >= 0
do
Result := quantity * price
ensure
correct: Result = quantity * price
end
end -- class PRODUCT</code>

View File

@@ -0,0 +1,41 @@
[[Property:title|New procedure layout]]
[[Property:weight|2]]
[[Property:uuid|586fd664-1be4-f588-5350-c7c703145c11]]
<div> [[Image:feature-wizard-procedure]] </div>
When clicking '''Procedure''', the window changes to the procedure layout. It has the following components:
* [[Feature clauses|Feature clause selection]]
* [[Name field|Feature name field]]
* [[Argument list|Argument list]]
* [[Header comment|Header comment field]]
* [[Precondition|Precondition field]]
* [[Local variable|Local variable field]]
* [[Feature body|Selection for: normal, once, deferred or external routine]]
* [[Postcondition|Postcondition field]]
==Example==
This dialog box:<br/>
<div> [[Image:feature-wizard-procedure-example]] </div><br/>
Produces this feature:<br/>
<code>
class
PRODUCT
feature {PERSON} -- Element change
place_order (person: PERSON; quantity: INTEGER)
-- Mail `quantity' to `person'.
require
person /= Void and quantity > 0
do
person.mail_order (Current, quantity)
ensure
person.has_ordered (Current)
end
end -- class PRODUCT</code>