[Previous] [Next] [Contents] [Index]


    CIF Converter Tools

This chapter is a reference manual for the CIF2SDT and SDT2CIF converter tools. The CIF2SDT tool converts CIF (the Common Interchange Format as defined in the Z.106 recommendation) files to SDT binary format files, while SDT2CIF tool converts SDT binary files or system files to CIF files.

CIF is a human readable text format for storing SDL diagrams, making it possible to store SDL diagrams in version control systems that only accept text files. In addition, it provides a base for converting diagrams to and from other SDL toolsets. The CIF2SDT and SDT2CIF tools bring the advantage of CIF to the SDT tools.

Table of Contents 

Introduction

Common Interchange Format

CIF (Common Interchange Format) is a text format specified by
ITU-T (International Telecommunication Union) in the recommendation Z.106 to ease the interchange of graphical SDL specifications. SDL-CIF is an extension to SDL-PR and is based on the SDL-PR syntax and can be read and written by tools as well as users. The CIF constructs are expressed as comments preceding the PR code. All the constructs available in SDL-PR are available in SDL-CIF with the exception of the macro call construct. The advantages of such a text format are:

However, CIF cannot be used as a storage format for files in SDT as it is required that specification stored in CIF file must be complete and correct.

CIF <-> SDT Converters

The CIF2SDT and SDT2CIF converters make the advantages of the CIF format available to the SDT tools. The converters are implemented as a binary that can be run in a textual, command-line mode from the OS prompt (on UNIX), or as separate applications with graphical user interfaces (in Windows). The converter tools can also be launched from the Organizer using the menu choices Convert GR to CIF and Convert CIF to GR from the Generate menu.

The conversion between CIF and the binary SDT format is performed as follows:

Note: 

The CIF2SDT or SDT2CIF tools require the SDT environment when running; meaning that there should be enough licenses available to be able to convert to/from CIF.

Generally, one CIF file contains several SDT diagrams. However, the placement of generated diagrams can be specified by the user.

CIF2SDT Converter Tool

The CIF2SDT tool converts CIF files to SDT binary format. It can convert one or more specified CIF files or all CIF files in a specified directory.

The CIF2SDT converter never overwrites existing data files. If the converter finds that the file it was going to write already exists, it generates a new name for the output file by replacing the two last characters at the end of the file name.

The CIF2SDT converter can be started in the following ways:

Command Line Syntax (UNIX only)

On UNIX, the CIF2SDT tool can be invoked from the OS prompt as follows:

The meaning of the command-line options is given in the following sections.

Command Line Options

Note: 

This option will only work if the CIF file was generated by SDT or contains the SDT-specific CIF comment OriginalFileName.

Examples of Usage


Example 52       

The CIF2SDT tool will convert the diagrams contained in the CIF file myfile.cif to the file myfile.sif (if a file named myfile.sif does not already exist), myfile01.sif (if a file named myfile.sif already exists, but the file myfile01.sif does not), myfile02.sif and so on.


Example 53       

The CIF2SDT tool will convert the diagrams contained in the CIF file lift.cif to SDT binary format and put it into an SDT block file named lift.sbk (again, if the file named lift.sbk does not already exist -- otherwise, the name will be modified and a corresponding message issued).


Example 54       

(where mycifdir specifies a directory name)

The CIF2SDT tool will search for CIF files in the directory named mycifdir, convert all CIF files found to SDT binary format and put the converted diagrams in the directory mycifdir. For information on how the search for CIF files is done, see How the Converter Works.


Example 55       

The CIF2SDT tool will convert the CIF files myblock.cbk, myprocss.cpr and myservce.csv and put the converted diagrams into the SDT binary files myblock.sbk, myprocss.spr and myservce.ssv.


Example 56       

(where mycifdir specifies a directory name)

The CIF2SDT tool will convert the CIF file mysystem.csy and put the converted diagrams into an SDT system file, then it will search the directory mycifdir and convert all CIF files found in this directory.


Convert CIF to GR Dialog (UNIX only)

On UNIX, the CIF2SDT converter can also be started by selecting Convert CIF to GR from the Organizer's Generate menu. This opens the Convert CIF to GR dialog:

Figure 179 : The Convert CIF to GR dialog

Extracted pic [3]

The dialog functions as a front-end to the cif2sdt converter described in Command Line Syntax (UNIX only). The only functionality not supported by the dialog is the possibility to specify a directory name as input to the conversion.

Note: 

This option will only work if the CIF file was generated by SDT or contains the SDT-specific CIF comment OriginalFileName.

Graphical User Interface (Windows only)

In Windows, the CIF2SDT converter is either started outside SDT by using the cif2sdt executable in the SDT distribution, or by selecting Convert CIF to GR from the Organizer's Generate menu. It provides a graphical user interface to control the conversions:

Figure 180 : CIF2SDT Graphical User Interface

Extracted pic [1]

To convert a CIF file or all CIF files in a directory, perform the following steps:

  1. Type a CIF file or directory name in the text field under CIF file or directory to convert.
  2. Specify the desired options by clicking on check boxes which specify conversion options; look for option explanations in Converter Options.
  3. Click the Generate SDT button.

After these steps, the conversion will proceed, possibly printing warning/errors/information messages into the Conversion log text box.

After the conversion has been performed, the CIF2SDT converter can be used again to convert more CIF files or directories.

Converter Options

Note: 

This option will only work if the CIF file was generated by SDT or contains the SDT-specific CIF comment OriginalFileName.

How the Converter Works

First of all, the converter analyzes the input and builds a list of files to convert. If one or a set of files was specified, it adds all the files specified to the list of files to convert. If a directory was specified, the converter searches in the specified directory for files with the extensions .cif, .cun, .csy, .cbk, .csu, .cpr, .csv, .cpd, .cmc, .cst, .cbt, .cpt, .cvt, .cop (which are assumed to contain CIF diagrams) and adds the files found to the list of files to convert. The extension for the output file is formed by replacing the first character of the extension of the input file with the character `s'.

When the list of files to convert is ready, the converter tries to convert each file in the list. The file being converted is parsed, analyzed, transformed, and then saved as an SDT file. During parsing, CIF comments take precedence over the PR text, which is supposed to contain additional attributes for CIF objects. If the converter finds an error in the PR text, it proceeds by printing a warning message about that fact, using only the information extracted from the CIF comments.

The advantage of the CIF2SDT converter is that it supports incomplete PR text. For example, it can handle empty text of symbols, empty signal lists, and empty gate constraints. However, there is an exception when the PR text is required to be correct: after the "Diagram Start" CIF comment.

If a line is found that does not have the correct breakpoints (to be correct, it should be a point on the symbol border), an autolayout method is used to place the line.

The converter never overwrites any existing files. If the file to be written gets the same name as an existing file, a new name is generated for the output file to avoid overwriting existing files.

Messages from CIF2SDT Converter

The CIF2SDT converter issues an information message when it needs to inform the user about something; for example, when it changes the output file name in order not to overwrite an existing file. It also issues a warning message when some non-fatal error is found; for example, when some symbol on a diagram occurs in a wrong context. It prints an error message when it is not possible to continue the conversion; for example, when the input file is wrong or corrupt.

Message Format

The general format for warning/error messages is the following:

The <error code> specifies the error code which can be used to find the warning/error explanation (see the following sections). The <line> and <column> specify a position in the source CIF file where the error has occurred. The <error text> gives a short explanation of what is wrong. The <additional information> specifies additional information about the error (for example, it can specify the name of an endpoint constraint that could not be bound).

The list of possible warning/error messages follows in the next sections.

List of Error Messages

Error 0: Arguments required (UNIX only)

This error indicates that no command-line arguments were given to the CIF2SDT converter, which thus cannot continue processing. To remedy the situation, specify one or more file/directory name(s) to convert.

Error 1: Illegal option (UNIX only)

This message is issued when an invalid option is found in the command line. To remedy the situation, supply an appropriate option instead of the invalid one.

Error 2: Duplicate option (UNIX only)

This message is issued when a duplicate command-line option is found. The command-line options can be specified only once. To remedy the situation, remove duplicated options from the command line.

Error 3: Missing output file (UNIX only)

This message is issued when the option -o has been specified, but no output file name follows. To remedy the situation, supply an output file name after the -o option.

Error 4: Illegal command line syntax (UNIX only)

This message is issued when the command line is found not to obey the command-line syntax. To remedy the situation, make the command line conform to the command-line syntax.

Error 5: Impossible to connect to SDT PostMaster

This message is issued when the CIF2SDT converter cannot connect to the PostMaster.

In Windows, the CIF2SDT converter requires the PostMaster to be running in order to perform conversion. Start the Organizer and try again.

On UNIX, the most likely cause of this message is that either the path to the SDT tools is not in the search path, or the maximum number of licenses is reached. To remedy the situation, ensure that the SDL Editor can be started (i.e. it is in the search path) and that there are enough licenses available.

Error 6: Error creating diagram

This message is issued when the CIF2SDT converter cannot create a diagram in the SDL Editor. This message is most probably caused by a corrupt input CIF file. To remedy the situation, correct the CIF file.

Error 7: Error creating page

This message is issued when the CIF2SDT converter cannot create a page in the SDL Editor. This message is most probably caused by a corrupt input CIF file. To remedy the situation, correct the CIF file.

Error 8: Error creating symbol

This message is issued when the CIF2SDT converter cannot create a symbol in the SDL Editor. This message is most probably caused by a corrupt input CIF file. To remedy the situation, correct the CIF file.

Error 9: Error saving diagram in file

This message is issued when the CIF2SDT converter cannot save the resulting diagram on the output file. This message may be caused by an invalid output path/file name. If this is the case, specify a valid path. This message may also be caused by insufficient disk space available. If this is the case, free some disk space.

Error 10: Size of symbol is not specified

This message is issued when the CIF2SDT converter encounters a symbol without an explicit size specified and without any default size specified in a diagram in the input CIF file. This is illegal according to the Z.106 standard. To remedy the situation, correct the source CIF file.

Error 11: Cannot bind gate reference

This message is issued when the CIF2SDT converter cannot bind a gate reference to a list of connections. This means the input file is corrupt. To remedy the situation, correct the source CIF file.

Error 12: Cannot bind connect for...

This message is issued when the CIF2SDT converter cannot bind a connection statement with a list of channels/signal routes. This means the input file is corrupt or illegal. To remedy the situation, correct the source CIF file.

Error 13: Cannot bind FROM endpoint for...

This message is issued when the CIF2SDT converter cannot bind a FROM endpoint of a channel or signal route to a block or process. This means that the input CIF file is corrupt or illegal. To remedy the situation, correct the CIF file.

Error 14: Cannot bind TO endpoint for...

This message is issued when the CIF2SDT converter cannot bind a TO endpoint of a channel or signal route to a block or process. This means that input CIF file is corrupt or illegal. To remedy the situation, correct the CIF file.

Error 15: Cannot bind endpoint of line

This message is issued when the CIF2SDT converter encounters a flow line statement and cannot find symbols which are supposed to be connected. To remedy the situation, correct the CIF file.

Error 16: Dashed should be used if keyword Adding is used for gate

Error 17: Wrong first endpoint in gate

Error 18: Gate constraint symbol is omitted for gate

These three messages mean that the source CIF file contains contradictory CIF comments and SDL-PR and is thus corrupt. To remedy the situation, correct the CIF file.

Error 19: Wrong page name

This message is issued when the CIF2SDT converter encounters a CIF PageSwitch comment in a source file that references an undefined page in the diagram. To remedy the situation, correct the CIF file.

Error 20: Wrong number of points in pointlist for gate

This message is issued when the CIF2SDT converter encounters a CIF Gate comment with a pointlist consisting of more than two points. This is a violation of the Z.106 standard, the input file is thus corrupt. To remedy the situation, correct the CIF file.

Error 21: Create line can occur only inside block (type) without decomposition

This message means that the source CIF file is corrupt. To remedy the situation, correct the source CIF file.

Error 22: Flowline can occur only inside diagrams with process body

This message means that the source CIF file is corrupt. To remedy the situation, correct the source CIF file.

Error 23: Symbol cannot occur in this context

This message means that the CIF2SDT converter encountered a graphical symbol in a wrong context in the source diagram (for example, a start symbol in a system diagram). To remedy the situation, correct the source CIF file.

Error 24: Syntax error

This message means that the CIF2SDT converter encountered a violation of the CIF syntax in the source CIF file. To remedy the situation, correct the source CIF file.

Error 25: Illegal name of output file

This message means that either no unique name was found for the output file or there was an input/output error during saving of the output file. To remedy the situation, try to convert the diagrams to a file with a different name (on UNIX, see the -o option).

Error 26: Cannot bind connection point text position

This message means that the position of text in a connection statement could not be bound. To remedy the situation, try to move the text of connection symbol in the source diagram, then re-run the converter.

Error 27: Wrong page type(s) on the diagram

This message means that the CIF2SDT converter found a process diagram with several pages of different types, which is a violation of the Z.106 standard. To remedy the situation, correct the CIF file.

Error 28: Analysis of CIF failed

This message means that the CIF2SDT converter failed to analyze the input CIF file. In this case nothing is generated in the output file. To remedy the situation, correct the CIF file.

Error 29: Wrong syntax of extended task

This message means that the CIF2SDT converter found a syntax error in the PR text of an extended task symbol. The incorrect text is printed as the rest of the error message. Either the left or right curly bracket is missing or they appear in the wrong place in the PR text. To remedy the situation, correct the CIF file.

List of Warning Messages

Warning 1: No input files

This warning is issued when the CIF2SDT converter finds out that no valid file or directory names were specified on the command line. To remedy the situation, ensure that the specified path/file names are correct.

Warning 2: Cannot convert file or directory

This warning is issued when the CIF2SDT converter cannot determine if the specified file is a CIF file or a directory. This is most probably caused by an invalid file/path name. To remedy the situation, ensure that the specified path/file names are correct.

Warning 3: SDLE says: ...

This warning is issued when the CIF2SDT converter receives a reply from the SDL Editor with a message explaining the reason of the error. To see the more detailed explanation of the reason for the error, see the text following the colon.

Warning 4: Empty diagram

This warning means that no diagrams are contained in the source CIF file.

Warning 5: Sorry, Select symbol is not supported in SDT SDLE

Since Select symbol is not supported in the SDL Editor, the converter has no option but to ignore it.

Warning 6: ... cannot contain ... text position specification, specification ignored

Warning 6: ... text placement specification is already specified, ignoring extra specification

Warning 7: This is location of previous specification

These warning messages mean that the source CIF file is corrupt. To remedy the situation, correct the CIF file.

Warning 8: Parsing of PR has failed

This means that there is incorrect SDL-PR after some CIF comment in the source CIF file. To remedy the situation, correct the CIF file.

Warning 9: Dashed attribute synthesized

Warning 10: Dashed attribute ignored

Warning 11: Ignoring gate references

These three messages mean that there are errors in source CIF file that have been automatically corrected.

Warning 12: Integer value expected, zero assumed

This message means that some other text was encountered instead of integer number in the source CIF file, thus the value has been assumed to be zero.

Warning 13: PR is not allowed in ...

This message means that the CIF2SDT converter encountered SDL-PR where it is not allowed to be. This also indicates that the source CIF file is corrupt. To remedy the situation, correct the CIF file.

Warning 14: Descriptors are not allowed (in typebased system)

This means that the source CIF file contained a type based system diagram with some symbols in it, which is a violation of the Z.106 standard. These symbols have been ignored.

SDT2CIF Converter Tool

The SDT2CIF tool converts SDT native (binary) format files to CIF files. It can convert one or more specified SDT binary format files, SDT system files or all SDT diagram files in a specified directory.

The SDT2CIF converter also supports the mixed platform feature of SDT (for more information on this topic, see Windows and UNIX File Compatibility. If the converter finds a [DRIVES] section during the conversion of an SDT system file, it assumes that this SDT system file is used on mixed platforms. This makes the converter change all characters in output file name to lower case (on UNIX) or replace the part of the path by the drive letter (in Windows).

The SDT2CIF converter never overwrites existing data files. If the converter finds that the file it was going to write already exists, it generates a new name for the output file by replacing the two last characters at the end of the file name.

The SDT2CIF converter can be started in the following ways:

Command Line Syntax (UNIX only)

On UNIX, the SDT2CIF tool can be invoked from the OS prompt as follows:

The meaning of the command-line options is given in the following sections.

Command Line Options

Examples of Usage


Example 57       

where mysystem.sdt has the following diagrams:

The SDT2CIF tool will convert all the diagrams referred to in the SDT system file and save them in the CIF format under transformed names:


Example 58       

(where mysdtdir specifies a directory name)

The SDT2CIF tool will look in the directory mysdtdir and convert all SDT binary files (but not SDT system files -- this would cause double conversion) to the corresponding CIF files.


Example 59       

The SDT2CIF tool will convert the three SDT binary files to the CIF files myblock.cbk, myprocss.cpr and myservce.csv.


Example 60       

The SDT2CIF tool will convert the three SDT binary files block_a.sbk, block_b.sbk, block_c.sbk and put all diagrams converted into the file blocks.cif.


Example 61       

The SDT2CIF tool will convert the three SDT binary files block_a.sbk, block_b.sbk, block_c.sbk and put all diagrams converted into the file named blocks_a.cbk (resulting from the name under which the first file in the list of files to convert would be saved if the -s switch was not specified).


Convert GR to CIF Dialog (UNIX only)

On UNIX, the SDT2CIF converter can also be started by selecting Convert GR to CIF from the Organizer's Generate menu. This opens the Convert GR to CIF dialog:

Figure 181 : The Convert GR to CIF dialog

Extracted pic [4]

The dialog functions as a front-end to the sdt2cif converter described in Command Line Syntax (UNIX only). The only functionality not supported by the dialog is the possibility to specify a directory name as input to the conversion.

Graphical User Interface (Windows only)

In Windows, the SDT2CIF converter is either started outside SDT by using the sdt2cif executable in the SDT distribution, or by selecting Convert GR to CIF from the Organizer's Generate menu. It provides a Graphical User Interface to control the conversions:

Figure 182 : SDT2CIF Graphical User Interface

Extracted pic [2]

To convert a single SDT binary file, SDT system file or all SDT binary files in a directory, perform the following steps:

  1. Type an SDT file or directory name in the text field under SDT file or directory to convert.
  2. Specify the desired options by clicking on check boxes which specify conversion options; look for option explanations in the following subsections.
  3. Click the Generate CIF button.

After these steps, the conversion will proceed, possibly printing warning/errors/information messages into the Conversion log text box.

After the conversion has been performed, the SDT2CIF converter can be used again to convert more SDT files or directories.

Converter Options

Messages from SDT2CIF Converter

The SDT2CIF converter issues an information message when it needs to inform the user about something; for example, when it changes the output file name so as not to overwrite an existing file. It also issues a warning message when some non-fatal error is found; for example, when some symbol on a diagram occurs in a wrong context. It prints an error message when it is not possible to continue the conversion; for example, when the input file is wrong or corrupt.

Message Format

The general format for warning/error messages is the following:

The <error code> specifies the error code which can be used to find the warning/error explanation (see the following sections). The <error text> gives a short explanation of what is wrong. The <additional information> specifies additional information about the error (for example, it can specify the name of an endpoint constraint that could not be bound).

The list of possible warning/error messages follows in the next sections.

List of Error Messages

Error 0: Arguments required (UNIX only)

This error indicates that no command-line arguments were given to the SDT2CIF converter, which thus cannot continue processing. To remedy the situation, supply one or more file/directory name(s) to convert.

Error 1: Illegal option (UNIX only)

This message is issued when an invalid option is found in the command line. To remedy the situation, supply an appropriate option instead of the invalid one.

Error 2: Duplicate option (UNIX only)

This message is issued when a duplicate command-line option is found. The command line options can be specified only once. To remedy the situation, remove duplicated options from the command line.

Error 3: Missing output file (UNIX only)

This message is issued when the option -o has been specified, but no output file name follows. To remedy the situation, supply an output file name after the -o option.

Error 4: Illegal command line syntax (UNIX only)

This message is issued when the command line is found not to obey the command-line syntax. To remedy the situation, make the command line conform to the command-line syntax.

Error 5: Impossible to connect to SDT PostMaster

This message is issued when the SDT2CIF converter cannot connect to the PostMaster.

In Windows, the SDT2CIF converter requires the PostMaster to be running in order to perform conversion. Start the Organizer and try again.

On UNIX, the most likely cause of this message is that either the path to the SDT tools is not in the search path, or the maximum number of licenses is reached. To remedy the situation, ensure that the SDL Editor can be started (i.e. it is in the search path) and that there are enough licenses available.

Error 6: SDLE cannot convert the file

This message means that either the SDT file is corrupt or SDT cannot read the source file or write to output file. To remedy the situation, ensure that the source SDT file is valid and that there is enough disk space. Try to re-start SDT and re-run the converter.

List of Warning Messages

Warning 0: No input files (UNIX only)

This message means that the SDT2CIF converter did not find any suitable file for conversion among those specified on the command line. To remedy the situation, ensure the specified file/path names are correct.

Warning 1: Cannot convert file or directory

This message is most probably caused by a path/file name misspelling. To remedy the situation, ensure that the specified file/path names are correct.

Warning 2: SDLE says: ...

This warning is issued when the SDT2CIF converter receives reply from the SDL Editor with message explaining the reason of the error. To see the more detailed explanation of the reason for the error, see the text following the colon.


[Previous] [Next] [Contents] [Index]