/[ascend]/trunk/base/generic/compiler/type_desc.h
ViewVC logotype

Diff of /trunk/base/generic/compiler/type_desc.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 354 by jds, Fri Dec 2 23:33:32 2005 UTC revision 355 by johnpye, Mon Mar 6 03:11:28 2006 UTC
# Line 43  Line 43 
43   *  </pre>   *  </pre>
44   */   */
45    
46  #ifndef type_desc_h_seen__  #ifndef ASC_TYPE_DESC_H
47  #define type_desc_h_seen__  #define ASC_TYPE_DESC_H
48    
49  /**  /**
50   *  Bad pointer for a patently bogus type definition when needed.   *  Bad pointer for a patently bogus type definition when needed.
# Line 287  extern enum type_kind GetBaseTypeF(CONST Line 287  extern enum type_kind GetBaseTypeF(CONST
287  #define BaseTypeIsEquation(d) ((d)->t & EQN_KIND)  #define BaseTypeIsEquation(d) ((d)->t & EQN_KIND)
288  /**<  Returns TRUE (int) if basetype of TypeDescription *d is among the equation types. */  /**<  Returns TRUE (int) if basetype of TypeDescription *d is among the equation types. */
289  #define BaseTypeIsSimple(d)   ((d)->t & SIMPLE_KINDS)  #define BaseTypeIsSimple(d)   ((d)->t & SIMPLE_KINDS)
290  /**<    /**<
291   *  Returns TRUE (int) if basetype of TypeDescription *d is among the simple types.   *  Returns TRUE (int) if basetype of TypeDescription *d is among the simple types.
292   *  Note that several types are not simple or compound --   *  Note that several types are not simple or compound --
293   *  we can't really make up our minds whether relations/whens/etc are   *  we can't really make up our minds whether relations/whens/etc are
# Line 349  extern int AddMethods(struct TypeDescrip Line 349  extern int AddMethods(struct TypeDescrip
349                        struct gl_list_t *pl,                        struct gl_list_t *pl,
350                        int err);                        int err);
351  /**<  /**<
352   *  Inserts new methods into a type and all its refinements.   *  Inserts new methods into a type and all its refinements.
353   *  pl should contain (struct InitProcedure *) to the methods to   *  pl should contain (struct InitProcedure *) to the methods to
354   *  add to d.  The methods named in pl must not conflict with any   *  add to d.  The methods named in pl must not conflict with any
355   *  method in d or its refinements.  If err != 0, rejects pl.<br><br>   *  method in d or its refinements.  If err != 0, rejects pl.<br><br>
356   *   *
357   *  If return is 1, caller is responsible for pl, OTHERWISE we manage it   *  If return is 1, caller is responsible for pl, OTHERWISE we manage it
# Line 370  extern int ReplaceMethods(struct TypeDes Line 370  extern int ReplaceMethods(struct TypeDes
370  /**<  /**<
371   *  Replaces listed methods in a type and all its refinements that do not   *  Replaces listed methods in a type and all its refinements that do not
372   *  themselves redefine the methods.  The methods in pl must exist in d or   *  themselves redefine the methods.  The methods in pl must exist in d or
373   *  else an error condition is returned.  Methods not named in pl but found   *  else an error condition is returned.  Methods not named in pl but found
374   *  in d or its refinements are left undisturbed. If err != 0, rejects pl.<br><br>   *  in d or its refinements are left undisturbed. If err != 0, rejects pl.<br><br>
375   *   *
376   *  If return is 1, caller is responsible for pl, OTHERWISE we manage it   *  If return is 1, caller is responsible for pl, OTHERWISE we manage it
# Line 400  extern void CopyTypeDescF(struct TypeDes Line 400  extern void CopyTypeDescF(struct TypeDes
400   */   */
401    
402  extern void DeleteTypeDesc(struct TypeDescription *d);  extern void DeleteTypeDesc(struct TypeDescription *d);
403  /**<  /**<
404   *  Decrement the reference count.  Eventually, this should delete it   *  Decrement the reference count.  Eventually, this should delete it
405   *  when ref_count == 0.  Note to myself:  Remember that array type   *  when ref_count == 0.  Note to myself:  Remember that array type
406   *  descriptions need to be removed from a list too.   *  descriptions need to be removed from a list too.
# Line 486  extern unsigned short GetTypeFlagsF(CONS Line 486  extern unsigned short GetTypeFlagsF(CONS
486    
487  #define TYPECONTAINSDEFAULTS 0x1  #define TYPECONTAINSDEFAULTS 0x1
488  #define TYPECONTAINSPARINSTS 0x2  #define TYPECONTAINSPARINSTS 0x2
489  /**<  /**<
490   *  We can add more, up to the minimum number of bits we expect a short   *  We can add more, up to the minimum number of bits we expect a short
491   *  to have under any C compiler.   *  to have under any C compiler.
492   *  Universal really should be under this protocol.   *  Universal really should be under this protocol.
493   */   */
494  #define TYPESHOW 0x100                #define TYPESHOW 0x100
495  /**< For browsing purposes */  /**< For browsing purposes */
496    
497  #ifdef NDEBUG  #ifdef NDEBUG
# Line 535  extern unsigned TypeHasParameterizedInst Line 535  extern unsigned TypeHasParameterizedInst
535   */   */
536    
537  #define AtomDefaulted(d) ((d)->u.atom.defaulted)  #define AtomDefaulted(d) ((d)->u.atom.defaulted)
538  /**<  /**<
539   *  Returns TRUE if the atom has a default value; otherwise returns FALSE.   *  Returns TRUE if the atom has a default value; otherwise returns FALSE.
540   */   */
541    
542  #define ConstantDefaulted(d) ((d)->u.constant.defaulted)  #define ConstantDefaulted(d) ((d)->u.constant.defaulted)
543  /**<  /**<
544   *  Returns TRUE if the Constant has a default value; otherwise returns FALSE.   *  Returns TRUE if the Constant has a default value; otherwise returns FALSE.
545   */   */
546    
# Line 715  extern struct gl_list_t *GetAncestorName Line 715  extern struct gl_list_t *GetAncestorName
715   */   */
716    
717  #define GetModelParameterWheres(d) ((d)->u.modarg.wheres)  #define GetModelParameterWheres(d) ((d)->u.modarg.wheres)
718  /**<  /**<
719   *  Return the list of statements that restrict the structure of   *  Return the list of statements that restrict the structure of
720   *  WILL_BE passed arguments in this MODEL.   *  WILL_BE passed arguments in this MODEL.
721   *  Used for instantiation-time checks.   *  Used for instantiation-time checks.
# Line 725  extern struct gl_list_t *GetAncestorName Line 725  extern struct gl_list_t *GetAncestorName
725   */   */
726    
727  #define GetModelParameterValues(d) ((d)->u.modarg.argdata)  #define GetModelParameterValues(d) ((d)->u.modarg.argdata)
728  /**<  /**<
729   *  NOT IMPLEMENTED.   *  NOT IMPLEMENTED.
730   *  Returns the list of values that match the ParameterLists.   *  Returns the list of values that match the ParameterLists.
731   *  Possibly this is a redundancy.   *  Possibly this is a redundancy.
# Line 881  extern struct TypeDescription Line 881  extern struct TypeDescription
881                       struct StatementList *tsl,                       struct StatementList *tsl,
882                       struct StatementList *vsl);                       struct StatementList *vsl);
883  /**<  /**<
884   *  Creates a Model TypeDescription structure with the parameters given.     *  Creates a Model TypeDescription structure with the parameters given.
885   *  sl, psl, rsl, wsl should NEVER be NULL, though they may be empty lists.     *  sl, psl, rsl, wsl should NEVER be NULL, though they may be empty lists.
886   *  tsl may be NULL.   *  tsl may be NULL.
887   *   *
888   *  @param name   Name of the type.   *  @param name   Name of the type.
# Line 1077  extern struct TypeDescription Line 1077  extern struct TypeDescription
1077   *  @return A pointer to the new TypeDescription structure.   *  @return A pointer to the new TypeDescription structure.
1078   */   */
1079    
1080  extern struct TypeDescription *MoreRefined(CONST struct TypeDescription *desc1,  extern struct TypeDescription *MoreRefined(CONST struct TypeDescription *desc1,
1081                                             CONST struct TypeDescription *desc2);                                             CONST struct TypeDescription *desc2);
1082  /**<  /**<
1083   *  Returns the more refined of desc1 or desc2, or   *  Returns the more refined of desc1 or desc2, or
# Line 1087  extern struct TypeDescription *MoreRefin Line 1087  extern struct TypeDescription *MoreRefin
1087  extern CONST struct TypeDescription  extern CONST struct TypeDescription
1088  *GreatestCommonAncestor(CONST struct TypeDescription *desc1,  *GreatestCommonAncestor(CONST struct TypeDescription *desc1,
1089                          CONST struct TypeDescription *desc2);                          CONST struct TypeDescription *desc2);
1090  /**<  /**<
1091   *  Returns the most refined common ancestor type of desc1,desc2.   *  Returns the most refined common ancestor type of desc1,desc2.
1092   *  If either of desc1 or desc2 directly REFINES the other, then   *  If either of desc1 or desc2 directly REFINES the other, then
1093   *  the return value will be the less refined of the two types.   *  the return value will be the less refined of the two types.
# Line 1139  extern struct TypeDescription *GetStatTy Line 1139  extern struct TypeDescription *GetStatTy
1139   */   */
1140    
1141  extern void WriteArrayTypeList(FILE *fp);  extern void WriteArrayTypeList(FILE *fp);
1142  /**<  /**<
1143   *  Writes the internal (implicit) array types to file fp.   *  Writes the internal (implicit) array types to file fp.
1144   *  This is a debugging function.  The information written isn't likely   *  This is a debugging function.  The information written isn't likely
1145   *  to be very meaningful.  It relies on internal variables, so we   *  to be very meaningful.  It relies on internal variables, so we
# Line 1174  extern void SetTypeShowBit(struct TypeDe Line 1174  extern void SetTypeShowBit(struct TypeDe
1174   *  @param value Flag for whether to set (non-zero) or clear (0) the show bit.   *  @param value Flag for whether to set (non-zero) or clear (0) the show bit.
1175   */   */
1176    
1177  #endif  /* type_desc_h_seen__ */  #endif  /* ASC_TYPE_DESC_H */
1178    

Legend:
Removed from v.354  
changed lines
  Added in v.355

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22