Example #1
0
File: bacon.c Project: wbhart/bacon
int main(void)
{
   ast_t * a;
   int jval;
   jit_t * jit;
   
   GC_INIT();
   GREG g;
 
   ast_init();
   sym_tab_init();
   types_init();
   scope_init();
   loc_tab_init();
   intrinsics_init();
   jit = llvm_init();
   ZZ_init(jit);
   
   yyinit(&g);

   printf("Welcome to Bacon v0.1\n\n");
   printf("> ");

   while (1)
   {
      if (!(jval = setjmp(exc)))
      {
         if (!yyparse(&g))
         {
            printf("Error parsing\n");
            abort();
         } else if (root)
         {
#if DEBUG1
            printf("\n");
            ast_print(root, 0);
#endif
            inference(root);
#if DEBUG2
            printf("\n");
            /*ast2_print(root, 0);*/
#endif
            exec_root(jit, root);
            root = NULL;
         }
      } else if (jval == 1)
         root = NULL;
      else /* jval == 2 */
         break;
      
      printf("\n> ");
   }

   llvm_cleanup(jit);
   yydeinit(&g);
    
   printf("\n");

   return 0;
}
Example #2
0
void 
init ()
{
        g_type_init ();
        scm_c_eval_string ("(use-modules (gnome-2) (gnome gobject))");

        repository_init ();
        types_init ();
        registered_type_init ();
        object_init ();
        function_init ();
        callable_init ();
        argument_init ();
}