DEADSOFTWARE

Добавлены указатели
[dsw-obn.git] / test.c
diff --git a/test.c b/test.c
index 7149026862087a8f63577916ffd361e8b89b08ef..8f3edc4aec855db2d7e30c6f1b24d0f45ece44c3 100644 (file)
--- a/test.c
+++ b/test.c
@@ -1,19 +1,22 @@
 #include "oberon.h"
+#include "generator.h"
 #include <assert.h>
 
-static oberon_type_t integer = { "INTEGER", OBERON_TYPE_INTEGER, sizeof(int) };
-static oberon_type_t boolean = { "BOOLEAN", OBERON_TYPE_BOOLEAN, sizeof(int) };
-
 static const char source[] =
        "MODULE Test;"
+       ""
+       "TYPE"
+       "       MyInt = INTEGER;"
+       "       MyRec = POINTER TO RECORD"
+       "               a : MyInt;"
+       "               next : MyRec;"
+       "       END;"
+       ""
        "VAR"
-       "       k : INTEGER;"
-       "       i : INTEGER;"
-       "       b : BOOLEAN;"
+       "       r : MyRec;"
+       ""
        "BEGIN"
-       "       k := 10;"
-       "       i := k;"
-       "       b := TRUE;"
+       "       "
        "END Test."
 ;
 
@@ -24,9 +27,9 @@ int
 main(int argc, char ** argv)
 {
        ctx = oberon_create_context();
-       oberon_register_global_type(ctx, &integer);
-       oberon_register_global_type(ctx, &boolean);
        mod = oberon_compile_module(ctx, source);
+       //mod -> begin();
+       oberon_generator_dump(ctx, "dump.txt");
        oberon_destroy_context(ctx);
        return 0;
 }