home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_06_07 / v6n7065a.txt < prev    next >
Text File  |  1989-09-28  |  1KB  |  34 lines

  1. /****************************  Listing 1  ****************************/
  2. /*******                                                       *******/
  3. /******* Add this code to the declarations section of yref2.y, *******/
  4. /*******             between the %{ and %} symbols             *******/
  5. /*******                                                       *******/
  6. /*********************************************************************/
  7.  
  8. struct symlist                     /*  Linked list for storing line numbers */
  9.         {
  10.         int line;                  /*  Line number for this instance */
  11.         int decl;                  /*  Declaration = 1, reference = 0 */
  12.         struct symlist *next;      /*  Pointer to next instance */
  13.         };
  14.  
  15. struct tnode
  16.         {
  17.         char *word;                /*  Identifier */
  18.         int count;                 /*  Total instances */
  19.         struct symlist *first;     /*  Pointer to beginning of line list */
  20.         struct symlist *current;   /*  Pointer to most recent line instance */
  21.         struct tnode *left;        /*  Pointer to left node in tree */
  22.         struct tnode *right;       /*  Pointer to right node in tree */
  23.         };
  24.  
  25. struct tnode *root;
  26. int yn_decl = 0;           /*  Declaration = 1, reference = 0 */
  27.  
  28. struct tnode *addtree(struct tnode *, char *);
  29. void treeprint(struct tnode *);
  30. void listprint(struct symlist *, int );
  31. struct tnode *talloc(void);
  32. struct symlist *lalloc(void);
  33.  
  34.