IBM
Contents Index Previous Next



CIF2SDT Converter Tool


The CIF2SDT tool converts CIF files to binary format files. 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

The CIF2SDT tool can be invoked from the OS prompt as follows:

cif2sdt [-v[ersion]] [-h] [-r] [-k] 
[ -o <output file name> ]
( <CIF file> | <directory> )*

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

(Windows only) When started without options or with -r option only, the Graphical User interface will be started, otherwise the application will execute as a command line application. However, to be able to get the output in the command window when run as a command line application you must use the special application conspawn as a wrapper (assuming C:\IBM\Rational\SDL_TTCN_Suite6.3 is the installation directory)

C:\IBM\Rational\SDL_TTCN_Suite6.3\bin\wini386\conspawn.exe -b
C:\IBM\Rational\SDL_TTCN_Suite6.3\bin\wini386\cif2sdt.exe 
myciffile

When using the converter as a command line application and invoking it within emacs path names in input files are lost. Therefore be sure to do a "cd" to the directory where the files are before invoking the converter.

Command Line Options

Note:

This option will only work if the CIF file contains the CIF comment OriginalFileName.

Examples of Usage

Example 145

cif2sdt myfile.cif

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 146

cif2sdt -o lift.sbk lift.cif

The CIF2SDT tool will convert the diagrams contained in the CIF file lift.cif to binary format and put it into an SDL 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 147

cif2sdt mycifdir

(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 binary format files.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 148

cif2sdt myblock.cbk myprocss.cpr myservce.csv

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

Example 149

cif2sdt mysystem.csy mycifdir

(where mycifdir specifies a directory name)

The CIF2SDT tool will convert the CIF file mysystem.csy and put the converted diagrams into an 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 169 : The Convert CIF to GR dialog

The dialog functions as a front-end to the cif2sdt converter described in Command Line Syntax. 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 contains the CIF comment OriginalFileName.

Graphical User Interface (Windows only)

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

Figure 170 : CIF2SDT Graphical User Interface

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.
    • To select a file using a standard dialog box, click the folder button which is located to the right of the text field.
  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 contains the 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 saved. 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 auto layout 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:

ERROR <error code>: [<line>, <column>:] <error text> 
<additional information>
WARNING <warning code>: [<line>, <column>:] <warning 
text> <additional information>

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 1: 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 2: 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 3: 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 4: 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 5: 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 6: 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 SDL Suite 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 7: 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 8: 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 9: 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 10: 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 11: 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 12: 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 13: 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 14: 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 15: 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 16: 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 17: Dashed should be used if keyword Adding is used for gate

Error 18: Wrong first endpoint in gate

Error 19: 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 20: 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 21: 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 22: 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 23: 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 24: 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 25: 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 26: 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 27: 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 28: 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 29: 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 30: 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 2: 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 3: 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 4: 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 5: Empty diagram

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

Warning 6: 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 7: ... cannot contain ... text position specification, specification ignored

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

Warning 8: 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 9: 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 10: Dashed attribute synthesized

Warning 11: Dashed attribute ignored

Warning 12: Ignoring gate references

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

Warning 13: 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 14: 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 15: 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.

Warning 16: Bad coordinate for line endpoint. Autolayout is used for this line

This means that a coordinate for a line endpoint has been found but this coordinate does not fall on the perimeter of the symbol that is connected to the line. Autolayout of the line will be used to place the line.


http://www.ibm.com/rational
Contents Index Previous Next