home *** CD-ROM | disk | FTP | other *** search
-
- /****** node.h ********************************************************/
- /** **/
- /** University of Illinois **/
- /** **/
- /** Department of Computer Science **/
- /** **/
- /** Tool: IFP Version: 0.5 **/
- /** **/
- /** Author: Arch D. Robison Date: May 1, 1985 **/
- /** **/
- /** Revised by: Arch D. Robison Date: May 5, 1987 **/
- /** **/
- /** Principal Investigators: Prof. R. H. Campbell **/
- /** Prof. W. J. Kubitz **/
- /** **/
- /** **/
- /**------------------------------------------------------------------**/
- /** (C) Copyright 1987 University of Illinois Board of Trustees **/
- /** All Rights Reserved. **/
- /**********************************************************************/
-
- #ifndef INCLUDE_NODE_H
- #define INCLUDE_NODE_H 1
-
- /*
- * Define FETCH as 1 to define "fetch" (^k) functional form, 0 otherwise.
- * Define XDEF as 1 to define "xdef" ({...} f) functional form, 0 otherwise.
- */
- #define FETCH 0
- #define XDEF 1
-
- extern ListPtr MakePath ();
-
- extern NodePtr PrimDef (), FindNode (), MakeNode ();
- extern void LinkPath (), GroupDef ();
-
-
- #define ObIsDefNode(X) ((X)->Tag==NODE && (X)->Node->NodeType==DEF)
- extern NodePtr CopyNPtr ();
- extern NodePtr MakeChild ();
- extern NodePtr RootNode, SysNode, ArithNode, LogicNode;
- extern void DelNPtr (), FormPath ();
- void InitNode ();
-
-
- /*
- * OpDef
- *
- * The OpDef structure is used for node initialization tables.
- *
- * The OPDEF macro is for writing static initilizations of OpDef tables.
- * The release version may look strange, since OPDEF does not use its
- * last parameter, which is for OOFP only.
- *
- * Fields
- * OpName = name of function
- * OpParam = internal id # for function. Many functions have the same
- * code, and are distinguished by passing the OpParam to the
- * code. For an example, see function Dyadic in F_arith.c
- * OpPtr = pointer to function code, these functions should be void,
- * but the compiler complains about void functions in static
- * initializations.
- */
- typedef struct {
- char *OpName;
- char OpParam;
- int (*OpPtr) ();
- } OpDef;
-
- #define OPDEF(a,b,c,d) {a,b,c} /* Throws d away */
-
- #define OpCount(OpTable) (sizeof(OpTable)/sizeof(OpTable[0]))
-
- extern NodePtr FormNode[];
-
- /*
- * Subscripts for FormNode
- *
- * These must correspond to the entries in the FormOpTable in forms.c
- * Also, the InFirst[] array in "infun.c" must be updated if entries are added.
- */
- #define NODE_C 0
- #define NODE_Comp 1
- #define NODE_Cons 2
- #define NODE_Each 3
- #define NODE_Fetch 4
- #define NODE_Filter (4 + FETCH)
- #define NODE_If (5 + FETCH)
- #define NODE_RInsert (6 + FETCH)
- #define NODE_Out (7 + FETCH)
- #define NODE_Sel (8 + FETCH)
- #define NODE_While (9 + FETCH)
- #define NODE_XDef (9 + FETCH + XDEF)
- #define NODE_Enc (9 + FETCH + XDEF + OOFP)
- #define FORM_TABLE_SIZE (1 + NODE_Enc)
-
-
- typedef struct {
- NodePtr FormNode; /* Node pointer for form */
- char *FormInPrefix;
- OpDef FormOp;
- char *FormComment; /* Comment for `expected' error message */
- } FormEntry;
-
- extern FormEntry FormTable[FORM_TABLE_SIZE];
-
- #endif
-
- /****************************** end of node.h ******************************/
-
-