]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - zephyr/zwgc/node.h
4fdf678f40eca72125160f4ecadf4b2ef3dd51bc
[1ts-debian.git] / zephyr / zwgc / node.h
1 /* This file is part of the Project Athena Zephyr Notification System.
2  * It is one of the source files comprising zwgc, the Zephyr WindowGram
3  * client.
4  *
5  *      Created by:     Marc Horowitz <marc@athena.mit.edu>
6  *
7  *      $Id$
8  *
9  *      Copyright (c) 1989 by the Massachusetts Institute of Technology.
10  *      For copying and distribution information, see the file
11  *      "mit-copyright.h".
12  */
13
14
15 #include <zephyr/mit-copyright.h>
16
17 #ifndef node_MODULE
18 #define node_MODULE
19
20 #include "new_string.h"
21
22 #define  STRING_CONSTANT_OPCODE         0
23 #define  VARREF_OPCODE                  1
24 #define  VARNAME_OPCODE                 2
25
26 #define  NOT_OPCODE                     3
27
28 #define  PLUS_OPCODE                    4
29 #define  AND_OPCODE                     5
30 #define  OR_OPCODE                      6
31 #define  EQ_OPCODE                      7
32 #define  NEQ_OPCODE                     8
33 #define  REGEQ_OPCODE                   9
34 #define  REGNEQ_OPCODE                  10
35
36 #define  BUFFER_OPCODE                  11
37
38 #define  SUBSTITUTE_OPCODE              12
39 #define  PROTECT_OPCODE                 13
40 #define  VERBATIM_OPCODE                14
41 #define  STYLESTRIP_OPCODE              15
42 #define  GETENV_OPCODE                  16
43 #define  UPCASE_OPCODE                  17
44 #define  DOWNCASE_OPCODE                18
45 #define  ZVAR_OPCODE                    19
46 #define  GET_OPCODE                     20
47
48 #define  LANY_OPCODE                    21
49 #define  RANY_OPCODE                    22
50 #define  LBREAK_OPCODE                  23
51 #define  RBREAK_OPCODE                  24
52 #define  LSPAN_OPCODE                   25
53 #define  RSPAN_OPCODE                   26
54
55 #define  LAST_EXPR_OPCODE               26
56
57 #define  NOOP_OPCODE                    27
58 #define  SET_OPCODE                     28
59 #define  FIELDS_OPCODE                  29
60
61 #define  PRINT_OPCODE                   30
62 #define  CLEARBUF_OPCODE                31
63
64 #define  APPENDPORT_OPCODE              32
65 #define  EXECPORT_OPCODE                33
66 #define  INPUTPORT_OPCODE               34
67 #define  OUTPUTPORT_OPCODE              35
68 #define  PUT_OPCODE                     36
69 #define  CLOSEINPUT_OPCODE              37
70 #define  CLOSEOUTPUT_OPCODE             38
71 #define  CLOSEPORT_OPCODE               39
72
73 #define  EXEC_OPCODE                    40
74
75 #define  IF_STMT_OPCODE                 41
76 #define  CASE_OPCODE                    42
77 #define  WHILE_OPCODE                   43
78 #define  BREAK_OPCODE                   44
79 #define  EXIT_OPCODE                    45
80
81 #define  IF_OPCODE                      46
82 #define  ELSEIF_OPCODE                  47
83 #define  ELSE_OPCODE                    48
84 #define  MATCHLIST_OPCODE               49
85 #define  DEFAULT_OPCODE                 50
86
87 #define  NUMBER_OF_OPCODES              51
88
89 typedef struct _Node {
90     int opcode;                              /* Read-only */
91     struct _Node *next;
92     union {
93         string string_constant;
94         struct {
95             struct _Node *first;
96             struct _Node *second;
97         } nodes;
98     } d;
99 } Node;
100
101 /* Function externs */
102
103 extern void node_DestroyAllNodes();
104
105 extern Node *node_create_string_constant();
106
107 extern Node *node_create_noary();
108 extern Node *node_create_unary();
109 extern Node *node_create_binary();
110
111 /*
112  *    Node *reverse_list_of_nodes(Node *list)
113  *        Modifies: the nodes on the linked list list
114  *        Effects: Reverses the linked list list and returns it.
115  *                 This is done by modifing the next pointers of the
116  *                 list elements to point to the previous node & returning
117  *                 the address of the (previously) last node.
118  */
119
120 extern Node *reverse_list_of_nodes();
121
122 #ifdef DEBUG
123 extern void node_display();
124 #endif
125
126 #endif