The browser window appears like:
Figure 1: Browser window
- The upper left pane is called the Projects pane, it contains a tree view of projects. A project can contain a list of folders or files.
- The lower left pane contains a list fragment forms of the fragment group selected in the Projects pane. It is called a fragment group viewer/editor or just group viewer/editor.
- The right-hand side pane displays the BETA code of the fragment form selected in the group viewer. It is called the code viewer/editor
[1].
This code viewer will be seen in many different windows and the
functionalities of the viewer is described later.
Below the code viewer/editor pane there are two info panes. Location displays path of the selected fragment group in the group list pane - or in the project list pane, if nothing is selected in the group list pane.
Info displays information, such as "no fragments in the selected project'" or what the source browser currently is doing.
Browsing can be done at basically 3 levels: the project level, the group level or at the code level.
The following sections describe the browser window menus offered by the source browser. The other subtools supply additional menus.
- Makes it possible to create a new fragment group with one fragment form. You can choose between the currently available grammars. A dialog pops up.
- Creates a minimal BETA program. You are prompted for the name and location of the new fragment group.
- Creates a minimal BETA library. You are prompted for the name and location of the new fragment group.
- Opens a standard file dialog, and you can now select (a) a project-file (must have extension .pjt), (b) a directory, and (c) a .bet/.ast/.astL file. You will then in the project list pane find a project of the corresponding type A, B, or C (see Project Definitions). All other selections will be ignored.
- If your program crashes, while you are not running it under the
the debugger in the Mjolner Tool, the dump file can be opened and the different activation levels can be browsed.
The source code browser subwindow will for each activation level
highlight the statement, that was executed at dump time.
- If changes have been made to the fragment group, it is saved. A backup of the old text file (if existent) is taken on e.g. foo.bet~ and a new text file is generated e.g. foo.bet.
- Saves the current fragment group under a another name. You are prompted for the name and location of the new fragment group. The editor continues with the new fragment group.
- Calls Save on all open group editors.
- Saves the current fragment group on textual form at the current abstraction level. You are prompted for the name and location of the text file.
- Recovers to the latest auto save file (.ast# or .astL# on PC). This command is enabled if the .ast# exists and is newer than the .ast file.
- Reverts any changes (since the latest save) made to the current fragment group.
- Print the contents of the codeviewer/editor.
- If checked, it is not possible to modify the fragment group. Group write protection is set automatically if there is no write permission on the fragment group file or if the global write protection is set.
- If checked the whole editor is in read-only mode.
- A preferences window pops up.
- Enables you to save the current contents of the project list pane on a project-file $USER/.ymer.pjt. This project is then automatically loaded next time you invoke a source browser application - in this way you can save your configuration. It also saves/creates another file, $USER/.ymer.rc containing information on the locations of the BETA compiler, and other tools in the Tools menu (only in the stand-alone source browser application Ymer).
- Enables you to clear the project list pane and reset it to the last settings (or the default settings, if no $USER/.ymer.[pjt|rc] files are found.
- Closes all browser windows, and terminates the application or . In both Close and Quit source browser applications will examine if any files have been changed, and prompt for whether these files should be saved before closing/quitting.
One important quality of Sif is the possibility to present documents at different abstraction levels. Abstract presentation gives a good overview over a document by suppressing irrelevant details. Abstract presentation is provided by means of contractions. A contraction is a special presentation of an sub-AST, where only the root is presented. See also Abstract Presentation in Source Browser Tutorial. If the construct has an associated comment, the comment marker is included in the contraction. Browsing in the document can be done by detailing, i.e. opening the contractions selectively. This is done either by the command Detail or by double-clicking. Abstract presentation can be used to produce documentation such as a interface specifications by saving the document on textual form at different abstraction levels, using the Save Abstract... command.
- Contracts the current selection, i.e. presents the current selection as a contraction instead of the full "text".
- Traverses the current selection recursively and contracts those constructs that have a certain syntactic category. This command has only effect if abstraction levels have been specified in the grammar for the particular language. The grammar may specify a list of syntactic categories that automatically shall be contracted. For BETA the syntactic categories are Descriptor, Attributes, and Imperatives, when opening the files in the viewer/editor. For more information on specifying abstraction levels see [MIA 91-14].
- Like Abstract Recursively but the current selection is reestablished after the Abstract Recursively command, i.e. the path from the root to the current selection is detailed. This command is useful if you want to see the context of the current selection.
- If the current selection is a contraction, this operation opens the contraction, i.e. presents the next level of text. A contraction can also be opened by double-clicking on it. If the current selection is not a contraction any visible contraction in the current selection will be opened.
- Recursively details the contractions in the current selection.
- During the checking phase a number of semantic links are inserted in the AST. These links are available to the user. Using this command on a name application the semantic link will be followed and the current selection is changed to the appropriate node in the current or another fragment form. Double-click can also be used to activate this command.
- Given a SLOT definition, a binding of the definition (i.e. a fragment form with the same name and type) can be searched for. This is done by selecting the SLOT definition and using this command. The editor will now search for a fragment form with the same name in the BODY and MDBODY hierarchy of the group that this fragment is part of. Notice that the binding of Attributes SLOTs may only be found in this way if they are bound in the BODY and MDBODY hierarchy. A shortcut or double-click can also be used to activate this command.
- The editor searches after a SLOT definition with the same name as the current fragment form along the ORIGIN chain until it finds it or reaches the top, i.e. betaenv.
- Changes the contents of the code viewer to the current selection, i.e. the root of the AST shown in the editor (the editor root) is changed to the sub-AST, that corresponds to the current selection.
- Extends the contents of the code viewer to show one level more of the structure, i.e. the editor root is changed to its father.
- Extends the contents of the code viewer to show the whole fragment form, i.e.
- the editor root is set to the whole AST of the fragment form.
- Rebuilds the textual presentation of the AST and reestablishes the current selection. This command can be used if the contents of the code viewer need to be refreshed.
- Only Win 95/NT. The font in the current code editor can be changed using this command.
- Adaptive prettyprinting can be turned on an off. Default is off.
- This command is useful for users of the metaprogramming system. It prints in the console window a dump of the sub-AST that corresponds to the current selection
If the destination fragment form is different from the source fragment form the destination fragment form is shown in the same code viewer or in a separate code viewer, depending on the code viewer of the source fragment form. If the code viewer of the source fragment form is
- part of the browser window, the contents of the code viewer window is changed
- a separate code viewer, the contents of the code viewer window is changed
- a subviewer, a new subviewer is opened
- part of a work space window, a new code viewer is inserted in the work space window.
When using the Pop-up Menu Button on an a construct that is not a nonterminal a popup menu, containing some of the most commonly used commands, is opened.
- Shortcut to History:Back
- Shortcut to History:Forward
- Shortcut to View:Follow Semantic Link
- Shortcut to View:Follow Semantic Link. The destination node is opened in a separate window.
- Shortcut to View:Follow Link to Fragment
- Shortcut to View:Follow Link to Fragment. The destination node is opened in a separate window.
- Shortcut to View:Follow Link to SLOT
- Shortcut to View:Follow Link to SLOT. The destination node is opened in a separate window.
- Shortcut to View:Open Separate Editor
- Shortcut to View:Open Subeditor
- Shortcut to Toolbar:Show UML Class Diagram
- Shortcut to Toolbar:Open GUI Editor
- Shortcut to Edit:Cut
- Shortcut to Edit:Copy
- Shortcut to Edit:Paste
- Shortcut to Edit:Paste Before
- Shortcut to Edit:Paste After
- Shortcut to Edit:Insert Before
- Shortcut to Edit:Insert After
- Shortcut to View:Reprettyprint
Back and Forward moves you along the path you have previously browsed.
Furthermore, this menu contains one entry for each fragment form, you have displayed in the code viewer. This is used for speedy access to previously visited fragment forms.
- Opens a workspace window (see later more on this).
- Opens a new browser window, identical to this one. This window is controlled by the same source browser application instance. Makes it possible to browse two different "places" at once.
- Opens a separate window just like the code viewer, displaying the currently selected fragment form in the group viewer.
- Will open a semantic errors viewer on the selected group, if there are any semantic errors in that group. See later for more information on the semantic errors editor.
- Will open a semantic errors editor on the selected group, if there are any semantic errors in that group. See later for more information on the semantic errors editor.
The rest of the menu contains one entry for each window opened by the source browser. Selecting one of these items will bring the window to the fron
In the code viewer, double-click can also used for browsing. Double-clicking on the current selection will perform different actions. If the current selection is
- a name application, the semantic link will be followed (if available). If the definition is located in another fragment form the contents of the code viewer will be changed to show that fragment form.
- a SLOT definition, the fragment link will be followed (if available) and the destination fragment form will be shown in the same code viewer.
- a comment mark (*), the full comment will be shown instead.
- an expanded comment (* ... *), the comment mark will be shown instead.
- a contraction (...), the contraction is opened, i.e. the next detail level is shown.
- anything else the current selection will be detailed, if it contains contractions (...)
Shift-double-click is used for browsing like double-click, except that separate windows are opened.
In the code viewer, shift double-click will do the same as double-click (except that the "result" will be presented in a separate window. Shift double-click will open different kind of separate windows depending on the current selection. If the current selection is:
- a name application, the semantic link will be followed (if available) and the destination fragment form will be shown in a separate code viewer
- a SLOT definition, the fragment link will be followed (if available) and the destination fragment form will be shown in a separate code viewer
- a comment, the comment will be shown in a separate window
- anything else a subviewer window with the current selection as its contents will be opened.
Besides the already mentioned information in the Info area, you will occasionally see status information to the right of the pane. This status information is shown as small boxes containing state information. There are three types of state information presently:
- '%' indicating that the current fragment group is locked (cannot be edited)
- '*' indicating that the current fragment group has been changed
- c' indicating that the current fragment group has been checked but a semantic checker (usually the BETA compiler), and that semantic information therefore is available for semantic browsing.
[1] The contents of the group viewer/editor can of course also
be considered as part of the BETA code, but this is actually
"code" written in the fragment lanuage
Mjolner Integrated Development Tool - Reference Manual |
© 1991-2004 Mjølner Informatics |
[Modified: Monday March 11th 2002 at 16:16]
|