Example #1
0
/* The c++ function for: printif(self:any) [NEW_ALLOC+BAG_UPDATE+SLOT_UPDATE] */
void  printif_any(OID self)
{ (Core.pretty->index = (Core.pretty->index+3));
  if (Core.pretty->pbreak == CTRUE)
   { int  b_index = buffer_length_void();
    int  _Zl = Core.pretty->index;
    (Core.pretty->pbreak = CFALSE);
    { ClaireHandler c_handle = ClaireHandler();
      if ERROR_IN 
      { print_any(self);
        ClEnv->cHandle--;} 
      else if (belong_to(_oid_(ClEnv->exception_I),_oid_(Core._much_too_far)) == CTRUE)
      { c_handle.catchIt();;} 
      else PREVIOUS_HANDLER;} 
Example #2
0
int main()
{
  setup_classes();

  // c = C()
  pyobj c = create_object(C);

  // d = D()
  pyobj d = create_object(D);

  // TODO: call the __init__ method if it exists

#ifdef TAGGING
  pyobj one = inject_int(1);
  pyobj three = inject_int(3);
#else
  pyobj one = create_int(1);
  pyobj three = create_int(3);
#endif

  // c.f = 1
  set_attr(c, "f", one);

  // d.f = 1
  set_attr(d, "f", one);

  pyobj i, j, k, h;

  // i = c.m()
  {
    pyobj meth = get_attr(c, "m");
    pyobj fun = get_function(meth);
    void *fp = get_fun_ptr(fun);
    pyobj (*f)(pyobj) = (pyobj (*)(pyobj)) fp; // cast to a function pointer type
    i = f(get_receiver(meth));
  }

  // j = d.m()
  {
    pyobj meth = get_attr(d, "m");
    pyobj fun = get_function(meth);
    void *fp = get_fun_ptr(fun);
    pyobj (*f)(pyobj) = (pyobj (*)(pyobj)) fp; // cast to a function pointer type
    j = f(get_receiver(meth));
  }

  // d.n(3)
  {
    pyobj (*f)(pyobj, pyobj) = (pyobj (*)(pyobj, pyobj)) get_fun_ptr_from_attr(d, "n");
    f(d, three);
  }

  // k = d.m()
  {
    pyobj meth = get_attr(d, "m");
    pyobj fun = get_function(meth);
    void *fp = get_fun_ptr(fun);
    pyobj (*f)(pyobj) = (pyobj (*)(pyobj)) fp; // cast to a function pointer type
    k = f(get_receiver(meth));
  }

  // h = i + j + k
  {
#ifdef TAGGING
    // optimized, but assumes i and j are integers
    // h = i + j + k

    // unoptimized, but checks that i and j are integers
    h = inject_int(project_int(i) + project_int(j) + project_int(k));
#else
    h = create_int(project_int(i) + project_int(j) + project_int(k));
#endif
  }

  // print i, j, k
  print_any(i);
  print_any(j);
  print_any(k);
  print_any(h);
  return 0;
}
Example #3
0
File: main.cpp Project: CCJY/coliru
 const basic_vstream& operator() ( const ARGS&... args ) const
 {
     print_any(args...) ;
     return *this ;
 }
Example #4
0
File: main.cpp Project: CCJY/coliru
 static STREAM_TYPE& print_any( const FIRST& first, const REST&... rest )
 {
     constexpr std::size_t n = sizeof...(rest) + 1 ;
     if( std::rand() % n == 0 ) return stm << first ;
     else return print_any(rest...) ;
 }
Example #5
0
int
main(void)
{
    int i;
    int n;
    int t;
    int pygen_0_tagF_temp;
    int pygen_1_tagF_temp;
    int pygen_0_compF_temp;
    int pygen_2_tagF_temp;
    int pygen_1_compF_temp;
    int pygen_0_projF_temp;
    int pygen_1_projF_temp;
    int pygen_2_compF_temp;
    int pygen_0_injF_temp;
    int pygen_1_ifexF_temp;
    int pygen_3_tagF_temp;
    int pygen_3_compF_temp;
    int pygen_2_projF_temp;
    int pygen_3_projF_temp;
    int pygen_4_compF_temp;
    int pygen_1_injF_temp;
    int pygen_0_ifexF_temp;
    int pygen_4_projF_temp;
    int pygen_5_projF_temp;
    int pygen_0_callF_temp;
    int pygen_2_injF_temp;
    int pygen_3_ifexF_temp;
    int pygen_4_tagF_temp;
    int pygen_5_compF_temp;
    int pygen_6_projF_temp;
    int pygen_7_projF_temp;
    int pygen_6_compF_temp;
    int pygen_3_injF_temp;
    int pygen_2_ifexF_temp;
    int pygen_8_projF_temp;
    int pygen_9_projF_temp;
    int pygen_7_compF_temp;
    int pygen_4_injF_temp;
    int pygen_2_let_temp;
    int pygen_5_tagF_temp;
    int pygen_8_compF_temp;
    int pygen_10_projF_temp;
    int pygen_9_compF_temp;
    int pygen_5_ifexF_temp;
    int pygen_6_tagF_temp;
    int pygen_10_compF_temp;
    int pygen_11_projF_temp;
    int pygen_11_compF_temp;
    int pygen_4_ifexF_temp;
    int pygen_1_callF_temp;
    int pygen_7_tagF_temp;
    int pygen_12_compF_temp;
    int pygen_12_projF_temp;
    int pygen_13_projF_temp;
    int pygen_0_addF_temp;
    int pygen_5_injF_temp;
    int pygen_7_ifexF_temp;
    int pygen_8_tagF_temp;
    int pygen_13_compF_temp;
    int pygen_14_projF_temp;
    int pygen_15_projF_temp;
    int pygen_1_addF_temp;
    int pygen_6_injF_temp;
    int pygen_6_ifexF_temp;
    int pygen_16_projF_temp;
    int pygen_17_projF_temp;
    int pygen_2_callF_temp;
    int pygen_7_injF_temp;
    int pygen_18_projF_temp;
    int pygen_0_usubF_temp;
    int pygen_8_injF_temp;
    int pygen_0_let_temp;
    int pygen_9_tagF_temp;
    int pygen_14_compF_temp;
    int pygen_19_projF_temp;
    int pygen_20_projF_temp;
    int pygen_2_addF_temp;
    int pygen_9_injF_temp;
    int pygen_9_ifexF_temp;
    int pygen_10_tagF_temp;
    int pygen_15_compF_temp;
    int pygen_21_projF_temp;
    int pygen_22_projF_temp;
    int pygen_3_addF_temp;
    int pygen_10_injF_temp;
    int pygen_8_ifexF_temp;
    int pygen_23_projF_temp;
    int pygen_24_projF_temp;
    int pygen_3_callF_temp;
    int pygen_11_injF_temp;
    int pygen_12_injF_temp;
    int pygen_1_let_temp;
    int pygen_11_tagF_temp;
    int pygen_16_compF_temp;
    int pygen_25_projF_temp;
    int pygen_26_projF_temp;
    int pygen_4_addF_temp;
    int pygen_13_injF_temp;
    int pygen_11_ifexF_temp;
    int pygen_12_tagF_temp;
    int pygen_17_compF_temp;
    int pygen_27_projF_temp;
    int pygen_28_projF_temp;
    int pygen_5_addF_temp;
    int pygen_14_injF_temp;
    int pygen_10_ifexF_temp;
    int pygen_29_projF_temp;
    int pygen_30_projF_temp;
    int pygen_4_callF_temp;
    int pygen_15_injF_temp;
    i = inject_int(0);
    n = input_int();
    t = inject_int(0);
    pygen_0_tagF_temp = tag(i);
    pygen_1_tagF_temp = tag(n);
    pygen_0_compF_temp = (pygen_0_tagF_temp == pygen_1_tagF_temp);
    if (pygen_0_compF_temp) {
        pygen_2_tagF_temp = tag(i);
        pygen_1_compF_temp = (pygen_2_tagF_temp == 0);
        if (pygen_1_compF_temp) {
            pygen_0_projF_temp = project_int(i);
            pygen_1_projF_temp = project_int(n);
            pygen_2_compF_temp = (pygen_0_projF_temp != pygen_1_projF_temp);
            pygen_0_injF_temp = inject_bool(pygen_2_compF_temp);
            pygen_1_ifexF_temp = pygen_0_injF_temp;
        } else {
            pygen_3_tagF_temp = tag(i);
            pygen_3_compF_temp = (pygen_3_tagF_temp == 1);
            if (pygen_3_compF_temp) {
                pygen_2_projF_temp = project_bool(i);
                pygen_3_projF_temp = project_bool(n);
                pygen_4_compF_temp = (pygen_2_projF_temp != pygen_3_projF_temp);
                pygen_1_injF_temp = inject_bool(pygen_4_compF_temp);
                pygen_0_ifexF_temp = pygen_1_injF_temp;
            } else {
                pygen_4_projF_temp = project_big(i);
                pygen_5_projF_temp = project_big(n);
                pygen_0_callF_temp = not_equal(pygen_4_projF_temp, pygen_5_projF_temp);
                pygen_2_injF_temp = inject_bool(pygen_0_callF_temp);
                pygen_0_ifexF_temp = pygen_2_injF_temp;
            }
            pygen_1_ifexF_temp = pygen_0_ifexF_temp;
        }
        pygen_3_ifexF_temp = pygen_1_ifexF_temp;
    } else {
        pygen_4_tagF_temp = tag(i);
        pygen_5_compF_temp = (pygen_4_tagF_temp == 0);
        if (pygen_5_compF_temp) {
            pygen_6_projF_temp = project_int(i);
            pygen_7_projF_temp = project_bool(n);
            pygen_6_compF_temp = (pygen_6_projF_temp != pygen_7_projF_temp);
            pygen_3_injF_temp = inject_bool(pygen_6_compF_temp);
            pygen_2_ifexF_temp = pygen_3_injF_temp;
        } else {
            pygen_8_projF_temp = project_bool(i);
            pygen_9_projF_temp = project_int(n);
            pygen_7_compF_temp = (pygen_8_projF_temp != pygen_9_projF_temp);
            pygen_4_injF_temp = inject_bool(pygen_7_compF_temp);
            pygen_2_ifexF_temp = pygen_4_injF_temp;
        }
        pygen_3_ifexF_temp = pygen_2_ifexF_temp;
    }
    pygen_2_let_temp = pygen_3_ifexF_temp;
    pygen_5_tagF_temp = tag(pygen_2_let_temp);
    pygen_8_compF_temp = (pygen_5_tagF_temp == 0);
    if (pygen_8_compF_temp) {
        pygen_10_projF_temp = project_int(pygen_2_let_temp);
        pygen_9_compF_temp = (0 != pygen_10_projF_temp);
        pygen_5_ifexF_temp = pygen_9_compF_temp;
    } else {
        pygen_6_tagF_temp = tag(pygen_2_let_temp);
        pygen_10_compF_temp = (pygen_6_tagF_temp == 1);
        if (pygen_10_compF_temp) {
            pygen_11_projF_temp = project_bool(pygen_2_let_temp);
            pygen_11_compF_temp = (0 != pygen_11_projF_temp);
            pygen_4_ifexF_temp = pygen_11_compF_temp;
        } else {
            pygen_1_callF_temp = is_true(pygen_2_let_temp);
            pygen_4_ifexF_temp = pygen_1_callF_temp;
        }
        pygen_5_ifexF_temp = pygen_4_ifexF_temp;
    }
    while (pygen_5_ifexF_temp) {
        pygen_7_tagF_temp = tag(t);
        pygen_12_compF_temp = (pygen_7_tagF_temp == 0);
        if (pygen_12_compF_temp) {
            pygen_12_projF_temp = project_int(t);
            pygen_13_projF_temp = project_int(i);
            pygen_0_addF_temp = (pygen_12_projF_temp + pygen_13_projF_temp);
            pygen_5_injF_temp = inject_int(pygen_0_addF_temp);
            pygen_7_ifexF_temp = pygen_5_injF_temp;
        } else {
            pygen_8_tagF_temp = tag(t);
            pygen_13_compF_temp = (pygen_8_tagF_temp == 1);
            if (pygen_13_compF_temp) {
                pygen_14_projF_temp = project_bool(t);
                pygen_15_projF_temp = project_bool(i);
                pygen_1_addF_temp = (pygen_14_projF_temp + pygen_15_projF_temp);
                pygen_6_injF_temp = inject_int(pygen_1_addF_temp);
                pygen_6_ifexF_temp = pygen_6_injF_temp;
            } else {
                pygen_16_projF_temp = project_big(t);
                pygen_17_projF_temp = project_big(i);
                pygen_2_callF_temp = add(pygen_16_projF_temp, pygen_17_projF_temp);
                pygen_7_injF_temp = inject_big(pygen_2_callF_temp);
                pygen_6_ifexF_temp = pygen_7_injF_temp;
            }
            pygen_7_ifexF_temp = pygen_6_ifexF_temp;
        }
        t = pygen_7_ifexF_temp;
        pygen_18_projF_temp = project_int(i);
        pygen_0_usubF_temp = -(pygen_18_projF_temp);
        pygen_8_injF_temp = inject_int(pygen_0_usubF_temp);
        pygen_0_let_temp = pygen_8_injF_temp;
        pygen_9_tagF_temp = tag(pygen_0_let_temp);
        pygen_14_compF_temp = (pygen_9_tagF_temp == 0);
        if (pygen_14_compF_temp) {
            pygen_19_projF_temp = project_int(pygen_0_let_temp);
            pygen_20_projF_temp = project_int(t);
            pygen_2_addF_temp = (pygen_19_projF_temp + pygen_20_projF_temp);
            pygen_9_injF_temp = inject_int(pygen_2_addF_temp);
            pygen_9_ifexF_temp = pygen_9_injF_temp;
        } else {
            pygen_10_tagF_temp = tag(pygen_0_let_temp);
            pygen_15_compF_temp = (pygen_10_tagF_temp == 1);
            if (pygen_15_compF_temp) {
                pygen_21_projF_temp = project_bool(pygen_0_let_temp);
                pygen_22_projF_temp = project_bool(t);
                pygen_3_addF_temp = (pygen_21_projF_temp + pygen_22_projF_temp);
                pygen_10_injF_temp = inject_int(pygen_3_addF_temp);
                pygen_8_ifexF_temp = pygen_10_injF_temp;
            } else {
                pygen_23_projF_temp = project_big(pygen_0_let_temp);
                pygen_24_projF_temp = project_big(t);
                pygen_3_callF_temp = add(pygen_23_projF_temp, pygen_24_projF_temp);
                pygen_11_injF_temp = inject_big(pygen_3_callF_temp);
                pygen_8_ifexF_temp = pygen_11_injF_temp;
            }
            pygen_9_ifexF_temp = pygen_8_ifexF_temp;
        }
        t = pygen_9_ifexF_temp;
        pygen_12_injF_temp = inject_int(1);
        pygen_1_let_temp = pygen_12_injF_temp;
        pygen_11_tagF_temp = tag(i);
        pygen_16_compF_temp = (pygen_11_tagF_temp == 0);
        if (pygen_16_compF_temp) {
            pygen_25_projF_temp = project_int(i);
            pygen_26_projF_temp = project_int(pygen_1_let_temp);
            pygen_4_addF_temp = (pygen_25_projF_temp + pygen_26_projF_temp);
            pygen_13_injF_temp = inject_int(pygen_4_addF_temp);
            pygen_11_ifexF_temp = pygen_13_injF_temp;
        } else {
            pygen_12_tagF_temp = tag(i);
            pygen_17_compF_temp = (pygen_12_tagF_temp == 1);
            if (pygen_17_compF_temp) {
                pygen_27_projF_temp = project_bool(i);
                pygen_28_projF_temp = project_bool(pygen_1_let_temp);
                pygen_5_addF_temp = (pygen_27_projF_temp + pygen_28_projF_temp);
                pygen_14_injF_temp = inject_int(pygen_5_addF_temp);
                pygen_10_ifexF_temp = pygen_14_injF_temp;
            } else {
                pygen_29_projF_temp = project_big(i);
                pygen_30_projF_temp = project_big(pygen_1_let_temp);
                pygen_4_callF_temp = add(pygen_29_projF_temp, pygen_30_projF_temp);
                pygen_15_injF_temp = inject_big(pygen_4_callF_temp);
                pygen_10_ifexF_temp = pygen_15_injF_temp;
            }
            pygen_11_ifexF_temp = pygen_10_ifexF_temp;
        }
        i = pygen_11_ifexF_temp;
        pygen_0_tagF_temp = tag(i);
        pygen_1_tagF_temp = tag(n);
        pygen_0_compF_temp = (pygen_0_tagF_temp == pygen_1_tagF_temp);
        if (pygen_0_compF_temp) {
            pygen_2_tagF_temp = tag(i);
            pygen_1_compF_temp = (pygen_2_tagF_temp == 0);
            if (pygen_1_compF_temp) {
                pygen_0_projF_temp = project_int(i);
                pygen_1_projF_temp = project_int(n);
                pygen_2_compF_temp = (pygen_0_projF_temp != pygen_1_projF_temp);
                pygen_0_injF_temp = inject_bool(pygen_2_compF_temp);
                pygen_1_ifexF_temp = pygen_0_injF_temp;
            } else {
                pygen_3_tagF_temp = tag(i);
                pygen_3_compF_temp = (pygen_3_tagF_temp == 1);
                if (pygen_3_compF_temp) {
                    pygen_2_projF_temp = project_bool(i);
                    pygen_3_projF_temp = project_bool(n);
                    pygen_4_compF_temp = (pygen_2_projF_temp != pygen_3_projF_temp);
                    pygen_1_injF_temp = inject_bool(pygen_4_compF_temp);
                    pygen_0_ifexF_temp = pygen_1_injF_temp;
                } else {
                    pygen_4_projF_temp = project_big(i);
                    pygen_5_projF_temp = project_big(n);
                    pygen_0_callF_temp = not_equal(pygen_4_projF_temp, pygen_5_projF_temp);
                    pygen_2_injF_temp = inject_bool(pygen_0_callF_temp);
                    pygen_0_ifexF_temp = pygen_2_injF_temp;
                }
                pygen_1_ifexF_temp = pygen_0_ifexF_temp;
            }
            pygen_3_ifexF_temp = pygen_1_ifexF_temp;
        } else {
            pygen_4_tagF_temp = tag(i);
            pygen_5_compF_temp = (pygen_4_tagF_temp == 0);
            if (pygen_5_compF_temp) {
                pygen_6_projF_temp = project_int(i);
                pygen_7_projF_temp = project_bool(n);
                pygen_6_compF_temp = (pygen_6_projF_temp != pygen_7_projF_temp);
                pygen_3_injF_temp = inject_bool(pygen_6_compF_temp);
                pygen_2_ifexF_temp = pygen_3_injF_temp;
            } else {
                pygen_8_projF_temp = project_bool(i);
                pygen_9_projF_temp = project_int(n);
                pygen_7_compF_temp = (pygen_8_projF_temp != pygen_9_projF_temp);
                pygen_4_injF_temp = inject_bool(pygen_7_compF_temp);
                pygen_2_ifexF_temp = pygen_4_injF_temp;
            }
            pygen_3_ifexF_temp = pygen_2_ifexF_temp;
        }
        pygen_2_let_temp = pygen_3_ifexF_temp;
        pygen_5_tagF_temp = tag(pygen_2_let_temp);
        pygen_8_compF_temp = (pygen_5_tagF_temp == 0);
        if (pygen_8_compF_temp) {
            pygen_10_projF_temp = project_int(pygen_2_let_temp);
            pygen_9_compF_temp = (0 != pygen_10_projF_temp);
            pygen_5_ifexF_temp = pygen_9_compF_temp;
        } else {
            pygen_6_tagF_temp = tag(pygen_2_let_temp);
            pygen_10_compF_temp = (pygen_6_tagF_temp == 1);
            if (pygen_10_compF_temp) {
                pygen_11_projF_temp = project_bool(pygen_2_let_temp);
                pygen_11_compF_temp = (0 != pygen_11_projF_temp);
                pygen_4_ifexF_temp = pygen_11_compF_temp;
            } else {
                pygen_1_callF_temp = is_true(pygen_2_let_temp);
                pygen_4_ifexF_temp = pygen_1_callF_temp;
            }
            pygen_5_ifexF_temp = pygen_4_ifexF_temp;
        }
    }
    print_any(t);
}
Example #6
0
/* The c++ function for: main(lp:list[string]) [NEW_ALLOC+BAG_UPDATE+SLOT_UPDATE+STRING_UPDATE] */
void  main_list(list *lp)
{ GC_BIND;
  { ClaireBoolean * rCode = CTRUE;
    char * _Zcm = copy_string("");
    char * _Zcf = copy_string("");
    int  dblevel = 1;
    char * _Zout = copy_string("");
    char * _Zcj = copy_string("");
    int  slevel = 0;
    int  clevel = 1;
    ClaireBoolean * _Zinit_ask = CTRUE;
    int  vlevel = 2;
    list * l = ((list *) copy_bag(lp));
    { ClaireHandler c_handle = ClaireHandler();
      if ERROR_IN 
      { { (Reader._starfs_star->value= _string_(copy_string("\\")));
          (OBJECT(Generate_producer,Generate.PRODUCER->value)->extension = copy_string(".cpp"));
          update_property(Optimize.libraries_dir,
            Optimize.compiler,
            17,
            Kernel._object,
            _oid_(list::alloc(Kernel._any,3,_string_(copy_string("c:\\claire\\v3.3\\bin\\public\\ntv")),
              _string_(copy_string("c:\\claire\\v3.3\\bin\\debug\\ntv")),
              _string_(copy_string("c:\\claire\\v3.3\\bin\\public\\ntv")))));
          (Optimize.compiler->headers_dir = copy_string("c:\\claire\\v3.3\\bin\\include"));
          update_property(Optimize.options,
            Optimize.compiler,
            19,
            Kernel._object,
            _oid_(list::alloc(Kernel._any,3,_string_(copy_string("-c /O2 /Oi")),
              _string_(copy_string("-c /Zi")),
              _string_(copy_string("-c /Zi")))));
          (Optimize.compiler->env = copy_string("ntv"));
          (Optimize.claire_lib->value= _string_(copy_string("")));
          { while ((l->length != 0))
            { if ((equal((*(l))[1],_string_(copy_string("?"))) == CTRUE) || 
                  (equal((*(l))[1],_string_(copy_string("-help"))) == CTRUE))
               printHelp_void();
              else if (equal((*(l))[1],_string_(copy_string("-s"))) == CTRUE)
               { if (3 <= l->length)
                 l= skip_list(l,3);
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -s <s1> <s2>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-f"))) == CTRUE)
               { if (2 <= l->length)
                 { load_string(string_v((*(l))[2]));
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -f <filename>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-env"))) == CTRUE)
               { if (2 <= l->length)
                 { (Optimize.compiler->env = string_v((*(l))[2]));
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -env <OS name>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-m"))) == CTRUE)
               { if (2 <= l->length)
                 { if (_Zinit_ask == CTRUE)
                   { load_string(copy_string("init"));
                    _Zinit_ask= CFALSE;
                    } 
                  { module * m = string2module_string(string_v((*(l))[2]));
                    load_module(m);
                    begin_module(m);
                    l= skip_list(l,2);
                    (Optimize.claire_modules->value= _oid_(OBJECT(list,Optimize.claire_modules->value)->addFast(_oid_(m))));
                    } 
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -m <module>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-v"))) == CTRUE)
               { if (2 <= l->length)
                 { vlevel= (vlevel+integer_I_string(string_v((*(l))[2])));
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -v <integer>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-ld"))) == CTRUE)
               { if (2 <= l->length)
                 { (Optimize.claire_lib->value= (*(l))[2]);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -od <directory>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-od"))) == CTRUE)
               { if (2 <= l->length)
                 { (Optimize.compiler->source = string_v((*(l))[2]));
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -od <directory>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-os"))) == CTRUE)
               { if (2 <= l->length)
                 { slevel= integer_I_string(string_v((*(l))[2]));
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -ol <int>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-S"))) == CTRUE)
               { if (2 <= l->length)
                 { (CLREAD(global_variable,new_class2(Core._global_variable,symbol_I_string2(string_v((*(l))[2]))),value) = Kernel.ctrue);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -S <FLAG>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-o"))) == CTRUE)
               { if (2 <= l->length)
                 { _Zout= string_v((*(l))[2]);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -o <name>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-p"))) == CTRUE)
               { (Optimize.OPT->profile_ask = CTRUE);
                dblevel= ((dblevel <= 1) ?
                  1 :
                  dblevel );
                l= skip_list(l,1);
                } 
              else if (equal((*(l))[1],_string_(copy_string("-D"))) == CTRUE)
               { dblevel= 0;
                l= skip_list(l,1);
                } 
              else if (equal((*(l))[1],_string_(copy_string("-safe"))) == CTRUE)
               { (Optimize.compiler->safety = ((dblevel == 0) ?
                  0 :
                  1 ));
                (Optimize.claire_lib->value= (*(Optimize.compiler->libraries_dir))[2]);
                (Optimize.claire_options->value= (*(Optimize.compiler->options))[2]);
                l= skip_list(l,1);
                } 
              else if (equal((*(l))[1],_string_(copy_string("-O"))) == CTRUE)
               { (Optimize.compiler->optimize_ask = CTRUE);
                dblevel= 2;
                l= skip_list(l,1);
                } 
              else if (equal((*(l))[1],_string_(copy_string("-l"))) == CTRUE)
               { if (2 <= l->length)
                 { Optimize.compiler->libraries->addFast((*(l))[2]);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -l <library>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-cl"))) == CTRUE)
               { if (2 <= l->length)
                 { _Zcm= string_v((*(l))[2]);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -cm <module>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-cc"))) == CTRUE)
               { if (2 <= l->length)
                 { clevel= 0;
                  _Zcm= string_v((*(l))[2]);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -cc <module>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-cm"))) == CTRUE)
               { if (2 <= l->length)
                 { clevel= 2;
                  _Zcm= string_v((*(l))[2]);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -cl <module>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-cj"))) == CTRUE)
               { if (2 <= l->length)
                 { _Zcj= string_v((*(l))[2]);
                  l= skip_list(l,2);
                  } 
                } 
              else if (equal((*(l))[1],_string_(copy_string("-cjx"))) == CTRUE)
               { if (2 <= l->length)
                 { _Zcj= string_v((*(l))[2]);
                  clevel= 0;
                  l= skip_list(l,2);
                  } 
                } 
              else if (equal((*(l))[1],_string_(copy_string("-cx"))) == CTRUE)
               { if (2 <= l->length)
                 { _Zcf= string_v((*(l))[2]);
                  l= skip_list(l,2);
                  clevel= 2;
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -cx <filename>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-n"))) == CTRUE)
               { _Zinit_ask= CFALSE;
                l= skip_list(l,1);
                } 
              else { if (string_v((*(l))[1])[1 - 1] == '-')
                   { print_any((*(l))[1]);
                    princ_string(copy_string(" is an unvalid option\n"));
                    printHelp_void();
                    } 
                  rCode= CFALSE;
                  l= list::empty(Kernel._string);
                  } 
                } 
            } 
          if (equal_string(_Zout,copy_string("")) == CTRUE)
           { if (equal_string(_Zcm,copy_string("")) != CTRUE)
             _Zout= _Zcm;
            else if (equal_string(_Zcf,copy_string("")) != CTRUE)
             _Zout= _Zcf;
            } 
          if (_Zinit_ask == CTRUE)
           load_string(copy_string("init"));
          (Optimize.claire_options->value= (*(Optimize.compiler->options))[((dblevel == 0) ?
            2 :
            ((dblevel == 2) ?
              1 :
              3 ) )]);
          if (equal(Optimize.claire_lib->value,_string_(copy_string(""))) == CTRUE)
           (Optimize.claire_lib->value= (*(Optimize.compiler->libraries_dir))[((dblevel == 0) ?
            2 :
            ((dblevel == 2) ?
              1 :
              3 ) )]);
          (ClEnv->verbose = vlevel);
          if (slevel > 0)
           (Optimize.compiler->safety = slevel);
          if (equal_string(_Zcm,copy_string("")) != CTRUE)
           { module * m = string2module_string(_Zcm);
            (Optimize.compiler->active_ask = CTRUE);
            if (equal(_oid_(m->uses),_oid_(list::alloc(1,GC_OID((*(OBJECT(bag,Optimize.claire_modules->value)))[2])))) == CTRUE)
             { (Optimize.claire_modules->value= _oid_(shrink_list(OBJECT(bag,Optimize.claire_modules->value),2)));
              tformat_string(copy_string("=== Light Module ~S:~S -> use ~S=== "),0,list::alloc(3,_oid_(m),
                GC_OID(_oid_(m->uses)),
                GC_OID(Optimize.claire_modules->value)));
              } 
            (Optimize.claire_modules->value= _oid_(OBJECT(list,Optimize.claire_modules->value)->addFast(_oid_(m))));
            (*Reader.load)(value_string(copy_string("Compile")));
            if (equal_string(_Zout,copy_string("")) != CTRUE)
             (m->external = _Zout);
            load_module(m);
            if (dblevel < 1)
             { (Optimize.compiler->safety = ((Optimize.compiler->safety <= 4) ?
                Optimize.compiler->safety :
                4 ));
              Optimize.compiler->debug_ask->addFast(_oid_(m));
              } 
            compile_module(m);
            if (clevel == 1)
             { if (equal_string(_Zout,copy_string("")) != CTRUE)
               (m->external = _Zout);
              cmakefile_any(_oid_(m),copy_string(""));
              } 
            else if (clevel == 2)
             cmakefile_any(_oid_(m),_Zout);
            CL_exit(0);
            } 
          else if (equal_string(_Zcj,copy_string("")) != CTRUE)
           (*Core.call)(value_string(copy_string("jcmakefile")),
            _oid_(string2module_string(_Zcj)),
            _string_(_Zout),
            _oid_(equal(clevel,0)));
          else if (equal_string(_Zcf,copy_string("")) != CTRUE)
           { (Optimize.compiler->active_ask = CTRUE);
            (*Reader.load)(value_string(copy_string("Compile")));
            load_string(_Zcf);
            function_compile_string(_Zcf,_Zcf);
            cmakefile_any(_string_(_Zcf),_Zout);
            CL_exit(0);
            } 
          } 
        ClEnv->cHandle--;} 
      else if (belong_to(_oid_(ClEnv->exception_I),_oid_(Kernel._any)) == CTRUE)
      { c_handle.catchIt();{ restore_state_meta_reader(Reader.reader);
          debug_if_possible_void();
          } 
        } 
      else PREVIOUS_HANDLER;} 
    } 
Example #7
0
int main()
{
  pyobj x = input_int();
  print_any(x);
}