1 /* BEGIN mrds_predicate_tree.incl.pl1 -- jaw, 2/14/79 */
 2 
 3 /* HISTORY:
 4 
 5    81-06-01 Jim Gray : removed assn type and len, now that
 6    mu_convert is being used.
 7 
 8 
 9 */
10 
11 
12 dcl 1 pred_node based (pn_ptr),                             /*  structure of predicate tree node */
13     2 type fixed bin,                                       /*  indicates if node or leaf */
14     2 id unal,                                              /* id for node */
15       3 lleaf_id like pred_leaf.id,                         /* id for left leaf */
16       3 op_code bit (6) unal,                               /* operator code for this node */
17       3 rleaf_id like pred_leaf.id,                         /* id for right leaf */
18     2 term_type fixed bin (5) unal,                         /* if term, indicates type of term */
19     2 root bit (1) unal,                                    /* on if root node */
20     2 term bit (1) unal,                                    /* on if node is term */
21     2 determined bit (1) unal,                              /* on if term is "determined" independent of other terms */
22     2 reserved bit (21) unal,                               /* reserved for future use */
23     2 parent ptr,                                           /* pointer to parent node */
24     2 lbr ptr,                                              /* pointer to left branch */
25     2 rbr ptr;                                              /* pointer to right branch */
26 
27 dcl  pn_ptr ptr;
28 
29 dcl 1 pred_array based (pred_ptr),                          /* list representation of pred. */
30     2 type fixed bin,                                       /*  indicates array, rather than node or leaf */
31     2 num_ands fixed bin,                                   /* is the number of and groups */
32     2 and_ptr (num_ands_init refer (pred_array.num_ands)) ptr; /* pointers to the and groups */
33 
34 dcl  pred_ptr ptr;
35 
36 dcl 1 and_group based (ag_ptr),                             /* list of pointers to all terms in and group */
37     2 num_terms fixed bin,                                  /* number of terms in list */
38     2 term_ptr (num_terms_init refer (and_group.num_terms)) ptr; /* point to terms in this and group */
39 
40 dcl  ag_ptr ptr;
41 dcl (num_ands_init,
42      num_terms_init) fixed bin;
43 
44 dcl ((CURRENT_OP init ("000001"b)),                         /* pred_node op_codes */
45     (AND_OP init ("000010"b)),
46     (OR_OP init ("000011"b)),
47     (NOT_OP init ("000100"b)),
48     (EQ_OP init ("000101"b)),
49     (NE_OP init ("000110"b)),
50     (LT_OP init ("000111"b)),
51     (GT_OP init ("001000"b)),
52     (LE_OP init ("001001"b)),
53     (GE_OP init ("001010"b)),
54     (ALL_OP init ("001011"b))) bit (6) int static options (constant);
55 
56 dcl ((CONST init (1)),                                      /* pred leaf data types */
57     (ATTR init (2)),
58     (EXPRES init (3))) fixed bin int static options (constant);
59 
60 dcl ((NODE init (0)),                                       /* type indicators */
61     (LEAF init (1)),
62     (ARRAY init (2))) fixed bin int static options (constant);
63 
64 dcl ((V_C init (1)),                                        /* pred_node term_types */
65     (V_V init (2))) fixed bin (5) int static options (constant);
66 
67 dcl 1 pred_leaf based (pl_ptr),                             /* structure for a predicate tree leaf */
68     2 type fixed bin,                                       /* indicates if node or leaf */
69     2 id,                                                   /* leaf id */
70       3 var_id bit (18) unal,                               /* index of tuple var. */
71       3 attr_id bit (18) unal,                              /* defn order of attr. */
72     2 dummy bit (1) unal,                                   /* on if dummy leaf for ALL_OP */
73     2 reserved bit (35) unal,                               /* reserved for future use */
74     2 data_type fixed bin,                                  /* whether const, attr, or expr */
75     2 lit_offset fixed bin (35),                            /* bit offset of literal or expr. result */
76     2 lit_length fixed bin (35),                            /* bit length of literal or expr. result */
77     2 rslt_desc bit (36),                                   /* descriptor of expr. result */
78     2 lit_ptr ptr,                                          /* ptr to literal or expr. result value */
79     2 lit_desc_ptr ptr,                                     /* ptr to literal or expr. result desc. */
80     2 ai_ptr ptr,                                           /* to rm_attr_info for attribute */
81     2 expr_ptr ptr,                                         /* pointer to expr. structure if expr. leaf */
82     2 parent ptr;                                           /* pointer to parent node */
83 
84 dcl  pl_ptr ptr;
85 
86 /* END mrds_predicate_tree.incl.pl1 */
87