diff --git a/oberon.h b/oberon.h
index d481e130b6e89c06e8b3227cc882e2be2339ecbc..ef9ad7f1c891223eb2241ef8d4020e3855a50645 100644 (file)
--- a/oberon.h
+++ b/oberon.h
oberon_type_t * base;
oberon_object_t * decl;
+ oberon_module_t * module;
+
int recursive;
int initialized;
gen_type_t * gen_type;
OBERON_CLASS_PARAM,
OBERON_CLASS_VAR_PARAM,
OBERON_CLASS_CONST,
- OBERON_CLASS_FIELD
-};
-
-enum
-{
- OBERON_SYSPROC_ABS
+ OBERON_CLASS_FIELD,
+ OBERON_CLASS_MODULE
};
/*
{
char * name;
int class;
+ int export;
+ int read_only;
int local;
int linked;
oberon_item_t * value;
oberon_object_t * next;
+ oberon_module_t * module;
+
gen_var_t * gen_var;
gen_proc_t * gen_proc;
};
struct oberon_module_s
{
char * name;
+ int ready;
oberon_scope_t * decl;
- void (* begin)();
+ oberon_module_t * next;
};
/*
* world_scope -- область видимости "мир" - выше модуля.
*/
+typedef const char * (*ModuleImportCallback)(const char * name);
+
struct oberon_context_s
{
+ /*** SCANER DATA ***/
const char * code;
int code_index;
int token;
char * string;
int integer;
+ /*** END SCANER DATA ***/
+ /*** PARSER DATA ***/
oberon_scope_t * decl;
oberon_module_t * mod;
+ /*** END PARSER DATA ***/
oberon_type_t * int_type;
oberon_type_t * bool_type;
oberon_type_t * void_type;
oberon_type_t * void_ptr_type;
oberon_scope_t * world_scope;
-
+ oberon_module_t * module_list;
+ ModuleImportCallback import_module;
gen_context_t * gen_context;
};
int is_item; // == 1
oberon_type_t * result;
oberon_expr_t * next;
+ int read_only;
int mode;
int integer;
int is_item; // == 0
oberon_type_t * result;
oberon_expr_t * next;
+ int read_only;
int op;
oberon_expr_t * left;
int is_item;
oberon_type_t * result;
oberon_expr_t * next;
+ int read_only;
};
oberon_item_t item;
oberon_oper_t oper;
};
-oberon_context_t * oberon_create_context();
+oberon_context_t * oberon_create_context(ModuleImportCallback import_module);
void oberon_destroy_context(oberon_context_t * ctx);
void oberon_register_global_type(oberon_context_t * ctx, oberon_type_t * type);
oberon_module_t * oberon_compile_module(oberon_context_t * ctx, const char * code);