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

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

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

revision 53 by ben.allan, Sun Dec 26 20:06:01 2004 UTC revision 54 by jds, Tue Aug 2 11:20:09 2005 UTC
# Line 1  Line 1 
1  /**<  /*
2   *  Model Child list routines   *  Model Child list routines
3   *  by Tom Epperly   *  by Tom Epperly
4   *  Version: $Revision: 1.21 $   *  Version: $Revision: 1.21 $
# Line 25  Line 25 
25   *  along with the program; if not, write to the Free Software Foundation,   *  along with the program; if not, write to the Free Software Foundation,
26   *  Inc., 675 Mass Ave, Cambridge, MA 02139 USA.  Check the file named   *  Inc., 675 Mass Ave, Cambridge, MA 02139 USA.  Check the file named
27   *  COPYING.   *  COPYING.
  *  
  *  This is a package of routines to process child lists.  
28   */   */
29    
30  /**<  /** @file
31     *  This is a package of routines to process child lists.
32     *  <pre>
33   *  When #including child.h, make sure these files are #included first:   *  When #including child.h, make sure these files are #included first:
34     *         #include "utilities/ascConfig.h"
35   *         #include "fractions.h"   *         #include "fractions.h"
36   *         #include "compiler.h"   *         #include "compiler.h"
37   *         #include "dimen.h"   *         #include "dimen.h"
38     *         #include "list.h"
39     *  </pre>
40   */   */
41    
   
42  #ifndef __CHILD_H_SEEN__  #ifndef __CHILD_H_SEEN__
43  #define __CHILD_H_SEEN__  #define __CHILD_H_SEEN__
 /**< requires  
  *# #include"compiler.h"  
  *# #include"list.h"  
  */  
44    
45    /**
46     *  The ChildListStructure is a private implementation detail.
47     *  All the public interface needs is a pointer thereto.
48     */
49  typedef CONST struct ChildListStructure *ChildListPtr;  typedef CONST struct ChildListStructure *ChildListPtr;
50    
51    /**
52     * The ChildListEntry is the interface container for creating
53     * childlists. Storage scheme and usage after that is all
54     * black magic which can only be done by following this header.<br><br>
55     *
56     * As of 9/96 we've added a number of important features to
57     * ChildList, and it's nobody's business how we implement it.
58     */
59  struct ChildListEntry {  struct ChildListEntry {
60    symchar *strptr;    symchar *strptr;
61    /**<        /**< the symbol table name of a child, eg "a" of a[i][j] */
    * this is the symbol table name of a child, eg "a" of a[i][j]  
    */  
62    CONST struct TypeDescription *typeptr;    CONST struct TypeDescription *typeptr;
63    /**<        /**< the most refined type for the child that can be determined
64     * this is the most refined type for the child that can be determined         * at parse time. Corresponding instances at run time may be this or
65     * at parse time. Corresponding instances at run time may be this or         * a more refined type. This allows several kinds of sanity checking.
66     * a more refined type. This allows several kinds of sanity checking.         * This pointer must not be NULL.
67     * This pointer must not be NULL.         */
    */  
68    CONST struct Statement *statement;    CONST struct Statement *statement;
69    /**<        /**< statement where child is initially defined. */
    * statement where child is initially defined.  
    */  
70    unsigned bflags;    unsigned bflags;
71    /**<        /**< boolean flags, as defined below with CBF_* */
    * boolean flags, as defined below with CBF_*  
    */  
72    short isarray;    short isarray;
73    /**<        /**< isarray should be number of subscripts if you firmly
74     * isarray should be number of subscripts if you firmly         * believe the named child is an array. Nobody could possibly
75     * believe the named child is an array. Nobody could possibly         * have more than a shorts worth of subscripts.
76     * have more than a shorts worth of subscripts.         */
    */  
77    short origin;    short origin;
78    /**<        /**< tells how child created (ALIASES, ARR, WILL_BE, IS_A,
79     * tells how child created (ALIASES, ARR, WILL_BE, IS_A,         *                            P-ALIASES, P-ARR, P-IS_A, P-WILL_BE)
80     *                          P-ALIASES, P-ARR, P-IS_A, P-WILL_BE)         * P-IS_A and P-WILL_BE indicate that it came through a parameter list.
81     * P-IS_A and P-WILL_BE indicate that it came through a parameter list.         * P-ALIASES indicates an alias of something that came through a
82     * P-ALIASES indicates an alias of something that came through a         * parameter list WILL_BE directly or indirectly (as a part of a parameter).
83     * parameter list WILL_BE directly or indirectly (as a part of a parameter).         *
84     *         * The set in the ALIASES-IS_A statement gets
85     * The set in the ALIASES-IS_A statement gets         * listed as an IS_A origin. The array gets listed as an ARR origin.
86     * listed as an IS_A origin. The array gets listed as an ARR origin.         */
87     */  
88  #define origin_ERR  0  #define origin_ERR  0     /**< Origin code - invalid origin. */
89  /**< set 1 */  /* set 1 */
90  #define origin_ALI  1  #define origin_ALI  1     /**< Origin code - ALIASES. */
91  #define origin_ARR      2  #define origin_ARR  2     /**< Origin code - ARR. */
92  #define origin_ISA  3  #define origin_ISA  3     /**< Origin code - IS_A. */
93  #define origin_WB   4  #define origin_WB   4     /**< Origin code - WILL_BE. */
94  /**< set 2 should match set 1, except having P and being > by offset */  /* set 2 should match set 1, except having P and being > by offset */
95  #define origin_PALI 5  #define origin_PALI 5     /**< Origin code - P-ALIASES. */
96  #define origin_PARR     6  #define origin_PARR 6     /**< Origin code - P-ARR. */
97  #define origin_PISA 7  #define origin_PISA 7     /**< Origin code - P-IS_A. */
98  #define origin_PWB  8  #define origin_PWB  8     /**< Origin code - P-WILL_BE. */
99  #define origin_PARAMETER_OFFSET (origin_PALI - origin_ALI)  #define origin_PARAMETER_OFFSET (origin_PALI - origin_ALI)
100  /**<  /**<
101   * Distance between corresponding origin and the parametric version.   * Distance between corresponding origin and the parametric version.
102   * If you mess with these origin defines, fix the macro LegalOrigin   * If you mess with these origin defines, fix the macro LegalOrigin
103   * in child.c   * in child.c
104   */   */
105  /**< child boolean flag bit definitions */  
106  #define CBF_VISIBLE 0x1 /**< child to be shown in UI among lists */  /* child boolean flag bit definitions */
107  #define CBF_SUPPORTED   0x2 /**< child is a '$upported' attribute */  #define CBF_VISIBLE   0x1 /**< child to be shown in UI among lists */
108  #define CBF_PASSED  0x4 /**< child is argument to another child */  #define CBF_SUPPORTED   0x2 /**< child is a '$upported' attribute */
109  /**< Note that because of arrays, CBF_PASSED is approximate.  #define CBF_PASSED    0x4 /**< child is argument to another child.
110   * If a[1] is passed, a gets marked passed, but if a.b is passed, a is not.                                 Note that because of arrays, CBF_PASSED
111   */                                 is approximate.  If a[1] is passed, a gets
112  /**< other CBF as required */                                 marked passed, but if a.b is passed, a is not. */
113  };  /* other CBF as required */
114  /**<  };  /* struct ChildListEntry */
  * As of 9/96 we've added a number of important features to  
  * ChildList, and it's nobody's business how we implement it.  
  * The ChildListEntry is the interface container for creating  
  * childlists. Storage scheme and usage after that is all  
  * black magic which can only be done by following this header.  
  */  
115    
116  #define AliasingOrigin(ori) \  #define AliasingOrigin(ori) \
117    ((ori) == origin_PALI || (ori) == origin_ALI || \    ((ori) == origin_PALI || (ori) == origin_ALI || \
118     (ori) == origin_PARR || (ori) == origin_ARR)     (ori) == origin_PARR || (ori) == origin_ARR)
119  /**<  /**< Returns 1 if the value given is an alias sort. */
  *  Returns 1 if the value given is an alias sort.  
  */  
120    
121  #define ParametricOrigin(ori) ((ori) >= origin_PALI && (ori) <= origin_PWB)  #define ParametricOrigin(ori) ((ori) >= origin_PALI && (ori) <= origin_PWB)
122  /**<  /**< Returns 1 if the value given is a parametric sort or 0 if not. */
  *  Returns 1 if the value given is a parametric sort or 0 if not.  
  */  
123    
124  extern int CmpChildListEntries(CONST struct ChildListEntry *,  extern int CmpChildListEntries(CONST struct ChildListEntry *e1,
125                                 CONST struct ChildListEntry *);                                 CONST struct ChildListEntry *e2);
126  /**<  /**<
127   *  CmpChildListEntries(e1,e2)   *  <!--  CmpChildListEntries(e1,e2)                                   -->
128   *  CONST struct ChildListEntry *e1, *e2;   *  <!--  CONST struct ChildListEntry *e1, *e2;                        -->
129   *  Returns the result of an alphabetical order comparison   *  Returns the result of an alphabetical order comparison
130   *  on the names in the two pointers. Not necessarily implemented   *  on the names in the two pointers. Not necessarily implemented
131   *  with strcmp, however, so you should use this function.   *  with strcmp, however, so you should use this function.
132   */   */
133    
134  extern ChildListPtr CreateChildList(struct gl_list_t *);  extern ChildListPtr CreateChildList(struct gl_list_t *l);
135  /**<  /**<
136   *  ChildListPtr CreateChildList(l)   *  <!--  ChildListPtr CreateChildList(l)                              -->
137   *  struct gl_list_t *l;   *  <!--  struct gl_list_t *l;                                         -->
138   *  This takes a list of struct ChildListEntry * from a gl_list_t to a   *  This takes a list of struct ChildListEntry * from a gl_list_t to a
139   *  ChildList type.   *  ChildList type.
140   *  l must be sorted and should not contain any duplicate entries,   *  l must be sorted and should not contain any duplicate entries,
# Line 154  extern ChildListPtr CreateChildList(stru Line 146  extern ChildListPtr CreateChildList(stru
146   *  We will return a ChildListPtr. You don't know what is in that.   *  We will return a ChildListPtr. You don't know what is in that.
147   *  We own the memory to it and only we know how to destroy it.   *  We own the memory to it and only we know how to destroy it.
148   *  Creating a ChildListPtr causes the type   *  Creating a ChildListPtr causes the type
149   *  descriptions of the children to be copied.   *  descriptions of the children to be copied.<br><br>
150   *   *
151   *  This function should never return a NULL pointer except in the   *  This function should never return a NULL pointer except in the
152   *  case where you have specified input with a NULL typeptr.   *  case where you have specified input with a NULL typeptr.
153   */   */
154    
155  extern void DestroyChildList(ChildListPtr);  extern void DestroyChildList(ChildListPtr cl);
156  /**<  /**<
157   *  void DestroyChildList(cl)   *  <!--  void DestroyChildList(cl)                                    -->
158   *  ChildListPtr cl;   *  <!--  ChildListPtr cl;                                             -->
159   *  Deallocate the memory associated with the list but not the symchars in   *  Deallocate the memory associated with the list but not the symchars in
160   *  the list. The fact that you're passing a CONST pointer object into   *  the list. The fact that you're passing a CONST pointer object into
161   *  this function is somewhat odd, but it suffices to know that after   *  this function is somewhat odd, but it suffices to know that after
# Line 171  extern void DestroyChildList(ChildListPt Line 163  extern void DestroyChildList(ChildListPt
163   *  really has been disposed of.   *  really has been disposed of.
164   */   */
165    
166  extern ChildListPtr AppendChildList(ChildListPtr,  extern ChildListPtr AppendChildList(ChildListPtr cl, struct gl_list_t *l);
167                                      struct gl_list_t *);  /**<
168  /**<   *  <!--  ChildListPtr AppendChildList(cl,l)                           -->
169   *  ChildListPtr AppendChildList(cl,l)   *  <!--  ChildListPtr cl;                                             -->
170   *  ChildListPtr cl;   *  <!--  struct gl_list_t *l;                                         -->
  *  struct gl_list_t *l;  
171   *  Create and return a new child list which contains all the information   *  Create and return a new child list which contains all the information
172   *  contained in cl or l.  l must be sorted, and it is assumed that there   *  contained in cl or l.  l must be sorted, and it is assumed that there
173   *  are no duplicate entries. The new list returned is sorted.   *  are no duplicate entries. The new list returned is sorted.
# Line 184  extern ChildListPtr AppendChildList(Chil Line 175  extern ChildListPtr AppendChildList(Chil
175   *  The same conditions for l in CreateChildList apply here.   *  The same conditions for l in CreateChildList apply here.
176   */   */
177    
178  extern unsigned long ChildListLen(ChildListPtr);  extern unsigned long ChildListLen(ChildListPtr cl);
179  /**<  /**<
180   *  unsigned long ChildListLen(cl)   *  <!--  unsigned long ChildListLen(cl)                               -->
181   *  CONST ChildListPtr cl;   *  <!--  CONST ChildListPtr cl;                                       -->
182   *  Return the length of the child list.   *  Return the length of the child list.
183   */   */
184    
185  extern symchar *ChildStrPtr(ChildListPtr ,unsigned long);  extern symchar *ChildStrPtr(ChildListPtr cl, unsigned long n);
186  /**<  /**<
187   *  symchar *ChildStrPtr(cl,n)   *  <!--  symchar *ChildStrPtr(cl,n)                                   -->
188   *  CONST ChildListPtr *cl;   *  <!--  CONST ChildListPtr *cl;                                      -->
189   *  unsigned long n;   *  <!--  unsigned long n;                                             -->
190   *  Return child number n name element 1 string.   *  Return child number n name element 1 string.
191   *  Children are numbered 1..ChildListLen(cl).   *  Children are numbered 1..ChildListLen(cl).
192   */   */
193    
194  extern unsigned int ChildIsArray(ChildListPtr ,unsigned long);  extern unsigned int ChildIsArray(ChildListPtr cl, unsigned long n);
195  /**<  /**<
196   *  unsigned int ChildIsArray(cl,n)   *  <!--  unsigned int ChildIsArray(cl,n)                              -->
197   *  CONST ChildListPtr *cl;   *  <!--  CONST ChildListPtr *cl;                                      -->
198   *  unsigned long n;   *  <!--  unsigned long n;                                             -->
199   *  Return >= 1 if child number n is determined array type at parse time.   *  Return >= 1 if child number n is determined array type at parse time.
200   *  The return value the number of subscripts of child n   *  The return value the number of subscripts of child n
201   *  needed to reach a single array element of ChildBaseTypePtr type.   *  needed to reach a single array element of ChildBaseTypePtr type.
202   *  Returns 0 if type is not array.   *  Returns 0 if type is not array.
203   */   */
204    
205  extern unsigned int ChildOrigin(ChildListPtr ,unsigned long);  extern unsigned int ChildOrigin(ChildListPtr cl, unsigned long n);
206  /**<  /**<
207   *  unsigned int ChildOrigin(cl,n)   *  <!--  unsigned int ChildOrigin(cl,n)                               -->
208   *  CONST ChildListPtr *cl;   *  <!--  CONST ChildListPtr *cl;                                      -->
209   *  unsigned long n;   *  <!--  unsigned long n;                                             -->
210   *  Return the origin code of the child.   *  Return the origin code of the child.
211   */   */
212    
213  extern unsigned int ChildAliasing(ChildListPtr ,unsigned long);  extern unsigned int ChildAliasing(ChildListPtr cl, unsigned long n);
214  /**<  /**<
215   *  unsigned int ChildAliasing(cl,n)   *  <!--  unsigned int ChildAliasing(cl,n)                             -->
216   *  CONST ChildListPtr *cl;   *  <!--  CONST ChildListPtr *cl;                                      -->
217   *  unsigned long n;   *  <!--  unsigned long n;                                             -->
218   *  Return the Aliasness of a child, meaning if the child ALIASES one   *  Return the Aliasness of a child, meaning if the child ALIASES one
219   *  passed into the type definition or a part of the definition.   *  passed into the type definition or a part of the definition.
220   */   */
221    
222  extern unsigned int ChildParametric(ChildListPtr ,unsigned long);  extern unsigned int ChildParametric(ChildListPtr cl, unsigned long n);
223  /**<  /**<
224   *  unsigned int ChildParametric(cl,n)   *  <!--  unsigned int ChildParametric(cl,n)                           -->
225   *  CONST ChildListPtr *cl;   *  <!--  CONST ChildListPtr *cl;                                      -->
226   *  unsigned long n;   *  <!--  unsigned long n;                                             -->
227   *  Return the parametricness of a child, meaning if the child is one   *  Return the parametricness of a child.  That is, if the child is one
228   *  passed into the type definition or one aliasing something or a part of   *  passed into the type definition or one aliasing something or a part of
229   *  something passed into the definition.   *  something passed into the definition.
230   */   */
231    
232  extern CONST struct Statement *ChildStatement(ChildListPtr,unsigned long);  extern CONST struct Statement *ChildStatement(ChildListPtr cl, unsigned long n);
233  /**<  /**<
234   *  CONST struct Statement *ChildStatement(cl,n)   *  <!--  CONST struct Statement *ChildStatement(cl,n)                 -->
235   *  CONST ChildListPtr *cl;   *  <!--  CONST ChildListPtr *cl;                                      -->
236   *  unsigned long n;   *  <!--  unsigned long n;                                             -->
237   *  Return child number n initial declaration statement.   *  Return child number n initial declaration statement.
238   *  Children are numbered 1..ChildListLen(cl).   *  Children are numbered 1..ChildListLen(cl).
239   */   */
240    
241  extern unsigned ChildGetBooleans(ChildListPtr,unsigned long);  extern unsigned ChildGetBooleans(ChildListPtr cl, unsigned long n);
242  /**<  /**<
243   *  unsigned int ChildGetBooleans(cl,n)   *  <!--  unsigned int ChildGetBooleans(cl,n)                          -->
244   *  CONST ChildListPtr *cl;   *  <!--  CONST ChildListPtr *cl;                                      -->
245   *  unsigned long n;   *  <!--  unsigned long n;                                             -->
246   *  Return child number n current boolean flags.   *  Return child number n current boolean flags.
247   *  Children are numbered 1..ChildListLen(cl).   *  Children are numbered 1..ChildListLen(cl).
248   *  If an improperly large or small n is given, result is 0.   *  If an improperly large or small n is given, result is 0.
249   */   */
250    
251  #define ChildVisible(cl,n) ((ChildGetBooleans((cl),(n)) & CBF_VISIBLE)!=0)  #define ChildVisible(cl,n) ((ChildGetBooleans((cl),(n)) & CBF_VISIBLE)!=0)
252  /**<  /**<
253   *  macro ChildVisible(clist,childnumber)   *  <!--  macro ChildVisible(clist,childnumber)                        -->
254   *  Returns 1 if child has visibility bit turned on.   *  Returns 1 if child has visibility bit turned on.
255   */   */
256    
257  #define ChildSupported(cl,n) ((ChildGetBooleans((cl),(n)) & CBF_SUPPORTED)!=0)  #define ChildSupported(cl,n) ((ChildGetBooleans((cl),(n)) & CBF_SUPPORTED)!=0)
258  /**<  /**<
259   *  macro ChildSupported(clist,childnumber)   *  <!--  macro ChildSupported(clist,childnumber)                      -->
260   *  Returns 1 if child has supported bit turned on.   *  Returns 1 if child has supported bit turned on.
261   */   */
262    
263  #define ChildPassed(cl,n) ((ChildGetBooleans((cl),(n)) & CBF_PASSED) !=0)  #define ChildPassed(cl,n) ((ChildGetBooleans((cl),(n)) & CBF_PASSED) !=0)
264  /**<  /**<
265   *  macro ChildSupported(clist,childnumber)   *  <!--  macro ChildPassed(clist,childnumber)                      -->
266   *  Returns 1 if child has PASSED bit turned on.   *  Returns 1 if child has PASSED bit turned on.
267   */   */
268    
269  extern void ChildSetBoolean(ChildListPtr,unsigned long,unsigned,unsigned);  extern void ChildSetBoolean(ChildListPtr cl, unsigned long n,
270  /**<                              unsigned cbfname, unsigned val);
271   *  void ChildSetBoolean(cl,n,cbfname,val)  /**<
272   *  CONST ChildListPtr *cl;   *  <!--  void ChildSetBoolean(cl,n,cbfname,val)                       -->
273   *  unsigned long n;   *  <!--  CONST ChildListPtr *cl;                                      -->
274   *  unsigned int cbfname; as defined above by CBF_   *  <!--  unsigned long n;                                             -->
275   *  unsigned int val;   0 or 1 only.   *  <!--  unsigned int cbfname; as defined above by CBF_               -->
276     *  <!--  unsigned int val;   0 or 1 only.                             -->
277   *  Set child number n current boolean flag bit cbfname to val.   *  Set child number n current boolean flag bit cbfname to val.
278   *  Children are numbered 1..ChildListLen(cl).   *  Children are numbered 1..ChildListLen(cl).
279     *  cbfname is a child boolean flag CBF_ defined above.
280     *  val is 0 or 1 only.
281   */   */
282    
283  #define ChildHide(cl,n) ChildSetBoolean((cl),(n),CBF_VISIBLE,0)  #define ChildHide(cl,n) ChildSetBoolean((cl),(n),CBF_VISIBLE,0)
284  /**<  /**<
285   *  macro ChildHide(cl,n)   *  <!--  macro ChildHide(cl,n)                                        -->
286   *  CONST ChildListPtr *cl;   *  <!--  CONST ChildListPtr *cl;                                      -->
287   *  unsigned long n;   *  <!--  unsigned long n;                                             -->
288   *  Hide (presumably for display purposes) the nth child in cl.   *  Hide (presumably for display purposes) the nth child in cl.
289     *  @param cl  CONST ChildListPtr*
290     *  @param n   unsigned long
291   */   */
292    
293  #define ChildShow(cl,n) ChildSetBoolean((cl),(n),CBF_VISIBLE,1)  #define ChildShow(cl,n) ChildSetBoolean((cl),(n),CBF_VISIBLE,1)
294  /**<  /**<
295   *  macro ChildShow(cl,n)   *  <!--  macro ChildShow(cl,n)                                        -->
296   *  CONST ChildListPtr *cl;   *  <!--  CONST ChildListPtr *cl;                                      -->
297   *  unsigned long n;   *  <!--  unsigned long n;                                             -->
298   *  Unhide (presumably for display purposes) the nth child in cl.   *  Unhide (presumably for display purposes) the nth child in cl.
299     *  @param cl CONST ChildListPtr
300     *  @param n  unsigned long
301   */   */
302    
303  extern CONST struct TypeDescription *ChildBaseTypePtr(ChildListPtr,  extern CONST struct TypeDescription *ChildBaseTypePtr(ChildListPtr cl,
304                                                        unsigned long);                                                        unsigned long n);
305  /**<  /**<
306   *  CONST struct TypeDescription *ChildBaseTypePtr(cl,n)   *  <!--  CONST struct TypeDescription *ChildBaseTypePtr(cl,n)         -->
307   *  CONST ChildListPtr cl;   *  <!--  CONST ChildListPtr cl;                                       -->
308   *  unsigned long n;   *  <!--  unsigned long n;                                             -->
309   *  Return child number n type determinable at parse time.   *  Return child number n type determinable at parse time.
310   *  If type was not determinable, returns NULL, but this will never be   *  If type was not determinable, returns NULL, but this will never be
311   *  the case as Something is always determinable.   *  the case as Something is always determinable.
# Line 317  extern CONST struct TypeDescription *Chi Line 315  extern CONST struct TypeDescription *Chi
315   *  with array base type info.   *  with array base type info.
316   *  If this pointer is not NULL, then any corresponding instance will   *  If this pointer is not NULL, then any corresponding instance will
317   *  be of at least the type returned.   *  be of at least the type returned.
318   *  Children are numbered 1..ChildListLen(cl).   *  Children are numbered 1..ChildListLen(cl).<br><br>
319   *   *
320   *  Note: The children of atoms always return NULL type since they do   *  Note: The children of atoms always return NULL type since they do
321   *  not have type descriptions in the system because they are not full   *  not have type descriptions in the system because they are not full
322   *  instances.   *  instances.
323   */   */
324    
325  extern unsigned long ChildPos(ChildListPtr ,symchar *);  extern unsigned long ChildPos(ChildListPtr cl, symchar *s);
326  /**<  /**<
327   *  unsigned long ChildPos(cl,s)   *  <!--  unsigned long ChildPos(cl,s)                                 -->
328   *  CONST ChildListPtr cl;   *  <!--  CONST ChildListPtr cl;                                       -->
329   *  symchar *s;   *  <!--  symchar *s;                                                  -->
330   *  Search for the string s in child list cl.  If it is not found,   *  Search for the string s in child list cl.  If it is not found,
331   *  it will return 0; otherwise, it returns the index of the child which   *  it will return 0; otherwise, it returns the index of the child which
332   *  matches s.   *  matches s.
# Line 342  extern unsigned long ChildPos(ChildListP Line 340  extern unsigned long ChildPos(ChildListP
340   *  If you need to guarantee s is in the table, call AddSymbol first.   *  If you need to guarantee s is in the table, call AddSymbol first.
341   */   */
342    
343  extern int CompareChildLists(ChildListPtr,ChildListPtr,unsigned long *);  extern int CompareChildLists(ChildListPtr cl, ChildListPtr c2, unsigned long *diff);
344  /**<  /**<
345   * cmp = CompareChildLists(GetChildList(d1),GetChildList(d2),&diff);   * <!--  cmp = CompareChildLists(GetChildList(d1),GetChildList(d2),&dif-->f);
346   * struct TypeDescription *d1,*d2;   * <!--  struct TypeDescription *d1,*d2;                               -->
347   * unsigned long int diff;   * <!--  unsigned long int diff;                                       -->
348   * int cmp;   * <!--  int cmp;                                                      -->
349   * Returns -1/0/1 as d1 <,==,> d2 (0). If cmp != 0, diff = position   * Returns -1/0/1 as d1 <,==,> d2 (0). If cmp != 0, diff = position
350   * in child list d2 of first difference, i.e. if the lists are m and n   * in child list d2 of first difference, i.e. if the lists are m and n
351   * long (m > n) and OTHERWISE equivalent, diff = n + 1.   * long (m > n) and OTHERWISE equivalent, diff = n + 1.
352   */   */
353    
354  extern void WriteChildList(FILE *,ChildListPtr);  extern void WriteChildList(FILE *fp, ChildListPtr cl);
355  /**<  /**<
356   *  WriteChildList(fp,cl)   *  <!--  WriteChildList(fp,cl)                                        -->
357   *  Write what is known at parse time about the children in the child list   *  Write what is known at parse time about the children in the child list
358   *  given.  What is known may be surprising. It may be only mildly   *  given.  What is known may be surprising. It may be only mildly
359   *  accurate.   *  accurate.
360   */   */
361  #endif /**< __CHILD_H_SEEN__ */  
362    #endif  /* __CHILD_H_SEEN__ */
363    

Legend:
Removed from v.53  
changed lines
  Added in v.54

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