val_t syntax___extern_type_inheritance___MMLocalClass___extern_c_type(val_t p0){
  struct {struct stack_frame_t me;} fra;
  val_t REGB0;
  val_t tmp;
  fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
  fra.me.file = LOCATE_syntax___extern_type_inheritance;
  fra.me.line = 24;
  fra.me.meth = LOCATE_syntax___extern_type_inheritance___MMLocalClass___extern_c_type;
  fra.me.has_broke = 0;
  fra.me.REG_size = 1;
  fra.me.nitni_local_ref_head = NULL;
  fra.me.REG[0] = NIT_NULL;
  fra.me.REG[0] = p0;
  /* syntax/extern_type_inheritance.nit:26 */
  fra.me.REG[0] = CALL_syntax___extern_inline___MMLocalClass___extern_type(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_syntax___extern_type_inheritance, 26);
  }
  fra.me.REG[0] = CALL_syntax___extern_inline___ExternCode___code(fra.me.REG[0])(fra.me.REG[0]);
  goto label1;
  label1: while(0);
  stack_frame_head = fra.me.prev;
  return fra.me.REG[0];
}
示例#2
0
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;
}
示例#3
0
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;
}
 void OC_syntax___extern_type_inheritance___MMLocalClass___extern_type_10(struct stack_frame_t *closctx, val_t p0, struct stack_frame_t *closctx_param, fun_t clos_fun0){
   struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
   val_t REGB0;
   fun_t CREG[1];
   val_t tmp;
   static val_t once_value_11; /* Once value */
   static val_t once_value_12; /* Once value */
   static val_t once_value_13; /* Once value */
   /* syntax/extern_type_inheritance.nit:73 */
   fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
   fra.me.file = LOCATE_syntax___extern_type_inheritance;
   fra.me.line = 0;
   fra.me.meth = LOCATE_syntax___extern_type_inheritance___MMLocalClass___extern_type;
   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.closure_ctx = closctx_param;
   fra.me.closure_funs = CREG;
   fra.me.REG[0] = p0;
   CREG[0] = clos_fun0;
   fra.me.REG[1] = CALL_standard___file___Object___stderr(closctx->REG[0])(closctx->REG[0]);
   REGB0 = TAG_Int(5);
   fra.me.REG[2] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
   if (!once_value_11) {
     fra.me.REG[3] = BOX_NativeString("");
     REGB0 = TAG_Int(0);
     fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB0);
     once_value_11 = fra.me.REG[3];
     register_static_object(&once_value_11);
   } else fra.me.REG[3] = once_value_11;
   fra.me.REG[3] = fra.me.REG[3];
   CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
   fra.me.REG[3] = CALL_syntax___extern_inline___MMLocalClass___extern_type(fra.me.REG[0])(fra.me.REG[0]);
   REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
   if (UNTAG_Bool(REGB0)) {
     nit_abort("Reciever is null", NULL, LOCATE_syntax___extern_type_inheritance, 73);
   }
   fra.me.REG[3] = CALL_syntax___extern_inline___ExternCode___code(fra.me.REG[3])(fra.me.REG[3]);
   CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
   if (!once_value_12) {
     fra.me.REG[3] = BOX_NativeString(" from ");
     REGB0 = TAG_Int(7);
     fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB0);
     once_value_12 = fra.me.REG[3];
     register_static_object(&once_value_12);
   } else fra.me.REG[3] = once_value_12;
   fra.me.REG[3] = fra.me.REG[3];
   CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
   fra.me.REG[0] = CALL_standard___string___Object___to_s(fra.me.REG[0])(fra.me.REG[0]);
   CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[0]);
   if (!once_value_13) {
     fra.me.REG[0] = BOX_NativeString("\n");
     REGB0 = TAG_Int(1);
     fra.me.REG[0] = NEW_String_standard___string___String___with_native(fra.me.REG[0], REGB0);
     once_value_13 = fra.me.REG[0];
     register_static_object(&once_value_13);
   } else fra.me.REG[0] = once_value_13;
   fra.me.REG[0] = fra.me.REG[0];
   CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[0]);
   fra.me.REG[2] = CALL_standard___string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]);
   CALL_standard___stream___OStream___write(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
   stack_frame_head = fra.me.prev;
   return;
 }