DEADSOFTWARE

Добавлено получение указателей на сгенерированные процедуры и переменные
[dsw-obn.git] / oberon.h
index 9d17afdb16e76ff0bbfa3e8d2ce30d4b80e46a7b..d481e130b6e89c06e8b3227cc882e2be2339ecbc 100644 (file)
--- a/oberon.h
+++ b/oberon.h
@@ -11,33 +11,34 @@ typedef struct gen_context_s gen_context_t;
 
 struct gen_proc_s
 {
-        gcc_jit_function * gcc_func;
+       gcc_jit_function * gcc_func;
 };
 
 struct gen_type_s
 {
-        gcc_jit_type * gcc_type;
-        gcc_jit_struct * gcc_struct;
+       gcc_jit_type * gcc_type;
+       gcc_jit_struct * gcc_struct;
 };
 
 struct gen_var_s
 {
-        gcc_jit_lvalue * gcc_lvalue;
-        gcc_jit_param * gcc_param;
-        gcc_jit_field * gcc_field;
+       gcc_jit_lvalue * gcc_lvalue;
+       gcc_jit_param * gcc_param;
+       gcc_jit_field * gcc_field;
 };
 
 struct gen_block_s
 {
-        gcc_jit_block * gcc_block;
+       gcc_jit_block * gcc_block;
        gen_block_t * up;
 };
 
 struct gen_context_s
 {
-        gcc_jit_context * gcc_context;
-        gcc_jit_result * gcc_result;
+       gcc_jit_context * gcc_context;
+       gcc_jit_result * gcc_result;
        gen_block_t * block;
+       unsigned record_count;
 };
 
 typedef struct oberon_type_s oberon_type_t;
@@ -138,6 +139,11 @@ enum
        OBERON_CLASS_FIELD
 };
 
+enum
+{
+       OBERON_SYSPROC_ABS
+};
+
 /*
  * Структура oberon_object_s (oberon_object_t) описывает все
  * объявления которые могут иметь имя. От констант, до процедур.
@@ -148,6 +154,9 @@ enum
  *   next -- ссылка на следующий объект в списке.
  */
 
+typedef oberon_expr_t * (*GenerateFuncCallback)(oberon_context_t *, int, oberon_expr_t *);
+typedef void (*GenerateProcCallback)(oberon_context_t *, int, oberon_expr_t *);
+
 struct oberon_object_s
 {
        char * name;
@@ -158,8 +167,12 @@ struct oberon_object_s
        int initialized;
 
        oberon_object_t * parent;
-       int has_return; // for proc
 
+       oberon_scope_t * scope; // for proc
+       int has_return; // for proc
+       int sysproc;
+       GenerateFuncCallback genfunc;
+       GenerateProcCallback genproc;
 
        oberon_type_t * type;
        oberon_item_t * value;
@@ -239,15 +252,22 @@ enum
 
 enum
 {
-       OP_LOGIC_NOT,
        OP_UNARY_MINUS,
+       OP_BITWISE_NOT,
+       OP_LOGIC_NOT,
+       OP_ABS,
+
        OP_ADD,
        OP_SUB,
        OP_MUL,
        OP_DIV,
        OP_MOD,
+       OP_BITWISE_AND,
+       OP_BITWISE_XOR,
+       OP_BITWISE_OP,
        OP_LOGIC_AND,
        OP_LOGIC_OR,
+
        OP_EQ,
        OP_NEQ,
        OP_LSS,