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 >
Wrap
C/C++ Source or Header
|
1994-07-29
|
6KB
|
167 lines
/*
** Fed-x parser output module for generating C++ class definitions
** December 5, 1989
** release 2 17-Feb-1992
** release 3 March 1993
** release 4 December 1993
** K. C. Morris
**
** Development of Fed-x was funded by the United States Government,
** and is not subject to copyright.
*******************************************************************
The conventions used in this binding follow the proposed specification
for the STEP Standard Data Access Interface as defined in document
N350 ( August 31, 1993 ) of ISO 10303 TC184/SC4/WG7.
*******************************************************************/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "express.h"
#include "exppp.h"
#include "dict.h"
#ifdef __CENTERLINE__
#define CONST
#else
#define CONST const
#endif
#define MAX_LEN 240
#define DEBUG if (0) printf
#define TD_PREFIX "t_"
#define ATTR_PREFIX "a_"
#define ENT_PREFIX "e_"
#define SCHEMA_PREFIX "s_"
#define TYPEprefix(t) (TYPEis_entity (t) ? ENT_PREFIX : TD_PREFIX)
#define SCHEMA_FILE_PREFIX "Sdai"
#define TYPE_PREFIX "Sdai"
#define ENTITYCLASS_PREFIX TYPE_PREFIX
#define ENUM_PREFIX "sdai"
#define move(b) (b = (b + strlen(b)))
#define TYPEtd_name(t,s) TypeDescriptorName ((t), (s))
typedef struct file_holder {
FILE* inc; /* include file */
FILE* lib; /* library file */
FILE* incall; /* include file for collecting all include files */
FILE* initall; /* for registering all entities from all schemas */
FILE* make; /* for indicating schema source files in makefile */
FILE* code;
FILE* init; /* contains function to initialize program
to use schema's entities */
FILE* initent;
} File_holder, FILES;
typedef struct EntityTag *EntityTag;
struct EntityTag {
/* these fields are used so that ENTITY types are processed in order
* when appearing in differnt schemas */
unsigned int started :1; /* marks the beginning of processing */
unsigned int complete :1; /* marks the end of processing */
Entity superclass; /* the entity being used as the supertype
* - with multiple inheritance only chose one */
};
Entity ENTITYget_superclass (Entity entity);
Entity ENTITYput_superclass (Entity entity);
int ENTITYhas_explicit_attributes (Entity e);
typedef struct SelectTag *SelectTag;
struct SelectTag {
/* these fields are used so that SELECT types are processed in order */
unsigned int started :1; /* marks the beginning of processing */
unsigned int complete :1; /* marks the end of processing */
};
#define String const char *
const char * CheckWord( const char *);
const char * StrToLower(const char *);
const char * StrToUpper (const char *);
const char * FirstToUpper (const char *);
const char * SelectName (const char *);
void* generate_attribute_name( Variable a, char *out );
char *
FundamentalType(const Type t,int report_reftypes);
char *
Type_Description(const Type ,char *);
FILE *FILEcreate(const char *);
void FILEclose(FILE *);
const char * ClassName(const char *);
const char * ENTITYget_classname(Entity);
void ENTITYPrint(Entity,FILES *,Schema);
const char * StrToConstant(const char *);
void TYPEprint_definition(Type, FILES *,Schema);
const char * PrettyTmpName (const char * oldname);
const char * EnumName (const char * oldname) ;
const char * TypeDescriptorName (Type , Schema );
char * TypeDescription (const Type t);
const char * TypeName (Type t);
const char * AccessType (Type t);
const char * TYPEget_ctype (const Type t);
void
ATTRprint_access_methods_put_head (CONST char * entnm, Variable a, FILE* file);
void
ATTRsign_access_methods (Variable a, FILE* file);
void
ATTRprint_access_methods_get_head (const char * classnm, Variable a, FILE* file) ;
char* TypeBody_Description(TypeBody body, char *buf);
int
isAggregateType (const Type t);
Variable
VARis_overrider (Entity e, Variable a);
int
isAggregate (Variable a);
void
TYPEselect_print (Type t, FILES* files, Schema schema) ;
void resolution_success(void);
void
TYPEprint_typedefs (Type t, FILE* f) ;
void
TYPEprint_new (const Type type, FILES* files, Schema schema);
void
TYPEprint_descriptions (const Type type, FILES* files, Schema schema);
extern const char *CheckWord(const char *word);
extern char ToLower(char c);
extern char ToUpper(char c);
extern const char *StrToLower(const char *word);
extern const char *StrToUpper(const char *word);
extern const char *StrToConstant(const char *word);
extern struct _iobuf *FILEcreate(const char *filename);
extern void FILEclose(struct _iobuf *file);
extern int isAggregate(struct Variable *a);
extern int isAggregateType(struct Scope *const t);
extern const char *TYPEget_ctype(struct Scope *const t);
extern const char *TypeName(struct Scope *t);
extern const char *AccessType(struct Scope *t);
extern const char *ClassName(const char *oldname);
extern const char *ENTITYget_classname(struct Scope *ent);
extern const char *PrettyTmpName(const char *oldname);
extern const char *EnumName(const char *oldname);
extern const char *SelectName(const char *oldname);
extern const char *FirstToUpper(const char *word);
extern const char *TypeDescriptorName(struct Scope *t,struct Scope *s);
extern int ENTITYhas_explicit_attributes(struct Scope *e);
extern struct Scope *ENTITYput_superclass(struct Scope *entity);
extern struct Scope *ENTITYget_superclass(struct Scope *entity);
extern struct Variable *VARis_type_shifter(struct Variable *a);
extern struct Variable *VARis_overrider(struct Scope *e,struct Variable *a);
/*Variable*/
/*VARis_simple_explicit (Variable a)*/
#define VARis_simple_explicit(a) (!VARis_type_shifter(a))
/*Variable*/
/*VARis_simple_derived (Variable a)*/
#define VARis_simple_derived(a) (!VARis_overrider(a))