X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=oberon.h;h=f84d332ca73124ace42cbaaa6c097586038bd114;hb=734fa8f9223c140a583e7f193df810d48555ac34;hp=becdd78e6cf530ec53d67ab0ce1ed9b86ab818ef;hpb=063ba732ee8778c34a3781270b18d52481dbf0cd;p=dsw-obn.git diff --git a/oberon.h b/oberon.h index becdd78..f84d332 100644 --- a/oberon.h +++ b/oberon.h @@ -3,33 +3,42 @@ #include -/* - * Стуктуры данных генератора - */ +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; -} gen_type_t; + gcc_jit_type * gcc_type; + gcc_jit_struct * gcc_struct; +}; -typedef struct +struct gen_var_s { - char stub[16]; gcc_jit_lvalue * gcc_lvalue; gcc_jit_param * gcc_param; -} gen_var_t; + gcc_jit_field * gcc_field; +}; -typedef struct +struct gen_block_s { - gcc_jit_context * gcc_context; gcc_jit_block * gcc_block; + gen_block_t * up; +}; + +struct gen_context_s +{ + gcc_jit_context * gcc_context; gcc_jit_result * gcc_result; -} gen_context_t; + gen_block_t * block; +}; typedef struct oberon_type_s oberon_type_t; typedef struct oberon_object_s oberon_object_t; @@ -56,6 +65,9 @@ struct oberon_scope_s oberon_context_t * ctx; oberon_object_t * list; oberon_scope_t * up; + + oberon_object_t * parent; + int local; }; /* @@ -69,7 +81,9 @@ enum OBERON_TYPE_INTEGER, OBERON_TYPE_BOOLEAN, OBERON_TYPE_PROCEDURE, - OBERON_TYPE_ARRAY + OBERON_TYPE_ARRAY, + OBERON_TYPE_RECORD, + OBERON_TYPE_POINTER }; /* @@ -95,12 +109,12 @@ struct oberon_type_s int class; int size; - int dim; - int num_decl; oberon_type_t * base; oberon_object_t * decl; + int recursive; + int initialized; gen_type_t * gen_type; }; @@ -120,7 +134,8 @@ enum OBERON_CLASS_PROC, OBERON_CLASS_PARAM, OBERON_CLASS_VAR_PARAM, - OBERON_CLASS_CONST + OBERON_CLASS_CONST, + OBERON_CLASS_FIELD }; /* @@ -138,6 +153,15 @@ struct oberon_object_s char * name; int class; + int local; + int linked; + int initialized; + + oberon_object_t * parent; + oberon_scope_t * scope; // for proc + int has_return; // for proc + + oberon_type_t * type; oberon_item_t * value; oberon_object_t * next; @@ -190,15 +214,13 @@ struct oberon_context_s 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_type_t * void_ptr_type; oberon_scope_t * world_scope; gen_context_t * gen_context; @@ -209,7 +231,11 @@ enum MODE_VAR, MODE_INTEGER, MODE_BOOLEAN, - MODE_CALL + MODE_CALL, + MODE_INDEX, + MODE_FIELD, + MODE_DEREF, + MODE_NIL }; enum @@ -242,6 +268,8 @@ struct oberon_item_s int boolean; oberon_object_t * var; + oberon_item_t * parent; + int num_args; oberon_expr_t * args; };