Semantical analysis

Static semantics generally

The static semantics analysis checks the consistency of the generated syntax tree (Common Representation), whereby the rules given by the language are attended. Concrete for SITE analysis operates on CR files and reports errors or warnings for SDL or also ASN.1. Following tools, e.g. the generation of code presuppose the consistency of a CR file.
The semantics analysis can be called both for complete specifications and individual Packages (in particular also ASN.1 modules). Referenced packages (use pack;) must be resolvable as CR files (search path), if they are not contained in the indicated CR file (e.g. usefull by partiual compilation).

Back to the start

Error messages and warnings

The analysis supports two basically different types of freely selectable error messages:

Errors and warnings can be divided into different classes: The lower four error classes should be reportet with an example to the SITE authors.
Back to the start

Analysis internally

SDL semantics is explained with a very complex, gradual replacement scenario. SITE follows these recommendations, however the syntactic structure changes only in exceptional cases. Because of the gradual analysis, error messages are not linear sorted.

  1. The command line parameters are analyzed and noted in internal structures.
  2. The CR file is read in.
  3. Referenced definitions are replaced by the definitions from the reference lists. It is also checked whether all packages, which are referecned in use clauses, are available. Missing packages are pulled tight and indicated as "externally" (importantly for the generation of code). If errors occur in this step, the analysis ends because of the reference errors which can be expected. One can be able to be output the CR after this step. With the PrettyPrinter one can produce oneself in this way a complete SDL/PR description without external Packages and with resolved referenced definitions.
  4. A symbol table of all local definitions is built. Also the implicit package Predefined is read.
  5. The symbol table is completed around imported definitions (package use and ASN.1 imports).
  6. The symbols of base types are transferred recursively to the derivatives. Also current context parameters are considered. After this step all structures contain symbol tables with all visible identifier. Errors by the inheritance are displayed.
  7. All references (identifier) are resolved. It also implies the analysis of expressions. Because of the frequent search in the symbol tables for suitable names, this step is very lengthy. There are various hash strategies, in order to improve the effectiveness of the search. Error messages concern false references, expressions and not unique resolution of references. If errors occur up to this step, then the analysis is aborted. Following steps often rely on a correct resolution of identifiers.
  8. There is a reference check for names. Here multiple definitions of same structures however different syntactic construction (sorts, generator names) are reported. Additionally the use of definitions is noted, in order to detect not used structures. These notes are from object-oriented view problematic, so that only in exceptional cases corresponding warnings are printed.
  9. Take place various consistency tests, which SDL otherwise still prescribe.
  10. On the basis of static instances (system, block, process...) instance test are executed. Those are so far however only tests of import/export structures. Actually also the routing structure would have to be tested here. This code is however deactivated, because of to many errors.
  11. There is optionally a step, which analyzes the communication interface of the SDL system for the environment. Here a file is written, which contains these information (signal.ext). So one can test the communication consistency of SDL systems based on same channel names. The consistency test are however specific for different SITE projects.

The individual steps are excellently modularized, so that the software in other SITE components can be reused. For example the code generator and the cross-reference service contain the modules up to the resolution of identifiers.

Back to the start

Further documentation

There is a UNIX manual, which explains the comand line parameters in detail. Also various studends papers contain partial aspects of the analysis. However, often the topicality is not given. One should assume one cannot successfully modify the sources of the analysis without tutorials to SITE. Also a reimplementation is not recommended, the analysis exists since about 1995 and will be never finnished until SDL-96 is replaced by SDL-2000. SDL is not a language it is a monster!
Back to the start

Sources and versions

The sources are embedded in a CVS structure. This contains however all project-specific adjustments, which are not freely available. Therefore in irregular periods public versions are extracted, during the writing of these pages we used version 4.3. One can inquire information whether there are relevant modifications in relation to the public version.
The substantial reason, a version restrainable are actually only critical CR modifications. At the moment we use CR version 3.4 internally
One should look up and find the sources on our FTP server. One can use also binary files for various architectures, if there are no problems with dynamic libraries.
Back to the start

Installation

The analysis must be found as executable program, i.e. possibly PATH has to be set accordingly. The analysis needs the package Predefined as CR file, i.e. call the SDL parser to if it is an SDL/PR file. For finding this file there are two possibilities:
  1. One indicates the file with the option -P explicitly.
  2. One sets an environment variable SITE_HOME on a directory (e.g. /usr/local/SITE), in which is under lib/ the file predefined.cr.
Both versions can also be hidden naturally in simple scripts. One should copy the manual to a place accessible for the command man (ending to consider). One can also read that!
Back to the start

Compilation

The Compilation is not quite simple, since various tools become necessary. One can download oneself if necessary the generated c files and only this compiling. That would be also the simplest method for Windows, not everyone will install a GNU development kit. Here a description which actually at the Comilation takes place:

Now to the problems:
Back to the start

Known bugs

Back to the start

created 29-Aug-94 by SITE maintenance crew
last change  at Fre Jun 27 11:26:45 CEST 2003