Difference between revisions of "Short"

From Liberty Eiffel Wiki
Jump to navigation Jump to search
(still feeding the page)
(still feeding the page)
Line 127: Line 127:
 
|-
 
|-
 
| valign="top" | ''hook016''
 
| valign="top" | ''hook016''
| If this hook file exists, and if an heading comment is present, the contents of this file is printed to replace the default string " --" at the beginning of each comment line.
+
| If this hook file exists, and if an heading comment is present, the contents of this file is printed to replace the default string <code>"&nbsp;--"</code> at the beginning of each comment line.
 
|-
 
|-
 
| valign="top" | ''hook017''
 
| valign="top" | ''hook017''
Line 137: Line 137:
 
| valign="top" | ''hook019''
 
| valign="top" | ''hook019''
 
| If this hook file exists, and if the processed class has no heading comment, this file is printed once.
 
| If this hook file exists, and if the processed class has no heading comment, this file is printed once.
  +
|}
  +
  +
=== Changing the output for the creation list ===
  +
  +
{| cellspacing="4" cellpadding="0" width="100%"
  +
|-
  +
| width="10%" valign="top" | ''hook100''
  +
| If it exists, this file is printed before the creation list to replace the default string <code>"creation%N"</code>.
  +
|-
  +
| valign="top" | ''hook101''
  +
| If it exists, this file is printed after the creation list to replace the default empty string <code>""</code>.
  +
|-
  +
| valign="top" | ''hook102''
  +
| If it exists, this file is printed when the class has no creation list.
  +
|}
  +
  +
=== Changing the output for the feature list ===
  +
  +
{| cellspacing="4" cellpadding="0" width="100%"
  +
|-
  +
| width="10%" valign="top" | ''hook200''
  +
| If it exists, this file is printed before the feature list when the option <code>-sort</code> is selected to replace the default string <code>"feature(s)%N"</code>.
  +
| width="10%" valign="top" | ''hook201''
  +
| If it exists, this file is printed after the feature list when the option <code>-sort</code is selected to replace the default empty string <code>""</code>.
  +
| width="10%" valign="top" | ''hook202''
  +
| If it exists, this file is printed before each feature list with no heading comment to replace the default string <code>"feature(s)&nbsp;from&nbsp;"</code>.
  +
| width="10%" valign="top" | ''hook203''
  +
| If exists, this file is printed after the class name introduced at ''hook202'' to replace the default string <code>"%N"</code>.
  +
| width="10%" valign="top" | ''hook204''
  +
| If it exists, this file is printed before a feature list with a heading comment to replace the default string <code>"feature(s)&nbsp;from&nbsp;"</code>.
  +
| width="10%" valign="top" | ''hook205''
  +
| If it exists, this file is printed after the class name introduced at ''hook204'' to replace the default string <code>"%N"</code>.
  +
| width="10%" valign="top" | ''hook206''
  +
| If it exists, this file is printed before each line of the feature list comment to replace the default string <code>"&nbsp;--"</code>.
  +
| width="10%" valign="top" | ''hook207''
  +
| If it exists, this file is printed after each line of the feature list comment to replace the default string <code>"%N"</code>.
  +
| width="10%" valign="top" | ''hook208''
  +
| If it exists, this file is printed after a feature list comment to replace the default empty string <code>""</code>.
 
|}
 
|}

Revision as of 13:35, 15 May 2006


This is a draft. Please wait for me to finish it --Cyril 15:46, 12 May 2006 (CEST)


The short command is the SmartEiffel interface generator. Using a plain Eiffel source file, the command prints on the standard output the interface of this class. It is also a good tool to perform many validity checks of a given class (syntax, exportation rules, inheritance, etc.).

In a normal installation, it is invoked by the command se short.

There are two ways of invoking it: the traditional mode and the ACE mode.

  • In the traditional mode, many options can be specified on the command line.
  • In the ACE mode (Assembly of Classes in Eiffel), most of its options are not allowed on the

command line; they have their equivalents in the ACE file.

Synopsis

  • se short [options] <class>
  • se short [options] <ace_file.ace> <class>

The first syntax is the traditional mode, the second is the ACE mode.

In the ACE mode, the name of the ACE file provided must end with the suffix .ace.

Options

-help Display a short summary of the command line syntax, as well as a complete list of the compiler's options.
-verbose Display (an enormous amount of) information during the compilation: a complete list of files loaded, the type inference scores, the generated files, and so on.
-version Display the SmartEiffel version number.
-loadpath <loadpath-file> Adds a loadpath file for class lookup. See details in the finder page.
-sort Sort features alphabetically.
-short Show only locally defined features (do not consider purely inherited features).
-no_style_warning Suppress the display of warning messages about non-compliance with Eiffel style rules (this flag does not have any effect any more in 2.3).
-no_warning Suppress all warning messages. This implies -no_style_warning.
-client <client_class> Specify the class whom the point of view is taken of. This command allows to know all the features visible to client_class from the class you short.

Note1: the default is equivalent to -client ANY.

Note2: se short -client STRING STRING does not show all features from STRING, but only those that are exported to STRING itself (callable via qualified calls).

-all_clients Display all the features, aven those not exported at all (marked feature {})

Predefined Output Formats

You can specify an output format, which will change some typographic details but not the contents itself (see [#Options the options above] to change the contents.

See also [#Adding_a_new_output_format below] to know how to add a new output format.

-plain The default compact output format. No special character added.
-pretty Basically, it is similar to -plain except that there are a couple of additional line-feeds (e.g. between features) that make the structure of the output easier to read. (It sort of appears like the "pretty" printer would have done it).
-tex1 Simple output mode for TeX.
-tex2 Output mode for TeX. Uses a bold font for keywords, an italic font for comments and a fixed font for identifiers.
-tex3 Output mode for TeX. Follows style guidelines given in ETL2 appendix A.
-html1 A nice HTML output (provided by Matthias Klose).
-html2 Another nice HTML output.
-html_css A nice HTML+CSS output (provided by John E. Perry). The CSS file must be called seshort.css.

Adding a new format

To define a new output format, you have to add a new sub-directory in the SmartEiffel/short directory. In order to change the output, this new directory must contain hook files, which contain the text used to replace the default output.

Here is the current list of hook files.

Changing the output for the class interface header

hook000 If this hook file exists, the contents of this file is printed very first.
hook010 If this hook file exists, and if the processed class is an expanded one, the contents of this file is printed before the class name to replace the default string "expanded class interface ".
hook011 If this hook file exists, and if the processed class is an deferred one, the contents of this file is printed before the class name to replace the default string "deferred class interface ".
hook012 If this hook file exists, and if the processed class is an ordinary one (not deferred nor expanded) the contents of this file is printed before the class name to replace the default string "class  interface ".
hook013 If this hook file exists, the contents of this file is printed before the class name whatever the kind of class (expanded, deferred or ordinary) to replace the default empty string "".
hook014 If this hook exists, the contents of the file is printed after the class name to replace the default string "%N".
hook015 If this hook file exists, and if a class header comment is present, this file is printed once before the heading class comment.
hook016 If this hook file exists, and if an heading comment is present, the contents of this file is printed to replace the default string " --" at the beginning of each comment line.
hook017 If this hook file exists, and if an heading comment is present, the contents of this file is printed to replace the default string "%N" at the end of each comment line.
hook018 If this hook file exists, and if a class heading comment is present, the contents of this file is printed once after the heading comment.
hook019 If this hook file exists, and if the processed class has no heading comment, this file is printed once.

Changing the output for the creation list

hook100 If it exists, this file is printed before the creation list to replace the default string "creation%N".
hook101 If it exists, this file is printed after the creation list to replace the default empty string "".
hook102 If it exists, this file is printed when the class has no creation list.

Changing the output for the feature list

hook200 If it exists, this file is printed before the feature list when the option -sort is selected to replace the default string "feature(s)%N". hook201 If it exists, this file is printed after the feature list when the option -sort</code is selected to replace the default empty string "". hook202 If it exists, this file is printed before each feature list with no heading comment to replace the default string "feature(s) from ". hook203 If exists, this file is printed after the class name introduced at hook202 to replace the default string "%N". hook204 If it exists, this file is printed before a feature list with a heading comment to replace the default string "feature(s) from ". hook205 If it exists, this file is printed after the class name introduced at hook204 to replace the default string "%N". hook206 If it exists, this file is printed before each line of the feature list comment to replace the default string " --". hook207 If it exists, this file is printed after each line of the feature list comment to replace the default string "%N". hook208 If it exists, this file is printed after a feature list comment to replace the default empty string "".