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
5 * Created by: Marc Horowitz <marc@athena.mit.edu>
9 * Copyright (c) 1989 by the Massachusetts Institute of Technology.
10 * For copying and distribution information, see the file
15 #include <zephyr/mit-copyright.h>
20 #include "new_string.h"
22 #define STRING_CONSTANT_OPCODE 0
23 #define VARREF_OPCODE 1
24 #define VARNAME_OPCODE 2
33 #define REGEQ_OPCODE 9
34 #define REGNEQ_OPCODE 10
36 #define BUFFER_OPCODE 11
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
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
55 #define LAST_EXPR_OPCODE 26
57 #define NOOP_OPCODE 27
59 #define FIELDS_OPCODE 29
61 #define PRINT_OPCODE 30
62 #define CLEARBUF_OPCODE 31
64 #define APPENDPORT_OPCODE 32
65 #define EXECPORT_OPCODE 33
66 #define INPUTPORT_OPCODE 34
67 #define OUTPUTPORT_OPCODE 35
69 #define CLOSEINPUT_OPCODE 37
70 #define CLOSEOUTPUT_OPCODE 38
71 #define CLOSEPORT_OPCODE 39
73 #define EXEC_OPCODE 40
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
82 #define ELSEIF_OPCODE 47
83 #define ELSE_OPCODE 48
84 #define MATCHLIST_OPCODE 49
85 #define DEFAULT_OPCODE 50
87 #define NUMBER_OF_OPCODES 51
89 typedef struct _Node {
90 int opcode; /* Read-only */
93 string string_constant;
101 /* Function externs */
103 extern void node_DestroyAllNodes();
105 extern Node *node_create_string_constant();
107 extern Node *node_create_noary();
108 extern Node *node_create_unary();
109 extern Node *node_create_binary();
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.
120 extern Node *reverse_list_of_nodes();
123 extern void node_display();