summaryrefslogtreecommitdiff
path: root/src/compilo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compilo.c')
-rw-r--r--src/compilo.c47
1 files changed, 42 insertions, 5 deletions
diff --git a/src/compilo.c b/src/compilo.c
index b146b4d..6c9e36b 100644
--- a/src/compilo.c
+++ b/src/compilo.c
@@ -1,7 +1,8 @@
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include "config.h"
-#include "global.h"
+#include "exceptions.h"
#include "meta.h"
#include "parser.h"
#include "hash.h"
@@ -31,10 +32,46 @@ void exception(int level, char *msg)
exit(level);
}
-void push_pile(char * s) {}
-void act_pile(int t) {}
+void invite(void) {
+ fprintf(stderr, _("Assembler\n\n"));
+}
+
+void init_all(void) {
+ fprintf(stderr, _(" o Initialising the meta engine... "));
+
+ if (meta_init()) {
+ exception(1, _("Meta parser init failed."));
+ }
+ fprintf(stderr, _(" Done!\n o Meta language loading... "));
+
+ if (meta_load("instructions.txt")) {
+ exception(1, _("Meta language loading failed."));
+ }
+
+ fprintf(stderr, _(" Done!\n o Initialising the assembler core..."));
+
+ if (assembler_init()) {
+ exception(1, _("Assembler core init failed."));
+ }
+
+ fprintf(stderr, _(" Done!\n"));
+}
+
+void flush_all(void) {
+ assembler_flush();
+ meta_flush();
+}
int main(void) {
- return 0;
-} \ No newline at end of file
+ invite();
+
+ fprintf(stderr, _("\nPerforming initialisation...\n\n"));
+ init_all();
+
+ fprintf(stderr, _("\nPerforming shutdown...\n\n"));
+ flush_all();
+
+ fprintf(stderr, _("Exitting, bye!\n"));
+ return 0;
+}