From Liberty Eiffel Wiki
Revision as of 10:54, 12 October 2006 by SEWikiImport FM (talk) (Mostly copied from the man page, but this page could use some editing)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


 se find [options] [<ACEfile.ace>] <Class> 

The find command tells you which file is loaded when searching for an Eiffel <Class>.

When an Eiffel file is found, find prints the full path name on standard output.

The exit status is set GENERAL.exit_success_code only when an existing file is found (thus allowing usage of the find command in shell scripts). As for other commands, when the ACE file mode is used, only the content of the <ACEfile.ace> file is used to search the source file. To see the loading path used by SmartEiffel, you can for example type the find command using a bad (inexistent) class name. In ACE file mode, the loading path can be updated by modifying the ACE file itself. In traditional mode (i.e. no ACE file), the default loading path may also be tailored (see below).



Display a brief summary of the command-line syntax and a complete list of find options.


Show the number of the version of SmartEiffel you're using.


Print system information during the compilation (full path of loaded files, type inference score, removed files, etc.).

-loadpath <loadpath_file>:

Adds a loadpath file for class lookup. See below for details on the loading path constitution.

Where Does find Search?

The algorithm used by SmartEiffel to look for an Eiffel source file is the following:

  1. Lower case filenames - SmartEiffel looks all along the loading path (see below) using <class> name in lower case as tail. If needed, the Eiffel suffix (".e") is added automatically. SmartEiffel only looks for suffixed files on the disk. Only the first file encountered according to the order of the path is taken in account. File is always supposed to have the same name as the inside class definition.
  2. Upper case filenames - When the previous step did not find the required Eiffel class file, SmartEiffel looks along the loading path (see below) for a file bearing the class name upper in upper case letters. If needed, the Eiffel suffix ".e" is added automatically. One must note that the overhead to find an upper case file name is not negligible at all and that a lower case file name may hide some upper case name.

How is the loading path built?

As described above, SmartEiffel looks for classes in .e files. But where should those files be situated? The answer is, in the loading path. The thing is, how is the loading path built, what are the default values, and how can it be changed?

Note: The following applies only if no ACE file is provided. If an ACE file is provided, only the listed clusters in that file are considered.

There are many things that are taken into account. Let's take them in order, from the most important to the least (i.e., in the order SmartEiffel looks in; remember that the first filename that matches is used, thus allowing class covering).

  1. The loadpath files given on the command line (using -loadpath) are searched first.
  2. If the current directory contains a file named, this file is used as loadpath file; otherwise, the current directory is considered as a path where to look for classes (this allows very simple projects not to define any loadpath file).
  3. At last, the loadpath files of the configuration file are used.