index da6a8041e833c307ff423b8411513067390e8c53..d828f4a2e855adbbd24d2852738453892614f634 100644 (file)
--- a/test.c
+++ b/test.c
#include "oberon.h"
#include "oberon.h"
+#include "generator.h"
#include <assert.h>
static const char source[] =
"MODULE Test;"
#include <assert.h>
static const char source[] =
"MODULE Test;"
+ "TYPE"
+ " Callback = PROCEDURE() : INTEGER;"
+ ""
"VAR"
"VAR"
- " k : INTEGER;"
+ " cb : Callback;"
" i : INTEGER;"
" i : INTEGER;"
- " b : BOOLEAN;"
""
""
- "PROCEDURE Tier;"
+ "PROCEDURE RelBack;"
"BEGIN"
"BEGIN"
- " k := 314;"
- "END Tier;"
+ " i := 666;"
+ "END RelBack;"
""
""
- "BEGIN"
- " k := 1;"
- " i := k;"
- " b := TRUE;"
- " Tier;"
+ "BEGIN;"
+ " i := 1;"
+ " i := cb();"
+ " RelBack;"
"END Test."
;
"END Test."
;
ctx = oberon_create_context();
mod = oberon_compile_module(ctx, source);
//mod -> begin();
ctx = oberon_create_context();
mod = oberon_compile_module(ctx, source);
//mod -> begin();
+ oberon_generator_dump(ctx, "dump.txt");
oberon_destroy_context(ctx);
return 0;
}
oberon_destroy_context(ctx);
return 0;
}