home *** CD-ROM | disk | FTP | other *** search
/ ftptest.leeds.ac.uk / 2015.02.ftptest.leeds.ac.uk.tar / ftptest.leeds.ac.uk / bionet / CAE-GROUP / SCL-WIN3x / FED_PLUS.EXE / CLASSES.H < prev    next >
C/C++ Source or Header  |  1994-07-29  |  6KB  |  167 lines

  1. /*
  2. ** Fed-x parser output module for generating C++  class definitions
  3. ** December  5, 1989
  4. ** release 2 17-Feb-1992
  5. ** release 3 March 1993
  6. ** release 4 December 1993
  7. ** K. C. Morris
  8. **
  9. ** Development of Fed-x was funded by the United States Government,
  10. ** and is not subject to copyright.
  11.  
  12. *******************************************************************
  13. The conventions used in this binding follow the proposed specification
  14. for the STEP Standard Data Access Interface as defined in document
  15. N350 ( August 31, 1993 ) of ISO 10303 TC184/SC4/WG7.
  16. *******************************************************************/
  17.  
  18. #include <stdio.h>
  19. #include <string.h>
  20. #include <ctype.h>
  21.  
  22.  
  23. #include "express.h"
  24. #include "exppp.h"
  25. #include "dict.h"
  26.  
  27.  
  28. #ifdef __CENTERLINE__
  29. #define CONST
  30. #else
  31. #define CONST const
  32. #endif
  33.  
  34. #define MAX_LEN        240
  35. #define DEBUG        if (0) printf 
  36.  
  37. #define TD_PREFIX    "t_"
  38. #define ATTR_PREFIX    "a_"
  39. #define ENT_PREFIX    "e_"
  40. #define SCHEMA_PREFIX    "s_"
  41.  
  42. #define TYPEprefix(t)         (TYPEis_entity (t) ? ENT_PREFIX : TD_PREFIX)
  43.  
  44. #define SCHEMA_FILE_PREFIX    "Sdai"
  45. #define TYPE_PREFIX   "Sdai"
  46. #define ENTITYCLASS_PREFIX    TYPE_PREFIX
  47. #define ENUM_PREFIX    "sdai"
  48.  
  49. #define move(b)        (b = (b + strlen(b)))
  50. #define TYPEtd_name(t,s)    TypeDescriptorName ((t), (s))
  51.  
  52. typedef  struct file_holder  {
  53.     FILE*  inc;        /*  include file  */
  54.     FILE*  lib;        /*  library file  */
  55.     FILE*  incall;    /*  include file for collecting all include files  */
  56.     FILE*  initall;    /*  for registering all entities from all schemas  */
  57.     FILE*  make;    /*  for indicating schema source files in makefile  */
  58.     FILE*  code;    
  59.     FILE*  init;    /*  contains function to initialize program
  60.                 to use schema's entities */
  61.     FILE*  initent;
  62. }  File_holder, FILES;
  63.  
  64. typedef struct EntityTag *EntityTag;
  65. struct EntityTag {
  66.   /*  these fields are used so that ENTITY types are processed in order
  67.    *  when appearing in differnt schemas   */
  68.   unsigned int started :1; /*  marks the beginning of processing  */
  69.   unsigned int complete :1;  /*  marks the end of processing  */
  70.  
  71.   Entity superclass;  /*  the entity being used as the supertype
  72.             *  - with multiple inheritance only chose one */
  73. };
  74.  
  75. Entity ENTITYget_superclass (Entity entity);
  76. Entity ENTITYput_superclass (Entity entity);
  77. int ENTITYhas_explicit_attributes (Entity e);
  78.  
  79. typedef struct SelectTag *SelectTag;
  80. struct SelectTag {
  81.   /*  these fields are used so that SELECT types are processed in order  */
  82.   unsigned int started :1; /*  marks the beginning of processing  */
  83.   unsigned int complete :1;  /*  marks the end of processing  */
  84.   };
  85.  
  86. #define String  const char *
  87. const char *    CheckWord( const char *);
  88. const char *     StrToLower(const char *);
  89. const char *    StrToUpper (const char *);
  90. const char *    FirstToUpper (const char *);
  91. const char *    SelectName (const char *); 
  92. void* generate_attribute_name( Variable a, char *out );
  93. char *
  94. FundamentalType(const Type t,int report_reftypes);
  95. char *
  96. Type_Description(const Type ,char *);
  97. FILE    *FILEcreate(const char *);
  98. void    FILEclose(FILE *);
  99. const char *  ClassName(const char *);
  100. const char *  ENTITYget_classname(Entity);
  101. void    ENTITYPrint(Entity,FILES *,Schema);
  102. const char *    StrToConstant(const char *);
  103. void    TYPEprint_definition(Type, FILES *,Schema);
  104. const char * PrettyTmpName (const char * oldname);
  105. const char * EnumName (const char * oldname)  ;
  106. const char * TypeDescriptorName (Type , Schema );
  107. char * TypeDescription (const Type t);
  108. const char * TypeName (Type t);
  109. const char * AccessType (Type t);
  110. const char * TYPEget_ctype (const Type t);
  111.  
  112. void
  113. ATTRprint_access_methods_put_head  (CONST char * entnm, Variable a, FILE* file);
  114. void
  115. ATTRsign_access_methods (Variable a, FILE* file);
  116. void
  117. ATTRprint_access_methods_get_head  (const char * classnm, Variable a, FILE* file) ;
  118. char* TypeBody_Description(TypeBody body, char *buf);
  119. int 
  120. isAggregateType (const Type t);
  121. Variable
  122. VARis_overrider (Entity e, Variable a); 
  123. int
  124. isAggregate  (Variable a);
  125. void
  126. TYPEselect_print (Type t, FILES* files, Schema schema) ;
  127. void resolution_success(void);
  128. void
  129. TYPEprint_typedefs (Type t, FILE* f)  ;
  130. void
  131. TYPEprint_new (const Type type, FILES* files, Schema schema);
  132. void
  133. TYPEprint_descriptions (const Type type, FILES* files, Schema schema); 
  134. extern const char *CheckWord(const char *word);
  135. extern char ToLower(char c);
  136. extern char ToUpper(char c);
  137. extern const char *StrToLower(const char *word);
  138. extern const char *StrToUpper(const char *word);
  139. extern const char *StrToConstant(const char *word);
  140. extern struct _iobuf *FILEcreate(const char *filename);
  141. extern void FILEclose(struct _iobuf *file);
  142. extern int isAggregate(struct Variable *a);
  143. extern int isAggregateType(struct Scope *const t);
  144. extern const char *TYPEget_ctype(struct Scope *const t);
  145. extern const char *TypeName(struct Scope *t);
  146. extern const char *AccessType(struct Scope *t);
  147. extern const char *ClassName(const char *oldname);
  148. extern const char *ENTITYget_classname(struct Scope *ent);
  149. extern const char *PrettyTmpName(const char *oldname);
  150. extern const char *EnumName(const char *oldname);
  151. extern const char *SelectName(const char *oldname);
  152. extern const char *FirstToUpper(const char *word);
  153. extern const char *TypeDescriptorName(struct Scope *t,struct Scope *s);
  154. extern int ENTITYhas_explicit_attributes(struct Scope *e);
  155. extern struct Scope *ENTITYput_superclass(struct Scope *entity);
  156. extern struct Scope *ENTITYget_superclass(struct Scope *entity);
  157. extern struct Variable *VARis_type_shifter(struct Variable *a);
  158. extern struct Variable *VARis_overrider(struct Scope *e,struct Variable *a);
  159. /*Variable*/
  160. /*VARis_simple_explicit (Variable a)*/
  161. #define VARis_simple_explicit(a)  (!VARis_type_shifter(a))
  162.  
  163. /*Variable*/
  164. /*VARis_simple_derived (Variable a)*/
  165. #define VARis_simple_derived(a)  (!VARis_overrider(a))
  166.  
  167.