en:docs:tk:som:sc:ug

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:docs:tk:som:sc:ug [2024/10/09 04:41] prokusheven: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 (optional)+==== 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 "directives"communicate with this preprocessor. White space may appear before the #. These lines have syntax independent of the rest of IDL; they may appear anywhere and have effects that last (independent of the IDL scoping rules) until the end of the translation unit. The textual location of IDL-specific pragmas may be semantically constrained. 
 + 
 +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 366: Line 381:
   * Methods section (optional)   * Methods section (optional)
  
-==== Include section ====+==== Include section (Preprocessing) ==== 
 + 
 +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 (%%<>%%), the search for the file will begin in system-specific locations. If parent is enclosed in double quotation marks (%%""%%), the search for the file will begin in the local context, then move to the system-specific locations. 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 (%%<>%%), the search for the file will begin in system-specific locations. If parent is enclosed in double quotation marks (%%""%%), the search for the file will begin in the local context, then move to the system-specific locations.
  
-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 (%%<>%%), the search for the file will begin in system-specific locations. If parent is enclosed in double quotation marks (%%""%%), the search for the file will begin in the local context, then move to the system-specific locations.
-brackets (%%<>%%), the search for the file will begin in system-specific locations. If parent is enclosed in double quotation marks (%%""%%), the search for the file will begin in the local context, then move to the system-specific locations.+
  
 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 (%%<>%%), the search for the file will begin in system-specific locations. If metaclass is enclosed in double quotation marks (%%""%%), the search for the file will begin in the local context, then move to the system-specific locations. 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 (%%<>%%), the search for the file will begin in system-specific locations. If metaclass is enclosed in double quotation marks (%%""%%), the search for the file will begin in the local context, then move to the system-specific locations.
 +
 +todo: @ line "file" "filepath"
  
 ==== 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://www.edm2.com/index.php/OS/2_Application_Binary_Interface_for_PowerPC_(32-bit)   http://www.os2site.com/sw/dev/info/abippc32.pdf
 +====== Список литературы ======
  
-  - Object Management Group, «C Language Mapping Specification 1.0,» [В Интернете]. Available: https://www.omg.org/spec/C/. [Дата обращения: 24 Август 2022]. 
-  - IBM, OS/2 2.0 Technical Library. System Object Model Guide and Reference. First Edition., 1991. https://www.os2museum.com/files/docs/os220tl/os2-2.0-som-1991.pdf 
  
 +  - Object Management Group, "C Language Mapping Specification 1.0, 1999" Available: https://www.omg.org/spec/C/
 +  - IBM, "OS/2 2.0 Technical Library. System Object Model Guide and Reference. First Edition, 1991"  Available: https://www.os2museum.com/files/docs/os220tl/os2-2.0-som-1991.pdf
 +  - Object Management Group, "The Common Object Request Broker: Architecture and Specification. Revision 1.1, 1991" Available: https://www.omg.org/spec/CORBA/1.1