Table of Contents Previous Chapter 31 The Analyzer

31 The Analyzer

The SDT Analyzer's primary task is to check SDL-92 diagrams with respect to syntactic and semantic rules. The Analyzer accepts both SDL-GR and SDL-PR as input, and has the ability to transform SDL-GR diagrams to SDL-PR files and vice-versa. This chapter is a reference to the Analyzer commands and to its limitations according to the Z.100 recommendation. For a guide to how to perform syntactic and semantic check on an SDL diagram structure, see chapter 6, Verifying a System.

The Analyzer Graphical UI

The Analyzer's graphical user interface is managed by the SDT Organizer.

In order to start the Analyzer, the Analyze menu choice or the Analyze quick button is to be selected. See page 1104 and page 1132, respectively.

The Analyzer Command-Line UI

This section is a reference to the Analyzer command-line mode, that is, when started from the OS prompt outside the SDT graphical environment.

Starting the Analyzer

The Analyzer is started with the command:

$sdtbin/sdtsan (1)
and responds with the Analyzer prompt

SDT Analyzer
Command : 

Syntax of Analyzer Commands

Command Names

A command name may be abbreviated by giving sufficient characters to distinguish it from other command names. A hyphen ('-') is used to separate command names into distinct parts.

Abbreviation of Commands

Any part may be abbreviated as long as the command does not become ambiguous.

Parameters in Commands

Two parameters are separated by one or several spaces.

Case Sensitivity in Commands

In both command names and parameters there is no distinction made between upper and lower case letters.

----------------------------------------------------------------
Note:                                                             
On UNIX systems, distinction is made between upper case letters   
and lower case letters for file names.                            
----------------------------------------------------------------

Description of Analyzer Commands

In this section, the Analyzer commands are listed in alphabetical order, along with their parameters and a description.

Add-Input

Parameters:

<Filespec>
This command adds an SDL-GR file (i.e. an SDL diagram stored in SDT binary format) to the list of files to be converted to PR.

--------------------------------------------------------------
Note:                                                           
The last file input this way must be followed by the command 
Set-GR-Mode on. --------------------------------------------------------------

Analyze

Parameters:

(None)
This command orders the Analyzer to perform the passes according to the Analyzer options as they are defined.

---------------------------------------------------------------
Hint:                                                            
The current analysis options can be printed using the command 
Show-Analyze-Options (see page 1554). ---------------------------------------------------------------
The order in which the passes are performed is:

  1. GR to PR conversion, if the input diagrams are SDL diagrams stored in SDT binary format.
  2. Macro expansion (optional).
  3. Syntactic analysis (optional).
  4. Pretty-printing of the PR file (optional).
  5. PR to GR conversion (optional). This pass converts an SDL-PR input file to SDL-GR diagrams, storing these files using SDT's native format.
  6. Semantic analysis (optional).
    ---------------------------------------------------------------
    Note:                                                            
    The Analyzer may need to be reset (using the New or Clear com    
    mand) between subsequent Analyze commands, since the Analyzer    
    keeps track of what passes have been performed in order to mini  
    mize analysis time.                                              
    ---------------------------------------------------------------
    

Clear

Parameters:

(None)
This command operates as the New command (see page 1545), the exception being that it preserves the input object to be analyzed. So, this command will simply reset the Analyzer and force it to perform all passes as defined in the options.

Exit

Parameters:

(None)
Terminates the Analyzer and returns you to the Operating System prompt.

Generate-C

Parameters:

(None)
This command invokes the C Code Generator, which will generate one / multiple C program(s) and header files, as well as a makefile.

This C program may then be compiled and linked in order to build up an executable file which properties are determined by the options which have been previously defined using the various commands in the generate options (the command Show-Generate-Options can be used to display the current settings).

Generate-CHILL

Parameters:

(None)
This command initializes the CHILL Translator, which will generate a CHILL file.

This CHILL program may then be compiled and linked in order to build up an executable application.

Generate-CSDL

Parameters:

(None)
This command orders the generation of CSDL(2) code.

This function is not supported in standard SDT environments.

Generate-MicroC

Parameters: (3)

(None)
This command invokes the SDT Cmicro Code Generator.

GR2PR

Parameters:

<GR-File> <PR-File>
The command converts the file designated by the file specifier GR-File to a textual (i.e. PR) description of the diagram, storing the results in the file designated by the file specifier PR-File.

The file GR-File should contain an SDL diagram stored in SDT format.

Help

Parameters:

[Command]
The command issues on-line help for the Analyzer commands. Depending on if a command is specified or not, the following happens:

Topic?

List-Diagrams

Parameters:

[*]/*[,diagramtype]
This command lists the SDL diagrams which are accessible using the current default search list. If no search list is defined, then this command lists the diagrams stored in the current work directory.

New

Parameters:

(None)
This command initializes the Analyzer. Following the New command, you will need to specify an input to the Analyzer using the Set-Object or the Set-Input command.

See also "Clear" on page 1543.

Operating-System

Parameters:

(None)
Creates a subprocess which returns you temporarily to the Operating System. Once you terminate this process, control is returned to the Analyzer.

Rehash-Search-List

Parameters:

<Filespec>
This command orders the Analyzer to rehash the contents of the directories specified by the search list designated by the file Filespec, i.e. recompute what SDL diagrams are accessible using the directories that are specified in a search list file.

This command should be typed if search lists are being used in the SDT environment and the contents of the directories included in the search list are changed.

Set-Compile-Link

Parameters:

[On/Off]
This option informs the C Code Generator if the generated code should be compiled and linked automatically (by executing the generated makefile) or not.

Default is on.

Set-Env-Header

Parameters:

[On/Off]
With this parameter turned on, a system information header file containing the definitions of the SDL system's interface to the environment is created by the C Code Generator (invoked by the Generate-C command).

This file is identified by the .ifc suffix.

Default is off.

Set-Error-Limit

Parameters:

<Errorlimit>
This command sets the limit of reported diagnostics (errors and warnings) after which the Analyzer will stop its execution.

Default is a limit of 30 diagnostics.

Set-Expand-Include

Parameters:

[On/Off]
This command defines whether the Analyzer should take care of
#INCLUDE statements (directive to include an SDL-PR file) or not when reading input diagrams and files.

Default is on.

Set-Expression-Limit

Parameters:

<Depth>
This command instructs the Analyzer to issue a warning when the semantic analyzer encounters an SDL expression which is at least Depth deep.

-----------------------------------------------------------------
Note:                                                              
Deeply nested expressions may cause a significant degradation of   
performance when performing the semantic analysis pass. It is      
therefore recommended to break down complex expressions into       
multiple, less complex expressions.                                
-----------------------------------------------------------------
Default is 0, meaning that no warnings will be issued.

Set-GR-Mode

Parameters:

[On/Off]
-----------------------------------------------------------
Note:                                                        
This command was named Set-Mode in earlier versions of SDT.  
-----------------------------------------------------------
This command enables or bypasses the GR to PR conversion pass, which needs to be run if the input to the Analyzer is an SDL diagram stored in SDL-GR format.

The mode will automatically be set to the appropriate value following the Set-Input command (see page 1548) or the Set-Object command. However, the mode could be superseded manually using the command Set-GR-Mode.

The mode is set to on by default.

Set-Graph-Unparse

Parameters:

[On/Off]
With this option on, the Analyzer will perform the PR to GR conversion pass (that is, the graphical unparse). Note that following the PR to GR conversion, no further Analyzer passes are possible; you will need to reset the Analyzer using the New or the Clear command (see page 1545 and page 1543).

Default is off.

Set-Input

Parameters:

<Filespec>
The Analyzer will use the file specified in Filespec as input file.

-----------------------------------------------------------
Note:                                                        
To specify an SDL diagram as input, the Set-Object command   
should be used. See page 1550.                               
-----------------------------------------------------------

Set-Kernel

Parameters:

<Kernel>
This option allows you to select the appropriate runtime library. The makefile generated by the C Code Generator contains instructions which link the generated and compiled code with object modules contained in the selected library. The effect of this will be that the code which is generated by the C Code Generator will have different properties, reflecting the purpose of its usage (simulation, application generation...). The allowed values of the parameter Kernel vary from one configuration to another. The definitions are made in the file sdtsct.knl. Following values are recognized today:

--------------------------------------------------------
Library       Application area                            
--------------------------------------------------------
SCTDEBCOM     Simulation, simulated time                  
SCTDEBCLCOM   Simulation, real time                       
SCTPERFSIM    Performance simulation                      
SCTAPPLCLENV  Application                                 
SCTDEBCLENV   Application debug (simulation with environ  
              ment)                                       
SCTVALIDATOR  Validation                                  
SCTTTCNLINK   TTCN link                                   
--------------------------------------------------------
Default is SCTDEBCOM.

Set-Lower-Case

Parameters:

[On/Off]
This command affects the capitalization of variables in the generated C code.

Default is off.

---------------------------------------------------------------------
Note:                                                                  
SDL does not distinguish between lower case letters (a..z) and upper   
case letters (A..Z), but the high-level programming language C         
does.                                                                  
---------------------------------------------------------------------

Set-Macro

Parameters:

[On/Off]
This command turns on or off the macro expansion pass. This option must be turned on if your diagram contains references to macro(s).

Default is off.

Set-Make

Parameters:

[On/Off]
This command affects the option which enables or disables the generation of a makefile in conjunction to generation of C code using the Generate-C command.

Default is on.

Set-Modularity

Parameters:

[Modularity]
Allows to specify the modularity of the code generated by the code generators, e.g. the C Code Generator. This option affects how many files will be generated.

Three options for the parameter Modularity are available;

Default value is No.

Set-Multiple-PR

Parameters:

[On/Off]
This command sets or resets the option that orders the GR to PR converter to generate one PR file for each SDL diagram in addition to the PR file that includes all diagrams.

Default is off.

Set-Object

Parameters:

<Diagramtype> <Diagramname>
Allows to select an SDL-GR diagram (stored using SDT's storage format) as input to the Analyzer. The command is available on SDL-88 diagrams only.

The parameter diagramtype can be any of the following:

The parameter diagramname is any valid diagram name.

Set-Organizer-File

Parameters:

<Filespec>
This command inputs a System File to the Analyzer. The Analyzer options are extracted from the file and applied to the Analyzer. To function properly, the System File should be ended with a command that orders the Analyzer to process information, such as:

When reading the file, the Analyzer ignores the sections that are not recognized.

See "Format of the System File" on page 1143 and "Options in the System File" on page 1146 in chapter 22, The SDT Organizer.

Set-Output

Parameters:

<Filespec>
Allows you to save the information generated by the Analyzer in files with a different name, using Filespec as the base name.

File suffixes are appended automatically by the Analyzer.

Set-Prefix

Parameters:

[Prefix]
Allows you to specify how the C Code Generator is to append a prefix to the names of the variables in the generated code.

Possible values for the parameter prefix are:

Default is Full.

Set-References

Parameters:

[On/Off]
This option allows you to disable the verification that exactly one reference corresponds to each remote definition.

Default is on.

Set-Semantic

Parameters:

[On/Off]
With this option turned on, the semantic check pass will be performed. Otherwise, the Analyzer will stop after the syntactic check.

Default is on.

Set-Separate

Parameters:

<SDL-qualifier>
This command allows you to perform a separate analysis of a diagram. The diagram is to be entered as an SDL qualifier. This informs the Analyzer about the context in which to retrieve definitions needed to analyze the diagram.

Set-Sort-Value

Parameters:

[On/Off]
If this option is turned off, then no check is performed that a sort definition has at least one literal or operator definition.

Default is on.

Set-Source

Parameters:

[On/Off]
Informs the C Code Generator whether to generate C code or not when the Generate-C command is given.

Default is on.

Set-Syntax

Parameters:

[On/Off]
This option turns on or off the syntax analysis pass. With this option off, the Analyzer will stop after the GR to PR conversion pass.

Default is on.

Set-System-Instance

Parameters:

SDL-Qualifier[, ...]
This command allows you to enter the appropriate definition of the blocks contained in the system you are analyzing:

Several definitions may be entered in one single command.

Set-Unparse-Program

Parameters:

[On/Off]
With this switch on, a pretty printed PR file will be generated. Pretty-printed PR files have the extension .prf

------------------------------------------------------------------
Note:                                                               
The PR file (.pr) that the Analyzer produces does not address the   
human reader.                                                       
------------------------------------------------------------------
Default is off.

Set-Upcase-Keyword-Unparse

Parameters:

[On/Off]
This command specifies whether SDL keywords should be capitalized using upper or lower case letters in the pretty-printed PR file.

Default is off (i.e. lower case letters).

Set-Warning-Output

Parameters:

[On/Off]
This command toggles the option to have the Analyzer issue warning messages reporting SDL signal output where the semantic meaning is different in SDL-88 and in SDL-92.

Default is on.

--------------------------------------------------------------
Note:                                                           
This command is particularly useful when working with SDT 2.X   
diagrams in an SDT 3.X environment. (SDT 2.X supports SDL-88,   
while SDT 3.X supports SDL-92)                                  
--------------------------------------------------------------

Set-Warning-Usage

Parameters:

[On/Off]
This command toggles the option to have the Analyzer report SDL definitions that are not referred (i.e. used).

Default is off.

Set-Xref

Parameters:

[On/Off]
With this option on, a file containing SDL Cross References will be generated following the Analyze command. See "SDL Cross-References" on page 1565.

Default is off.

Show-Analyze-Options

Parameters:

(None)
This command lists the Analyzer current options.

Show-Commands

Parameters:

(None)
Similar to Help. The commands are listed without the command parameters in a two-column format.

Show-Generate-Options

Parameters:

(None)
This command displays the C Code Generator options as currently defined.

Show-License

Parameters:

(None)
This command returns information about:

Show-Version

Parameters:

(None)
This command displays the version number of Analyzer and the additional tools included in the Analyzer.

Miscellaneous Analyzer Commands

The following commands can be used for instance in the case of malfunction or unexpected behavior. They are not described further within the scope of the SDT user's documentation.

zzList-Diagrams-Raw

Parameters:

(None)

zzSetSDL92

Parameters:

(None)

zzSet-Warn-Context

Parameters:

(None)

zzTransport

Parameters:

(None)

zzWrite-Path

Parameters:

(None)

zzWrite-Pretty

Parameters:

(None)

zzWrite-Symbol

Parameters:

(None)

zzWrite-Syntax

Parameters:

(None)

The GR to PR Converter

The GR to PR converter translates SDL diagrams stored in SDT binary files into PR files. Given a diagram, it replaces all graphical symbols in that diagram by their corresponding keywords and copies any text in the symbols to the output file. When possible, the definitions in the output file will appear in the same order as in the input. If a graphical symbol references another diagram, the referenced diagram will be converted in the same way. Diagrams referenced in PR form and macros only called in PR will not be converted. If a macro is called only in PR form, the macro definition must be in PR and placed in a diagram that will be converted.

The PR files produced by SDT fill various purposes:

Mapping between GR and PR

The following list defines the mapping between the GR and PR forms:

Substructures in Block Types
- Directive #BLOCKTYPE

To be able to perform a correct conversion of SDL-GR substructures to SDL-PR, when the enclosing diagram is a block type, the Analyzer directive #BLOCKTYPE is used.

The directive should be appended to the diagram kernel heading symbol.

The Macro Expander

A macro is a form of text substitution used in the SDL system definitions. In a macro definition, a collection of lexical units is defined. A macro call indicates where the text from the macro definition body is to be included. All macro calls must be expanded before further analysis of the system definition can be done.

-----------------------------------
Note:                                
Macros may not contain any states.   
-----------------------------------
The name of the macro definition is visible in the whole system definition. A macro call may appear before its corresponding macro definition. A macro definition may contain macro calls, but not calls to itself, directly or indirectly.

A macro may use parameters, called formal parameters, in macro definitions and actual parameters in macro calls. There must be an equal number of formal parameters and actual parameters in corresponding macro definitions and macro calls. Using multiple formal parameters with the same name is not allowed.

When a character string is used as an actual parameter, the value of the character string will be used to replace the formal parameter in the macro body and not the character string itself.

The keyword MACROID may be used in a macro definition body only. The MACROID keyword will be replaced by a unique name at each expansion of the macro (that is, only one unique name is available at each expansion of a macro definition). New names can be constructed by concatenating names, parameters and MACROID using a percent sign (%) as a separator.

The reserved word MACRODEFINITION is not allowed inside a macro definition. The reserved words MACROID and ENDMACRO are only allowed inside a macro definition.

Macro expansion follows this order:

  1. The name in the macro call is used to find the corresponding macro definition, and a copy of that macro definition is made.
  2. In this copy, all occurrences of formal parameters are replaced by actual parameters. All occurrences of
    MACROID are replaced by a unique name. Also, all percent signs (%) separating names are removed.
  3. Macro calls in the modified macro definition body are expanded.
  4. The modified and expanded text is substituted for the macro call text in the system definition.

Implementation Details

The syntax checks made in the macro parser are entirely macro specific since nothing else is possible until all macro calls are expanded. Some semantic checks are made during the expansion.

Example 36 : Macro in SDL that Will Not Work  
Constructs such as:

macro test('if par3 then',
           'if not par3 then',
           'k<0') ;
where the text par3 in the first and second parameter strings is intended to be replaced by the third formal parameter in the macro definition will not work. This is because all formal parameters are replaced with actual parameters in a single step.

  
The reserved word MACROID is replaced by a unique name consisting of the string "XMID" and an integer. To assure system wide uniqueness the name is tested against all existing names in the system and the integer will be increased until the name is unique.

Separate Analysis

You may perform analysis on separate SDL units. The units that can be handled (other than system) are:

If a unit is given without context, only syntactic checking can be performed. But, if the unit's placement in the system (that is, its context) is also given, both the syntactic checking and most of the semantic checking can be performed. The context of a unit is its enclosing scope units including the definitions that are not referenced, i.e. remote diagrams are excluded.

GR Input

In the Analyzer, the context is specified in the Organizer tree structure if the input is a GR diagram. The diagrams surrounding the diagram that is to be separately analyzed and the diagrams inside that diagram are translated to PR and analyzed. No errors will occur due to missing remote diagrams, except missing remote diagrams inside the separately analyzed diagram. See "Performing Syntax Check" on page 313 in the chapter Verifying a System.

PR Input

If the input is a PR file, the Analyzer removes the parts of the system that are not to be semantically analyzed after the syntax analysis. See "Converting SDL-PR to SDL-GR" on page 319 in the chapter Verifying a System.

Including Separate PR Files

The Analyzer allows the user to divide the SDL description into a number of separate PR files. (The macro expansion can, however, only handle one file at a time.) It may, for example, be convenient to have the system level data type definitions in a separate file. A separate file is included by adding an include directive to the SDL description.

Syntax of #INCLUDE Directives

The include directive is #INCLUDE followed by the name of the file which should be surrounded by single quotation marks. The directive should be placed in an SDL comment, directly after the comment start ("/*"), at the place where the file should be included.

However, if the #INCLUDE comment is placed directly after a reference (see the third include in Example 37 below), the file will be included at the end of the system description. It is then assumed that the include file contains the remote definition.

Example 37 : #INCLUDE in Analyzer  
System Example;
/*#INCLUDE 'DataDefs.pr' */
/*#INCLUDE 'BlockA.pr' */
BlockB referenced;
/*#INCLUDE 'RemoteBlockB.pr' */
EndSystem Example;
  

Search Order for Included PR Files

The Analyzer will search for included SDL-PR files in the following order:

  1. The current default directory.
  2. The directory designated by the environment variable HOME.
  3. The directory designated by $sdtrelease/include/ADT
    (This directory contains a number of useful abstract data types in SDL-PR that are included in the SDT distribution. See chapter 35, The ADT Library for more information.)

The PR to GR converter

General

The PR to GR Converter performs a conversion from SDL-PR files into SDL-GR diagrams. (It is also possible to input SDL-GR diagrams, which transforms them to new SDL-GR diagrams, applying default layouting algorithms.)

Conversion is done on a one-diagram-per-file basis, meaning that each generated GR diagram will be stored on one file. However, entering a PR file may generate multiple GR diagrams, depending on the contents of the PR file.

------------------------------------------------------------------
Note:                                                               
The PR to GR converter requires syntactically correct diagrams or   
PR files as input in order to function properly.                    
Diagrams containing semantic errors will be converted, but, the re  
sulting SDL-GR interpretation may be different from the SDL-        
PR representation.                                                  
------------------------------------------------------------------

Conversion Principles

The Analyzer passes which are performed are:

  1. Macro expansion (if the PR input contains macro definitions)
  2. Syntax analysis
  3. PR to GR conversion
  4. Then, graphical layouting is done by the SDL Editor.

Resulting files

The result from the PR to GR conversion is a number of SDL-GR binary files. Each diagram will be stored on one file.

Graphical layouting is done by the SDL Editor and follows default algorithms. See The SDL Editor chapter, section "Automatic Layouting of Diagrams" on page 1269 for more details on this topic.

To reconstruct the SDL diagram structure, the Organizer's command Import Diagrams should be used (see page 1079).

SDL Cross-References

The Analyzer has the ability to produce listings of SDL entities and references to these definitions. In one file, all definitions of entities in an SDL system will be gathered, along with cross references to these entities. Entities mainly used to indicate structure (such as system, block, substructure, process, procedure, and service), as well as entities defining objects (such as signals, variables and sorts) will be considered as definitions.

The file, which is described further below, is a plain text file.

----------------------------------------------------------------------
Note:                                                                   
SDT has support for graphical presentation of a cross-reference file,   
using an SDL-like graphical notation. To achieve this, you can use      
The Cross Reference Viewer tool. See page 1391.                         
----------------------------------------------------------------------

Definitions and Cross References Files

The file name will be unitname.xrf for the cross references file, where unitname is the name of the SDL unit selected for analysis. Alternatively, the file name is to be supplied by the user when running the Analyzer from the Organizer.

If an SDL system is selected for analysis, all definitions and cross references are generated; while if case of a non-SDL system unit, definitions and cross references in the following units are generated:

The following entities will be part of the files:

-------------------------------------------
ACTIVE                 ATLEAST               
BLOCK                  BLOCK SUBSTRUCTURE    
CHANNEL                CHANNEL SUBSTRUCTURE  
CONNECTION             CONTINUOUS SIGNAL     
CREATE                 DCL                   
DECISION               ENABLING CONDITION    
EXPORT                 EXPORTED_PROCEDURE    
FORMAL PARAMETER       FPAR                  
GATE                   GENERATOR             
IMPORT                 IMPORTED              
IMPORTED VARIABLE      IN-CONNECTOR          
INHERITS               INPUT                 
INSTANTIATION          JOIN                  
LITERAL                NEWTYPE               
NEXTSTATE              NUMBER OF INSTANCES   
OPERATOR               OUT-CONNECTOR         
OUTPUT                 PACKAGE_INTERFACE     
PROCEDURE              PROCEDURE CALL        
PROCEDURE PARAMETERS   PROCESS               
PROCESS PARAMETERS     REMOTE PROCEDURE      
REMOTE VARIABLE        RESET                 
SAVE                   SERVICE               
SET                    SIGNAL                
SIGNAL ROUTE           SIGNALLIST            
SIGNALROUTE            SIGNALSET             
SORT                   STATE                 
STATE_LIST             SYNONYM               
SYNTYPE                SYSTEM                
TASK                   TIMER                 
TRANSITION OPTION      USE                   
VARIABLE               VIEW                  
VIEWED                                       
-------------------------------------------
--------------------------------------------------------------------
Note:                                                                 
No cross references will be generated for the predefined data types   
(INTEGER, NATURAL, CHARACTER, CHARSTRING,                             
BOOLEAN, REAL, TIME, DURATION, PID) or for the pre                    
defined generators (ARRAY, STRING, POWERSET) as well as               
LITERALS and OPERATORS that are not part of the list above.           
--------------------------------------------------------------------

Syntax of Files

For each definition of any kind mentioned above the following information is generated:

ScopeLevel EntityType EntityName Reference

Explanation

For each entity used to indicate structure (system, block, substructure, process, procedure, service) there is a header consisting of three additional lines, which should be considered as a comment to increase the readability.

Example 38 : Reference in Analyzer Error  
2  SIGNAL Bump \ 
SDTREF(SDL,/usr/tom/demongame.ssy(1),122(40,30),3)
  

Order of Definitions

The definitions are generated in pre-order (prefix walk in the tree formed by the definitions). This means that an entity is always followed by the entities defined within the entity. It also means that an entity at level N is defined in the first entity at level N-1 found when scanning upwards in the file.

Cross References

For each place where an entity is used, information about that cross reference is generated:

Example 39 : Cross References  
4  DCL Count \ 
#SDTREF(SDL,/usr/tom/game.spr(1),179(80,10),2)
     TASK \ 
#SDTREF(SDL,/usr/tom/game.spr(1),137(30,40),1)
     OUTPUT                   
#SDTREF(SDL,/usr/tom/game.spr(1),128(80,55),2)
  
Cross references consist of a keyword, describing where the reference was found, and the SDL reference. In Example 39 on page 1568, the variable Count is referenced in a task symbol and in an output. All cross references for an entity are placed immediately after the line for the definition.

-------------------------------------------------------------------
Note:                                                                
Entities used to indicate structure can also have cross references   
(procedure call, process create).                                    
-------------------------------------------------------------------

Error Handling

Errors may be detected both during interaction with the user (command interpretation) and during analysis. Errors occurring during command interpretation are displayed on the screen, and errors generated during analysis are both displayed on the screen and appended to the error file. The name of the error file is the base file name with the extension .err.

Command Interpretation Errors

Errors that occur during command interpretation are errors due to:

Diagnostics Issued During Analysis

Errors may be found during the various steps of the analysis. The different types of diagnostics and the format of the messages are described below ("GR to PR Conversion" on page 1571, "Macro Expansion" on page 1571, "Lexical and Syntactic Analysis" on page 1571, "Semantic Analysis" on page 1572). The messages are listed in "Error and Warning Messages" on page 1579.

Diagnostic Types

Errors can be of the following types:

Warnings

There are different types of warnings:

Errors

One type of error is detected; violation of an SDL rule.

Internal Error

Internal errors due to malfunction of the Analyzer are detected. An internal error often has its roots in an SDL error from which the Analyzer did not recover properly.

Diagnostic Format

Messages generally consist of the following parts:

Trace Back

The trace back starts with a reference to the erroneous SDL item or a line number if the input is a PR file (also a file name if the error occurred in an included PR file), and a reference to the file where the SDL diagram is stored (in some cases several references are given).

The second part of the trace shows where in the SDL scope structure the error occurred.

GR to PR Conversion

The reference always contains graphical references to source SDL-GR diagrams.

Macro Expansion

The reference contains the macro call stack instead of the SDL scope structure.

Lexical and Syntactic Analysis

The message describing the error includes a text line where the illegal construct is indicated with a "?". If the trace back is common to many lexical or syntactic errors, the trace back will only occur after the last of these error messages.

The error also contains a reference to the source file.

Example of a Syntax Error

Example 40 : Syntax Error Produced by Analyzer  
#SDTREF(SDL,/use/tom/game.spr(1),137(30,40),1,11)
ERROR 312 Syntax error in rule VARIABLE, symbol = 
found but one of the following
expected:
!  (  :=  
task Count=0 ;
         ?
  
The interpretation of the error message is that the Analyzer found the symbol "=" when it expected one of the symbols "!" (the field selector), "(" or ":=".

In the current example, the assignment statement can be found in position 11 the first line in the object with the ID 137 at position (30, 40) on page 3, on page 1 in the diagram stored on file /use/tom/game.spr.

For more information on the format used for references in SDT, see "Syntax" on page 2476 in chapter 41, References in SDT-3.

Semantic Analysis

The message describing the error includes, if possible, a line containing the error, with a "?" immediately preceding the SDL item that caused the error.

The error also contains a reference to the source file.

Example of a Semantic Error

Example 41 : Semantic Error Produced by Analyzer  
#SDTREF(SDL,/usr/tom/game.spr(1),296(55,40),1)
ERROR 88 Undefined procedure
call ? ErrorHandler
  
The interpretation of this error message is that the procedure ErrorHandler is referred to but not is defined, and the call can be found in page 1 of the diagram stored on the on file /usr/tom/game.spr, in line 1 of the object with ID 296 and at position (55, 40).

For more information on the format used for references in SDT, see "Syntax" on page 2476 in chapter 41, References in SDT-3.

Implementation Restrictions

The present version of the Analyzer is an almost complete SDL-88 analyzer, except for a few concepts that cannot be handled completely and some semantic checks that are not yet implemented. These restrictions and the implementation limits are described in this section. When possible, a workaround is described.

The GR to PR Converter

Macros and macro calls are transformed to PR and expanded in PR form. This restricts the usability of macros, for instance the number of inlets and outlets must be 0 or 1.

The PR to GR Converter

PR to GR conversion is subject to the following restrictions:

The Syntactic and Semantic Analysis

Restrictions on input

The Analyzer cannot handle spaces in names (a space is a shorthand for an underline). You should replace spaces with explicit underlines.

Restrictions on Semantic Analysis

Semantic analysis is subjected to the following restrictions and limitations:

Example 42 : Deep Complex SDL Expression  
Alternative 1
DECISION
  (a > b) and
  (b > c) and
  (c > d) and 
  etc... 
  (y > z);
(True):  TASK status := 1;
(False): TASK status := 0;
ENDDECISION;
Alternative 2
TASK
  ok := ok and (i > j)
  ok := ok and (j > k)
  etc...
  ok := ok and (y > z)
DECISION ok;
(True)  : TASK status := 1;
(False) : TASK status := 0;
ENDDECISION;
  

Semantic Checks that are not Performed

Analysis of the following semantic SDL rules is not performed:

  1. The consistent partitioning subset must be a consistent refinement subset.
  2. The decision answers must be mutually exclusive.
  3. An exported variable must exist for each imported variable.
  4. The type check and the evaluation and check of the equivalence classes in axioms is not performed.
  5. Generator names and generator formal parameters must not be:

Restrictions on Separate Analysis

The following semantic checks are not performed when performing separate analysis of an SDL diagram:

Implementation Limits

The Analyzer is subject to two implementation limits:

Analyzer Files

When a diagram is being analyzed, a number of files are generated. The file names consist of the diagram name appended with a file extension. The following file extensions are used:

This page intentionally left blank


Footnotes

(1)
sdtbin is assumed to be set to designate the directory where the SDT binaries are stored. This is an installation-dependent parameter.
(2)
CSDL is a trademark of Italtel.
(3)
The exact syntax is subject to change since the tool is still under development.
 
Table of Contents Next Chapter