X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=test.c;h=2c2966752c60839008da78f4ce6eec82f9154e3a;hb=518cba11c21426f922afef90048f5f9c8130fed2;hp=2247eac4b7f42e6c463a01918e822d2adf45915e;hpb=b752043cfbb49243ca3727dbfc9be5b614a8c9c2;p=dsw-obn.git diff --git a/test.c b/test.c index 2247eac..2c29667 100644 --- a/test.c +++ b/test.c @@ -1,16 +1,21 @@ #include "oberon.h" +#include "generator.h" #include -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;" "VAR" " i : INTEGER;" - " b : BOOLEAN;" - "BEGIN" - " i := 10;" + " j : INTEGER;" + "" + "PROCEDURE Tier(VAR x : INTEGER);" + "BEGIN;" + " x := i;" + "END Tier;" + "" + "BEGIN;" + " i := 666;" + " Tier(j);" "END Test." ; @@ -21,8 +26,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; }