Some projects might want to use their own special-purpose tools for which a global installation is not convenient or not appropriate. In such a case, the project's description file can explicitly demand the tool to be registered temporarily. This is the purpose of the special tool class tool. Example:
Library
structure Foo
is
bar-tool.cm : tool
foo.b : bar
Here, the member whose class is tool (i.e, bar-tool.cm) must be the CM description file of the tool's implementation. The difference to class cm is that the so-specified library does not become part of the current project but is loaded and linked immediately via CM.load_plugin, causing one or more new classes and their classifiers to be registered.
If we assume that loading bar-tool.cm causes a class bar to be registered with its associated rule (e.g., by invoking Tools.registerStdShellCmdTool), the class name bar will be available for all subsequent members of the current description file. Likewise, classifiers (e.g., filename suffixes) registered by bar-tool.cm will also be available.
The effect of registering classes and classifiers using class tool lasts until the end of the current description file and is restricted to that file. This means that other description files that also want to use class bar will have to have their own tool entry.11
Local tool classes and suffixes temporarily override any equally-named global classes or suffixes, respectively.