DevBrowser

DEFINITION DevBrowser;

	PROCEDURE ImportSymFile (f: Files.File; OUT s: Stores.Store);
	PROCEDURE ShowInterface (opts: ARRAY OF CHAR);
	PROCEDURE ImportCodeFile (f: Files.File; OUT s: Stores.Store);
	PROCEDURE ShowCodeFile;

END DevBrowser.


The browser shows the interface of a module or of an item in a module. It extract the necessary interface information out of the module's symbol file. A symbol file contains only minimal information, it doesn't contain comments nor does it retain information about the textual order in which a module's item have been defined (their display is sorted alphabetically). For records, the browser only shows newly introduced fields and procedures (or procedures redefined with covariant function results). You can follow the record type hiearchy to the base type by applying the browser command again on the base type name in the record declaration.
The browser is also able to decode a code file and to display important information about the code file. In particular, the imported items (types, procedures, etc.) are shown to indicate on which features provided by other modules a given module depends (sometimes called the "required interface" of a module, in contrast to the "provided interface", i.e., the exported functionality of the module).
Both browser functions are available also as importers (-> Converters), which can be installed with the following statements for example in StdConfig.Startup:

	Converters.Register("DevBrowser.ImportSymFile", "", "TextViews.View", "OSF", {});
	Converters.Register("DevBrowser.ImportCodeFile", "", "TextViews.View", "OCF", {});

Possible menu:

MENU
	"&Interface"	""	"DevBrowser.ShowInterface('')"	"TextCmds.SelectionGuard"
	"&Flat Interface"	""	"DevBrowser.ShowInterface('!')"	"TextCmds.SelectionGuard"
	"Import Interface"	""	"DevBrowser.ShowCodeFile"	"TextCmds.SelectionGuard"
END


PROCEDURE ImportSymFile (f: Files.File; OUT s: Stores.Store)
This procedure is installed upon startup of BlackBox as an importer for symbol files (-> Converters). The importer converts the symbol file into a textual browser output.

PROCEDURE ShowInterface (opts: ARRAY OF CHAR)
Guard: TextCmds.SelectionGuard
If a module name is selected, this command shows the complete definition of the module. If a qualident is selected, only the definition of the corresponding item is shown.
opts = "" creates an output which only shows the newly introduced extensions in the case of record types.
opts = "!" creates an output which also shows the inherited base type features of record types ("flat interface").
opts = "+" creates an output which shows some additional low-level information useful for a compiler developer (not further documented).
opts = "/" creates an output which is formatted in a special way. Inofficially known as the "Dijkstra option".
opts = "&" creates an output which also shows hooks in the interface.
opts = "@" creates an output using the settings from the interface browser dialog.
opts = "c" creates an output which shows only the items being usable in client modules.
opts = "e" creates an output which shows only the items being extensible.
Several options may be combined.

PROCEDURE ImportCodeFile (f: Files.File; OUT s: Stores.Store)
This procedure is installed upon startup of BlackBox as an importer for code files (-> Converters). The importer converts the code file into a textual browser output in the same way as the command ShowCodeFile.

PROCEDURE ShowCodeFile
Guard: TextCmds.SelectionGuard
If a module name is selected, this command opens a text view in browser mode that shows information about the code file of the compiled module. This includes the code file's header information and the generated code both in hex form and in the form of symbolic instruction codes. In order to simplify reading of the generated code it is possible to merge the code of a procedure with its source code, if available, by clicking on the link at the beginning of a procedure. In the generated detail view, the source code pieces are links that navigate to the corresponding source code.
Note that absolute addresses in the code are resolved only at load time and are simply displayed as generated by the compiler. The fixup-chains used by the loader for resolving absolute addresses and the meta-information about program entities are (currently) not included in the output.