use nitg to bootstrap; drop bootstrap of nitc
[nit.git] / c_src / ffi___c._sep.c
diff --git a/c_src/ffi___c._sep.c b/c_src/ffi___c._sep.c
deleted file mode 100644 (file)
index e4694df..0000000
+++ /dev/null
@@ -1,402 +0,0 @@
-/* This C file is generated by NIT to compile module ffi___c. */
-#include "ffi___c._sep.h"
-static const char LOCATE_ffi___c___ExternCode___is_c[] = "c::ExternCode::is_c";
-val_t ffi___c___ExternCode___is_c(val_t p0){
-  struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
-  val_t REGB0;
-  val_t REGB1;
-  val_t REGB2;
-  val_t tmp;
-    static val_t once_value_1; /* Once value */
-    static val_t once_value_2; /* Once value */
-  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
-  fra.me.file = LOCATE_ffi___c;
-  fra.me.line = 24;
-  fra.me.meth = LOCATE_ffi___c___ExternCode___is_c;
-  fra.me.has_broke = 0;
-  fra.me.REG_size = 3;
-  fra.me.nitni_local_ref_head = NULL;
-  fra.me.REG[0] = NIT_NULL;
-  fra.me.REG[1] = NIT_NULL;
-  fra.me.REG[2] = NIT_NULL;
-  fra.me.REG[0] = p0;
-  /* ffi/c.nit:24 */
-  fra.me.REG[1] = CALL_syntax___extern_inline___ExternCode___language(fra.me.REG[0])(fra.me.REG[0]);
-  REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
-  if (UNTAG_Bool(REGB0)) {
-  } else {
-    REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
-    if (UNTAG_Bool(REGB1)) {
-      REGB1 = TAG_Bool(0);
-      REGB0 = REGB1;
-    } else {
-      REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], NIT_NULL);
-      REGB0 = REGB1;
-    }
-  }
-  if (UNTAG_Bool(REGB0)) {
-    REGB0 = TAG_Bool(1);
-  } else {
-    /* ffi/c.nit:25 */
-    fra.me.REG[1] = CALL_ffi___ffi_base___ExternCode___language_lowered(fra.me.REG[0])(fra.me.REG[0]);
-    if (!once_value_1) {
-      fra.me.REG[2] = BOX_NativeString("c");
-      REGB1 = TAG_Int(1);
-      fra.me.REG[2] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[2])(fra.me.REG[2], REGB1);
-      once_value_1 = fra.me.REG[2];
-      register_static_object(&once_value_1);
-    } else fra.me.REG[2] = once_value_1;
-    fra.me.REG[2] = fra.me.REG[2];
-    REGB1 = TAG_Bool(IS_EQUAL_ON(fra.me.REG[2],fra.me.REG[1]));
-    if (UNTAG_Bool(REGB1)) {
-    } else {
-      REGB2 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
-      if (UNTAG_Bool(REGB2)) {
-        REGB2 = TAG_Bool(0);
-        REGB1 = REGB2;
-      } else {
-        REGB2 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
-        REGB1 = REGB2;
-      }
-    }
-    /* ffi/c.nit:24 */
-    REGB0 = REGB1;
-  }
-  if (UNTAG_Bool(REGB0)) {
-    REGB0 = TAG_Bool(1);
-  } else {
-    /* ffi/c.nit:25 */
-    fra.me.REG[0] = CALL_ffi___ffi_base___ExternCode___language_lowered(fra.me.REG[0])(fra.me.REG[0]);
-    if (!once_value_2) {
-      fra.me.REG[2] = BOX_NativeString("c ");
-      REGB1 = TAG_Int(2);
-      fra.me.REG[2] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[2])(fra.me.REG[2], REGB1);
-      once_value_2 = fra.me.REG[2];
-      register_static_object(&once_value_2);
-    } else fra.me.REG[2] = once_value_2;
-    fra.me.REG[2] = fra.me.REG[2];
-    REGB1 = TAG_Bool(fra.me.REG[0]==NIT_NULL);
-    if (UNTAG_Bool(REGB1)) {
-      nit_abort("Reciever is null", NULL, LOCATE_ffi___c, 25);
-    }
-    REGB1 = CALL_standard___string___AbstractString___has_prefix(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]);
-    /* ffi/c.nit:24 */
-    REGB0 = REGB1;
-  }
-  goto label3;
-  label3: while(0);
-  stack_frame_head = fra.me.prev;
-  return REGB0;
-}
-static const char LOCATE_ffi___c___ExternCode___is_c_body[] = "c::ExternCode::is_c_body";
-val_t ffi___c___ExternCode___is_c_body(val_t p0){
-  struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
-  val_t REGB0;
-  val_t REGB1;
-  val_t REGB2;
-  val_t tmp;
-    static val_t once_value_1; /* Once value */
-    static val_t once_value_2; /* Once value */
-  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
-  fra.me.file = LOCATE_ffi___c;
-  fra.me.line = 27;
-  fra.me.meth = LOCATE_ffi___c___ExternCode___is_c_body;
-  fra.me.has_broke = 0;
-  fra.me.REG_size = 3;
-  fra.me.nitni_local_ref_head = NULL;
-  fra.me.REG[0] = NIT_NULL;
-  fra.me.REG[1] = NIT_NULL;
-  fra.me.REG[2] = NIT_NULL;
-  fra.me.REG[0] = p0;
-  /* ffi/c.nit:27 */
-  fra.me.REG[1] = CALL_syntax___extern_inline___ExternCode___language(fra.me.REG[0])(fra.me.REG[0]);
-  REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
-  if (UNTAG_Bool(REGB0)) {
-  } else {
-    REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
-    if (UNTAG_Bool(REGB1)) {
-      REGB1 = TAG_Bool(0);
-      REGB0 = REGB1;
-    } else {
-      REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], NIT_NULL);
-      REGB0 = REGB1;
-    }
-  }
-  if (UNTAG_Bool(REGB0)) {
-    REGB0 = TAG_Bool(1);
-  } else {
-    /* ffi/c.nit:28 */
-    fra.me.REG[1] = CALL_ffi___ffi_base___ExternCode___language_lowered(fra.me.REG[0])(fra.me.REG[0]);
-    if (!once_value_1) {
-      fra.me.REG[2] = BOX_NativeString("c");
-      REGB1 = TAG_Int(1);
-      fra.me.REG[2] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[2])(fra.me.REG[2], REGB1);
-      once_value_1 = fra.me.REG[2];
-      register_static_object(&once_value_1);
-    } else fra.me.REG[2] = once_value_1;
-    fra.me.REG[2] = fra.me.REG[2];
-    REGB1 = TAG_Bool(IS_EQUAL_ON(fra.me.REG[2],fra.me.REG[1]));
-    if (UNTAG_Bool(REGB1)) {
-    } else {
-      REGB2 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
-      if (UNTAG_Bool(REGB2)) {
-        REGB2 = TAG_Bool(0);
-        REGB1 = REGB2;
-      } else {
-        REGB2 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
-        REGB1 = REGB2;
-      }
-    }
-    /* ffi/c.nit:27 */
-    REGB0 = REGB1;
-  }
-  if (UNTAG_Bool(REGB0)) {
-    REGB0 = TAG_Bool(1);
-  } else {
-    /* ffi/c.nit:28 */
-    fra.me.REG[0] = CALL_ffi___ffi_base___ExternCode___language_lowered(fra.me.REG[0])(fra.me.REG[0]);
-    if (!once_value_2) {
-      fra.me.REG[2] = BOX_NativeString("c body");
-      REGB1 = TAG_Int(6);
-      fra.me.REG[2] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[2])(fra.me.REG[2], REGB1);
-      once_value_2 = fra.me.REG[2];
-      register_static_object(&once_value_2);
-    } else fra.me.REG[2] = once_value_2;
-    fra.me.REG[2] = fra.me.REG[2];
-    REGB1 = TAG_Bool(IS_EQUAL_ON(fra.me.REG[2],fra.me.REG[0]));
-    if (UNTAG_Bool(REGB1)) {
-    } else {
-      REGB2 = TAG_Bool(fra.me.REG[0]==NIT_NULL);
-      if (UNTAG_Bool(REGB2)) {
-        REGB2 = TAG_Bool(0);
-        REGB1 = REGB2;
-      } else {
-        REGB2 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]);
-        REGB1 = REGB2;
-      }
-    }
-    /* ffi/c.nit:27 */
-    REGB0 = REGB1;
-  }
-  goto label3;
-  label3: while(0);
-  stack_frame_head = fra.me.prev;
-  return REGB0;
-}
-static const char LOCATE_ffi___c___ExternCode___is_c_header[] = "c::ExternCode::is_c_header";
-val_t ffi___c___ExternCode___is_c_header(val_t p0){
-  struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
-  val_t REGB0;
-  val_t REGB1;
-  val_t tmp;
-  static val_t once_value_1; /* Once value */
-  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
-  fra.me.file = LOCATE_ffi___c;
-  fra.me.line = 30;
-  fra.me.meth = LOCATE_ffi___c___ExternCode___is_c_header;
-  fra.me.has_broke = 0;
-  fra.me.REG_size = 2;
-  fra.me.nitni_local_ref_head = NULL;
-  fra.me.REG[0] = NIT_NULL;
-  fra.me.REG[1] = NIT_NULL;
-  fra.me.REG[0] = p0;
-  /* ffi/c.nit:30 */
-  fra.me.REG[0] = CALL_ffi___ffi_base___ExternCode___language_lowered(fra.me.REG[0])(fra.me.REG[0]);
-  if (!once_value_1) {
-    fra.me.REG[1] = BOX_NativeString("c header");
-    REGB0 = TAG_Int(8);
-    fra.me.REG[1] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[1])(fra.me.REG[1], REGB0);
-    once_value_1 = fra.me.REG[1];
-    register_static_object(&once_value_1);
-  } else fra.me.REG[1] = once_value_1;
-  fra.me.REG[1] = fra.me.REG[1];
-  REGB0 = TAG_Bool(IS_EQUAL_ON(fra.me.REG[1],fra.me.REG[0]));
-  if (UNTAG_Bool(REGB0)) {
-  } else {
-    REGB1 = TAG_Bool(fra.me.REG[0]==NIT_NULL);
-    if (UNTAG_Bool(REGB1)) {
-      REGB1 = TAG_Bool(0);
-      REGB0 = REGB1;
-    } else {
-      REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]);
-      REGB0 = REGB1;
-    }
-  }
-  goto label2;
-  label2: while(0);
-  stack_frame_head = fra.me.prev;
-  return REGB0;
-}
-static const char LOCATE_ffi___c___ExternCode___accept_ffi_visitor[] = "c::ExternCode::(ffi_base::FFIVisited::accept_ffi_visitor)";
-void ffi___c___ExternCode___accept_ffi_visitor(val_t p0, val_t p1){
-  struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
-  val_t REGB0;
-  val_t tmp;
-  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
-  fra.me.file = LOCATE_ffi___c;
-  fra.me.line = 32;
-  fra.me.meth = LOCATE_ffi___c___ExternCode___accept_ffi_visitor;
-  fra.me.has_broke = 0;
-  fra.me.REG_size = 4;
-  fra.me.nitni_local_ref_head = NULL;
-  fra.me.REG[0] = NIT_NULL;
-  fra.me.REG[1] = NIT_NULL;
-  fra.me.REG[2] = NIT_NULL;
-  fra.me.REG[3] = NIT_NULL;
-  fra.me.REG[0] = p0;
-  fra.me.REG[1] = p1;
-  /* ffi/c.nit:34 */
-  REGB0 = CALL_ffi___c___ExternCode___is_c_header(fra.me.REG[0])(fra.me.REG[0]);
-  if (UNTAG_Bool(REGB0)) {
-    /* ffi/c.nit:35 */
-    fra.me.REG[2] = CALL_ffi___ffi_base___FFIVisitor___compilation_unit(fra.me.REG[1])(fra.me.REG[1]);
-    fra.me.REG[2] = CALL_c_tools___CCompilationUnit___header_custom(fra.me.REG[2])(fra.me.REG[2]);
-    fra.me.REG[3] = CALL_syntax___extern_inline___ExternCode___code(fra.me.REG[0])(fra.me.REG[0]);
-    CALL_compiling_writer___Writer___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
-  } else {
-    /* ffi/c.nit:36 */
-    REGB0 = CALL_ffi___c___ExternCode___is_c_body(fra.me.REG[0])(fra.me.REG[0]);
-    if (UNTAG_Bool(REGB0)) {
-      /* ffi/c.nit:37 */
-      fra.me.REG[1] = CALL_ffi___ffi_base___FFIVisitor___compilation_unit(fra.me.REG[1])(fra.me.REG[1]);
-      fra.me.REG[1] = CALL_c_tools___CCompilationUnit___body_custom(fra.me.REG[1])(fra.me.REG[1]);
-      fra.me.REG[0] = CALL_syntax___extern_inline___ExternCode___code(fra.me.REG[0])(fra.me.REG[0]);
-      CALL_compiling_writer___Writer___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]);
-    }
-  }
-  stack_frame_head = fra.me.prev;
-  return;
-}
-static const char LOCATE_ffi___c___MMMethod___accept_ffi_visitor[] = "c::MMMethod::(ffi_base::FFIVisited::accept_ffi_visitor)";
-void ffi___c___MMMethod___accept_ffi_visitor(val_t p0, val_t p1){
-  struct {struct stack_frame_t me; val_t MORE_REG[6];} fra;
-  val_t REGB0;
-  val_t tmp;
-  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
-  fra.me.file = LOCATE_ffi___c;
-  fra.me.line = 43;
-  fra.me.meth = LOCATE_ffi___c___MMMethod___accept_ffi_visitor;
-  fra.me.has_broke = 0;
-  fra.me.REG_size = 7;
-  fra.me.nitni_local_ref_head = NULL;
-  fra.me.REG[0] = NIT_NULL;
-  fra.me.REG[1] = NIT_NULL;
-  fra.me.REG[2] = NIT_NULL;
-  fra.me.REG[3] = NIT_NULL;
-  fra.me.REG[4] = NIT_NULL;
-  fra.me.REG[5] = NIT_NULL;
-  fra.me.REG[6] = NIT_NULL;
-  fra.me.REG[0] = p0;
-  fra.me.REG[1] = p1;
-  /* ffi/c.nit:43 */
-  fra.me.REG[2] = fra.me.REG[0];
-  fra.me.REG[3] = fra.me.REG[1];
-  /* ffi/c.nit:45 */
-  fra.me.REG[4] = CALL_syntax___extern_inline___MMMethod___extern_implementation(fra.me.REG[2])(fra.me.REG[2]);
-  REGB0 = TAG_Bool(fra.me.REG[4]==NIT_NULL);
-  if (UNTAG_Bool(REGB0)) {
-    nit_abort("Reciever is null", NULL, LOCATE_ffi___c, 45);
-  }
-  REGB0 = CALL_ffi___c___ExternCode___is_c(fra.me.REG[4])(fra.me.REG[4]);
-  if (UNTAG_Bool(REGB0)) {
-    /* ffi/c.nit:46 */
-    fra.me.REG[4] = CALL_native_interface___ni_metamodel___MMMethod___impl_csignature(fra.me.REG[2])(fra.me.REG[2]);
-    fra.me.REG[4] = NEW_CFunction_c_tools___CFunction___init(fra.me.REG[4]);
-    /* ffi/c.nit:47 */
-    fra.me.REG[5] = CALL_c_tools___CFunction___decls(fra.me.REG[4])(fra.me.REG[4]);
-    fra.me.REG[6] = CALL_syntax___extern_inline___MMMethod___extern_implementation(fra.me.REG[2])(fra.me.REG[2]);
-    REGB0 = TAG_Bool(fra.me.REG[6]==NIT_NULL);
-    if (UNTAG_Bool(REGB0)) {
-      nit_abort("Reciever is null", NULL, LOCATE_ffi___c, 47);
-    }
-    fra.me.REG[6] = CALL_syntax___extern_inline___ExternCode___location(fra.me.REG[6])(fra.me.REG[6]);
-    REGB0 = TAG_Bool(fra.me.REG[6]==NIT_NULL);
-    if (UNTAG_Bool(REGB0)) {
-      nit_abort("Reciever is null", NULL, LOCATE_ffi___c, 47);
-    }
-    fra.me.REG[6] = CALL_ffi___c___Location___as_line_pragma(fra.me.REG[6])(fra.me.REG[6]);
-    CALL_compiling_writer___Writer___add(fra.me.REG[5])(fra.me.REG[5], fra.me.REG[6]);
-    /* ffi/c.nit:48 */
-    fra.me.REG[6] = CALL_c_tools___CFunction___exprs(fra.me.REG[4])(fra.me.REG[4]);
-    fra.me.REG[2] = CALL_syntax___extern_inline___MMMethod___extern_implementation(fra.me.REG[2])(fra.me.REG[2]);
-    REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
-    if (UNTAG_Bool(REGB0)) {
-      nit_abort("Reciever is null", NULL, LOCATE_ffi___c, 48);
-    }
-    fra.me.REG[2] = CALL_syntax___extern_inline___ExternCode___code(fra.me.REG[2])(fra.me.REG[2]);
-    CALL_compiling_writer___Writer___add(fra.me.REG[6])(fra.me.REG[6], fra.me.REG[2]);
-    /* ffi/c.nit:49 */
-    fra.me.REG[3] = CALL_ffi___ffi_base___FFIVisitor___compilation_unit(fra.me.REG[3])(fra.me.REG[3]);
-    CALL_c_tools___CCompilationUnit___add_exported_function(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]);
-  } else {
-    /* ffi/c.nit:51 */
-    CALL_SUPER_ffi___c___MMMethod___accept_ffi_visitor(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]);
-  }
-  stack_frame_head = fra.me.prev;
-  return;
-}
-static const char LOCATE_ffi___c___Location___as_line_pragma[] = "c::Location::as_line_pragma";
-val_t ffi___c___Location___as_line_pragma(val_t p0){
-  struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
-  val_t REGB0;
-  val_t tmp;
-  static val_t once_value_1; /* Once value */
-  static val_t once_value_2; /* Once value */
-  static val_t once_value_3; /* Once value */
-  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
-  fra.me.file = LOCATE_ffi___c;
-  fra.me.line = 57;
-  fra.me.meth = LOCATE_ffi___c___Location___as_line_pragma;
-  fra.me.has_broke = 0;
-  fra.me.REG_size = 3;
-  fra.me.nitni_local_ref_head = NULL;
-  fra.me.REG[0] = NIT_NULL;
-  fra.me.REG[1] = NIT_NULL;
-  fra.me.REG[2] = NIT_NULL;
-  fra.me.REG[0] = p0;
-  /* ffi/c.nit:59 */
-  REGB0 = TAG_Int(5);
-  fra.me.REG[1] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
-  if (!once_value_1) {
-    fra.me.REG[2] = BOX_NativeString("#line ");
-    REGB0 = TAG_Int(6);
-    fra.me.REG[2] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[2])(fra.me.REG[2], REGB0);
-    once_value_1 = fra.me.REG[2];
-    register_static_object(&once_value_1);
-  } else fra.me.REG[2] = once_value_1;
-  fra.me.REG[2] = fra.me.REG[2];
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
-  REGB0 = CALL_location___Location___line_start(fra.me.REG[0])(fra.me.REG[0]);
-  fra.me.REG[2] = CALL_standard___string___Object___to_s(REGB0)(REGB0);
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
-  if (!once_value_2) {
-    fra.me.REG[2] = BOX_NativeString(" \"");
-    REGB0 = TAG_Int(2);
-    fra.me.REG[2] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[2])(fra.me.REG[2], REGB0);
-    once_value_2 = fra.me.REG[2];
-    register_static_object(&once_value_2);
-  } else fra.me.REG[2] = once_value_2;
-  fra.me.REG[2] = fra.me.REG[2];
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
-  fra.me.REG[0] = CALL_location___Location___file(fra.me.REG[0])(fra.me.REG[0]);
-  REGB0 = TAG_Bool(fra.me.REG[0]==NIT_NULL);
-  if (UNTAG_Bool(REGB0)) {
-    nit_abort("Reciever is null", NULL, LOCATE_ffi___c, 59);
-  }
-  fra.me.REG[0] = CALL_location___SourceFile___filename(fra.me.REG[0])(fra.me.REG[0]);
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]);
-  if (!once_value_3) {
-    fra.me.REG[0] = BOX_NativeString("\"\n");
-    REGB0 = TAG_Int(2);
-    fra.me.REG[0] = CALL_standard___string___NativeString___to_s_with_length(fra.me.REG[0])(fra.me.REG[0], REGB0);
-    once_value_3 = fra.me.REG[0];
-    register_static_object(&once_value_3);
-  } else fra.me.REG[0] = once_value_3;
-  fra.me.REG[0] = fra.me.REG[0];
-  CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]);
-  fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[1])(fra.me.REG[1]);
-  goto label4;
-  label4: while(0);
-  stack_frame_head = fra.me.prev;
-  return fra.me.REG[1];
-}