diff --git a/oberon.h b/oberon.h
index 7ed16291b9b4da45a0c1b9bb7db798b1e427f067..f29aa4d4a780b18af1a526bcbc9556580f3d94ff 100644 (file)
--- a/oberon.h
+++ b/oberon.h
#ifndef EMBEDED_OBERON_SCRIPT_H
#define EMBEDED_OBERON_SCRIPT_H
#ifndef EMBEDED_OBERON_SCRIPT_H
#define EMBEDED_OBERON_SCRIPT_H
-typedef struct oberon_var_s oberon_var_t;
typedef struct oberon_type_s oberon_type_t;
typedef struct oberon_type_s oberon_type_t;
+typedef struct oberon_object_s oberon_object_t;
typedef struct oberon_module_s oberon_module_t;
typedef struct oberon_context_s oberon_context_t;
typedef struct oberon_module_s oberon_module_t;
typedef struct oberon_context_s oberon_context_t;
+typedef struct oberon_scope_s oberon_scope_t;
-enum {
+struct oberon_scope_s
+{
+ oberon_context_t * ctx;
+ oberon_object_t * list;
+ oberon_scope_t * up;
+};
+
+enum
+{
OBERON_TYPE_INTEGER,
OBERON_TYPE_BOOLEAN,
};
struct oberon_type_s
{
OBERON_TYPE_INTEGER,
OBERON_TYPE_BOOLEAN,
};
struct oberon_type_s
{
- char * name;
int class;
int size;
int class;
int size;
- oberon_type_t * next;
void * gen_type;
};
void * gen_type;
};
-struct oberon_var_s
+enum
+{
+ OBERON_CLASS_VAR,
+ OBERON_CLASS_TYPE,
+ OBERON_CLASS_PROC
+};
+
+struct oberon_object_s
{
{
- char * name;
- oberon_type_t * type;
- oberon_var_t * next;
+ char * name;
+ int class;
+
+ oberon_type_t * type;
void * gen_var;
void * gen_var;
+ void * gen_proc;
+
+ oberon_object_t * next;
};
struct oberon_module_s
{
char * name;
};
struct oberon_module_s
{
char * name;
- oberon_var_t * vars;
+
+ oberon_scope_t * decl;
void (* begin)();
};
void (* begin)();
};
char * string;
int integer;
char * string;
int integer;
+ oberon_scope_t * decl;
oberon_module_t * mod;
oberon_module_t * mod;
- oberon_type_t * types;
oberon_type_t * int_type;
oberon_type_t * bool_type;
oberon_type_t * int_type;
oberon_type_t * bool_type;
+ oberon_scope_t * world_scope;
void * gen_context;
};
void * gen_context;
};
enum {
MODE_VAR,
MODE_INTEGER,
enum {
MODE_VAR,
MODE_INTEGER,
- MODE_BOOLEAN
+ MODE_BOOLEAN,
+ MODE_CALL
};
enum {
};
enum {
int mode;
int integer;
int boolean;
int mode;
int integer;
int boolean;
- oberon_var_t * var;
+ oberon_object_t * var;
};
struct oberon_oper_s
};
struct oberon_oper_s