The 'pdl' Facility

As discussed earlier in this chapter, the SOM Compiler provides a pdl (Public Definition Language) emitter. This emitter generates a file that is the same as the .idl file from which it is produced, except that it removes all items within the .idl file that are marked as "private." An item is marked as private by surrounding it with "#ifdef_ _PRIVATE_ _" and "#endif" directives. Thus, the pdl emitter can be used to generate a "public" version of a .idl file. (Generally, client programs will need only the "public" methods and attributes.)

The SOMobjects Toolkit also provides a separate program, pdl, which performs the same function as the pdl emitter, but can be invoked independently of the SOM Compiler. In addition, the pdl program can remove any kind of items in the .idl file that are preceded by a user-specified "#ifdef" directive and followed by an "#endif" directive: The pdl program is invoked as follows:

where "files" specifies one or more .idl files whose specified "#ifdef" sections are to be removed. Filenames must be completely specified (with the .idl extension). If no "#ifdef" directive is specified (by including a -/<string> option), then the "#ifdef_ _PRIVATE_ __"sections will be removed by default.

The pdl command supports the following options. (Selected options can be specified individually, as a string of option characters, or as a combination of both. Any option that takes an argument either must be specified individually or must appear as the final option in a string of option characters.)

  • c cmd -d dir -h -f -s smemit -/ <string>

    For example, to install public versions of the .idl files in the directory "pubinclude", type:

       pdl -d pubinclude *.idl


    [Back: Running the SOM Compiler]
    [Next: Implementing Classes in SOM]