3.4 Browsing at Code Level

3.4.1 Abstract Presentation

When a fragment is shown in the code viewer, i.abstract presentation; is used. Instead of showing the program in full detail, 3 dots (...) are shown for certain syntactic categories. In the presentation of BETA programs these syntactic categories are Descriptor, Attributes and Imperatives.

These 3 dots are called a contraction. By clicking the Definition command of the toolbar (or double-clicking) when a contraction is selected the next level of detail is shown. E.g. when double-clicking on the 3 dots belonging to insertSubset in Fig. 4, the result will be:

Figure 6

[19kb 731x566 GIF]

Abstract presentation can be used to browse around in the program or to produce documentation. By means of the commands in the View menu or by double-clicking an appropriate abstraction level can be chosen. This presentation can then be written on a text file by means of the Save Abstract... command in the Group menu.

3.4.2 Semantic Links

This facility is only relevant for BETA programs. If the program has been checked it is possible to browse around in the semantic structure of the program. If, for example, a name application is selected in the code viewer, the corresponding name definition can be found by clicking the Definition command of the toolbar (or double-clicking).

If the definition is in another fragment, a code viewer is opened on that fragment. Fig. 7 is the result of double-clicking on 'set' in the first line of the code viewer in Fig. 6.

Figure 7

[18kb 731x566 GIF]

If the program has not been checked, no semantic links are available. Or if the program has been modified, the semantic links may become inconsistent and the program then has to be re-checked. If this command is used and the program needs to be re-checked and a dialog box, that offers re-checking, is popped up.

3.4.3 Comments

In order to compress information in the windows, comments are not shown in the code viewer window, but instead a so-called comment mark (*) is shown. By clicking the Definition command of the toolbar (or double-clicking) on such a comment mark, the comment mark is expanded and the whole comment is shown. Fig. 8 is the result of double-clicking on the comment mark after multiSet in Fig. 7:

Figure 8

[19kb 731x566 GIF]

Likewise the expanded comment can be collapsed to a comment mark again by double-clicking on it.

3.4.4 Fragment and SLOT Links

Follow link to fragment form

Given a SLOT definition, the link to the binding of the definition (i.e. a fragment form with the same name and type) can be followed.

Figure 9

[18kb 731x566 GIF]

This is done by selecting the SLOT definition in a code viewer and clicking the Definition command of the toolbar (or double-clicking). The editor will now search for a fragment form with the same name in the BODY and MDBODY hierarchy of the group that the current fragment is part of. Doing this in the example above will result in the fragment shown in Fig. 11. If Shift-double-click is used a separate code viewer window is shown.

Figure 10

[18kb 731x566 GIF]

Notice that during an editing session the fragment form may not be found since the program may be incomplete. Another restriction is that binding of Attributes SLOTs only can be found in this way if they are bound in the BODY and MDBODY hierarchy. If not, there is no automatic way of finding the bindings.

Follow link to SLOT definition

Given a fragment form, the link (possibly dangling) to the SLOT definition with the same name can be followed. This can be done by selecting a fragment form and using To SLOT command in the toolbar. The editor searches after a SLOT definition along the ORIGIN chain until it finds it or reaches the top, i.e. betaenv.

3.4.5 Searching

By means of the Find command in the Edit menu it is possible to search for a substring of a lexem, i.e. a name definition, a name application or a string in a codeviewer.

It is also possible to search in

An especiallly useful facility is the browser of search hits, that collects all the search hits for easy overview and access.

In the following two examples of advanced search will be demonstrated. First we will search for a text in a fragment group and then we will search for a all applications of a certain name.

An example of searching in a fragment group will now be shown. We want to find all occurrences of the text 'put' in 'basiclib/betaenv'. First we open 'basiclib/betaenv' in mjolner. When using the Find command the search window pops up:

Figure 11

[5kb 416x250 GIF]

If we enter 'put' and click on the 'Browse hits' button the current fragment group i.e. 'betaenv' will be searched for occurrences of the text 'put'. I.e. all lexems (name declarations, name applications and strings) will be searched. The search hits are then presented in the search hit browser:

Figure 12

[7kb 418x346 GIF]

This search hit browser can be used to select some of the search hits. The Return key can be used to browse quickly through the search hits. An example of a selected search hit:

Figure 13

[19kb 731x566 GIF]

An example of searching for all applications of a certain name in a project will now be shown. If the current selection in the source browser is a name declaration or a name applicatin the Find command will provide the possibility of searching for applications of that name declaration. In this case we want to search not only in a file (fragment group) but in the whole 'containers' directory. We want to find all occurrences of the name 'element' as declared in the 'containers/container' file. If we select the 'element' declaration in 'containers/container' and activate the Find command, the Search window will appear as:

Figure 14

[6kb 416x250 GIF]

We have changed the search area to be the current project. In this case the current project is the 'containers' directory. Pressing the 'Show all hits' button the 'Search hit browser' will appear as:

Figure 15

[7kb 418x346 GIF]

An example of a selected search hit:

Figure 16

[20kb 731x566 GIF]

It is also possible to search for a text string or all applications of a name in the whole dependency graph. See Dependency Graph - Domain and Extent Projects for how to select the dependency graph for a fragment group. For a given fragment group, select the Extent of the dependency graph as project in the Project list pane and search in 'Current Project'.


Mjolner Integrated Development Tool - Tutorial
© 1991-2004 Mjølner Informatics
[Modified: Monday March 11th 2002 at 16:16]