Table of Contents Previous Chapter 23 The SDL Editor

23 The SDL Editor

Grammar Help Window

The Grammar Help window is an auxiliary window that provides features that assist the user in editing SDL textual elements that are correct according to the SDL grammar.

The Grammar Help window is a multi-functionality window; it can also provide signal dictionary capabilities. These functions are further described in "Signal Dictionary Window" on page 1250. What functionality is provided depends on the options defined on the Select menu.

Each SDL Editor window has its associated Grammar Help window. The window looks like this:

Figure 315 : The Grammar Help Window. 
-----
(fig)  
       
-----
In the next sections, we will describe the components that comprise the Grammar Help Window:

The Menu Bar

The menu bar contains the following menus:

The File menu

Figure 316 : The Grammar Help File Menu. 
-----
(fig)  
       
-----
The File menu contains menu choices that allow to access files that contain SDL Grammar Help templates. The available menu-choices are:

Load

This command selects the file with grammar help definitions to be loaded.

Following the command, a Standard File Selection Dialog is issued where the appropriate file can be located. See Figure 317.

Figure 317 : Load a Grammar Help File. 
-----
(fig)  
       
-----
Grammar template files normally have the file extension .tpl. With SDT, a standard template file, sdt.tpl, is enclosed. The SDL Editor attempts to locate a .tpl file each time the Load command is invoked.

Any template definitions that are already loaded will be replaced by the contents of the selected grammar help definition file.

Merge

Merge extends the current loaded grammar definitions with the contents of a grammar help definition file.

This feature issues a Standard File Selection Dialog, similar to the one issued after the Load command, for adding a set of custom templates to the basic set provided in SDT.

Any template definitions that are already loaded will be extended with the contents of the merged template definition file.

Close

This menu choice closes the Grammar Help window.

The Edit menu

Figure 318 : The Grammar Help Edit Menu. 
-----
(fig)  
       
-----
The Edit menu provides two utility functions that can be used when copying text from the Grammar window to the SDL Editor's text window. If it is decided that the copied text is not required, an Undo function is available.

The available menu choices are:

Undo

With the Insert, Replace and double-clicking on an item in Name Field, text can be placed into an SDL object.

The Undo command allows to revert those changes.

Insert

This menu choice copies the entire contents of the Grammar Field and copies it into the Text Window at the current I-beam cursor location. Selected text will thus be overwritten.

---------------------------------------------------------------------
Note:  double-clicking                                                 
A shortcut for Insert is to double-click on the template name in the   
name field.                                                            
---------------------------------------------------------------------

Replace

This command replaces the contents of the text window with the contents of the grammar field. This function is a shortcut for the following sequence: "Select All, Clear and Insert".

The Select menu

Figure 319 : The Grammar Help Select Menu 
-----
(fig)  
       
-----
The commands on the Select menu define what functionality the Grammar Help window should provide. The following options are supported:

Each of these functions can be enabled or disabled individually. In addition, an Options menu choice allows to enable and disable multiple options in one command only.

The options that are currently activated are indicated by an asterisk (`*') preceding the corresponding menu choice. When invoking the Grammar Help, the Grammar option is enabled, while the remaining options are disabled.

Grammar

This toggle option, when set to on, will enable the SDL Grammar Help function. Turning the option off disables the function.

Up

This toggle option enables the Up option provided in the Signal Dictionary Window. See page 1253.

This

See page 1253 for a description of this toggle button.

Down

See page 1253.

All

See page 1253.

MSC

See page 1253.

External

See page 1254.

Options

See page 1254.

The Tools menu

Figure 320 : The Grammar Help Tools Menu 
-----
(fig)  
       
-----
The commands on the Tools menu provide various convenience functions:

Show Editor

When operated, pops-up the parent SDL Editor window.

Show Definition

The functionality is described in the section titled "Signal Dictionary Window" on page 1250.

The Symbol Label

The symbol label field is a non-editable text field that displays the type of symbol that is currently selected in the SDL Editor.

Figure 321 : The Symbol Field. 
-----
(fig)  
       
-----
The symbol label reads "No single symbol selected" in the following circumstances:

The Name Field

The name field consists of a scrollable list that contains a list of names of templates associated with the currently selected symbol.

Figure 322 : The Name Field. 
-----
(fig)  
       
-----
The list is updated automatically each time an object in the SDL Editor's drawing area is selected, to reflect the templates that are currently available for that object. By default, the first item in the list is selected.

The name field is empty in the following circumstances:

When selecting an item in the list, the corresponding template definition appears in the Grammar Field, allowing to check its contents before inserting it into the text window (see "Insert" and "Replace" on page 1240).

The Grammar Field

The grammar field is a scrollable field from which text can be copied. Its contents are updated to reflect the definition for the currently selected item in the Name Field.

The grammar field is empty if no item is selected in the Name Field (or if the name field is empty)

Figure 323 : The Grammar Field. 
-----
(fig)  
       
-----
In order to copy and paste text from the template definition field to the text window, the following options are available:

The Grammar Help File

This section is a reference for the format of the files that contain SDL Grammar Help definitions.

General

The template definition file format is line-oriented, and uses two separator characters chosen so as to not interfere with the possible contents of templates appearing in the file.

-------------------------------------------------------------------
Note:                                                                
The characters @ and $ are separator characters. They are reserved   
for that purpose.                                                    
-------------------------------------------------------------------

Format

The template definition file is divided into sections defining templates for a particular symbol type. A section begins with a Grammar Help Declaration part and ends with a Grammar Help Definition part.

Grammar Help Declaration

The declaration of a new section has the following syntax:

@<editortype>@<symboltype>[@[<symbolcomment>]]
editortype, symboltype and symbolcomment are to be replaced with the adequate text strings.

Comments in Grammar Help files is also permissible.

Example 29 : The Declaration of a Channel Template  
@SDL@CHANNEL@Channel symbol
The declaration is to be interpreted as:
   

editortype

editortype may currently be of one of the keywords:

symboltype

symboltype is defined per editor and the allowed names are the following:

ADDITIONAL_HEADING_BLOCK
ADDITIONAL_HEADING_BLOCK_TYPE
ADDITIONAL_HEADING_PROCEDURE
ADDITIONAL_HEADING_PROCESS
ADDITIONAL_HEADING_PROCESS_TYPE
ADDITIONAL_HEADING_P_AS_SERVICE
ADDITIONAL_HEADING_SERVICE
ADDITIONAL_HEADING_SERVICE_TYPE
ADDITIONAL_HEADING_SYSTEM
ADDITIONAL_HEADING_SYSTEM_TYPE
BLOCKSUBSTRUCTURE
BLOCK_REF
BLOCK_TYPE_REF
CALL
CHANNEL
CHANNELSUBSTRUCTURE
CONNECTION_POINT
CONNECTOR
CONTINUOUS_SIGNAL
CREATE
DECISION
ENABLING_CONDITION
GATE
INPUT
KERNEL_HEADING
KERNEL_HEADING_BLOCK
KERNEL_HEADING_BLOCK_TYPE
KERNEL_HEADING_PROCEDURE
KERNEL_HEADING_PROCESS
KERNEL_HEADING_PROCESS_TYPE
KERNEL_HEADING_SERVICE
KERNEL_HEADING_SERVICE_TYPE
KERNEL_HEADING_SYSTEM
KERNEL_HEADING_SYSTEM_TYPE
MACROCALL
OPERATOR_REF
OUTPUT
PACKAGE_REF
PAGENUMBER
PRIORITY_INPUT
PRIORITY_OUTPUT
PROCEDURE_REF
PROCEDURE_START
PROCESS_REF
PROCESS_TYPE_REF
RETURN
SAVE
SERVICE_REF
SERVICE_TYPE_REF
SIGNALROUTE
START
STATE
STOP
TASK
TEXTSYMBOL_BLOCK_SUBSTR
TEXTSYMBOL_MACRO
TEXTSYMBOL_PROCEDURE
TEXTSYMBOL_PROCESS
TEXTSYMBOL_P_AS_SERVICE
TEXTSYMBOL_SERVICE
TEXTSYMBOL_SYSTEM
TRANSITION_OPTION
---------------------------------------------------------------------
Note:                                                                  
If the same section appears more than once, all template definitions   
under those sections will be available.                                
---------------------------------------------------------------------

symbolcomment

symbolcomment is an optional feature, which allows specification of a text to be associated with each symboltype. The text for a specific symboltype appears in the symbol type field of the Grammar Help window whenever a symbol of that type is selected in the editor.

Comments

Also, comments may appear in the file using the following syntax:

@COMMENT@<commenttext>
------------------------------------------------------------------
Note:                                                               
Such a comment signals the end of the previous section and should   
only be used before another section.                                
------------------------------------------------------------------

Grammar Help Definition

A SDL grammar template has significance only if it is located after a valid declaration. The template will be added to the list of templates for that section.

A template definition is started with a line beginning with a $ sign and continues until either:

Syntax

The syntax of a template definition is simply:

$<templatename>'Newline'
<multiple lines constituting the template definition>
Example 30 : The Definition of a Channel Example  
$GRAMMAR
Z100: 2.5.1 (p.45)
Z100: 2.5.5 (p.50) Signal list
<ChannelName> ::= <Name>
<SignalList> ::=
  ( <SignalName> / '(' <SignalListName> ')' )",'
$SignalList
SignalName, SignalName
$SignalList2
SignalName, SignalName, (SignalListName)
  
--------------------------------------------------------------------
Note:                                                                 
Neither leading nor trailing newlines will be added to the template   
definition. These can be added to the template simply by adding a     
leading empty line and/or a trailing empty line in the template defi  
nition.                                                               
--------------------------------------------------------------------

File Handling

When a Grammar Help window is opened, the SDL Editor will try to locate a SDL grammar help file and to load it, if found. The search order is as follows:

  1. The SDL Editor starts by fetching the preference value
    Editor*TemplateFile.
  2. If no value is specified for the preference parameter, it will use the default file name sdt.tpl.
  3. The directories where the SDL Editor will search for the file are:
  4. If no file can be located, either with a specified name or the default name, the user gets the option of searching manually (i.e. from a Standard File Selection Dialog, see Figure 317 on page 1239) for files with the standard suffix .tpl.
  5. If the user declines by clicking Cancel, the Grammar Help window will appear without contents. The user can now locate a grammar help file by choosing Load (or Merge, which will have the same effect in this case).

Signal Dictionary Window

The Signal Dictionary window is an auxiliary window that provides features that assist the user in gaining access to all signals that are defined in the diagrams that are currently hold by the Organizer, in the Diagram Structure Area and (see "Presentation Areas" on page 1059 in The SDT Organizer chapter). The signal dictionary window has also the ability to import an external signal dictionary and import Message Sequence Charts (each MSC message will be mapped to an SDL signal).

-----------------------------------------------------------------
Note:                                                              
The signal dictionary function requires a file with grammar help   
templates (sdt.tpl) in order to function properly. See "The Gram   
mar Help File" on page 1244.                                       
-----------------------------------------------------------------
Each SDL Editor window has its associated Signal Dictionary window. The window looks like this:

Figure 324 : The Signal Dictionary Window. 
-----
(fig)  
       
-----

Signal Dictionary Update

The signal dictionary function stores information about signals in an information server. The information server updates its contents each time an SDL diagram is saved. When the diagram is saved by the SDL Editor, the SDT Analyser is invoked and produces a mirrored image which is an SDL-PR description of the SDL-GR diagram. That information is then loaded into the information server which serves the SDL Editor with information upon request. All of this is done automatically without the user having to bother about performing any actions.

---------------------------------------------------------------------
Note:                                                                  
In order to extract signal information from an diagram, SDT re         
quires the diagram to be syntactically correct in the sense that SDL-  
PR code can be generated from the SDL-GR diagram without en            
countering errors.                                                     
---------------------------------------------------------------------

The Menu Bar

The File menu

The functionality which is available on this menu is identical to the one described under the Grammar Help Window section. These commands are useful only when requesting Grammar Help support. See "The File menu" on page 1238 for more information.

The Edit menu

The Edit menu provides two utility functions that can be used when copying text from the Signal Dictionary window to the SDL Editor's text window. If it is decided that the copied text is not required, an Undo function is available.

The available menu choices are:

Undo

With the Insert, Replace and double-clicking on an item in the name field, text can be placed into an SDL object.

The Undo command allows to revert those changes.

Insert

This menu choice copies the entire contents of the Signal Definition and copies it into the Text Window at the current I-beam cursor location. Selected text will thus be overwritten.

---------------------------------------------------------------------
Note:  double-clicking                                                 
A shortcut for Insert is to double-click on the template name in the   
name field.                                                            
---------------------------------------------------------------------

Replace

This command replaces the contents of the Text Window with the contents of the Signal Definition. This function is a shortcut for the following sequence: "Select All and Insert".

The Select menu

The Select menu looks like this:

Figure 325 : The Select Menu. 
-----
(fig)  
       
-----
The Select menu provides functions that define the functionality that the Signal Dictionary should provide. These functions restrict or extend the scope of search for signals. Also, the Signal Dictionary functionality can be extended to provide access to MSC Messages and an external signal library. The available options are:

Each of these options can be individually turned on and off. The options that are currently turned on are indicated by an asterisk (`*') preceding the menu choice. Invoking a menu choice toggles the corresponding option.

Grammar

This options controls whether the Signal Dictionary window should also provide SDL Grammar Help or not. See section "Grammar Help Window" on page 1237 for a description of this function.

Up

This option displays the SDL signals that are available when looking one level up in the SDL hierarchy.

This

Turning This on lists all signals that used in the current diagram, i.e. this diagram.

Down

This option displays the SDL signals that are available when looking one level down in the SDL hierarchy.

All

This option displays all signals that are defined and are visible according to the SDL scope rules, starting from the Root diagram in the Organizer Diagram Structure Area.

MSC

This option displays all messages that are available in the Message Sequence Charts that are submitted as input to the Signal Dictionary function. Each message is mapped to an SDL signal, with its parameters mapped to SDL signal parameters.

An MSC is submitted as input to the Signal Dictionary if contained in the Organizer's Associated Documents area and if associated to an SDL diagram that is present in the Organizer's Diagram Structure.

External

This option displays all signals that have been imported from an external signal dictionary. Importing external signals is done through The SDT Public Interface interface. See "Load Definition File" on page 2562.

Options

Issues a dialog where all options can be individually turned on and off (see "Select menu" on page 1252 for a description of the individual options).

The default options for the Signal Dictionary are Up and Down.

Figure 326 : The Select Options. 
-----
(fig)  
       
-----

The Tools menu

The Tools menu has two menu choices:

Show Editor

The functionality is described in the section titled "Grammar Help Window" on page 1237.

Show Definition

An SDL Editor comes up showing the definition of the item which is selected in the signal list.

The Symbol Label

The symbol label field is a non-editable text field that displays the type of object that is currently selected in the SDL Editor.

Figure 327 : The Symbol Label. 
-----
(fig)  
       
-----
The symbol label reads "No single symbol selected" in the following circumstances:

The Signal List

The signal list is a selectable list where all occurrences of SDL that are found according to the current selection criterias are listed.

Figure 328 : The Signal List. 
-----
(fig)  
       
-----
The signal list is empty when:

The following objects are recognized as carrying signal information:

--------------------------------------------------
Object                       Usage                  
--------------------------------------------------
channel line                 Reference to signal    
channel name                                        
signal list in channel                              
connection point             Reference to signal    
gate                         Reference to signal    
gate name                                           
signal list in gate                                 
input                        Reference to signal    
output                       Reference to signal    
priority input               Reference to signal    
save                         Reference to signal    
signal route line            Reference to signal    
signal route name                                   
signal list in signal route                         
text                         Declaration of signal  
--------------------------------------------------

Signal List Notation and Syntax

Each line in the signal list follows a notation that informs about the various diagrams and symbols where signals are used and also about the context.

The notation that is adopted is an SDL-like graphical notation. It is also possible to select a textual notation if the font face used in the graphical notation is not supported by the computer.

Selecting the textual notation is done by setting the environment variable SDLENOGRAPHICS before SDT is started.

Each item in the signal list is one of the following:

Separator

The signal list is divided into several sections. The top of each section is clearly marked with a separator, having the appearance of a thick line (graphical notation) or a number of hashes ("###...###") preceding and following a text that identifies the section.

Figure 329 : A Signal List Separator. 
-----
(fig)  
       
-----
Each of these sections corresponds to an option that is enabled in the Select menu (see page 1241). Their meaning and order of appearance in the signal list is as follows:

Diagram Identifier

Diagrams are graphically identified with an SDL Reference symbol in the left margin which identifies the diagram type, followed by the diagram name.

Figure 330 : Diagram Type Symbols. 
-----
(fig)  
       
-----
The textual notation reads <diagramtype diagramname>

All information that is listed after a diagram identifier is related to that diagram, until the next diagram identifier or separator.

Gate

Gates are graphically identified by an arrow pointing into or out from the frame symbol, followed by the name of the gate.

Figure 331 : Gate Symbols. 
-----
(fig)  
       
-----
The textual notation reads:

GA <Gatename>:<In>|<Out>|<In:Out>

Signals on a Gate

The lines that appear after the gate and before the next gate, channel, signal route or diagram identifier consist of all signals or signal lists that are conveyed on the gate, the signals in to the diagram appearing first and the signals sent from the diagram appearing last.

Signals are listed according to the order of appearance in the respective signal lists.

Selecting a gate in the list displays one or two lines in the Signal Definition list; in the case of a bidirectional gate, the first line holds the signals sent to the diagram while the second line holds the signals sent from the diagram.

Channel

Channels are graphically identified by an arrow between the frame and a block symbol (in the case of a channel to/from the environment), alternatively with an arrow between two block symbols (an internal channel).

Figure 332 : Channel Symbols. 
-----
(fig)  
       
-----
The textual notation of a channel is:

CH <Channelname>:<In>|<Out>|<In:Out>|<Int>|<Int:Int>
Channels are present on package, system, block, block substructure and system type diagrams only.

The lines of information that follow a channel consist of the signals that are conveyed on it. The appearance is similar to listing signals on a gate. See "Signals on a Gate" on page 1259 for information about listing order.

Signal Route

Signal routes are graphically identified by an arrow between the frame and a process symbol (a channel to/from the environment), alternatively with an arrow between two process symbols (an internal signal route).

Figure 333 : Signal Route Symbols. 
-----
(fig)  
       
-----
The textual notation of a signal route looks like this:

SR <Signalroutename>:\
<In>|<Out]>|<In:Out>|<Int>|<Int:Int>
Signal routes are present on block and block type diagrams only.

The lines of information that follow a signal route consist of the signals that are conveyed on it. The appearance is similar to listing signals on a gate. See "Signals on a Gate" on page 1259 for information about listing order.

Signal and Signal List

Signals and signal lists can appear in the following contexts:

The notation that is adopted differs slightly depending on the context.

Signal Definitions

A signal definition appears following directly after the diagram identifier where the signal is declared. The signal is identified by its name and its location is indented to distinguish it from other items.

The indentation is filled with blank space (see Figure 334).

Figure 334 : Signal Definitions. 
-----
(fig)  
       
-----
-----------------------------------------------------------------------
Note:                                                                    
Each signal appears only once within a diagram. If a signal is refer     
enced at least once within the diagram, it is not listed in the signal   
definitions section for that diagram, only references are listed.        
-----------------------------------------------------------------------

Signal References on Lines

A signal reference on a line uses a similar notation as for Signal Definitions (see above). The indentation consist of an arrow that identifies the direction of the signals (see Figure 335).

Figure 335 : Signal References on a Line. 
-----
(fig)  
       
-----

Signal References in Flow Diagrams

In flow diagrams, signal references are listed along with the context the signal is used. This is indicated by the following attributes (multiple attributes can be set):

The graphical notation for showing these attribute uses SDL input and SDL output symbols, and a question mark for showing that the signal is not declared. (See Figure 336).

Figure 336 : Signal Symbols. 
-----
(fig)  
       
-----
The textual notation uses the characters:

[I][O][?]
These characters appear at fixed positions. Where an attribute is not set, this is indicated with a hyphen (`-'). See Figure 337.

Figure 337 : An Undeclared Signal which is Input and Output. 
-----
(fig)  
       
-----

Timer

A timer is handled identically as a Signal and Signal List. To indicate that the item is a timer, the graphical MSC symbol for timer is used. Alternatively, a `T' appears as the rightmost attribute.

Figure 338 : Timer Symbol. 
-----
(fig)  
       
-----
Timers can appear in the following contexts:

Error Notification

If SDT fails in extracting signal information from some SDL diagrams, this is indicated graphically in the signal list by a "bug" symbol located to the right of the diagram names. In such cases, the information contained in that diagram is not available to the signal dictionary function.

Figure 339 : Errors were Detected when Extracting Signals.Figure legend: SDT 
		failedin extracting signal information from the process type diagrams Door, DoorLock 
		andthe block type diagram Doors (one level down in the SDL hierarchy) 
-----
(fig)  
       
       
       
       
-----
These error situations are either caused by:

The error reports are listed in the Organizer Log Window. See also "Signal Dictionary Update" on page 1250.

In the textual notation, this is indicated by an error message following the diagram name:

<diagramtype diagramname> :GrPrError
Figure 340 : Errors were Detected when Extracting Signals.Figure legend: The 
		currentdiagram (This diagram) is process type Door. SDT could not convert this 
		diagramto SDL-PR. 
-----
(fig)  
       
       
       
-----

The Signal Definition

The signal definition contains the following information:

SignalListName = Signal1, Signal2,...,SignalN

Keyboard Accelerators

In addition to the standard keyboard accelerators, described in "Accelerators and Mnemonics" on page 1048, the Grammar Help and Signal Dictionary window features the following:

----------------------------------------------------------------
Accelerator  Command / functionality                              
----------------------------------------------------------------
g            Select the Grammar section if the option is          
             enabled and bring the separator into view            
u            Similar to g but applies on Up.                      
t            Similar to g but applies on This.                    
d            Similar to g but applies on Down.                    
a            Similar to g but applies on All.                     
m            Similar to g but applies on MSC.                     
e            Similar to g but applies on External.                
ctrl-g       Toggles the Grammar option on / off (see page        
             1241). When the option is enabled, brings the        
             Grammar separator into view and selects it.          
ctrl-u       Same as ctrl-g, but applies on the Up option         
             (see page 1253).                                     
ctrl-t       Same as ctrl-g, but applies on the This option       
             (see page 1253).                                     
ctrl-d       Same as ctrl-g, but applies on the Down option       
             (see page 1253).                                     
ctrl-a       Same as ctrl-g, but applies on the All option        
             (see page 1253).                                     
ctrl-m       Same as ctrl-g, but applies on the MSC option        
             (see page 1253).                                     
ctrl-e       Same as ctrl-g, but applies on the External          
             option (see page 1254).                              
ctrl-f       Finds the last occurrence of the first word in the   
             currently select object in the SDL Editor draw       
             ing area and selects it in the This section.         
             The first word is defined as the text string from    
             the start of the object's text and until either:     
             ·  a ` ` (space)                                     
             ·  a `,' (comma)                                     
             ·  a `(` (left parenthesis)                          
             ·  a <TAB>                                     
             ·  a `\n' (newline).                                 
----------------------------------------------------------------

Footnotes

(1)
The term "available" means defined and / or referenced.
(2)
Save of signal is also considered as input by the Signal Dictionary function.
(3)
A signal list is identified with its name within parentheses, such as(SignalListName)
 
Table of Contents Next Chapter