Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:docs:tk:som:sc:ug [2024/10/09 03:42] – prokushev | en:docs:tk:som:sc:ug [2024/10/11 09:04] (current) – [Include section (Preprocessing)] prokushev | ||
---|---|---|---|
Line 24: | Line 24: | ||
* Undocumented SOMTTypes now documented. | * Undocumented SOMTTypes now documented. | ||
* SOMIPC now supports IDL 4.2 specification. | * SOMIPC now supports IDL 4.2 specification. | ||
- | * CORBA C Language Mapping Specification 1.0 now supported by default instead of SOM C Language mapping. | + | * CORBA C Language Mapping Specification 1.0 now supported by default instead of CORBA 1.1 C Language mapping. |
* Added support of OIDL files | * Added support of OIDL files | ||
Line 141: | Line 141: | ||
Latest IBM SOM 3.0 supports CORBA IDL mostly at level of CORBA 1.1. somFree supports CORBA IDL 4.2 with all extensions found in SOM IDL. | Latest IBM SOM 3.0 supports CORBA IDL mostly at level of CORBA 1.1. somFree supports CORBA IDL 4.2 with all extensions found in SOM IDL. | ||
- | * Include Directives | + | ==== Preprocessing ==== |
+ | |||
+ | IDL shall be preprocessed according to the specification of the preprocessor in ISO/IEC 14882:2003. The preprocessor may be implemented as a separate process or built into the IDL compiler. | ||
+ | |||
+ | Lines beginning with # (also called " | ||
+ | |||
+ | A preprocessing directive (or any line) may be continued on the next line in a source file by placing a backslash character (\), immediately before the newline at the end of the line to be continued. The preprocessor effects the continuation by deleting the backslash and the newline. A backslash character may not be the last character in a source file. | ||
+ | |||
+ | The primary use of the preprocessing facilities is to include definitions from other IDL specifications. Text in files included with a #include directive is treated as if it appeared in the including file. | ||
+ | |||
+ | todo: #line | ||
+ | todo: #pragma | ||
+ | |||
+ | ==== Syntax ==== | ||
* Type and Constant Declarations (optional) | * Type and Constant Declarations (optional) | ||
* Exception Declarations (optional) | * Exception Declarations (optional) | ||
Line 147: | Line 161: | ||
* Module declaration (optional) | * Module declaration (optional) | ||
+ | ==== Example ==== | ||
Let's try to define our class interface. | Let's try to define our class interface. | ||
Line 163: | Line 178: | ||
Ok. Imagine, we need class to have access to Java objects. Let's write a class interface in terms of Interface Definition Language. | Ok. Imagine, we need class to have access to Java objects. Let's write a class interface in terms of Interface Definition Language. | ||
- | < | + | < |
# | # | ||
Line 184: | Line 199: | ||
Classic IDL file contains definitions like | Classic IDL file contains definitions like | ||
- | < | + | < |
| | ||
{ | { | ||
Line 196: | Line 211: | ||
[http:// | [http:// | ||
- | < | + | < |
# | # | ||
Line 298: | Line 313: | ||
using this script: | using this script: | ||
- | < | + | < |
/* REXX - our best dog */ | /* REXX - our best dog */ | ||
Line 335: | Line 350: | ||
As result, you'll have following: | As result, you'll have following: | ||
- | < | + | < |
# | # | ||
Line 366: | Line 381: | ||
* Methods section (optional) | * Methods section (optional) | ||
- | ==== Include section ==== | + | ==== Include section |
+ | |||
+ | Include section handled by SPP preprocessor. Preprocessor is a simple tool which includes files pointed by include section into the original file. | ||
Include section is optional and contains names of OIDL files with definition of parent class, metaclasses and private interfaces of ancestor classes. | Include section is optional and contains names of OIDL files with definition of parent class, metaclasses and private interfaces of ancestor classes. | ||
Line 378: | Line 395: | ||
ancestor is the name of the OIDL file containing the private part of an ancestor class' interface needed in the definition of this class. If ancestor is enclosed in angle brackets (%%<> | ancestor is the name of the OIDL file containing the private part of an ancestor class' interface needed in the definition of this class. If ancestor is enclosed in angle brackets (%%<> | ||
- | parent is the name of the OIDL file containing the parent class of the class for which the Include statement is provided. If parent is enclosed in angle | + | parent is the name of the OIDL file containing the parent class of the class for which the Include statement is provided. If parent is enclosed in angle brackets (%%<> |
- | brackets (%%<> | + | |
metaclass is the OIDL file containing the metaclass of the class for which the include statement is provided. If metaclass is enclosed in angle brackets (%%<> | metaclass is the OIDL file containing the metaclass of the class for which the include statement is provided. If metaclass is enclosed in angle brackets (%%<> | ||
+ | |||
+ | todo: @ line " | ||
==== Class section ==== | ==== Class section ==== | ||
Line 471: | Line 489: | ||
2. Support both entry points (emitSL and emit) in emitters. | 2. Support both entry points (emitSL and emit) in emitters. | ||
somFree emitters automatically switches to IBM SOM 2.1 ABI on emit call and to IBM SOM 3.0 ABI on emitSL call. | somFree emitters automatically switches to IBM SOM 2.1 ABI on emit call and to IBM SOM 3.0 ABI on emitSL call. | ||
- | ====== Список литературы ====== | ||
+ | todo: add info abount internal structures like in http:// | ||
+ | ====== Список литературы ====== | ||
- | - Object Management Group, «C Language Mapping Specification 1.0,» [В Интернете]. Available: https:// | ||
- | - IBM, OS/2 2.0 Technical Library. System Object Model Guide and Reference. First Edition., 1991. https:// | ||
+ | - Object Management Group, "C Language Mapping Specification 1.0, 1999" Available: https:// | ||
+ | - IBM, "OS/2 2.0 Technical Library. System Object Model Guide and Reference. First Edition, 1991" | ||
+ | - Object Management Group, "The Common Object Request Broker: Architecture and Specification. Revision 1.1, 1991" Available: https:// | ||