DEADSOFTWARE

Начало проекта, где-то первая неделя июля.
[dsw-obn.git] / oberon.h
1 #ifndef EMBEDED_OBERON_SCRIPT_H
2 #define EMBEDED_OBERON_SCRIPT_H
4 enum {
5 OBERON_TYPE_INTEGER,
6 OBERON_TYPE_BOOLEAN,
7 };
9 typedef struct oberon_var_s oberon_var_t;
10 typedef struct oberon_type_s oberon_type_t;
11 typedef struct oberon_module_s oberon_module_t;
12 typedef struct oberon_context_s oberon_context_t;
14 struct oberon_type_s
15 {
16 char * name;
17 int class;
18 int size;
19 oberon_type_t * next;
20 };
22 struct oberon_var_s
23 {
24 char * name;
25 oberon_type_t * type;
26 oberon_var_t * next;
27 };
29 struct oberon_module_s
30 {
31 char * name;
32 oberon_var_t * vars;
33 };
35 struct oberon_context_s
36 {
37 const char * code;
38 int code_index;
40 char c;
41 int token;
42 char * string;
43 int integer;
45 oberon_module_t * mod;
47 oberon_type_t * types;
48 };
50 oberon_context_t * oberon_create_context();
51 void oberon_register_global_type(oberon_context_t * ctx, oberon_type_t * type);
52 oberon_module_t * oberon_compile_module(oberon_context_t * ctx, const char * code);
54 #endif // EMBEDED_OBERON_SCRIPT_H