home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / ifp / part06 / interp / node.h < prev   
Encoding:
C/C++ Source or Header  |  1987-07-06  |  3.1 KB  |  83 lines

  1.  
  2. /****** node.h ********************************************************/
  3. /**                                                                  **/
  4. /**                    University of Illinois                        **/
  5. /**                                                                  **/
  6. /**                Department of Computer Science                    **/
  7. /**                                                                  **/
  8. /**   Tool: IFP                         Version: 0.5                 **/
  9. /**                                                                  **/
  10. /**   Author:  Arch D. Robison          Date:   May 1, 1985          **/
  11. /**                                                                  **/
  12. /**   Revised by: Arch D. Robison       Date:  July 8, 1986          **/
  13. /**                                                                  **/
  14. /**   Principal Investigators: Prof. R. H. Campbell                  **/
  15. /**                            Prof. W. J. Kubitz                    **/
  16. /**                                                                  **/
  17. /**                                                                  **/
  18. /**------------------------------------------------------------------**/
  19. /**   (C) Copyright 1987  University of Illinois Board of Trustees   **/
  20. /**                       All Rights Reserved.                       **/
  21. /**********************************************************************/
  22.  
  23. #ifndef INCLUDE_NODE_H
  24. #define INCLUDE_NODE_H 1
  25.  
  26. /*
  27.  * Define FETCH as 1 to define "fetch" (^k) functional form, 0 otherwise.
  28.  * Define XDEF  as 1 to define "xdef"  ({...} f) functional form, 0 otherwise.
  29.  */
  30. #define FETCH 0
  31. #define XDEF 1
  32.  
  33. extern ListPtr MakePath ();
  34. extern NodePtr CopyNPtr (), FindNode ();
  35. extern NodePtr MakeNode (), MakeChild (), PrimDef ();
  36. extern NodePtr RootNode, SysNode, ArithNode, LogicNode;
  37. extern void DelNPtr (), FormPath (), GroupDef (), LinkPath ();
  38. void InitNode ();
  39.  
  40. typedef struct {        /* Used for node initialization tables */
  41.    char *OpName;
  42.    char OpParam;
  43.    int (*OpPtr) ();     /* Actually void, but compiler complains about void */
  44. } OpDef;                /* in static initializations of this structure      */
  45.  
  46. #define OpCount(OpTable) (sizeof(OpTable)/sizeof(OpTable[0])) 
  47.  
  48. extern NodePtr FormNode[];
  49.  
  50. /*
  51.  * Subscripts for FormNode
  52.  *
  53.  * These must correspond to the entries in the FormOpTable in forms.c
  54.  */
  55. #define NODE_C          0
  56. #define NODE_Comp       1
  57. #define NODE_Cons       2
  58. #define NODE_Each       3
  59. #define NODE_Fetch    4
  60. #define NODE_Filter     (4 + FETCH)
  61. #define NODE_If         (5 + FETCH)
  62. #define NODE_RInsert    (6 + FETCH)
  63. #define NODE_Out        (7 + FETCH)
  64. #define NODE_Sel        (8 + FETCH)
  65. #define NODE_While      (9 + FETCH)
  66. #define NODE_XDef    (9 + FETCH + XDEF) 
  67. #define FORM_TABLE_SIZE (10 + FETCH + XDEF)
  68.  
  69.  
  70. typedef struct {
  71.    NodePtr FormNode;            /* Node pointer for form */
  72.    char *FormInPrefix;
  73.    OpDef FormOp;
  74.    char *FormComment;        /* Comment for `expected' error message */
  75. } FormEntry;
  76.  
  77. extern FormEntry FormTable[FORM_TABLE_SIZE];
  78.  
  79. #endif
  80.  
  81. /****************************** end of node.h ******************************/
  82.  
  83.