DEADSOFTWARE

Добавлен тип CHAR
[dsw-obn.git] / src / oberon-internals.h
index c28cfa5b80761a1d42992a32ffa5d49fa31dce76..c154d0127093d265ed6c970614f21549f9a0f557 100644 (file)
@@ -32,7 +32,7 @@ struct oberon_scope_t
        oberon_type_t * parent_type;
 };
 
-enum
+enum oberon_type_kind
 {
        OBERON_TYPE_VOID,
        OBERON_TYPE_INTEGER,
@@ -41,7 +41,8 @@ enum
        OBERON_TYPE_ARRAY,
        OBERON_TYPE_RECORD,
        OBERON_TYPE_POINTER,
-       OBERON_TYPE_REAL
+       OBERON_TYPE_REAL,
+       OBERON_TYPE_CHAR
 };
 
 typedef oberon_expr_t * (*GenerateFuncCallback)(oberon_context_t *, int, oberon_expr_t *);
@@ -49,7 +50,7 @@ typedef void (*GenerateProcCallback)(oberon_context_t *, int, oberon_expr_t *);
 
 struct oberon_type_t
 {
-       int class;
+       enum oberon_type_kind class;
        int size;
 
        int num_decl;
@@ -68,7 +69,7 @@ struct oberon_type_t
        gen_type_t * gen_type;
 };
 
-enum
+enum oberon_object_kind
 {
        OBERON_CLASS_VAR,
        OBERON_CLASS_TYPE,
@@ -83,7 +84,7 @@ enum
 struct oberon_object_t
 {
        char * name;
-       int class;
+       enum oberon_object_kind class;
        int export;
        int read_only;
 
@@ -140,6 +141,8 @@ struct oberon_context_t
        oberon_module_t * mod;
        /*** END PARSER DATA ***/
 
+       oberon_type_t * void_type;
+       oberon_type_t * void_ptr_type;
        oberon_type_t * bool_type;
        oberon_type_t * byte_type;
        oberon_type_t * shortint_type;
@@ -147,8 +150,7 @@ struct oberon_context_t
        oberon_type_t * longint_type;
        oberon_type_t * real_type;
        oberon_type_t * longreal_type;
-       oberon_type_t * void_type;
-       oberon_type_t * void_ptr_type;
+       oberon_type_t * char_type;
 
        oberon_scope_t * world_scope;
        oberon_module_t * module_list;
@@ -156,7 +158,7 @@ struct oberon_context_t
        gen_context_t * gen_context;
 };
 
-enum
+enum oberon_mode_kind
 {
        MODE_VAR,
        MODE_INTEGER,
@@ -168,9 +170,10 @@ enum
        MODE_NIL,
        MODE_NEW,
        MODE_REAL,
+       MODE_CHAR
 };
 
-enum
+enum oberon_operator_kind
 {
        OP_UNARY_MINUS,
        OP_BITWISE_NOT,
@@ -200,12 +203,12 @@ enum
 
 struct oberon_item_t
 {
-       int is_item; // == 1
+       bool is_item; // == 1
        oberon_type_t * result;
        oberon_expr_t * next;
-       int read_only;
+       bool read_only;
 
-       int mode;
+       enum oberon_mode_kind mode;
        long integer;
        double real;
        int boolean;
@@ -219,12 +222,12 @@ struct oberon_item_t
 
 struct oberon_oper_t
 {
-       int is_item; // == 0
+       bool is_item; // == 0
        oberon_type_t * result;
        oberon_expr_t * next;
-       int read_only;
+       bool read_only;
 
-       int op;
+       enum oberon_operator_kind op;
        oberon_expr_t * left;
        oberon_expr_t * right;
 };
@@ -232,10 +235,10 @@ struct oberon_oper_t
 union oberon_expr_t
 {
        struct {
-               int is_item;
+               bool is_item;
                oberon_type_t * result;
                oberon_expr_t * next;
-               int read_only;
+               bool read_only;
        };
 
        oberon_item_t item;