29 |
*//* |
*//* |
30 |
by Tom Epperly |
by Tom Epperly |
31 |
Created: 1/10/90 |
Created: 1/10/90 |
32 |
Version: $Revision: 1.13 $ |
Last in CVS: $Revision: 1.13 $ $Date: 1998/04/11 01:31:54 $ $Author: ballan $ |
|
Version control file: $RCSfile: proc.h,v $ |
|
|
Date last modified: $Date: 1998/04/11 01:31:54 $ |
|
|
Last modified by: $Author: ballan $ |
|
33 |
*/ |
*/ |
34 |
|
|
35 |
#ifndef ASC_PROC_H |
#ifndef ASC_PROC_H |
47 |
extern struct InitProcedure *CreateProcedure(symchar *name, |
extern struct InitProcedure *CreateProcedure(symchar *name, |
48 |
struct StatementList *stats); |
struct StatementList *stats); |
49 |
/**< |
/**< |
|
* <!-- struct InitProcedure *CreateProcedure(name,stats) --> |
|
|
* <!-- symchar *name; --> |
|
|
* <!-- struct StatementList *stats; --> |
|
50 |
* Create a procedure data structure with name and stats. |
* Create a procedure data structure with name and stats. |
51 |
*/ |
*/ |
52 |
|
|
53 |
extern struct InitProcedure *CopyProcedure(struct InitProcedure *p); |
extern struct InitProcedure *CopyProcedure(struct InitProcedure *p); |
54 |
/**< |
/**< |
|
* <!-- struct InitProcedure *CopyProcedure(p) --> |
|
|
* <!-- struct InitProcedure *p; --> |
|
55 |
* Make a copy of procedure p, but this copy should not be modified. |
* Make a copy of procedure p, but this copy should not be modified. |
56 |
* If you want to change the structure, use CopyProcToModify. Use |
* If you want to change the structure, use CopyProcToModify. Use |
57 |
* DestroyProcedure when you are done with it. |
* DestroyProcedure when you are done with it. |
59 |
|
|
60 |
extern struct InitProcedure *CopyProcToModify(struct InitProcedure *p); |
extern struct InitProcedure *CopyProcToModify(struct InitProcedure *p); |
61 |
/**< |
/**< |
|
* <!-- struct InitProcedure *CopyProcToModify(p) --> |
|
|
* <!-- struct InitProcedure *p; --> |
|
62 |
* Make a copy, but this copy can be changed. |
* Make a copy, but this copy can be changed. |
63 |
*/ |
*/ |
64 |
|
|
65 |
extern struct gl_list_t *MergeProcedureLists(struct gl_list_t *old_list, |
extern struct gl_list_t *MergeProcedureLists(struct gl_list_t *old_list, |
66 |
struct gl_list_t *new_list); |
struct gl_list_t *new_list); |
67 |
/**< |
/**< |
|
* <!-- plr = MergeProcedureLists(old,new); --> |
|
|
* <!-- struct gl_list_t *plr, *old, *new; --> |
|
68 |
* Merges the lists of (struct InitProcedure *) given into a third list, |
* Merges the lists of (struct InitProcedure *) given into a third list, |
69 |
* plr. |
* plr. |
70 |
* new, if it exists, is destroyed because we move the contents to plr. |
* new, if it exists, is destroyed because we move the contents to plr. |
95 |
|
|
96 |
extern void DestroyProcedure(struct InitProcedure *p); |
extern void DestroyProcedure(struct InitProcedure *p); |
97 |
/**< |
/**< |
|
* <!-- void DestroyProcedure(p) --> |
|
|
* <!-- struct InitProcedure *p; --> |
|
98 |
* Destroy this reference to p. This won't necessary destroy all the parts |
* Destroy this reference to p. This won't necessary destroy all the parts |
99 |
* of p. |
* of p. |
100 |
*/ |
*/ |
101 |
|
|
102 |
extern void DestroyProcedureList(struct gl_list_t *pl); |
extern void DestroyProcedureList(struct gl_list_t *pl); |
103 |
/**< |
/**< |
|
* <!-- void DestroyProcedureList(pl) --> |
|
|
* <!-- struct gl_list_t *pl contain pointers to --> |
|
|
* <!-- struct InitProcedure *p --> |
|
104 |
* Destroy this reference to p. This won't necessary destroy all the parts |
* Destroy this reference to p. This won't necessary destroy all the parts |
105 |
* of each p unless the parts have no other references. The gl_list is |
* of each p unless the parts have no other references. The gl_list is |
106 |
* destroyed as are all the p in it. |
* destroyed as are all the p in it. |
111 |
struct gl_list_t *pl2 , |
struct gl_list_t *pl2 , |
112 |
unsigned long int *n); |
unsigned long int *n); |
113 |
/**< |
/**< |
|
* <!-- CompareProcedureLists(pl1,pl2,&n) --> |
|
|
* <!-- struct gl_list_t *pl1, *pl2 contain pointers to --> |
|
|
* <!-- struct InitProcedure *p. --> |
|
|
* <!-- unsigned long n; --> |
|
114 |
* Returns 0 if pl1,pl2 semantically equivalent, 1 if not. |
* Returns 0 if pl1,pl2 semantically equivalent, 1 if not. |
115 |
* If return is 1, n contains the index of the first different |
* If return is 1, n contains the index of the first different |
116 |
* procedure. |
* procedure. |
129 |
*/ |
*/ |
130 |
ASC_DLLSPEC(symchar *) ProcNameF(CONST struct InitProcedure *p); |
ASC_DLLSPEC(symchar *) ProcNameF(CONST struct InitProcedure *p); |
131 |
/**< |
/**< |
|
* <!-- macro ProcName(p) --> |
|
|
* <!-- symchar *ProcNameF(p) --> |
|
|
* <!-- const struct InitProcedure *p; --> |
|
|
* <!-- Return the name part of a procedure structure. --> |
|
132 |
* Implementation function for ProcName(). Do not call this |
* Implementation function for ProcName(). Do not call this |
133 |
* function directly - use ProcName() instead. |
* function directly - use ProcName() instead. |
134 |
*/ |
*/ |
146 |
*/ |
*/ |
147 |
extern struct StatementList *ProcStatementListF(CONST struct InitProcedure *p); |
extern struct StatementList *ProcStatementListF(CONST struct InitProcedure *p); |
148 |
/**< |
/**< |
|
* <!-- struct StatementList *ProcStatementListF(p) --> |
|
|
* <!-- const struct InitProcedure *p; --> |
|
|
* <!-- Return the statement list part of the procedure structure. --> |
|
149 |
* Implementation function for ProcStatementList(). Do not call this |
* Implementation function for ProcStatementList(). Do not call this |
150 |
* function directly - use ProcStatementList() instead. |
* function directly - use ProcStatementList() instead. |
151 |
*/ |
*/ |
165 |
*/ |
*/ |
166 |
extern long GetProcParseIdF(CONST struct InitProcedure *p); |
extern long GetProcParseIdF(CONST struct InitProcedure *p); |
167 |
/**< |
/**< |
|
* <!-- id = GetProcParseIdF(p); --> |
|
|
* <!-- const struct InitProcedure *p; --> |
|
|
* <!-- long id; --> |
|
|
* <!-- Return the parse id of the type which originally defined this--> |
|
|
* <!-- procedure. This may be a copy of that procedure and not the --> |
|
|
* <!-- original, but this is of no significance. --> |
|
168 |
* Implementation function for GetProcParseId(). Do not call this |
* Implementation function for GetProcParseId(). Do not call this |
169 |
* function directly - use GetProcParseId() instead. |
* function directly - use GetProcParseId() instead. |
170 |
*/ |
*/ |
191 |
*/ |
*/ |
192 |
extern void SetProcParseIdF(struct InitProcedure *p, long id); |
extern void SetProcParseIdF(struct InitProcedure *p, long id); |
193 |
/**< |
/**< |
|
* <!-- SetProcParseIdF(p,id); --> |
|
|
* <!-- const struct InitProcedure *p; --> |
|
|
* <!-- long id. --> |
|
|
* <!-- Sets the parse id of the procedure. The wisdom of this move --> |
|
|
* <!-- is not investigated. The rules should be: --> |
|
|
* <!-- Procs normally get id's at the type desc creation step once --> |
|
|
* <!-- parseid is known. When a proc is inherited (by copy) the copy --> |
|
|
* <!-- retains the id of the original. If a method is added after the --> |
|
|
* <!-- type's creation, it should get that types id. If a method is replaced --> |
|
|
* <!-- in a type, all the refiners of that type which contain an --> |
|
|
* <!-- inherited copy of the method also get replaced and this id --> |
|
|
* <!-- helps us figure out which method was inherited efficiently. --> |
|
194 |
* Implementation function for SetProcParseId(). Do not call this |
* Implementation function for SetProcParseId(). Do not call this |
195 |
* function directly - use SetProcParseId() instead. |
* function directly - use SetProcParseId() instead. |
196 |
*/ |
*/ |
197 |
|
|
198 |
extern int CmpProcs(CONST struct InitProcedure *p1, CONST struct InitProcedure *p2); |
extern int CmpProcs(CONST struct InitProcedure *p1, CONST struct InitProcedure *p2); |
199 |
/**< |
/**< |
|
* <!-- int CmpProcs(p1,p2) --> |
|
|
* <!-- const struct InitProcedure *p1,*p2; --> |
|
200 |
* Compare the two procedures to provide an ordering for them. |
* Compare the two procedures to provide an ordering for them. |
201 |
* Simply alphabetizing. |
* Simply alphabetizing. |
202 |
*/ |
*/ |