From 8212d25ba09a7fdf1938a1992022a0143d29e05b Mon Sep 17 00:00:00 2001 From: Pixel <> Date: Sun, 1 Apr 2001 12:36:50 +0000 Subject: Exceptions --- src/compilo.c | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) (limited to 'src/compilo.c') 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 #include +#include #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; +} -- cgit v1.2.3