index 2247eac4b7f42e6c463a01918e822d2adf45915e..178327ecf317a2ad3298036bf70b59a620c1af39 100644 (file)
--- a/test.c
+++ b/test.c
#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;"
- "VAR"
- " i : INTEGER;"
- " b : BOOLEAN;"
+ ""
+ "TYPE"
+ " MyInt = INTEGER;"
+ " MyRec = RECORD"
+ " a : MyInt;"
+ " END;"
+ " MyRecPtr = POINTER TO MyRec;"
+ ""
"BEGIN"
- " i := 10;"
+ " "
"END Test."
;
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;
}