Up Top       Prev clean      Next pretty


SmallEiffel Tools: finder

Syntax

finder Class

Finder tells you which file will be loaded when SmallEiffel searches for an Eiffel Class.

When an Eiffel file is found for the specified class, finder prints the full path name on standard output.

The exit status is set to GENERAL.exit_success_code only when an existing file is found (thus allowing usage of command finder in shell scripts).

To see the loading path used by SmallEiffel, you can type the finder command using a bad (nonexistent) class name. The default loading path may be updated (see the READ_ME file of the sys directory).

With no argument, finder prints a help message.

Search algorithm

The algorithm used by SmallEiffel to search for an Eiffel source file is in two main parts:
  1. SmallEiffel looks all along the load path using the class name in lower case as the file to search for. If necessary, the Eiffel suffix (".e") is added automatically. SmallEiffel only considers suffixed files. The first file encountered along the load path is returned. There is no provision for handling duplicate class names.

    An Eiffel class file is always supposed to have the same name as the class whose definition it contains.

  2. The second step is taken only when the first step has failed to find a file. SmallEiffel searches for a file named rename.se in each directory of the load path.

    The file rename.se allows the user to put in file foo the class bar for example. This renaming facility has been added especially for DOS (where file names are limited to 8.3 characters), but can be used in any implementation.

    Each line of a rename.se file is a directive containing two names, first the full name of the class and then the short filename to use. A renaming directive is only effective in the directory where the rename.se file is located.

    The file /usr/lib/SmallEiffel/misc/rename.se is an example of a rename.se file which would need to be put in lib_std/ for use with DOS.

    In view of the algorithm that SmallEiffel uses to find a class file, it is better not to use the renaming facilities if you wish to speed up class loading.

  3. Finally, when the previous steps have found nothing, SmallEiffel looks along the loading path using the class name in upper case as the basename. If necessary, the Eiffel suffix (".e") is added automatically.

    Please note that the overhead to find an upper case file name is not negligible and that a lower case file name may mask one with an upper case name.

Changing the default load path

To change the default load path, you need to add a special file called loadpath.se in the directory in which you type any SmallEiffel command (compile, finder, pretty, ...). Each line of the file loadpath.se must be an existing directory path.

All the directories named in loadpath.se are prepended to the default load path.



Up Top       Prev clean      Next pretty



This page was last changed by Oliver Elphick on 3rd August 1997.