home *** CD-ROM | disk | FTP | other *** search
Wrap
/* -- ANSI C code generated by : -- SmallEiffel The GNU Eiffel Compiler -- Release (- 0.82) -- -- Copyright (C), 1994-98 - LORIA - UHP - CRIN - INRIA - FRANCE -- -- Dominique COLNET and Suzanne COLLIN - colnet@loria.fr -- -- http://www.loria.fr/SmallEiffel -- */ #include "compile_to_jvm.h" void r705copy_from(T705 C,T705 a1,int a2){ int _i=0; _i=a2; while (!((_i)<(0))) { (C)[_i]=((a1)[_i]); _i=(_i)-(1); } } T705 r705realloc(T705 C,int a1,int a2){ T705 R=NULL; R=calloc(a2,sizeof(T0*)); r705copy_from(R,C,(a1)-(1)); return R; } void r513copy_from(T513 C,T513 a1,int a2){ int _i=0; _i=a2; while (!((_i)<(0))) { (C)[_i]=((a1)[_i]); _i=(_i)-(1); } } T513 r513realloc(T513 C,int a1,int a2){ T513 R=NULL; R=calloc(a2,sizeof(T0*)); r513copy_from(R,C,(a1)-(1)); return R; } void r221copy_from(T221 C,T221 a1,int a2){ int _i=0; _i=a2; while (!((_i)<(0))) { (C)[_i]=((a1)[_i]); _i=(_i)-(1); } } T221 r221realloc(T221 C,int a1,int a2){ T221 R=NULL; R=calloc(a2,sizeof(T0*)); r221copy_from(R,C,(a1)-(1)); return R; } void r686clear_all(T686 C,int a1){ int _i=0; int _v=0; _i=a1; while (!((_i)<(0))) { (C)[_i]=(_v); _i=(_i)-(1); } } void r686set_all_with(T686 C,int a1,int a2){ int _i=0; _i=a2; while (!((_i)<(0))) { (C)[_i]=(a1); _i=(_i)-(1); } } int r686fast_index_of(T686 C,int a1,int a2){ int R=0; while (!(((R)>(a2))||((a1)==((C)[R])))) { R=(R)+(1); } return R; } void r686copy_from(T686 C,T686 a1,int a2){ int _i=0; _i=a2; while (!((_i)<(0))) { (C)[_i]=((a1)[_i]); _i=(_i)-(1); } } T686 r686realloc(T686 C,int a1,int a2){ T686 R=NULL; R=calloc(a2,sizeof(int)); r686copy_from(R,C,(a1)-(1)); return R; } void r857set_all_with(T857 C,T0* a1,int a2){ int _i=0; _i=a2; while (!((_i)<(0))) { (C)[_i]=(a1); _i=(_i)-(1); } } void r857copy_from(T857 C,T857 a1,int a2){ int _i=0; _i=a2; while (!((_i)<(0))) { (C)[_i]=((a1)[_i]); _i=(_i)-(1); } } T857 r857realloc(T857 C,int a1,int a2){ T857 R=NULL; R=calloc(a2,sizeof(T0*)); r857copy_from(R,C,(a1)-(1)); return R; } void r44copy_from(T44 C,T44 a1,int a2){ int _i=0; _i=a2; while (!((_i)<(0))) { (C)[_i]=((a1)[_i]); _i=(_i)-(1); } } T44 r44realloc(T44 C,int a1,int a2){ T44 R=NULL; R=calloc(a2,sizeof(T0*)); r44copy_from(R,C,(a1)-(1)); return R; } void r191copy_from(T191 C,T191 a1,int a2){ int _i=0; _i=a2; while (!((_i)<(0))) { (C)[_i]=((a1)[_i]); _i=(_i)-(1); } } T191 r191realloc(T191 C,int a1,int a2){ T191 R=NULL; R=calloc(a2,sizeof(T0*)); r191copy_from(R,C,(a1)-(1)); return R; } void r7add_first(T7* C,char a1){ int _i=0; r7extend(C,'\40'); _i=(((T7*)C))->_count/*4*/; while (!((_i)==(1))) { /*[IRF3.5put*/((((T7*)C))->_storage/*0*/)[(_i)-(1)]=(/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[((_i)-(1))-(1)]/*)*/); /*]*/ _i=(_i)-(1); } /*[IRF3.5put*/((((T7*)C))->_storage/*0*/)[(1)-(1)]=(a1); /*]*/ } void r7extend(T7* C,char a1){ int _new_capacity=0; /*IF*/if (((((T7*)C))->_capacity/*8*/)>((((T7*)C))->_count/*4*/)) { } else if (((((T7*)C))->_capacity/*8*/)==(0)) { C->_capacity=32; C->_storage=calloc((((T7*)C))->_capacity/*8*/,sizeof(char)); } else { _new_capacity=(2)*((((T7*)C))->_capacity/*8*/); C->_storage=r9realloc((((T7*)C))->_storage/*0*/,(((T7*)C))->_capacity/*8*/,_new_capacity); C->_capacity=_new_capacity; } /*FI*/C->_count=((((T7*)C))->_count/*4*/)+(1); /*[IRF3.5put*/((((T7*)C))->_storage/*0*/)[((((T7*)C))->_count/*4*/)-(1)]=(a1); /*]*/ } void r7set_last(T7* C,char a1){ /*IF*/if ((((((T7*)C))->_count/*4*/)==(0))||((/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[((((T7*)C))->_count/*4*/)-(1)]/*)*/)!=(a1))) { r7extend(C,a1); } /*FI*/} /*No:STRING.remove_suffix*/ int r7hash_code(T7* C){ int R=0; R=r9hashcode((((T7*)C))->_storage/*0*/,((((T7*)C))->_count/*4*/)-(1)); return R; } void r7to_lower(T7* C){ int _i=0; _i=(((T7*)C))->_count/*4*/; while (!((_i)==(0))) { /*[IRF3.5put*/((((T7*)C))->_storage/*0*/)[(_i)-(1)]=(r3to_lower(/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[(_i)-(1)]/*)*/)); /*]*/ _i=(_i)-(1); } } /*No:STRING.empty*/ int r7index_of_string(T7* C,T0* a1){ int R=0; int _i3=0; int _i2=0; int _i1=0; int _stop=0; _i1=1; _i2=(((T7*)((T7*)a1)))->_count/*4*/; _i3=_i2; while (!((R)!=(0))) { /*IF*/if ((_i2)>((((T7*)C))->_count/*4*/)) { R=((((T7*)C))->_count/*4*/)+(1); } else { _stop=0; while (!(_stop)) { /*IF*/if ((_i3)==(0)) { _stop=1; R=_i1; } else if ((/*(IRF4.6item*/((((T7*)((T7*)a1)))->_storage/*0*/)[(_i3)-(1)]/*)*/)!=(/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[(_i2)-(1)]/*)*/)) { _stop=1; } /*FI*/_i3=(_i3)-(1); _i2=(_i2)-(1); } } /*FI*/_i1=(_i1)+(1); _i3=(((T7*)((T7*)a1)))->_count/*4*/; _i2=((_i1)+(_i3))-(1); } return R; } int r7_px_60(T7* C,T0* a1){ int R=0; int _i=0; _i=1; while (!(((((((T7*)C))->_count/*4*/)<(_i))||(((((T7*)((T7*)a1)))->_count/*4*/)<(_i)))||((/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[(_i)-(1)]/*)*/)!=(/*(IRF4.6item*/((((T7*)((T7*)a1)))->_storage/*0*/)[(_i)-(1)]/*)*/)))) { _i=(_i)+(1); } /*IF*/if (((((T7*)C))->_count/*4*/)<(_i)) { R=((((T7*)((T7*)a1)))->_count/*4*/)>=(_i); } else if (((((T7*)((T7*)a1)))->_count/*4*/)<(_i)) { R=0; } else { R=(((unsigned)(/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[(_i)-(1)]/*)*/))<((unsigned)(/*(IRF4.6item*/((((T7*)((T7*)a1)))->_storage/*0*/)[(_i)-(1)]/*)*/))); } /*FI*/return R; } void r7make(T7* C,int a1){ /*IF*/if ((a1)>(0)) { /*IF*/if (((((T7*)C))->_capacity/*8*/)<(a1)) { C->_storage=calloc(a1,sizeof(char)); C->_capacity=a1; } /*FI*/} /*FI*/C->_count=0; } void* r7to_external(T7* C){ void* R=0; /*IF*/if (((((T7*)C))->_capacity/*8*/)>((((T7*)C))->_count/*4*/)) { C->_count=((((T7*)C))->_count/*4*/)+(1); /*IF*/if ((/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[((((T7*)C))->_count/*4*/)-(1)]/*)*/)!=('\0')) { /*[IRF3.5put*/((((T7*)C))->_storage/*0*/)[((((T7*)C))->_count/*4*/)-(1)]=('\0'); /*]*/ } /*FI*/} else { r7extend(C,'\0'); } /*FI*/C->_count=((((T7*)C))->_count/*4*/)-(1); R=((void*)(((T7*)C))->_storage/*0*/); return R; } /*No:STRING.item*/ int r7has_string(T7* C,T0* a1){ int R=0; R=(r7index_of_string(C,a1))!=(((((T7*)C))->_count/*4*/)+(1)); return R; } /*No:STRING.clear*/ /*No:STRING.storage*/ T0* r7twin(T7* C){ T0* R=NULL; R=malloc(sizeof(*C)); *((T7*)R)=M7; r7copy(((T7*)R),((T0*)C)); return R; } int r7is_equal(T7* C,T0* a1){ int R=0; /*IF*/if ((C)==((void*)(a1))) { R=1; } else if (((((T7*)C))->_count/*4*/)==((((T7*)((T7*)a1)))->_count/*4*/)) { /*IF*/if (((((T7*)C))->_count/*4*/)>(0)) { R=r9fast_memcmp((((T7*)C))->_storage/*0*/,(((T7*)((T7*)a1)))->_storage/*0*/,(((T7*)C))->_count/*4*/); } else { R=1; } /*FI*/} /*FI*/return R; } void r7swap(T7* C,int a1,int a2){ char _tmp=0; _tmp=/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[(a1)-(1)]/*)*/; /*[IRF3.5put*/((((T7*)C))->_storage/*0*/)[(a1)-(1)]=(/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[(a2)-(1)]/*)*/); /*]*/ /*[IRF3.5put*/((((T7*)C))->_storage/*0*/)[(a2)-(1)]=(_tmp); /*]*/ } char r7last(T7* C){ char R=0; R=/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[((((T7*)C))->_count/*4*/)-(1)]/*)*/; return R; } /*No:STRING.capacity*/ int r7has_suffix(T7* C,T0* a1){ int R=0; int _i2=0; int _i1=0; /*IF*/if (((((T7*)((T7*)a1)))->_count/*4*/)<=((((T7*)C))->_count/*4*/)) { _i1=(((((T7*)C))->_count/*4*/)-((((T7*)((T7*)a1)))->_count/*4*/))+(1); _i2=1; while (!((((_i1)>((((T7*)C))->_count/*4*/))||((_i2)>((((T7*)((T7*)a1)))->_count/*4*/)))||((/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[(_i1)-(1)]/*)*/)!=(/*(IRF4.6item*/((((T7*)((T7*)a1)))->_storage/*0*/)[(_i2)-(1)]/*)*/)))) { _i1=(_i1)+(1); _i2=(_i2)+(1); } R=(_i1)>((((T7*)C))->_count/*4*/); } /*FI*/return R; } int r7has(T7* C,char a1){ int R=0; R=(r7index_of(C,a1))!=(((((T7*)C))->_count/*4*/)+(1)); return R; } void r7copy(T7* C,T0* a1){ C->_count=(((T7*)((T7*)a1)))->_count/*4*/; /*IF*/if (((((T7*)C))->_count/*4*/)>(0)) { /*IF*/if (((((T7*)C))->_capacity/*8*/)<((((T7*)C))->_count/*4*/)) { C->_storage=calloc((((T7*)C))->_count/*4*/,sizeof(char)); C->_capacity=(((T7*)C))->_count/*4*/; } /*FI*/r9copy_from((((T7*)C))->_storage/*0*/,(((T7*)((T7*)a1)))->_storage/*0*/,((((T7*)C))->_count/*4*/)-(1)); } /*FI*/} int r7same_as(T7* C,T0* a1){ int R=0; int _i=0; /*IF*/if ((a1)==((void*)(C))) { R=1; } else { /*IF*/if (((((T7*)((T7*)a1)))->_count/*4*/)!=((((T7*)C))->_count/*4*/)) { } else { _i=(((T7*)C))->_count/*4*/; while (!(((_i)==(0))||(!(r3same_as(/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[(_i)-(1)]/*)*/,/*(IRF4.6item*/((((T7*)((T7*)a1)))->_storage/*0*/)[(_i)-(1)]/*)*/))))) { _i=(_i)-(1); } R=(_i)==(0); } /*FI*/} /*FI*/return R; } /*No:STRING.put*/ void r7prepend(T7* C,T0* a1){ int _old_count=0; int _i=0; _old_count=(((T7*)C))->_count/*4*/; _i=(((T7*)((T7*)a1)))->_count/*4*/; while (!((_i)==(0))) { r7extend(C,'\40'); _i=(_i)-(1); } _i=(((T7*)C))->_count/*4*/; while (!((_old_count)==(0))) { /*[IRF3.5put*/((((T7*)C))->_storage/*0*/)[(_i)-(1)]=(/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[(_old_count)-(1)]/*)*/); /*]*/ _i=(_i)-(1); _old_count=(_old_count)-(1); } _i=(((T7*)((T7*)a1)))->_count/*4*/; while (!((_i)==(0))) { /*[IRF3.5put*/((((T7*)C))->_storage/*0*/)[(_i)-(1)]=(/*(IRF4.6item*/((((T7*)((T7*)a1)))->_storage/*0*/)[(_i)-(1)]/*)*/); /*]*/ _i=(_i)-(1); } } /*No:STRING.count*/ void r7to_upper(T7* C){ int _i=0; _i=(((T7*)C))->_count/*4*/; while (!((_i)==(0))) { /*[IRF3.5put*/((((T7*)C))->_storage/*0*/)[(_i)-(1)]=(r3to_upper(/*(IRF4.6item*/((((T7*)C))->_storage/*0*/)[(_i)-(1)]/*)*/)); /*]*/ _i=(_i)-(1); } } void r7remove_last(T7* C,int a1){ C->_count=((((T7*)C))->_count/*4*/)-(a1); } /*No:STRING.first*/ int r7index_of(T7* C,char a1){ int R=0; R=(1)+(r9fast_index_of((((T7*)C))->_storage/*0*/,a1,((((T7*)C))->_count/*4*/)-(1))); return R; } void r7append(T7* C,T0* a1){ int _i=0; _i=1; while (!((_i)>((((T7*)((T7*)a1)))->_count/*4*/))) { r7extend(C,/*(IRF4.6item*/((((T7*)((T7*)a1)))->_storage/*0*/)[(_i)-(1)]/*)*/); _i=(_i)+(1); } } /*No:ARRAY[INTEGER_CONSTANT].clear_all*/ /*No:ARRAY[INTEGER_CONSTANT].set_all_with*/ void r28make(T28* C,int a1,int a2){ int _needed=0; C->_lower=a1; C->_upper=a2; _needed=((a2)-(a1))+(1); /*IF*/if ((_needed)>(0)) { /*IF*/if (((((T28*)C))->_capacity/*8*/)<(_needed)) { /*IF*/if (((((T28*)C))->_capacity/*8*/)==(0)) { C->_storage=calloc(_needed,sizeof(T0*)); } else { C->_storage=calloc(_needed,sizeof(T0*)); } /*FI*/C->_capacity=_needed; } else { /*[IRF3.6clear_all*/{T28* C1=C; T0* __value=NULL; /*[IRF3.6set_all_with*/{T28* C2=C1; T0* c1=__value; r392set_all_with((((T28*)C2))->_storage/*4*/,c1,((((T28*)C2))->_upper/*12*/)-((((T28*)C2))->_lower/*16*/)); }/*]*/ }/*]*/ } /*FI*/} /*FI*/} T0* r28item(T28* C,int a1){ T0* R=NULL; R=((((T28*)C))->_storage/*4*/)[(a1)-((((T28*)C))->_lower/*16*/)]; return R; } /*No:ARRAY[INTEGER_CONSTANT].storage*/ T0* r28twin(T28* C){ T0* R=NULL; R=malloc(sizeof(*C)); *((T28*)R)=M28; r28copy(((T28*)R),((T0*)C)); return R; } /*No:ARRAY[INTEGER_CONSTANT].capacity*/ void r28copy(T28* C,T0* a1){ int _needed_capacity=0; C->_lower=(((T28*)((T28*)a1)))->_lower/*16*/; C->_upper=(((T28*)((T28*)a1)))->_upper/*12*/; _needed_capacity=(((((T28*)C))->_upper/*12*/)-((((T28*)C))->_lower/*16*/))+(1); /*IF*/if (((((T28*)C))->_capacity/*8*/)<(_needed_capacity)) { C->_capacity=_needed_capacity; C->_storage=calloc((((T28*)C))->_capacity/*8*/,sizeof(T0*)); } /*FI*//*IF*/if ((_needed_capacity)>(0)) { r392copy_from((((T28*)C))->_storage/*4*/,(((T28*)((T28*)a1)))->_storage/*4*/,(_needed_capacity)-(1)); } /*FI*/} /*No:ARRAY[INTEGER_CONSTANT].lower*/ /*No:ARRAY[INTEGER_CONSTANT].put*/ /*No:ARRAY[INTEGER_CONSTANT].upper*/ void r28add_last(T28* C,T0* a1){ int _new_capacity=0; /*IF*/if (((((T28*)C))->_capacity/*8*/)<((r28count(C))+(1))) { /*IF*/if (((((T28*)C))->_capacity/*8*/)==(0)) { C->_capacity=16; C->_storage=calloc((((T28*)C))->_capacity/*8*/,sizeof(T0*)); } else { _new_capacity=(2)*((((T28*)C))->_capacity/*8*/); C->_storage=r392realloc((((T28*)C))->_storage/*4*/,(((T28*)C))->_capacity/*8*/,_new_capacity); C->_capacity=_new_capacity; } /*FI*/} /*FI*/C->_upper=((((T28*)C))->_upper/*12*/)+(1); /*[IRF3.6put*/{T28* C1=C; T0* b1=a1; int b2=(((T28*)C))->_upper/*12*/; ((((T28*)C1))->_storage/*4*/)[(b2)-((((T28*)C1))->_lower/*16*/)]=(b1); }/*]*/ } int r28count(T28* C){ int R=0; R=(((((T28*)C))->_upper/*12*/)-((((T28*)C))->_lower/*16*/))+(1); return R; } T0* r28first(T28* C){ T0* R=NULL; R=r28item(C,(((T28*)C))->_lower/*16*/); return R; } T0* r235item(T235* C,int a1){ T0* R=NULL; R=((((T235*)C))->_storage/*0*/)[(a1)-((((T235*)C))->_lower/*12*/)]; return R; } /*No:ARRAY[CREATION_CLAUSE].storage*/ /*No:ARRAY[CREATION_CLAUSE].capacity*/ /*No:ARRAY[CREATION_CLAUSE].lower*/ /*No:ARRAY[CREATION_CLAUSE].put*/ /*No:ARRAY[CREATION_CLAUSE].upper*/ int r235count(T235* C){ int R=0; R=(((((T235*)C))->_upper/*8*/)-((((T235*)C))->_lower/*12*/))+(1); return R; } void r235add_last(T235* C,T0* a1){ int _new_capacity=0; /*IF*/if (((((T235*)C))->_capacity/*4*/)<((r235count(C))+(1))) { /*IF*/if (((((T235*)C))->_capacity/*4*/)==(0)) { C->_capacity=16; C->_storage=calloc((((T235*)C))->_capacity/*4*/,sizeof(T0*)); } else { _new_capacity=(2)*((((T235*)C))->_capacity/*4*/); C->_storage=r513realloc((((T235*)C))->_storage/*0*/,(((T235*)C))->_capacity/*4*/,_new_capacity); C->_capacity=_new_capacity; } /*FI*/} /*FI*/C->_upper=((((T235*)C))->_upper/*8*/)+(1); /*[IRF3.6put*/{T235* C1=C; T0* b1=a1; int b2=(((T235*)C))->_upper/*8*/; ((((T235*)C1))->_storage/*0*/)[(b2)-((((T235*)C1))->_lower/*12*/)]=(b1); }/*]*/ } T0* r235first(T235* C){ T0* R=NULL; R=r235item(C,(((T235*)C))->_lower/*12*/); return R; }