X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=test.c;h=d828f4a2e855adbbd24d2852738453892614f634;hb=d3438ae51da4c98b47441911495f10e686191abd;hp=2247eac4b7f42e6c463a01918e822d2adf45915e;hpb=b752043cfbb49243ca3727dbfc9be5b614a8c9c2;p=dsw-obn.git diff --git a/test.c b/test.c index 2247eac..d828f4a 100644 --- a/test.c +++ b/test.c @@ -1,16 +1,25 @@ #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;" + "TYPE" + " Callback = PROCEDURE() : INTEGER;" + "" "VAR" + " cb : Callback;" " i : INTEGER;" - " b : BOOLEAN;" + "" + "PROCEDURE RelBack;" "BEGIN" - " i := 10;" + " i := 666;" + "END RelBack;" + "" + "BEGIN;" + " i := 1;" + " i := cb();" + " RelBack;" "END Test." ; @@ -21,8 +30,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; }