home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / sm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-26  |  21.9 KB  |  681 lines

  1. /*
  2.  *   COMPONENT_NAME: somc
  3.  *
  4.  *   ORIGINS: 27
  5.  *
  6.  *
  7.  *   10H9767, 10H9769  (C) COPYRIGHT International Business Machines Corp. 1992,1994
  8.  *   All Rights Reserved
  9.  *   Licensed Materials - Property of IBM
  10.  *   US Government Users Restricted Rights - Use, duplication or
  11.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  12.  */
  13. /* %Z% %I% %W% %G% %U% [%H% %T%] */
  14.  
  15. /*
  16.  */
  17.  
  18. /*
  19.  *         File:    sm.h.
  20.  *     Contents:    Basic type defintions used by the compiler and
  21.  *                  emitters, including emitter framework.
  22.  *
  23.  *                  The SOM Compiler (both IDL and OIDL) build up an
  24.  *                  internal strucuture called an "Entry" structure.
  25.  *                  This structure contains all of the information from
  26.  *                  the parsed IDL and OIDL files.  It is detailed in
  27.  *                  in the section entitled INTERNAL DATA STRUCTURES.
  28.  *      History:    [10/24/92] Program created.
  29.  *                  [12/06/93] __RESTRICT_MEMORY__ support #1115
  30.  *                  [01/14/94] Changes for SC LITE #1184
  31.  *                  [05/09/94] Changes for Data Description #3290
  32.  */
  33.  
  34. #ifndef sm_h
  35. #define sm_h
  36.  
  37. #include <smcidl.h>
  38.  
  39. #ifdef __SOMIDL__
  40.  
  41. /*
  42.  * For now we don't tell the IR about the internal structures of sm.h:
  43.  * these are not required dynamically, and we have all the information we
  44.  * want from the individual classes:
  45.  * To make the IDL compiler happy though we have to give some types for
  46.  * the following:
  47.  */
  48.  
  49. typedef void *Entry;
  50. typedef void *Mlist;
  51. typedef void *AttList;
  52. typedef void *NumberList;
  53. typedef void *SwitchBody;
  54.  
  55. #else
  56.  
  57. #define _DBCS         1
  58. #ifndef __SCLITE__
  59. #define SOMDESCRIPTOR 1
  60. #endif
  61.  
  62. #if defined(__OS2__) || defined(_WDOS) || /* 11494, 19368 */ defined(__WINDOWS__) || defined(_WIN32) /* 15369 */
  63.     #define SMTMP   "\\"
  64.     #define SMSLASH   '\\'
  65. #else
  66.     #define SMTMP   "/tmp"
  67.     #define SMSLASH   '/'
  68. #endif /* __OS2__ || _WDOS ||  _WIN32 ||  */
  69.  
  70. #ifndef SOMEXTERN
  71.     #ifdef __cplusplus
  72.     #define SOMEXTERN extern "C"
  73.     #else
  74.     #define SOMEXTERN extern
  75.     #endif /* __cplusplus */
  76. #endif /* SOMEXTERN */
  77.  
  78. #ifndef SOM_BOOLEAN
  79.   #define SOM_BOOLEAN
  80.   typedef unsigned char boolean;
  81. #endif /* SOM_BOOLEAN */
  82.  
  83. #ifndef SOM_TYPECODE
  84.   #define SOM_TYPECODE
  85.   typedef void * TypeCode;
  86. #endif /* SOM_TYPECODE */
  87.  
  88. /*
  89.  * Types of symbol table entries.
  90.  * Those wtih _BTYPE are base types,
  91.  * Those with _PTYPE are pre-declare types: such as unions, structs, enums.
  92.  * These are typically for forward references.  It is an error to mention
  93.  * a _PTYPE without some form of pointer reference.
  94.  * ISCONTYPE returns TRUE if its a constructed type.  This is used for
  95.  * typedefs as we can give the same name to a typedef of a constructed type.
  96.  */
  97.  
  98. #define ISMETHODTYPE(t)  (t == SOMTNewMethodE || t == SOMTOverrideMethodE || \
  99.               t == SOMTOverriddenMethodE)
  100. #define ISPTYPE(t)       (t == SOMTStructPE || t == SOMTEnumPE || \
  101.               t == SOMTUnionPE)
  102. #define ISCONTYPE(t)     (t == SOMTStructE || t == SOMTUnionE)
  103. #define ISSTYPE(t)       (t == SOMTStructSE || t == SOMTUnionSE)
  104. #define ISBTYPE(t)       (t == SOMTAnyBE || t == SOMTBooleanBE || \
  105.               t == SOMTCharBE || t == SOMTDoubleBE || \
  106.               t == SOMTEnumBE || t == SOMTFloatBE || \
  107.               t == SOMTLongBE || t == SOMTOctetBE || \
  108.               t == SOMTShortBE || t == SOMTStringBE || \
  109.               t == SOMTTypeCodeBE || t == SOMTTypedefBE || \
  110.               t == SOMTUnsignedLongBE || \
  111.               t == SOMTUnsignedShortBE ||\
  112.               t == SOMTVoidPtrBE || t == SOMTVoidBE)
  113.  
  114. #define SMIN            0x1
  115. #define SMOUT           0x2
  116. #define SMINOUT         0x3
  117.  
  118.  
  119. /*
  120.  * OIDL Compatibility.
  121.  */
  122. #define OVERRIDE            SOMTOverrideMethodE
  123. #define NEW                 SOMTNewMethodE
  124. #define ALLMETHODS          SMALLMETHODS_TYPE
  125.  
  126. #define PUBLIC              0x1
  127. #define PRIVATE             0x2
  128. #define PRIV_OR_PUB         (PRIVATE|PUBLIC)
  129.  
  130.  
  131. /*
  132.  * These macros and types are to deal with the different extensions that
  133.  * IDL vs OIDL introduce.
  134.  */
  135. _typedef struct {
  136.     char *ext;
  137.     char *ext_tmp;
  138.     char *public_ext;
  139.     char *private_ext;
  140.     char *throw_away_comment;
  141.     char *header_comment;
  142.     char *precompiler;
  143.     char *output_ext;
  144.     char *comment_ext;
  145.     char *filestem;
  146. } _name(SMEXT);
  147.  
  148. #define SM_IDL_EXT                      "idl"
  149. #define SM_IDL_TMP_EXT                  "id2"
  150. #define SM_IDL_PUBLIC_EXT               "dl"
  151. #define SM_IDL_PRIVATE_EXT              "pdl"
  152. #define SM_IDL_THROWAWAY_COMMENT        "//# "
  153.  
  154. #define SM_EXT                          somtext.ext
  155. #define SM_EXT_TMP                      somtext.ext_tmp
  156. #define SM_PUBLIC_EXT                   somtext.public_ext
  157. #define SM_PRIVATE_EXT                  somtext.private_ext
  158. #define SM_THROW_AWAY_COMMENT           somtext.throw_away_comment
  159. #define SM_HEADER_COMMENT               somtext.header_comment
  160. #define SM_PRECOMPILER                  somtext.precompiler
  161. #define SM_OUTPUT_EXT                   somtext.output_ext
  162. #define SM_COMMENT_EXT                  somtext.comment_ext
  163. #define SM_FILE_STEM                    somtext.filestem
  164.  
  165. #define SM_COMMENT_STYLE_START          1
  166. #define END_OF_COMMENT                  "@#$%!^%&*(~)+_) End of SOM Comment"
  167. #ifdef __RESTRICT_MEMORY__              /* #1115 */
  168. #define MAX_COMMENT_SIZE                24576
  169. #define HASH_SIZE                         109
  170. #else
  171. #define MAX_COMMENT_SIZE                49152
  172. #define HASH_SIZE                         401
  173. #endif /* #1115 */
  174. #define LARGEBUF                         4096
  175.  
  176. /*
  177.  *  Useful Macros.
  178.  */
  179.  
  180. #define smmalloc(nbytes)    somtsmalloc (nbytes, FALSE)
  181. #define smcalloc(nbytes)    somtsmalloc (nbytes, TRUE)
  182.  
  183. /*
  184.  * INTERNAL DATA STRUCTURES FOR THE PARSED IDL AND OIDL FILES:
  185.  */
  186.  
  187. /*
  188.  * These structures have been written so that they can be
  189.  * included multiple times for the SOM Compiler, for the Emitter Framework,
  190.  * and for IDL.
  191.  */
  192.  
  193. _typedef enum SOMTTypes {
  194.  
  195.     SOMTAnyBE,
  196.     SOMTArgumentE,
  197.     SOMTAttE,
  198.     SOMTBadEntryE,
  199.     SOMTBaseE,
  200.     SOMTBooleanBE,
  201.     SOMTCaseEntryE,
  202.     SOMTCaseListE,
  203.     SOMTCaseSTME,
  204.     SOMTCharBE,
  205.     SOMTClassE,
  206.     SOMTConstE,
  207.     SOMTCopyrightE,
  208.     SOMTDataE,
  209.     SOMTDclListE,
  210.     SOMTDefaultE,
  211.     SOMTDoubleBE,
  212.     SOMTEBaseE,
  213.     SOMTEEnumE,
  214.     SOMTEnumBE,
  215.     SOMTEnumE,
  216.     SOMTEnumPE,
  217.     SOMTFloatBE,
  218.     SOMTGroupE,
  219.     SOMTLongBE,
  220.     SOMTMetaE,
  221.     SOMTModuleE,
  222.     SOMTNegativeBE,
  223.     SOMTNewMethodE,
  224.     SOMTOctetBE,
  225.     SOMTOverriddenMethodE,
  226.     SOMTOverrideMethodE,
  227.     SOMTPassthruE,
  228.     SOMTSequenceE,
  229.     SOMTSequenceTDE,
  230.     SOMTShortBE,
  231.     SOMTStringBE,
  232.     SOMTStringE,
  233.     SOMTStructE,
  234.     SOMTStructPE,
  235.     SOMTStructSE,
  236.     SOMTTyDclE,
  237.     SOMTTypeCodeBE,
  238.     SOMTTypedefBE,
  239.     SOMTTypedefE,
  240.     SOMTUnionE,
  241.     SOMTUnionPE,
  242.     SOMTUnionSE,
  243.     SOMTUnsignedLongBE,
  244.     SOMTUnsignedShortBE,
  245.     SOMTVoidBE,
  246.     SOMTVoidPtrBE,
  247.  
  248.     /* defect #5751  */
  249.     SOMTEmitterBeginE,
  250.     SOMTEmitterEndE
  251.  
  252. } _name(SOMTTypes);
  253.  
  254.  
  255.     /*
  256.      * Map the basic structures, NOT Classes, onto typenames.
  257.      */
  258.     #define _Att             Att
  259.     #define _AttList         AttList
  260.     #define _CaseEntry       CaseEntry
  261.     #define _Class           Class
  262.     #define _Const           Const
  263.     #define _ConstUnion      ConstUnion
  264.     #define _Entry           Entry
  265.     #define _EntryUnion      EntryUnion
  266.     #define _EnumName        EnumName
  267.     #define _Enumerator      Enumerator
  268.     #define _Meta            Meta
  269.     #define _Method_OR_Data  Method_OR_Data
  270.     #define _Mlist           Mlist
  271.     #define _Module          Module
  272.     #define _NameList        NameList
  273.     #define _NumberList      NumberList
  274.     #define _Parent          Parent
  275.     #define _Passthru        Passthru
  276.     #define _Sequence        Sequence
  277.     #define _Simple          Simple
  278.     #define _String          String
  279.     #define _Struct          Struct
  280.     #define _SwitchBody      SwitchBody
  281.     #define _Typedef         Typedef
  282.     #define _Union           Union
  283.  
  284.     /*
  285.      * #define all the framework class types:
  286.      */
  287.     #define _SOMTAttributeEntryC      _Entry
  288.     #define _SOMTBaseClassEntryC      _Entry
  289.     #define _SOMTClassEntryC          _Entry
  290.     #define _SOMTCommonEntryC         _Entry
  291.     #define _SOMTDataEntryC           _Entry
  292.     #define _SOMTEmitC                _Entry
  293.     #define _SOMTEntryC               _Entry
  294.     #define _SOMTMetaClassEntryC      _Entry
  295.     #define _SOMTMethodEntryC         _Entry
  296.     #define _SOMTParameterEntryC      _Entry
  297.     #define _SOMTPassthruEntryC       _Entry
  298.     #define _SOMTStructEntryC         _Entry
  299.     #define _SOMTUnionEntryC          _Entry
  300.     #define _SOMTEnumEntryC           _Entry
  301.     #define _SOMTConstEntryC          _Entry
  302.     #define _SOMTSequenceEntryC       _Entry
  303.     #define _SOMTStringEntryC         _Entry
  304.     #define _SOMTEnumNameEntryC       _Entry
  305.     #define _SOMTModuleEntryC         _Entry
  306.  
  307. /*
  308.  * These too are possible contenders for class types
  309.  * so lets prime them now.
  310.  */
  311. #define _SOMTAttListC            _struct _AttList
  312. #define _SOMTMlistC              _struct _Mlist
  313. #define _SOMTNumberListC         _struct _NumberList
  314. #define _SOMTNameListC           _struct _NameList
  315. #define _SOMTSwitchBodyC         _struct _SwitchBody
  316. #define _SOMTModuleC             _struct _Module
  317.  
  318. /* 
  319.  * Forward reference the main Entry/OEntry structure.
  320.  */
  321. _typedef struct  _Entry _name(_Entry);
  322.  
  323. /*
  324.  *  AttList is used for attributes, and release order.
  325.  */
  326. _typedef struct _AttList {
  327.     char *name;                        /* Name of attribute */
  328.     char *value;                       /* Value of attribute */
  329.     _SOMTAttListC *next;               /* Next attribute */
  330. } _name(_AttList);
  331.  
  332. /* Added for 3290 */
  333. typedef struct ReleaseOrder {
  334.     char *name;                        /* Name of attribute */
  335.     char *value;                       /* Value of attribute */
  336.     _SOMTAttListC *next;               /* Next attribute */
  337.     /* Same as AttList above for binary compatibility */
  338.     _AttList *staticlist;
  339.     _AttList *protectedlist;
  340.     _AttList *publiclist;
  341.     _AttList *privatelist;
  342. } ReleaseOrder;
  343. /* End of 3290 */
  344.  
  345. /*
  346.  * Mlist is used as a linked list for Entry pointers.
  347.  */
  348. _typedef struct _Mlist {
  349.     _SOMTEntryC *ep;
  350.     _SOMTMlistC *next;
  351. } _name(_Mlist);
  352.  
  353. /*
  354.  * NumberList is used for lists of Numbers.
  355.  */
  356. _typedef struct _NumberList {
  357.     unsigned long n;
  358.     _SOMTNumberListC *next;
  359. } _name(_NumberList);
  360.  
  361.  
  362. /*
  363.  * NameList is used for lists of Names.
  364.  */
  365. _typedef struct _NameList {
  366.     char *name;
  367.     _SOMTNameListC *next;
  368. } _name(_NameList);
  369.  
  370. _typedef struct _CaseEntry {
  371.     _NameList *labels;                 /* list of case labels */
  372.     _SOMTEntryC *type;                 /* Type of switch */
  373.     _SOMTEntryC *dcl;                  /* Declarator for this type */
  374. } _name(_CaseEntry);
  375.  
  376. _typedef struct _SwitchBody {
  377.     _CaseEntry *entry;
  378.     _SOMTSwitchBodyC *next;
  379. } _name(_SwitchBody);
  380.  
  381. _typedef struct _Class {               /* SOMTClassE */
  382.     char *file;                        /* File name of the class */
  383.     _SOMTMetaClassEntryC *meta;        /* Pointer to meta class statement. OIDL
  384.                     * Compatibility */
  385.     _SOMTBaseClassEntryC *parent;      /* Pointer to parent class statement.
  386.                     * OIDL Compatibility */
  387.     _Mlist *parents;                   /* Pointer to list of parent class
  388.                     * statements. OIDL Compatibility */
  389.     _AttList *release;                 /* Release order associated with class */
  390.     _SOMTPassthruEntryC *passthrus;    /* List of passthrus for this class */
  391.     _SOMTDataEntryC *data;             /* List of instance data declarations */
  392.     TypeCode dataTc;                   /* Instance data struct TypeCode */
  393.     short methodcnt;                   /* Number of NEW methods in the class */
  394.     _SOMTMethodEntryC *methods;        /* Pointer to first method */
  395.     _Mlist *inherited;                 /* Pointer to inherited non/overridden
  396.                     * methods */
  397.     _Mlist *pubdefs;                   /* Public IDL type definitions i.e.
  398.                     * those types that are defined in the
  399.                     * "interface" section */
  400.  
  401.     _SOMTModuleEntryC *mod;            /* This is set to the containing module,
  402.                     * Otherwise NULL. */
  403.     _SOMTClassEntryC *cls;             /* If this Class is a meta class, then
  404.                     * this points to the Class of which
  405.                     * this is a meta class for, otherwise
  406.                     * NULL */
  407.     char isforward;                    /* 1 if forward ref, 0 otherwise */
  408. } _name(_Class);
  409.  
  410. _typedef struct _Meta {                /* SOMTMetaE */
  411.     char *file;                        /* File name of the meta class */
  412.     _SOMTClassEntryC *metadef;         /* Pointer to the meta class defn */
  413. } _name(_Meta);
  414.  
  415. _typedef struct _Parent {              /* SOMTBaseE */
  416.     _SOMTClassEntryC *parentdef;       /* Pointer to the parent class defn */
  417. } _name(_Parent);
  418.  
  419. _typedef struct _Passthru {            /* SOMTPassthruE */
  420.     _SOMTPassthruEntryC *next;         /* Pointer to next passthru */
  421. } _name(_Passthru);
  422.  
  423. _typedef struct _Method_OR_Data {      /* SOMTNewMethodE, SOMTOverrideMethodE,
  424.                     * SOMTOverriddenMethodE, SOMTDataE,
  425.                     * SOMTArgumentE, SOMTTypedefBE.
  426.                     * At present we store all of our
  427.                     * information for a METHOD declaration
  428.                     * and a DATA declartion in the
  429.                     * Method_OR_Data structure.  This is
  430.                     * convienient since we use the same
  431.                     * parsing code to parse a method
  432.                     * prototype as we do a data
  433.                     * declaration. In addition, with the
  434.                     * exception of omethod and oparent all
  435.                     * of the other fields are pontentially
  436.                     * used by a data declaration. */
  437.     _SOMTEntryC *eptype;               /* Structured form of the char *type
  438.                     * entry. IDL Extension. */
  439.     char *ptrs;                        /* Pointers to type. IDL Extension */
  440.     _NumberList *array;                /* List of array dimensions. IDL
  441.                     * Extension. */
  442.     char *arrays;                      /* String version of array dimensions,
  443.                     * same information in the NumberList
  444.                     * array, but retained for OIDL
  445.                     * compatibility. */
  446.     char *defn;                        /* Un-parsed defn of method call. OIDL
  447.                     * compatibility. */
  448.     char *type;                        /* [Return] type of method. OIDL
  449.                     * compatibility. */
  450.     char varargs;                      /* Method has a varargs parameter */
  451.     char isprivate;                    /* Method is 1=PRIVATE, 0=PUBLIC */
  452.     char inoutmode;                    /* In, out, inout. */
  453.     char isselfref;                    /* If =1 then arg points to self */
  454.     char isoneway;                     /* If =1 then oneway method */
  455.     short argcnt;                      /* Number of arguments */
  456.     _SOMTParameterEntryC *args;        /* Structured list of argument
  457.                     * declarations */
  458.     _SOMTMethodEntryC *omethod;        /* If method is overridden the original
  459.                     * method defn, otherwise NULL. */
  460.     _SOMTClassEntryC *oparent;         /* If method is overridden the original
  461.                     * parent defn, otherwise current
  462.                     * parent. */
  463.     _SOMTEntryC *group;                /* Pointer to group method appears in.
  464.                     * OIDL Compatibility. */
  465.     _SOMTMethodEntryC *next;           /* Next method/data/arg in class */
  466.     char **ctxsa;                      /* context string literal array */
  467.     _Mlist *raiseslist;                /* list of exceptions */
  468. } _name(_Method_OR_Data);
  469.  
  470. _typedef struct _Struct {              /* SOMTStructE, SOMTStructSE */
  471.     _Mlist *dcllist;                   /* list of declarators */
  472.     _SOMTClassEntryC *cls;             /* Class defined in for scoping */
  473.     char isexcept;                     /* TRUE if exception, otherwise FALSE */
  474.     char ismutref;                     /* TRUE if mutually-referential, 
  475.                     * otherwise FALSE, #206  */
  476. } _name(_Struct);
  477.  
  478. _typedef struct _Typedef {             /* SOMTTypedefE, SOMTTyDclE */
  479.     _SOMTEntryC *type;
  480.     _Mlist *dcllist;                   /* List of declarators */
  481.     _SOMTEntryC *next;                 /* FIX: Migration for old compiler
  482.                     * Should really turn all of our list of
  483.                     * Entries into Mlists. */
  484. } _name(_Typedef);
  485.  
  486. _typedef struct _Union {               /* SOMTUnionE, SOMTUnionSE */
  487.     _SOMTEntryC *type;                 /* Switch type */
  488.     _SwitchBody *swbody;               /* Body of switch */
  489.     char ismutref;                     /* TRUE if mutually-referential, 
  490.                     * otherwise FALSE, #206  */
  491. } _name(_Union);
  492.  
  493. _typedef struct _Enumerator {          /* SOMTEnumE */
  494.     _Mlist *names;                     /* list of enumerator names */
  495. } _name(_Enumerator);
  496.  
  497. _typedef union _ConstUnion _switch(SOMTTypes) {
  498.     _case(SOMTShortBE)
  499.     _case(SOMTLongBE)
  500.     _case(SOMTUnsignedShortBE)
  501.     _case(SOMTCharBE)
  502.     _case(SOMTBooleanBE)
  503.     _case(SOMTEnumBE)
  504.     _case(SOMTUnsignedLongBE)
  505.     unsigned long ul;
  506.     _case(SOMTNegativeBE)
  507.     long l;
  508.     _case(SOMTFloatBE)
  509.     _case(SOMTDoubleBE)
  510.     char *d;                       /* Due to errors in AIX compiler we, use
  511.                       strings for floats and doubles! */
  512.     _case(SOMTStringBE)
  513.     char *s;
  514. } _name(_ConstUnion);
  515.  
  516. _typedef struct _Const {               /* SOMTConstE */
  517.     _SOMTEntryC *type;                 /* Type of constant */
  518.     char *s;                           /* String value of expression */
  519.     SOMTTypes utype;                   /* Union type - if we had one. */
  520.     _ConstUnion u;                     /* Numeric Value of constant */
  521. } _name(_Const);
  522.  
  523. _typedef struct _Att {                 /* SOMTAttE */
  524.     char isreadonly;                   /* Read-only or not */
  525.     _SOMTEntryC *type;                 /* Simple type. */
  526.     _Mlist *dcllist;                   /* list of declarators */
  527.     _Mlist *get;                       /* list of get methods  */
  528.     _Mlist *set;                       /* list of set methods  */
  529. } _name(_Att);
  530.  
  531. _typedef struct _Sequence {            /* SOMTSequenceE, SOMTSequenceTDE */
  532.     _SOMTEntryC *type;                 /* Simple type */
  533.     long n;                            /* positive int const */
  534.     _SOMTEntryC *seqty;                /* Pointer to extra Seq. Typedef */
  535. } _name(_Sequence);
  536.  
  537. _typedef struct _String {              /* SOMTStringE */
  538.     long n;                            /* length of string */
  539. } _name(_String);
  540.  
  541. _typedef struct _EnumName {            /* SOMTEnumBE */
  542.     _SOMTEnumEntryC *ep;               /* pointer to ENUM Entry */
  543.     unsigned long value;               /* Value of Enumeration */
  544. } _name(_EnumName);
  545.  
  546. _typedef struct _Module {              /* SOMTModuleE */
  547.     _Mlist *defs;                      /* list of module definitions */
  548.     _SOMTModuleEntryC *mod;            /* This is set to the containing module,
  549.                     * Otherwise NULL. */
  550.     char *file;                        /* File in which Module appears */
  551. } _name(_Module);
  552.  
  553. /*
  554.  * The union of all of these different types
  555.  */
  556. _typedef union _EntryUnion _switch(SOMTTypes)
  557. {
  558.     _case(SOMTClassE)
  559.     _Class c;
  560.     _case(SOMTMetaE)
  561.     _Meta mt;
  562.     _case(SOMTBaseE)
  563.     _Parent p;
  564.     _case(SOMTPassthruE)
  565.     _Passthru pt;
  566.     _case(SOMTNewMethodE)
  567.     _case(SOMTOverrideMethodE)
  568.     _case(SOMTOverriddenMethodE)
  569.     _case(SOMTDataE)
  570.     _case(SOMTArgumentE)
  571.     _case(SOMTTypedefBE)
  572.     _case(SOMTVoidPtrBE)
  573.     _Method_OR_Data m;
  574.     _case(SOMTStructE)
  575.     _Struct struc;
  576.     _case(SOMTTyDclE)
  577.     _case(SOMTTypedefE)
  578.     _Typedef ty;
  579.     _case(SOMTUnionE)
  580.     _case(SOMTUnionSE)
  581.     _Union un;
  582.     _case(SOMTEnumE)
  583.     _Enumerator enumerator;
  584.     _case(SOMTConstE)
  585.     _Const con;
  586.     _case(SOMTAttE)
  587.     _Att att;
  588.     _case(SOMTSequenceE)
  589.     _case(SOMTSequenceTDE)
  590.     _Sequence seq;
  591.     _case(SOMTStringE)
  592.     _String str;
  593.     _case(SOMTEnumBE)
  594.     _EnumName enumN;
  595.     _case(SOMTModuleE)
  596.     _Module mod;
  597. } _name(_EntryUnion);
  598.  
  599. /*
  600.  *  Entry is the main data structure for storing classes, methods, passthrus,
  601.  *  groups, and data.
  602.  */
  603.  
  604. struct _Entry {
  605.     char *name;                        /* Name of entry */
  606.     SOMTTypes type;                    /* SOMTClassE, SMMETHOD_TYPE, etc */
  607.     char **sname;                      /* Scoped name */
  608.     char *comment;                     /* Comment associated with entry */
  609.     _AttList *atts;                    /* List of attributes */
  610.     TypeCode tc;                       /* TypeCode if appropriate, or NULL */
  611.     long lineno;                       /* Line number in source file */
  612. #ifdef SOMTEntryC
  613.     SOMTEntryC *objref;                /* Points to the object containing this
  614.                     * entry */
  615. #else
  616.     _SOMTEntryC *objref;               /* Points to the object containing this
  617.                     * entry */
  618. #endif
  619.     char isref;                        /* TRUE if this is a reference to the
  620.                     * real type, rather than a declaration
  621.                     * of it. */
  622.     _EntryUnion u;
  623. };
  624.  
  625. /*
  626.  * Attempt to reset the world by #undef as much as possible.
  627.  */
  628. #undef _Att
  629. #undef _AttList
  630. #undef _CaseEntry
  631. #undef _Class
  632. #undef _Const
  633. #undef _ConstUnion
  634. #undef _Entry
  635. #undef _EntryUnion
  636. #undef _EnumName
  637. #undef _Enumerator
  638. #undef _Meta
  639. #undef _Method_OR_Data
  640. #undef _Mlist
  641. #undef _Module
  642. #undef _NameList
  643. #undef _NumberList
  644. #undef _Parent
  645. #undef _Passthru
  646. #undef _SOMTAttListC
  647. #undef _SOMTAttributeEntryC
  648. #undef _SOMTBaseClassEntryC
  649. #undef _SOMTClassEntryC
  650. #undef _SOMTCommonEntryC
  651. #undef _SOMTConstEntryC
  652. #undef _SOMTDataEntryC
  653. #undef _SOMTEmitC
  654. #undef _SOMTEntryC
  655. #undef _SOMTEnumEntryC
  656. #undef _SOMTEnumNameEntryC
  657. #undef _SOMTMetaClassEntryC
  658. #undef _SOMTMethodEntryC
  659. #undef _SOMTMlistC
  660. #undef _SOMTModuleC
  661. #undef _SOMTModuleEntryC
  662. #undef _SOMTNameListC
  663. #undef _SOMTNumberListC
  664. #undef _SOMTParameterEntryC
  665. #undef _SOMTPassthruEntryC
  666. #undef _SOMTSequenceEntryC
  667. #undef _SOMTStringEntryC
  668. #undef _SOMTStructEntryC
  669. #undef _SOMTSwitchBodyC
  670. #undef _SOMTUnionEntryC
  671. #undef _Sequence
  672. #undef _Simple
  673. #undef _String
  674. #undef _Struct
  675. #undef _SwitchBody
  676. #undef _Typedef
  677. #undef _Union
  678.  
  679. #endif /* __SOMIDL__ */
  680. #endif /* _sm_h */
  681.