This is compile_to_c35.c in view mode; [Download] [Up]
/* ANSI C code generated by SmallEiffel. */ /* -- SmallEiffel -- Release (- 0.91) -- FRANCE -- Copyright (C), 1994 - Dominique COLNET and Suzanne COLLIN -- University Henri Poincare' - Nancy 1 - email colnet@loria.fr -- CRIN (Centre de Recherche en Informatique de Nancy) -- FRANCE */ #include "compile_to_c.h" /*ASSERTION*/T0* rT68to_runnable(T68 *C,T0* a1){ T0* R=NULL; T0* _e=NULL; /*IF*/if (!((C)->_current_type)) { C->_current_type=a1; R=(T0 *)C; /*IF*/if (((int)(C)->_expression)) { _e=XrT72to_runnable((C)->_expression,a1); /*IF*/if (!(_e)) { rT68error(rT68start_position(C),(T0 *)ms97_27); } else { C->_expression=_e; /*IF*/if (!(XrT62is_boolean(XrT72result_type((C)->_expression)))) { rT48add_type(XrT72result_type((C)->_expression),(T0 *)ms107_27); rT68error(rT68start_position(C),(T0 *)ms97_27); } /*FI*/} /*FI*/} /*FI*/} else { {T68 *n=((T68*)se_new(68)); rT68make(n,(C)->_tag,(C)->_expression,(C)->_comment); R=(T0 *)n;} R=rT68to_runnable((T68*)R,a1); } /*FI*/return R; } /*ASSERTION*/void rT68error(/*C*/T0* a1,T0* a2){ rT48add_position(a1); rT48error((T48*)oRBC27eh,a2); }/*ASSERTION*/T0* rT68start_position(T68 *C){ T0* R=NULL; /*IF*/if (((int)(C)->_tag)) { R=((T163*)(C)->_tag)->_start_position; } else if (((int)(C)->_expression)) { R=XrT72start_position((C)->_expression); } else { R=((T63*)(C)->_comment)->_start_position; } /*FI*/return R; } /*ASSERTION*/int rT68use_current(T68 *C){ int R=0; /*IF*/if (((int)(C)->_expression)) { R=XrT72use_current((C)->_expression); } /*FI*/return R; } /*ASSERTION*/void rT68compile_to_c_old(T68 *C){ /*IF*/if (((int)(C)->_expression)) { XrT72compile_to_c_old((C)->_expression); } /*FI*/}/*ASSERTION*/void rT68compile_to_c(T68 *C){ /*IF*/if (((int)(C)->_expression)) { rT44check_assertion((T44*)oRBC27cpp,(C)->_expression); } /*FI*/}/*ASSERTION*/int rT68is_pre_computable(T68 *C){ int R=0; /*IF*/if (!((C)->_expression)) { R=1; } else { R=XrT72is_pre_computable((C)->_expression); } /*FI*/return R; } /*ASSERTION*/void rT68make(T68 *C,T0* a1,T0* a2,T0* a3){ C->_tag=a1; C->_expression=a2; C->_comment=a3; }/*COMPOUND*/T0* rT142first(T142 *C){ T0* R=NULL; /*IF*/if (((int)(C)->_list)) { R=rT225first((T225*)(C)->_list); } /*FI*/return R; } /*COMPOUND*/void rT142fatal_error(/*C*/T0* a1){ rT48fatal_error(a1); }/*COMPOUND*/int rT142count(T142 *C){ int R=0; /*IF*/if (((int)(C)->_list)) { R=((T225*)(C)->_list)->_upper; } /*FI*/return R; } /*COMPOUND*/T0* rT142to_runnable(T142 *C,T0* a1){ T0* R=NULL; T0* _i2=NULL; T0* _i1=NULL; int _i=0; /*IF*/if (!((C)->_current_type)) { C->_current_type=a1; /*IF*/if (((int)(C)->_list)) { _i=1; while (!((_i)>(((T225*)(C)->_list)->_upper))) { _i1=rT225item((T225*)(C)->_list,_i); _i2=XrT181to_runnable(_i1,(T0 *)C); /*IF*/if ((/*(IRF4*/((T48*)oRBC27eh)->_nb_errors/*)*/)>(0)) { rT48append((T0 *)ms1_142); rT48append(XrT62written_mark((C)->_current_type)); rT48add_position(XrT181start_position(_i1)); rT142fatal_error((T0 *)ms2_142); } else { rT225put((T225*)(C)->_list,_i2,_i); } /*FI*/_i=(_i)+(1); } } /*FI*/R=(T0 *)C; } else { /*IF*/if (!((C)->_list)) { {T142 *n=((T142*)se_new(142)); rT142make(n,(C)->_header_comment,NULL); R=(T0 *)n;} } else { {T142 *n=((T142*)se_new(142)); rT142make(n,(C)->_header_comment,rT225twin((T225*)(C)->_list)); R=(T0 *)n;} } /*FI*/R=rT142to_runnable((T142*)R,a1); } /*FI*/return R; } /*COMPOUND*/int rT142use_current(T142 *C){ int R=0; int _i=0; /*IF*/if (((int)(C)->_list)) { _i=1; while (!((R)||((_i)>(((T225*)(C)->_list)->_upper)))) { R=XrT181use_current(rT225item((T225*)(C)->_list,_i)); _i=(_i)+(1); } } /*FI*/return R; } /*COMPOUND*/T0* rT142run_class(T142 *C){ T0* R=NULL; R=XrT62run_class((C)->_current_type); return R; } /*COMPOUND*/void rT142compile_to_c(T142 *C){ int _i=0; /*IF*/if (((int)(C)->_list)) { _i=1; while (!((_i)>(((T225*)(C)->_list)->_upper))) { XrT181compile_to_c(rT225item((T225*)(C)->_list,_i)); _i=(_i)+(1); } } /*FI*/}/*COMPOUND*/int rT142is_pre_computable(T142 *C){ int R=0; int _i=0; /*IF*/if (!((C)->_list)) { R=1; } else { _i=((T225*)(C)->_list)->_upper; R=1; while (!((!(R))||((_i)==(0)))) { R=XrT181is_pre_computable(rT225item((T225*)(C)->_list,_i)); _i=(_i)-(1); } } /*FI*/return R; } /*COMPOUND*/void rT142make(T142 *C,T0* a1,T0* a2){ C->_header_comment=a1; C->_list=a2; }/*ARRAY[BOOLEAN]*/void rT284clear_all(T284 *C){ int _value=0; rT284set_all_with(C,_value); }/*ARRAY[BOOLEAN]*/void rT284set_all_with(T284 *C,int a1){ int _i=0; _i=(C)->_upper; while (!((_i)<((C)->_lower))) { rT284put(C,a1,_i); _i=(_i)-(1); } }/*ARRAY[BOOLEAN]*/void rT284resize(T284 *C,int a1,int a2){ T37 _mem={0/*dummy*/}; int _up=0; int _i=0; T0* _other=NULL; {T284 *n=((T284*)se_new(284)); rT284make(n,a1,a2); _other=(T0 *)n;} _i=rT2max((C)->_lower,((T284*)_other)->_lower); _up=rT2min((C)->_upper,((T284*)_other)->_upper); while (!((_i)>(_up))) { rT284put((T284*)_other,rT284item(C,_i),_i); _i=(_i)+(1); } /*IF*/if (((int)(C)->_storage)) { free((C)->_storage); } /*FI*/rT284standard_copy(C,_other); free(((void *)(T284*)_other)); }/*ARRAY[BOOLEAN]*/void rT284force(T284 *C,int a1,int a2){ /*IF*/if (((C)->_upper)<(a2)) { rT284resize(C,(C)->_lower,a2); } else if ((a2)<((C)->_lower)) { rT284resize(C,a2,(C)->_upper); } /*FI*/rT284put(C,a1,a2); }/*ARRAY[BOOLEAN]*/int rT284item(T284 *C,int a1){ int R=0; R=(((int*)(C->_storage))[a1-(C->_lower)]); return R; } /*ARRAY[BOOLEAN]*/int rT284valid_index(T284 *C,int a1){ int R=0; R=(((C)->_lower)<=(a1))&&((a1)<=((C)->_upper)); return R; } /*ARRAY[BOOLEAN]*/int* rT284malloc(/*C*/int a1){ int* R=0; T37 _mem={0/*dummy*/}; int _x=0; /*IF*/{/*AT*/R=malloc((a1)*(((0),sizeof(T6)))); } /*FI*/return R; } /*ARRAY[BOOLEAN]*/void rT284put(T284 *C,int a1,int a2){ ((int*)(C->_storage))[a2-(C->_lower)]=a1; } /*ARRAY[BOOLEAN]*/void rT284standard_copy(T284 *C,T0* a1){ memcpy(C,a1,s[a1->id]); }/*ARRAY[BOOLEAN]*/void rT284set_slice_with(T284 *C,int a1,int a2,int a3){ int _i=0; _i=a2; while (!((_i)>(a3))) { rT284put(C,a1,_i); _i=(_i)+(1); } }/*ARRAY[BOOLEAN]*/void rT284make(T284 *C,int a1,int a2){ T37 _mem={0/*dummy*/}; C->_lower=a1; C->_upper=a2; /*IF*/if (((int)(C)->_storage)) { free((C)->_storage); } /*FI*/C->_capacity=((a2)-(a1))+(1); /*IF*/if (((C)->_capacity)>(0)) { /*IF*/if (((C)->_capacity)<(16)) { C->_capacity=16; } /*FI*/C->_storage=rT284malloc((C)->_capacity); rT284clear_all(C); } /*FI*/}/*FILE_TOOLS*/int rT283same_files(/*C*/T0* a1,T0* a2){ int R=0; /*IF*/if (!(rT283file_exists(a1))) { } else if (!(rT283file_exists(a2))) { } else { rT43connect_to((T43*)oRBC283std_fr1,a1); rT43connect_to((T43*)oRBC283std_fr2,a2); /*IF*/if (!(rT43is_connected((T43*)oRBC283std_fr1))) { } else if (!(rT43is_connected((T43*)oRBC283std_fr1))) { } else { R=1; while (!(((!(R))||(rT43end_of_input((T43*)oRBC283std_fr1)))||(rT43end_of_input((T43*)oRBC283std_fr2)))) { rT43read_character((T43*)oRBC283std_fr1); rT43read_character((T43*)oRBC283std_fr2); R=(rT43last_character((T43*)oRBC283std_fr1))==(rT43last_character((T43*)oRBC283std_fr2)); } rT43disconnect((T43*)oRBC283std_fr1); rT43disconnect((T43*)oRBC283std_fr2); } /*FI*/} /*FI*/return R; } T0*oRBC283std_fr2; T0*oRBC283std_fr1; /*FILE_TOOLS*/int rT283file_exists(/*C*/T0* a1){ int R=0; void * _p=0; _p=rT7to_external((T7*)a1); {FILE *f=fopen(((char*)_p),"r"); R=(f != NULL); if (R) fclose(f);} return R; } /*ARRAY[RUN_FEATURE_6]*/void rT282clear_all(T282 *C){ T0* _value=NULL; rT282set_all_with(C,_value); }/*ARRAY[RUN_FEATURE_6]*/int rT282count(T282 *C){ int R=0; R=(((C)->_upper)-((C)->_lower))+(1); return R; } /*ARRAY[RUN_FEATURE_6]*/void rT282set_all_with(T282 *C,T0* a1){ int _i=0; _i=(C)->_upper; while (!((_i)<((C)->_lower))) { rT282put(C,a1,_i); _i=(_i)-(1); } }/*ARRAY[RUN_FEATURE_6]*/void rT282resize(T282 *C,int a1,int a2){ T37 _mem={0/*dummy*/}; int _up=0; int _i=0; T0* _other=NULL; {T282 *n=((T282*)se_new(282)); rT282make(n,a1,a2); _other=(T0 *)n;} _i=rT2max((C)->_lower,((T282*)_other)->_lower); _up=rT2min((C)->_upper,((T282*)_other)->_upper); while (!((_i)>(_up))) { rT282put((T282*)_other,rT282item(C,_i),_i); _i=(_i)+(1); } /*IF*/if (((int)(C)->_storage)) { free((C)->_storage); } /*FI*/rT282standard_copy(C,_other); free(((void *)(T282*)_other)); }/*ARRAY[RUN_FEATURE_6]*/int rT282fast_has(T282 *C,T0* a1){ int R=0; R=(rT282fast_index_of(C,a1))!=(((C)->_upper)+(1)); return R; } /*ARRAY[RUN_FEATURE_6]*/int rT282fast_index_of(T282 *C,T0* a1){ int R=0; R=(C)->_lower; while (!(((R)>((C)->_upper))||(((T0 *)a1)==((T0 *)rT282item(C,R))))) { R=(R)+(1); } return R; } /*ARRAY[RUN_FEATURE_6]*/void rT282force(T282 *C,T0* a1,int a2){ /*IF*/if (((C)->_upper)<(a2)) { rT282resize(C,(C)->_lower,a2); } else if ((a2)<((C)->_lower)) { rT282resize(C,a2,(C)->_upper); } /*FI*/rT282put(C,a1,a2); }/*ARRAY[RUN_FEATURE_6]*/T0* rT282item(T282 *C,int a1){ T0* R=NULL; R=(((T0**)(C->_storage))[a1-(C->_lower)]); return R; } /*ARRAY[RUN_FEATURE_6]*/T0** rT282realloc(/*C*/T0** a1,int a2){ T0** R=0; T37 _mem={0/*dummy*/}; T0* _x=NULL; /*IF*//*AF*//*AE*/ R=realloc(a1,(a2)*(sizeof(char *))); /*FI*/return R; } /*ARRAY[RUN_FEATURE_6]*/void rT282add_last(T282 *C,T0* a1){ /*IF*//*AF*//*AE*/ /*FI*//*IF*/if (((C)->_capacity)<((rT282count(C))+(1))) { /*IF*/if (((C)->_capacity)==(0)) { C->_capacity=16; C->_storage=rT282malloc((C)->_capacity); } else { C->_capacity=((C)->_capacity)+(16); C->_storage=rT282realloc((C)->_storage,(C)->_capacity); } /*FI*/} /*FI*/C->_upper=((C)->_upper)+(1); rT282put(C,a1,(C)->_upper); }/*ARRAY[RUN_FEATURE_6]*/T0** rT282malloc(/*C*/int a1){ T0** R=0; T37 _mem={0/*dummy*/}; T0* _x=NULL; /*IF*//*AF*//*AE*/ R=malloc((a1)*(sizeof(char *))); /*FI*/return R; } /*ARRAY[RUN_FEATURE_6]*/void rT282put(T282 *C,T0* a1,int a2){ ((T0**)(C->_storage))[a2-(C->_lower)]=a1; } /*ARRAY[RUN_FEATURE_6]*/void rT282standard_copy(T282 *C,T0* a1){ memcpy(C,a1,s[a1->id]); }/*ARRAY[RUN_FEATURE_6]*/void rT282swap(T282 *C,int a1,int a2){ T0* _tmp=NULL; _tmp=rT282item(C,a1); rT282put(C,rT282item(C,a2),a1); rT282put(C,_tmp,a2); }/*ARRAY[RUN_FEATURE_6]*/void rT282make(T282 *C,int a1,int a2){ T37 _mem={0/*dummy*/}; C->_lower=a1; C->_upper=a2; /*IF*/if (((int)(C)->_storage)) { free((C)->_storage); } /*FI*/C->_capacity=((a2)-(a1))+(1); /*IF*/if (((C)->_capacity)>(0)) { /*IF*/if (((C)->_capacity)<(16)) { C->_capacity=16; } /*FI*/C->_storage=rT282malloc((C)->_capacity); rT282clear_all(C); } /*FI*/}/*ARRAY[EFFECTIVE_ARG_LIST]*/void rT280clear_all(T280 *C){ T0* _value=NULL; rT280set_all_with(C,_value); }/*ARRAY[EFFECTIVE_ARG_LIST]*/void rT280set_all_with(T280 *C,T0* a1){ int _i=0; _i=(C)->_upper; while (!((_i)<((C)->_lower))) { rT280put(C,a1,_i); _i=(_i)-(1); } }/*ARRAY[EFFECTIVE_ARG_LIST]*/void rT280resize(T280 *C,int a1,int a2){ T37 _mem={0/*dummy*/}; int _up=0; int _i=0; T0* _other=NULL; {T280 *n=((T280*)se_new(280)); rT280make(n,a1,a2); _other=(T0 *)n;} _i=rT2max((C)->_lower,((T280*)_other)->_lower); _up=rT2min((C)->_upper,((T280*)_other)->_upper); while (!((_i)>(_up))) { rT280put((T280*)_other,rT280item(C,_i),_i); _i=(_i)+(1); } /*IF*/if (((int)(C)->_storage)) { free((C)->_storage); } /*FI*/rT280standard_copy(C,_other); free(((void *)(T280*)_other)); }/*ARRAY[EFFECTIVE_ARG_LIST]*/T0* rT280item(T280 *C,int a1){ T0* R=NULL; R=(((T0**)(C->_storage))[a1-(C->_lower)]); return R; } /*ARRAY[EFFECTIVE_ARG_LIST]*/T0** rT280malloc(/*C*/int a1){ T0** R=0; T37 _mem={0/*dummy*/}; T0* _x=NULL; /*IF*//*AF*//*AE*/ R=malloc((a1)*(sizeof(char *))); /*FI*/return R; } /*ARRAY[EFFECTIVE_ARG_LIST]*/void rT280put(T280 *C,T0* a1,int a2){ ((T0**)(C->_storage))[a2-(C->_lower)]=a1; } /*ARRAY[EFFECTIVE_ARG_LIST]*/void rT280standard_copy(T280 *C,T0* a1){ memcpy(C,a1,s[a1->id]); }/*ARRAY[EFFECTIVE_ARG_LIST]*/void rT280make(T280 *C,int a1,int a2){ T37 _mem={0/*dummy*/}; C->_lower=a1; C->_upper=a2; /*IF*/if (((int)(C)->_storage)) { free((C)->_storage); } /*FI*/C->_capacity=((a2)-(a1))+(1); /*IF*/if (((C)->_capacity)>(0)) { /*IF*/if (((C)->_capacity)<(16)) { C->_capacity=16; } /*FI*/C->_storage=rT280malloc((C)->_capacity); rT280clear_all(C); } /*FI*/}/*ARRAY[SWITCH]*/void rT279clear_all(T279 *C){ T0* _value=NULL; rT279set_all_with(C,_value); }/*ARRAY[SWITCH]*/int rT279count(T279 *C){ int R=0; R=(((C)->_upper)-((C)->_lower))+(1); return R; } /*ARRAY[SWITCH]*/void rT279set_all_with(T279 *C,T0* a1){ int _i=0; _i=(C)->_upper; while (!((_i)<((C)->_lower))) { rT279put(C,a1,_i); _i=(_i)-(1); } }/*ARRAY[SWITCH]*/void rT279resize(T279 *C,int a1,int a2){ T37 _mem={0/*dummy*/}; int _up=0; int _i=0; T0* _other=NULL; {T279 *n=((T279*)se_new(279)); rT279make(n,a1,a2); _other=(T0 *)n;} _i=rT2max((C)->_lower,((T279*)_other)->_lower); _up=rT2min((C)->_upper,((T279*)_other)->_upper); while (!((_i)>(_up))) { rT279put((T279*)_other,rT279item(C,_i),_i); _i=(_i)+(1); } /*IF*/if (((int)(C)->_storage)) { free((C)->_storage); } /*FI*/rT279standard_copy(C,_other); free(((void *)(T279*)_other)); }/*ARRAY[SWITCH]*/T0* rT279item(T279 *C,int a1){ T0* R=NULL; R=(((T0**)(C->_storage))[a1-(C->_lower)]); return R; } /*ARRAY[SWITCH]*/T0** rT279realloc(/*C*/T0** a1,int a2){ T0** R=0; T37 _mem={0/*dummy*/}; T0* _x=NULL; /*IF*//*AF*//*AE*/ R=realloc(a1,(a2)*(sizeof(char *))); /*FI*/return R; } /*ARRAY[SWITCH]*/void rT279add_last(T279 *C,T0* a1){ /*IF*//*AF*//*AE*/ /*FI*//*IF*/if (((C)->_capacity)<((rT279count(C))+(1))) { /*IF*/if (((C)->_capacity)==(0)) { C->_capacity=16; C->_storage=rT279malloc((C)->_capacity); } else { C->_capacity=((C)->_capacity)+(16); C->_storage=rT279realloc((C)->_storage,(C)->_capacity); } /*FI*/} /*FI*/C->_upper=((C)->_upper)+(1); rT279put(C,a1,(C)->_upper); }/*ARRAY[SWITCH]*/T0** rT279malloc(/*C*/int a1){ T0** R=0; T37 _mem={0/*dummy*/}; T0* _x=NULL; /*IF*//*AF*//*AE*/ R=malloc((a1)*(sizeof(char *))); /*FI*/return R; } /*ARRAY[SWITCH]*/void rT279put(T279 *C,T0* a1,int a2){ ((T0**)(C->_storage))[a2-(C->_lower)]=a1; } /*ARRAY[SWITCH]*/void rT279standard_copy(T279 *C,T0* a1){ memcpy(C,a1,s[a1->id]); }/*ARRAY[SWITCH]*/void rT279make(T279 *C,int a1,int a2){ T37 _mem={0/*dummy*/}; C->_lower=a1; C->_upper=a2; /*IF*/if (((int)(C)->_storage)) { free((C)->_storage); } /*FI*/C->_capacity=((a2)-(a1))+(1); /*IF*/if (((C)->_capacity)>(0)) { /*IF*/if (((C)->_capacity)<(16)) { C->_capacity=16; } /*FI*/C->_storage=rT279malloc((C)->_capacity); rT279clear_all(C); } /*FI*/}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.