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.
$sdtbin/sdtsan (1)and responds with the Analyzer prompt
SDT Analyzer Command :
---------------------------------------------------------------- Note: On UNIX systems, distinction is made between upper case letters and lower case letters for file names. ----------------------------------------------------------------
<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. --------------------------------------------------------------
(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 commandThe order in which the passes are performed is:
Show-Analyze-Options (see page 1554). ---------------------------------------------------------------
--------------------------------------------------------------- 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. ---------------------------------------------------------------
(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.
(None)Terminates the Analyzer and returns you to the Operating System prompt.
(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).
(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.
(None)This command orders the generation of CSDL(2) code.
This function is not supported in standard SDT environments.
(None)This command invokes the SDT Cmicro Code Generator.
<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.
[Command]The command issues on-line help for the Analyzer commands. Depending on if a command is specified or not, the following happens:
Topic?
[*]/*[,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.
(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.
(None)Creates a subprocess which returns you temporarily to the Operating System. Once you terminate this process, control is returned to the Analyzer.
<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.
[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.
[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.
<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.
[On/Off]This command defines whether the Analyzer should take care of
Default is on.
<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.
[On/Off]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.----------------------------------------------------------- Note: This command was named Set-Mode in earlier versions of SDT. -----------------------------------------------------------
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.
[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.
<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. -----------------------------------------------------------
<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.
[On/Off]This command affects the capitalization of variables in the generated C code.
--------------------------------------------------------------------- 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. ---------------------------------------------------------------------
[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.
[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.
[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;
[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.
<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:
<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.
<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.
[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:
[On/Off]This option allows you to disable the verification that exactly one reference corresponds to each remote definition.
Default is on.
[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.
<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.
[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.
[On/Off]Informs the C Code Generator whether to generate C code or not when the Generate-C command is given.
Default is on.
[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.
SDL-Qualifier[, ...]This command allows you to enter the appropriate definition of the blocks contained in the system you are analyzing:
[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.
[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).
[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) --------------------------------------------------------------
[On/Off]This command toggles the option to have the Analyzer report SDL definitions that are not referred (i.e. used).
Default is off.
[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.
(None)This command lists the Analyzer current options.
(None)Similar to Help. The commands are listed without the command parameters in a two-column format.
(None)This command displays the C Code Generator options as currently defined.
(None)This command returns information about:
(None)This command displays the version number of Analyzer and the additional tools included in the Analyzer.
(None)
(None)
(None)
(None)
(None)
(None)
(None)
(None)
The PR files produced by SDT fill various purposes:
----------------------------------------------------------------------- Note: The order in which text symbols are converted may be of impor tance when it comes to code generation issues. This is, in particular, applicable when using the C Code Generator. Therefore you should use one text symbol only for type definitions. -----------------------------------------------------------------------
The directive should be appended to the diagram kernel heading symbol.
----------------------------------- 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:
Example 36 : Macro in SDL that Will Not WorkConstructs 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.
------------------------------------------------------------------ Note: When performing separate analysis on a package, referred packages must be supplied as well. ------------------------------------------------------------------
Example 37 : #INCLUDE in Analyzer System Example; /*#INCLUDE 'DataDefs.pr' */ /*#INCLUDE 'BlockA.pr' */ BlockB referenced; /*#INCLUDE 'RemoteBlockB.pr' */ EndSystem Example;
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. ------------------------------------------------------------------
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).
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. ----------------------------------------------------------------------
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:
-------------------------------------------------------------------- Note: The generated file will contain information that is valid for the se lected consistent subset. --------------------------------------------------------------------
------------------------------------------- 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. --------------------------------------------------------------------
ScopeLevel EntityType EntityName Reference
Example 38 : Reference in Analyzer Error 2 SIGNAL Bump \ SDTREF(SDL,/usr/tom/demongame.ssy(1),122(40,30),3)
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). -------------------------------------------------------------------
The error also contains a reference to the source file.
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.
The error also contains a reference to the source file.
Example 41 : Semantic Error Produced by Analyzer #SDTREF(SDL,/usr/tom/game.spr(1),296(55,40),1) ERROR 88 Undefined procedure call ? ErrorHandlerThe 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.
Example 42 : Deep Complex SDL ExpressionAlternative 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;
Table of Contents Next Chapter