1 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
2 ** All rights reserved.
4 ** Authors: Martin Trapp, Christian Schaefer,
7 ** entity.h: declarations for entity
16 /*******************************************************************/
18 /*******************************************************************/
20 /* initalize entity */
21 void init_entity (void);
24 /*******************************************************************/
26 /*******************************************************************/
28 typedef struct entity {
30 ident *name; /* name of this entity */
31 type *owner; /* The class this entity belongs to */
32 ident *ld_name; /* Unique name of this entity, i.e., the mangled
33 name. E.g., for a class `A' with field `a' this
34 is the ident for `A_a'. */
35 type *type; /* The type of this entity, e.g., a method type, a
36 basic type of the language or a class itself */
37 unsigned long visit; /* visited counter for walks of the type information */
40 /* create a new entity */
41 entity *new_entity (type *owner, ident *name, type *type);
43 /* manipulate fields of entity */
45 char *get_entity_name (entity *); */
46 ident *get_entity_ident (entity *);
48 void set_entity_ld_name (entity *, char *ld_name);
49 void set_entity_ld_ident (entity *, ident *ld_ident);
52 // type_class *get_entity_owner (entity *);
53 type *get_entity_owner (entity *);
54 // void set_entity_owner (entity *, union type *);
55 void set_entity_owner (entity *, type *);
56 inline void assert_legal_owner_of_ent(type *);
58 ident *get_entity_ld_name (entity *); /** resolve name conflict!! standard: ident **/
60 char *get_entity_ld_ident (entity *);
61 void set_entity_ld_name (entity *, char *ld_name);
62 void set_entity_ld_ident (entity *, ident *ld_ident);
65 type *get_entity_type (entity *);
66 void set_entity_type (entity *, type *);
68 # endif /* _ENTITY_H_ */