Download 15 The CPP2SDL Tool

Transcript
Chapter
15
The CPP2SDL Tool
Introduction
The overall purpose of the CPP2SDL tool is to provide a convenient
means of making external C or C++ declarations available in an SDL
context. This is accomplished by translating the C/C++ declarations
into representing SDL declarations. These resulting declarations can be
injected at an arbitrary level in the SDL scope hierarchy, and may then
be used just as if they actually were declared at that scope level. When
target code is generated for the SDL system, the Code Generator produces C or C++ code for usages of generated SDL declarations that
matches the original C/C++ declarations. The picture below depicts the
data flow when using CPP2SDL, and the context of the tool.
.
Other SDL/PR
Import specification
C/C++ header
files
.pr
.is
SDL/PR
.h
CPP2SDL
.pr
C/C++ object
files
.o
.o
C/C++
Linker
Analyzer &
C/C++ Code
Generator
Other object
code
C/C++
.c
C/C++
Compiler
.o
Object code
.exe Application
Figure 170 CPP2SDL Data Flow and Context
As can be seen in the figure, the input to CPP2SDL is a set of C/C++
header files and, optionally, an import specification. From this input
CPP2SDL generates an SDL/PR file containing SDL representations
for the declarations in the header files, or for a subset of these declarations according to what is specified in the import specification. The generated SDL/PR is analyzed together with other SDL/PR, e.g. the
758
,um-st1
Telelogic Tau 4.5 User’s Manual
July 2003