home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / coven / coven-utils-1.1.tgz / coven-utils-1.1.tar / utils / coven-language / symbol.h < prev   
C/C++ Source or Header  |  2003-01-28  |  3KB  |  134 lines

  1. /*
  2.  * (C) 2001 Clemson University
  3.  *
  4.  * See COPYING in top-level directory.
  5.  */
  6.  
  7.  
  8. #ifndef _SYMBOL_H_
  9. #define _SYMBOL_H_
  10.  
  11. #ifndef lint
  12. static char symbol_h_rcsid[] = "$Header: /projects/cvsroot/coven-language/symbol.h,v 1.3 2003/01/28 14:55:09 ndebard Exp $";
  13. #endif
  14.  
  15. /* $Log: symbol.h,v $
  16. /* Revision 1.3  2003/01/28 14:55:09  ndebard
  17. /* New GPL.
  18. /*
  19. /* Revision 1.2  2003/01/23 13:06:54  ndebard
  20. /* GPLed this dir.
  21. /*
  22. /* Revision 1.1.1.1  2003/01/23 11:47:48  ndebard
  23. /* Imported source - from Coven project, reorganizing
  24. /*
  25. /* Revision 1.5  2002/11/06 14:43:16  ndebard
  26. /* The compiler should now correctly parse the sample language we have
  27. /* developed.  It won't handle everything, but should be OK.
  28. /*
  29. /* Revision 1.4  2002/11/05 23:46:41  ndebard
  30. /* Working on the language.  It should handle everything up to dropping the
  31. /* output for module calls right now.
  32. /*
  33. /* Revision 1.3  2002/07/31 14:44:48  ndebard
  34. /* Lots of changes while in Scotland.  This now parses the MODULES and
  35. /* VARIABLES sections correctly (it is believed).  The backend of the Coven
  36. /* driver needs to be redesigned now to handle some new data types before
  37. /* the PROGRAM section can be completed.
  38. /*
  39. /* Revision 1.2  2002/07/03 20:45:53  walt
  40. /* initial added symbol table stuff
  41. /*
  42. /* Revision 1.1  2002/07/03 18:55:12  walt
  43. /* First set of files for Coven compiler - WBL
  44. /*
  45.  * Revision 1.5  1991/02/06  15:15:15  walt
  46.  * added linking capability
  47.  *
  48.  * Revision 1.4  90/11/29  13:09:38  walt
  49.  * moved to single source directory
  50.  * added RCS Headers and Logs
  51.  * 
  52.  * Revision 1.3  90/08/20  12:14:39  walt
  53.  * version before connection configuration was added
  54.  * 
  55.  * Revision 1.2  90/03/08  10:40:23  walt
  56.  * this is the original rawasm language
  57.  * 
  58.  * Revision 1.1  90/02/02  10:19:53  walt
  59.  * Initial revision
  60.  * 
  61.  */
  62.  
  63. /*
  64.  *    symbol.h --- declarations for all the public types
  65.  */
  66.  
  67. #define TYPE_MODULE 0x1
  68. #define TYPE_VARIABLE 0x2    
  69. #define TYPE_ARGUMENT 0x3    
  70. #define TYPE_TYPE 0x4
  71. #define TYPE_CONST 0x5
  72.  
  73. typedef struct mod_call
  74. {
  75.     char *name;
  76.     char *proc;
  77.     int thread;
  78.     char *btable;
  79.     char *loop;
  80.     struct mod_call *next;
  81. } mod_call, *mod_call_p;
  82.  
  83. typedef struct argument_ent
  84. {
  85.     char *name;
  86.     int direction;
  87.     int mclass;
  88.     struct sym_ent *type;
  89. } argument_ent, *argument_ent_p;
  90.  
  91. typedef struct module_ent
  92. {
  93.     char *path;
  94.     int times_called;
  95.     struct sym_ent *args;
  96. } module_ent, *module_ent_p;
  97.  
  98. typedef struct variable_ent
  99. {
  100.     int vclass;
  101.     struct sym_ent *type;
  102. } variable_ent, *variable_ent_p;
  103.  
  104. typedef struct const_ent
  105. {
  106.     struct sym_ent *type;
  107.     char *cvalue;
  108. } const_ent, *const_ent_p;
  109.  
  110. typedef union type_ent
  111. {
  112.     void *v;
  113.     module_ent_p mod;
  114.     variable_ent_p var;
  115.     const_ent_p con;
  116.     argument_ent_p arg;
  117. } type_ent, *type_ent_p;
  118.  
  119. typedef struct sym_ent
  120. {
  121.     char *name;        /* ptr to string table */
  122.     int type;
  123.     union type_ent value;    /* sybmol record */
  124.     struct sym_ent *next;    /* next in line */
  125. } sym_ent, *sym_ent_p;
  126.  
  127. sym_ent_p symenter(char *name, sym_ent_p context, int type);
  128. sym_ent_p symlook(char *name, sym_ent_p context, int type);
  129. sym_ent_p lookup_type(char *name);
  130. void init_symbol_table();
  131.  
  132. #endif
  133.  
  134.