diff --git a/oberon.h b/oberon.h
index 69ee927fede72bb5a643c55608c23db621e78c44..9d17afdb16e76ff0bbfa3e8d2ce30d4b80e46a7b 100644 (file)
--- a/oberon.h
+++ b/oberon.h
#include <libgccjit.h>
#include <libgccjit.h>
-/*
- * Стуктуры данных генератора
- */
+typedef struct gen_proc_s gen_proc_t;
+typedef struct gen_type_s gen_type_t;
+typedef struct gen_var_s gen_var_t;
+typedef struct gen_block_s gen_block_t;
+typedef struct gen_context_s gen_context_t;
-typedef struct
+struct gen_proc_s
{
{
- gcc_jit_function * gcc_func;
-} gen_proc_t;
+ gcc_jit_function * gcc_func;
+};
-typedef struct
+struct gen_type_s
{
{
- gcc_jit_type * gcc_type;
- gcc_jit_struct * gcc_struct;
-} gen_type_t;
+ gcc_jit_type * gcc_type;
+ gcc_jit_struct * gcc_struct;
+};
-typedef struct
+struct gen_var_s
{
{
- gcc_jit_lvalue * gcc_lvalue;
- gcc_jit_param * gcc_param;
- gcc_jit_field * gcc_field;
-} gen_var_t;
+ gcc_jit_lvalue * gcc_lvalue;
+ gcc_jit_param * gcc_param;
+ gcc_jit_field * gcc_field;
+};
-typedef struct
+struct gen_block_s
{
{
- gcc_jit_context * gcc_context;
- gcc_jit_block * gcc_block;
- gcc_jit_result * gcc_result;
-} gen_context_t;
+ gcc_jit_block * gcc_block;
+ gen_block_t * up;
+};
+
+struct gen_context_s
+{
+ gcc_jit_context * gcc_context;
+ gcc_jit_result * gcc_result;
+ gen_block_t * block;
+};
typedef struct oberon_type_s oberon_type_t;
typedef struct oberon_object_s oberon_object_t;
typedef struct oberon_type_s oberon_type_t;
typedef struct oberon_object_s oberon_object_t;
oberon_context_t * ctx;
oberon_object_t * list;
oberon_scope_t * up;
oberon_context_t * ctx;
oberon_object_t * list;
oberon_scope_t * up;
+
+ oberon_object_t * parent;
+ int local;
};
/*
};
/*
OBERON_TYPE_PROCEDURE,
OBERON_TYPE_ARRAY,
OBERON_TYPE_RECORD,
OBERON_TYPE_PROCEDURE,
OBERON_TYPE_ARRAY,
OBERON_TYPE_RECORD,
+ OBERON_TYPE_POINTER
};
/*
};
/*
int class;
int size;
int class;
int size;
- int dim;
-
int num_decl;
oberon_type_t * base;
oberon_object_t * decl;
int num_decl;
oberon_type_t * base;
oberon_object_t * decl;
+ int recursive;
+ int initialized;
gen_type_t * gen_type;
};
gen_type_t * gen_type;
};
char * name;
int class;
char * name;
int class;
+ int local;
+ int linked;
+ int initialized;
+
+ oberon_object_t * parent;
+ int has_return; // for proc
+
+
oberon_type_t * type;
oberon_item_t * value;
oberon_object_t * next;
oberon_type_t * type;
oberon_item_t * value;
oberon_object_t * next;
char * string;
int integer;
char * string;
int integer;
- int has_return;
- oberon_type_t * result_type;
-
oberon_scope_t * decl;
oberon_module_t * mod;
oberon_type_t * int_type;
oberon_type_t * bool_type;
oberon_type_t * void_type;
oberon_scope_t * decl;
oberon_module_t * mod;
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;
gen_context_t * gen_context;
oberon_scope_t * world_scope;
gen_context_t * gen_context;
MODE_BOOLEAN,
MODE_CALL,
MODE_INDEX,
MODE_BOOLEAN,
MODE_CALL,
MODE_INDEX,
- MODE_FIELD
+ MODE_FIELD,
+ MODE_DEREF,
+ MODE_NIL
};
enum
};
enum