1 #ifndef OBERON_INTERNALS_H
2 #define OBERON_INTERNALS_H
4 #include <stdint.h>
5 #include <stdbool.h>
24 struct oberon_scope_t
25 {
33 };
35 enum oberon_type_kind
36 {
37 OBERON_TYPE_VOID,
38 OBERON_TYPE_INTEGER,
39 OBERON_TYPE_BOOLEAN,
40 OBERON_TYPE_PROCEDURE,
41 OBERON_TYPE_ARRAY,
42 OBERON_TYPE_RECORD,
43 OBERON_TYPE_POINTER,
44 OBERON_TYPE_REAL,
45 OBERON_TYPE_CHAR,
46 OBERON_TYPE_STRING
47 };
52 struct oberon_type_t
53 {
63 GenerateFuncCallback genfunc;
64 GenerateProcCallback genproc;
71 };
73 enum oberon_object_kind
74 {
75 OBERON_CLASS_VAR,
76 OBERON_CLASS_TYPE,
77 OBERON_CLASS_PROC,
78 OBERON_CLASS_PARAM,
79 OBERON_CLASS_VAR_PARAM,
80 OBERON_CLASS_CONST,
81 OBERON_CLASS_FIELD,
82 OBERON_CLASS_MODULE
83 };
85 struct oberon_object_t
86 {
110 };
112 struct oberon_module_t
113 {
122 };
126 struct oberon_context_t
127 {
128 /*** SCANER DATA ***/
138 /*** END SCANER DATA ***/
140 /*** PARSER DATA ***/
143 /*** END PARSER DATA ***/
159 ModuleImportCallback import_module;
161 };
163 enum oberon_mode_kind
164 {
165 MODE_VAR,
166 MODE_INTEGER,
167 MODE_BOOLEAN,
168 MODE_CALL,
169 MODE_INDEX,
170 MODE_FIELD,
171 MODE_DEREF,
172 MODE_NIL,
173 MODE_NEW,
174 MODE_REAL,
175 MODE_CHAR,
176 MODE_STRING
177 };
179 enum oberon_operator_kind
180 {
181 OP_UNARY_MINUS,
182 OP_BITWISE_NOT,
183 OP_LOGIC_NOT,
184 OP_ABS,
186 OP_ADD,
187 OP_SUB,
188 OP_MUL,
189 OP_DIV,
190 OP_MOD,
191 OP_BITWISE_AND,
192 OP_BITWISE_XOR,
193 OP_BITWISE_OR,
194 OP_LOGIC_AND,
195 OP_LOGIC_OR,
197 OP_EQ,
198 OP_NEQ,
199 OP_LSS,
200 OP_LEQ,
201 OP_GRT,
202 OP_GEQ,
204 OP_CAST
205 };
207 struct oberon_item_t
208 {
225 };
227 struct oberon_oper_t
228 {
237 };
239 union oberon_expr_t
240 {
246 };
248 oberon_item_t item;
249 oberon_oper_t oper;
250 };