Pristine Ack-5.5
[Ack-5.5.git] / lang / pc / comp / node.H
1 /* N O D E   O F   A N   A B S T R A C T   P A R S E T R E E */
2
3 struct node {
4         struct node *nd_left;
5 #define nd_next nd_left
6         struct node *nd_right;
7         int nd_class;           /* kind of node */
8 #define Value           0       /* constant */
9 #define Name            1       /* an identifier */
10 #define Uoper           2       /* unary operator */
11 #define Boper           3       /* binary operator */
12 #define Xset            4       /* a set */
13 #define Set             5       /* a set constant */
14 #define Call            6       /* a function call */
15 #define NameOrCall      7       /* call or name of function */
16 #define Arrow           8       /* ^ construction */
17 #define Arrsel          9       /* array selection */
18 #define Def             10      /* an identified name */
19 #define Link            11
20 #define LinkDef         12
21 #define Cast            13      /* convert integer to real */
22 #define IntCoerc        14      /* coercion of integers to longs */
23 #define IntReduc        15      /* reduction of longs to integers */
24                                 /* do NOT change the order or the numbers!!! */
25         struct type *nd_type;   /* type of this node */
26         struct token nd_token;
27 #define nd_def          nd_token.tk_data.tk_def
28 #define nd_set          nd_token.tk_data.tk_set
29 #define nd_lab          nd_token.tk_data.tk_lab
30 #define nd_symb         nd_token.tk_symb
31 #define nd_lineno       nd_token.tk_lineno
32 #define nd_IDF          nd_token.TOK_IDF
33 #define nd_STR          nd_token.TOK_STR
34 #define nd_SLE          nd_token.TOK_SLE
35 #define nd_SLA          nd_token.TOK_SLA
36 #define nd_INT          nd_token.TOK_INT
37 #define nd_REL          nd_token.TOK_REL
38 #define nd_RLA          nd_token.TOK_RLA
39 #define nd_RIV          nd_token.TOK_RIV
40 };
41
42 /* ALLOCDEF "node" 50 */
43
44 extern struct node *MkNode(), *MkLeaf(), *ChkStdInOut();
45
46 #define IsProcCall(lnd) ((lnd)->nd_type->tp_fund & T_ROUTINE)
47
48 #define NULLNODE ((struct node *) 0)