X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;ds=inline;f=test.c;h=b07a08d0898a7f2816a6bb281c9f6050ac31d9bb;hb=734fa8f9223c140a583e7f193df810d48555ac34;hp=7149026862087a8f63577916ffd361e8b89b08ef;hpb=c3449e207b5e1e85ecea55975163a4dc6b986962;p=dsw-obn.git diff --git a/test.c b/test.c index 7149026..b07a08d 100644 --- a/test.c +++ b/test.c @@ -1,19 +1,28 @@ #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" + " Rec = RECORD i : INTEGER; END;" "VAR" - " k : INTEGER;" " i : INTEGER;" - " b : BOOLEAN;" - "BEGIN" - " k := 10;" - " i := k;" - " b := TRUE;" + " j : INTEGER;" + "" + "PROCEDURE ^ Tier(x : INTEGER);" + "" + "PROCEDURE Tier(x : INTEGER);" + "VAR a : INTEGER;" + "BEGIN;" + " a := 1;" + "END Tier;" + "" + "PROCEDURE ^ Tier(x : INTEGER);" + "" + "BEGIN;" + " i := 666;" + " Tier(1);" "END Test." ; @@ -24,9 +33,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; }