GIT
/
REPO
/
FRED-BOY
Projects
/
dsw-obn.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Поправлено умножение, добавлен вывод результата генератора в файл
[dsw-obn.git]
/
test.c
diff --git
a/test.c
b/test.c
index 2247eac4b7f42e6c463a01918e822d2adf45915e..178327ecf317a2ad3298036bf70b59a620c1af39 100644
(file)
--- a/
test.c
+++ b/
test.c
@@
-1,16
+1,19
@@
#include "oberon.h"
#include "oberon.h"
+#include "generator.h"
#include <assert.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;"
static const char source[] =
"MODULE Test;"
- "VAR"
- " i : INTEGER;"
- " b : BOOLEAN;"
+ ""
+ "TYPE"
+ " MyInt = INTEGER;"
+ " MyRec = RECORD"
+ " a : MyInt;"
+ " END;"
+ " MyRecPtr = POINTER TO MyRec;"
+ ""
"BEGIN"
"BEGIN"
- "
i := 10;
"
+ " "
"END Test."
;
"END Test."
;
@@
-21,8
+24,9
@@
int
main(int argc, char ** argv)
{
ctx = oberon_create_context();
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 = oberon_compile_module(ctx, source);
+ //mod -> begin();
+ oberon_generator_dump(ctx, "dump.txt");
+ oberon_destroy_context(ctx);
return 0;
}
return 0;
}
DEADSOFTWARE 2012-2025