Jump to content

SOM Compiler: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
by [[Prokushev]]
The SOM compiler (SC.EXE) is a precompiler for generating [[SOM]] source code, mainly used for WPS extensions.


In [[Interface definition language|previous]] article we looked at SOM [[Interface Definition Language]]. Now we'll try to explain how SOM Compiler works.  
The SOM compiler was distributed by IBM as part of the [[SOMobjects Developer Toolkit for OS/2]] and the OpenDoc Toolkit. Later this toolkits integrated into [[IBM Developer's Toolkit for OS/2 Warp Version 4]].


SOM Compiler is a tool to produce various file formats from [[Interface Definition Language]] files. SOM Compiler reads IDL file and produces abstract graph tree. Using abstract tree SOM Compiler generates object graph tree using classes like '''[[SOMTEntryC]]'''. After object graph is ready, SOM Compiler uses classes like '''[[SOMTEmitC]]''' to produce output template. Output file generated with help of '''[[SOMTTemplateOutputC]]''' class.  
SOM Compiler is a tool to produce various file formats from [[Interface Definition Language|Interface Definition Language]] files. SOM Compiler reads IDL file and produces abstract graph tree. Using abstract tree SOM Compiler generates object graph tree using classes like '''SOMTEntryC'''. After object graph is ready, SOM Compiler uses classes like '''SOMTEmitC''' to produce output file.  


SOM Compiler uses DLL-name based loading of classes libraries (other programs can user another approach, like WPS does. WPS uses [[Interface Repository]] to find corresponding class). Most of SOM Compiler classes libraries it is implementation of corresponding [[emitter]]. Emitters can be created with help of [[Emitter Framework]].
SOM Compiler uses DLL-name based loading of classes libraries (other programs can user another approach, like WPS does. WPS uses [[Interface Repository Framework|Interface Repository]] to find corresponding class). Most of SOM Compiler classes libraries it is implementation of corresponding [[emitter]]. Emitters can be created with help of [[Emitter Framework]].


SOM Compiler actually is client program which uses [[Emitter Framework]] classes. SOM Compiler is closed-source, but with open architecture. Only things which can't be easely extended are parser, abstract graph builder and object graph builder. Other things can be ''shadowed'' and replaced by our own.


Let's look at SOM Compiler command line syntax to understand how to produce corresponding skeleton code from SOM Compiler template (bellow is SOM Compiler help screen):
==Version==
* 1997-02-28: included in ''IBM Developer's Toolkit for OS/2 Warp Version 4''
* 1999-06-30: Latest Version for OS/2


sc [-C:D:E:I:S:VU:cd:hi:m:prsvw] f1 f2 ...
==License==
Where:
IBM Copyright. Discontinued
-C <n>            - size of comment buffer (default: 200000)
-D <DEFINE>      - same as -D option for cpp.
-E <var>=<value>  - set environment variable.
-I <INCLUDE>      - same as -I option for cpp.
-S <n>            - size of string buffer (default: 200000)
-U <UNDEFINE>    - same as -U option for cpp.
-V                - show version number of compiler.
-c                - ignore all comments.
-d <dir>          - output directory for each emitted file.
-h                - this message.
-i <file>        - use this file name as supplied.
-m <name[=value]> - add global modifier.
-p                - shorthand for -D__PRIVATE__.
-r                - check releaseorder entries exist (default: FALSE).
-s <string>      - replace SMEMIT variable with <string>
-u                - update interface repository.
-v                - verbose debugging mode (default: FALSE).
-w                - don't display warnings (default: FALSE).
Modifiers:
addprefixes : adds `functionprefix' to method names in template file
[no]addstar : [no]add `*' to C bindings for interface references.
      corba : check the source for CORBA compliance.
        csc : force running of OIDL compiler.
emitappend : append the emitted files at the end of existing file.
  noheader : don't add a header to the emitted file.
      noint : don't warn about "int" causing portability problems.
    nolock : don't lock the IR during update.
      nopp : don't run the source through the pre-processor.
      notc : don't use typecodes for emit information.
nouseshort : don't generate short names for types.
  pp=<path> : specify a local pre-processor to use.
  tcconsts : generate CORBA TypeCode constants.


Note: All command-line modifiers can be set in the environment
==Authors==
by changing them to UPPERCASE and preappending "SM" to them.
* Andy Martin (IBM)
 
Environment Variables:
==Articles==
SMEMIT=[h;ih;c;xh;xih;xc;def;ir;pdl]
* [[First steps with the SOM compiler]] by [[Prokushev]]
: emitters to run (default : h;ih).
 
SMINCLUDE=<dir1>[;<dir2>]+
==Product Documentation==
: where to search for .idl and .efw files.
*''System Object Model Programming Guide''
SMKNOWNEXTS=ext[;ext]+
*''System Object Model Programming Reference''
: add headers to user written emitters.
 
SMTMP=<dir>
==Links==
: directory to hold intermediate files.
* {{L-IBMAnnUS|ZP93-0415}} (1993-06-15) - IBM SOMobjects Developer Toolkit, Workstation Runtimes, Workgroup Runtimes Version 2.0 for OS/2
SOMIR=<path>[;<path>]+
 
: list of IRs to search.
;Download
* som30os2.zip - IBM SOMobjects Developer Toolkit V 3.0 (1996-12-24)
Pragmas:
* SOM for Windows NT
#pragma somemittypes on          : turn on emission of global types.
 
#pragma somemittypes off        : turn off emission of global types.
[[Category:SOM]]
#pragma modifier <modifier stm>; : instead of modifier statement.
Now let's explain each command line switch deeper.

Latest revision as of 07:10, 7 August 2023

The SOM compiler (SC.EXE) is a precompiler for generating SOM source code, mainly used for WPS extensions.

The SOM compiler was distributed by IBM as part of the SOMobjects Developer Toolkit for OS/2 and the OpenDoc Toolkit. Later this toolkits integrated into IBM Developer's Toolkit for OS/2 Warp Version 4.

SOM Compiler is a tool to produce various file formats from Interface Definition Language files. SOM Compiler reads IDL file and produces abstract graph tree. Using abstract tree SOM Compiler generates object graph tree using classes like SOMTEntryC. After object graph is ready, SOM Compiler uses classes like SOMTEmitC to produce output file.

SOM Compiler uses DLL-name based loading of classes libraries (other programs can user another approach, like WPS does. WPS uses Interface Repository to find corresponding class). Most of SOM Compiler classes libraries it is implementation of corresponding emitter. Emitters can be created with help of Emitter Framework.


Version

  • 1997-02-28: included in IBM Developer's Toolkit for OS/2 Warp Version 4
  • 1999-06-30: Latest Version for OS/2

License

IBM Copyright. Discontinued

Authors

  • Andy Martin (IBM)

Articles

Product Documentation

  • System Object Model Programming Guide
  • System Object Model Programming Reference

Links

  • ZP93-0415 (1993-06-15) - IBM SOMobjects Developer Toolkit, Workstation Runtimes, Workgroup Runtimes Version 2.0 for OS/2
Download
  • som30os2.zip - IBM SOMobjects Developer Toolkit V 3.0 (1996-12-24)
  • SOM for Windows NT