diff --git a/src/oberon-internals.h b/src/oberon-internals.h
index e265a79cc1b39aff1e2a6afa7d3b51913853c756..c28cfa5b80761a1d42992a32ffa5d49fa31dce76 100644 (file)
--- a/src/oberon-internals.h
+++ b/src/oberon-internals.h
#ifndef OBERON_INTERNALS_H
#define OBERON_INTERNALS_H
#ifndef OBERON_INTERNALS_H
#define OBERON_INTERNALS_H
+#include <stdint.h>
+#include <stdbool.h>
+
+typedef struct gen_module_t gen_module_t;
typedef struct gen_proc_t gen_proc_t;
typedef struct gen_type_t gen_type_t;
typedef struct gen_var_t gen_var_t;
typedef struct gen_proc_t gen_proc_t;
typedef struct gen_type_t gen_type_t;
typedef struct gen_var_t gen_var_t;
oberon_object_t * list;
oberon_scope_t * up;
oberon_object_t * list;
oberon_scope_t * up;
- oberon_object_t * parent;
int local;
int local;
+ oberon_object_t * parent;
+ oberon_type_t * parent_type;
};
enum
};
enum
OBERON_TYPE_REAL
};
OBERON_TYPE_REAL
};
+typedef oberon_expr_t * (*GenerateFuncCallback)(oberon_context_t *, int, oberon_expr_t *);
+typedef void (*GenerateProcCallback)(oberon_context_t *, int, oberon_expr_t *);
+
struct oberon_type_t
{
int class;
struct oberon_type_t
{
int class;
int num_decl;
oberon_type_t * base;
oberon_object_t * decl;
int num_decl;
oberon_type_t * base;
oberon_object_t * decl;
+ oberon_scope_t * scope;
+
+ bool sysproc;
+ GenerateFuncCallback genfunc;
+ GenerateProcCallback genproc;
oberon_module_t * module;
oberon_module_t * module;
OBERON_CLASS_MODULE
};
OBERON_CLASS_MODULE
};
-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_t
{
char * name;
struct oberon_object_t
{
char * name;
int initialized;
oberon_object_t * parent;
int initialized;
oberon_object_t * parent;
+ oberon_type_t * parent_type;
oberon_scope_t * scope; // for proc
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;
oberon_type_t * type;
oberon_item_t * value;
oberon_scope_t * decl;
oberon_module_t * next;
oberon_scope_t * decl;
oberon_module_t * next;
+
+ gen_module_t * gen_mod;
};
typedef const char * (*ModuleImportCallback)(const char * name);
};
typedef const char * (*ModuleImportCallback)(const char * name);
char c;
int token;
char * string;
char c;
int token;
char * string;
- long integer;
+ int64_t integer;
double real;
double real;
+ bool longmode;
/*** END SCANER DATA ***/
/*** PARSER DATA ***/
/*** END SCANER DATA ***/
/*** PARSER DATA ***/
oberon_module_t * mod;
/*** END PARSER DATA ***/
oberon_module_t * mod;
/*** END PARSER DATA ***/
- oberon_type_t * int_type;
oberon_type_t * bool_type;
oberon_type_t * bool_type;
+ oberon_type_t * byte_type;
+ oberon_type_t * shortint_type;
+ oberon_type_t * int_type;
+ oberon_type_t * longint_type;
oberon_type_t * real_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 * void_type;
oberon_type_t * void_ptr_type;
+
oberon_scope_t * world_scope;
oberon_module_t * module_list;
ModuleImportCallback import_module;
oberon_scope_t * world_scope;
oberon_module_t * module_list;
ModuleImportCallback import_module;
MODE_DEREF,
MODE_NIL,
MODE_NEW,
MODE_DEREF,
MODE_NIL,
MODE_NEW,
- MODE_REAL
+ MODE_REAL,
};
enum
};
enum
OP_MOD,
OP_BITWISE_AND,
OP_BITWISE_XOR,
OP_MOD,
OP_BITWISE_AND,
OP_BITWISE_XOR,
- OP_BITWISE_OP,
+ OP_BITWISE_OR,
OP_LOGIC_AND,
OP_LOGIC_OR,
OP_LOGIC_AND,
OP_LOGIC_OR,
OP_LSS,
OP_LEQ,
OP_GRT,
OP_LSS,
OP_LEQ,
OP_GRT,
- OP_GEQ
+ OP_GEQ,
+
+ OP_CAST
};
struct oberon_item_t
};
struct oberon_item_t
oberon_oper_t oper;
};
oberon_oper_t oper;
};
-extern void
-oberon_error(oberon_context_t * ctx, const char * fmt, ...);
-
#endif // OBERON_INTERNALS_H
#endif // OBERON_INTERNALS_H