This is pretty1.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 "pretty.h" T0 *se_new(int id){ int sz=s[id]; T0 *n=malloc((size_t)sz); memset(n,0,sz); n->id=id; return n; } T0*oRBC27fmt; /*FUNCTION*/T0* rT258first_name(T258 *C){ T0* R=NULL; R=rT128item((T128*)(C)->_names,1); return R; } /*FUNCTION*/void rT258error(/*C*/T0* a1,T0* a2){ rT46add_position(a1); rT46error((T46*)oRBC27eh,a2); }T0*oRBC27eh; /*FUNCTION*/T0* rT258start_position(T258 *C){ T0* R=NULL; R=/*XrT*FEATURE_NAME*/((T68*)rT258first_name(C))->_start_position; return R; } /*FUNCTION*/void rT258pretty_print_routine_body(T258 *C){ /*IF*/if (((int)(C)->_local_vars)) { rT139pretty_print((T139*)(C)->_local_vars); } /*FI*/rT267indent((T267*)oRBC27fmt); /*[IRF3:pretty_print_once_or_do*/rT267keyword((T267*)oRBC27fmt,(T0 *)ms1_256); /*]*/ rT267put_character((T267*)oRBC27fmt,'\40'); /*IF*/if (((int)(C)->_routine_body)) { rT140pretty_print((T140*)(C)->_routine_body); } /*FI*/}/*FUNCTION*/void rT258pretty_print_arguments(T258 *C){ /*IF*/if (((int)(C)->_arguments)) { rT95pretty_print((T95*)(C)->_arguments); } /*FI*/}/*FUNCTION*/void rT258pretty_print_one_name(/*C*/T0* a1){ /*IF*/if (/*XrT*FEATURE_NAME*/((T68*)a1)->_is_frozen) { rT267keyword((T267*)oRBC27fmt,(T0 *)ms11_64); } /*FI*/XrT69pretty_print(a1); }/*FUNCTION*/void rT258pretty_print_names(T258 *C){ int _i=0; _i=1; rT258pretty_print_one_name(rT128item((T128*)(C)->_names,_i)); _i=(_i)+(1); while (!((_i)>(rT128count((T128*)(C)->_names)))) { rT267put_string((T267*)oRBC27fmt,(T0 *)ms10_64); rT258pretty_print_one_name(rT128item((T128*)(C)->_names,_i)); _i=(_i)+(1); } }/*FUNCTION*/void rT258pretty_print_profile(T258 *C){ rT258pretty_print_names(C); /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT258pretty_print_arguments(C); /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(3);/*]*/ /*IF*/if (((int)(C)->_result_type)) { rT267put_string((T267*)oRBC27fmt,(T0 *)ms9_64); XrT60pretty_print((C)->_result_type); } /*FI*/}/*FUNCTION*/void rT258pretty_print(T258 *C){ T0* _fn=NULL; /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(1);/*]*/ rT267indent((T267*)oRBC27fmt); rT258pretty_print_profile(C); rT267keyword((T267*)oRBC27fmt,(T0 *)ms1_158); /*IF*/if (((int)(C)->_obsolete_mark)) { /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT267indent((T267*)oRBC27fmt); rT267keyword((T267*)oRBC27fmt,(T0 *)ms2_158); rT78pretty_print((T78*)(C)->_obsolete_mark); } /*FI*//*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT267indent((T267*)oRBC27fmt); /*IF*/if (((int)(C)->_header_comment)) { rT61pretty_print((T61*)(C)->_header_comment); } /*FI*//*IF*/if (((int)(C)->_require_assertion)) { /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT137pretty_print((T137*)(C)->_require_assertion); } /*FI*//*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT267indent((T267*)oRBC27fmt); rT258pretty_print_routine_body(C); /*IF*/if (((int)(C)->_ensure_assertion)) { /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT159pretty_print((T159*)(C)->_ensure_assertion); } /*FI*//*IF*/if (((int)(C)->_rescue_compound)) { /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT267indent((T267*)oRBC27fmt); rT267keyword((T267*)oRBC27fmt,(T0 *)ms3_158); rT140pretty_print((T140*)(C)->_rescue_compound); } /*FI*//*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT267indent((T267*)oRBC27fmt); rT267keyword((T267*)oRBC27fmt,(T0 *)ms4_158); /*IF*/if ((((int)(C)->_end_comment))&&(!(rT61dummy((T61*)(C)->_end_comment)))) { rT61pretty_print((T61*)(C)->_end_comment); } else if (((T267*)oRBC27fmt)->_print_end_routine) { rT267put_string((T267*)oRBC27fmt,(T0 *)ms5_158); _fn=rT258first_name(C); /*IF*/if (XrT69is_prefix_name(_fn)) { rT267keyword((T267*)oRBC27fmt,(T0 *)ms6_158); rT267put_character((T267*)oRBC27fmt,'\42'); rT267put_string((T267*)oRBC27fmt,/*XrT*FEATURE_NAME*/((T68*)_fn)->_to_string); rT267put_character((T267*)oRBC27fmt,'\42'); } else if (XrT69is_infix_name(_fn)) { rT267keyword((T267*)oRBC27fmt,(T0 *)ms7_158); rT267put_character((T267*)oRBC27fmt,'\42'); rT267put_string((T267*)oRBC27fmt,/*XrT*FEATURE_NAME*/((T68*)_fn)->_to_string); rT267put_character((T267*)oRBC27fmt,'\42'); } else { rT267put_string((T267*)oRBC27fmt,/*XrT*FEATURE_NAME*/((T68*)_fn)->_to_string); } /*FI*/} /*FI*/rT267put_character((T267*)oRBC27fmt,'\12'); }/*FUNCTION*/void rT258add_into(T258 *C,T0* a1){ T0* _fn=NULL; int _i=0; C->_base_class=rT47base_class((T47*)/*XrT*FEATURE_NAME*/((T68*)rT128item((T128*)(C)->_names,1))->_start_position); _i=1; while (!((_i)>(rT128count((T128*)(C)->_names)))) { _fn=rT128item((T128*)(C)->_names,_i); /*IF*/if (rT63has((T63*)a1,XrT69to_key(_fn))) { _fn=XrT64first_name(rT63at((T63*)a1,XrT69to_key(_fn))); rT46add_position(/*XrT*FEATURE_NAME*/((T68*)_fn)->_start_position); rT46add_position(/*XrT*FEATURE_NAME*/((T68*)rT128item((T128*)(C)->_names,_i))->_start_position); rT46error((T46*)oRBC27eh,(T0 *)ms12_64); rT46append(/*XrT*FEATURE_NAME*/((T68*)_fn)->_to_string); rT46error((T46*)oRBC27eh,(T0 *)ms102_27); } else { rT63put((T63*)a1,(T0 *)C,XrT69to_key(_fn)); } /*FI*/_i=(_i)+(1); } }/*FUNCTION*/void rT258set_header_comment(T258 *C,T0* a1){ /*IF*/if ((((int)a1))&&((rT61count((T61*)a1))>(1))) { C->_end_comment=a1; } /*FI*/}/*FUNCTION*/void rT258set_rescue_compound(T258 *C,T0* a1){ /*IF*/if ((((int)a1))&&(/*(IRF4*/0/*)*/)) { rT258error(rT258start_position(C),(T0 *)ms8_158); } /*FI*/C->_rescue_compound=a1; }/*FUNCTION*/void rT258make_e_feature(T258 *C,T0* a1,T0* a2){ C->_names=a1; C->_result_type=a2; }/*FUNCTION*/void rT258make_routine(T258 *C,T0* a1,T0* a2,T0* a3,T0* a4,T0* a5){ rT258make_e_feature(C,a1,NULL); C->_header_comment=a4; C->_arguments=a2; C->_obsolete_mark=a3; C->_require_assertion=a5; }/*FUNCTION*/void rT258make_effective_routine(T258 *C,T0* a1,T0* a2,T0* a3,T0* a4,T0* a5,T0* a6,T0* a7){ rT258make_routine(C,a1,a2,a3,a4,a5); C->_local_vars=a6; C->_routine_body=a7; C->_use_current_state=1008; }/*FUNCTION*/void rT258make(T258 *C,T0* a1,T0* a2,T0* a3,T0* a4,T0* a5,T0* a6,T0* a7,T0* a8){ rT258make_effective_routine(C,a1,a2,a4,a5,a6,a7,a8); C->_result_type=a3; }/*BIT_CONSTANT*/void rT79bracketed_print(T79 *C){ rT267put_character((T267*)oRBC27fmt,'\50'); rT79pretty_print(C); rT267put_character((T267*)oRBC27fmt,'\51'); }/*BIT_CONSTANT*/T0* rT79add_comment(T79 *C,T0* a1){ T0* R=NULL; /*IF*/if ((!(a1))||((rT61count((T61*)a1))==(0))) { R=(T0 *)C; } else { {T226 *n=((T226*)se_new(226)); rT226make(n,(T0 *)C,a1); R=(T0 *)n;}} /*FI*/return R; } /*BIT_CONSTANT*/void rT79print_as_target(T79 *C){ rT79bracketed_print(C); rT267put_character((T267*)oRBC27fmt,'\56'); }/*BIT_CONSTANT*/void rT79pretty_print(T79 *C){ rT267put_string((T267*)oRBC27fmt,(C)->_value); rT267put_character((T267*)oRBC27fmt,'B'); }/*E_OLD*/void rT171bracketed_print(T171 *C){ rT267put_character((T267*)oRBC27fmt,'\50'); rT171pretty_print(C); rT267put_character((T267*)oRBC27fmt,'\51'); }/*E_OLD*/T0* rT171add_comment(T171 *C,T0* a1){ T0* R=NULL; /*IF*/if ((!(a1))||((rT61count((T61*)a1))==(0))) { R=(T0 *)C; } else { {T226 *n=((T226*)se_new(226)); rT226make(n,(T0 *)C,a1); R=(T0 *)n;}} /*FI*/return R; } /*E_OLD*/void rT171print_as_target(T171 *C){ rT171bracketed_print(C); rT267put_character((T267*)oRBC27fmt,'\56'); }/*E_OLD*/T0* rT171start_position(T171 *C){ T0* R=NULL; R=XrT70start_position((C)->_expression); return R; } /*E_OLD*/void rT171pretty_print(T171 *C){ rT267put_string((T267*)oRBC27fmt,(T0 *)ms3_171); rT267level_incr((T267*)oRBC27fmt); XrT70pretty_print((C)->_expression); rT267level_decr((T267*)oRBC27fmt); }/*REAL_CONSTANT*/void rT81bracketed_print(T81 *C){ rT267put_character((T267*)oRBC27fmt,'\50'); rT81pretty_print(C); rT267put_character((T267*)oRBC27fmt,'\51'); }/*REAL_CONSTANT*/void rT81error(/*C*/T0* a1,T0* a2){ rT46add_position(a1); rT46error((T46*)oRBC27eh,a2); }/*REAL_CONSTANT*/T0* rT81add_comment(T81 *C,T0* a1){ T0* R=NULL; /*IF*/if ((!(a1))||((rT61count((T61*)a1))==(0))) { R=(T0 *)C; } else { {T226 *n=((T226*)se_new(226)); rT226make(n,(T0 *)C,a1); R=(T0 *)n;}} /*FI*/return R; } /*REAL_CONSTANT*/void rT81print_as_target(T81 *C){ rT81bracketed_print(C); rT267put_character((T267*)oRBC27fmt,'\56'); }/*REAL_CONSTANT*/void rT81pretty_print(T81 *C){ rT267put_string((T267*)oRBC27fmt,(C)->_to_string); }/*REAL_CONSTANT*/T0* rT81_px45(T81 *C){ T0* R=NULL; rT81error((C)->_start_position,(T0 *)ms3_81); return R; } /*REAL_CONSTANT*/T0* rT81to_integer_constant(T81 *C){ T0* R=NULL; rT81error((C)->_start_position,(T0 *)ms2_81); return R; } /*REAL_CONSTANT*/void rT81make(T81 *C,T0* a1,T0* a2,int a3,float a4,int a5){ C->_start_position=a1; C->_to_string=a2; C->_integral_part=a3; C->_fractional_part=a4; C->_exponent=a5; }/*ONCE_FUNCTION*/T0* rT261first_name(T261 *C){ T0* R=NULL; R=rT128item((T128*)(C)->_names,1); return R; } /*ONCE_FUNCTION*/void rT261error(/*C*/T0* a1,T0* a2){ rT46add_position(a1); rT46error((T46*)oRBC27eh,a2); }/*ONCE_FUNCTION*/T0* rT261start_position(T261 *C){ T0* R=NULL; R=/*XrT*FEATURE_NAME*/((T68*)rT261first_name(C))->_start_position; return R; } /*ONCE_FUNCTION*/void rT261pretty_print_routine_body(T261 *C){ /*IF*/if (((int)(C)->_local_vars)) { rT139pretty_print((T139*)(C)->_local_vars); } /*FI*/rT267indent((T267*)oRBC27fmt); /*[IRF3:pretty_print_once_or_do*/rT267put_string((T267*)oRBC27fmt,(T0 *)ms1_259); /*]*/ rT267put_character((T267*)oRBC27fmt,'\40'); /*IF*/if (((int)(C)->_routine_body)) { rT140pretty_print((T140*)(C)->_routine_body); } /*FI*/}/*ONCE_FUNCTION*/void rT261pretty_print_arguments(T261 *C){ /*IF*/if (((int)(C)->_arguments)) { rT95pretty_print((T95*)(C)->_arguments); } /*FI*/}/*ONCE_FUNCTION*/void rT261pretty_print_one_name(/*C*/T0* a1){ /*IF*/if (/*XrT*FEATURE_NAME*/((T68*)a1)->_is_frozen) { rT267keyword((T267*)oRBC27fmt,(T0 *)ms11_64); } /*FI*/XrT69pretty_print(a1); }/*ONCE_FUNCTION*/void rT261pretty_print_names(T261 *C){ int _i=0; _i=1; rT261pretty_print_one_name(rT128item((T128*)(C)->_names,_i)); _i=(_i)+(1); while (!((_i)>(rT128count((T128*)(C)->_names)))) { rT267put_string((T267*)oRBC27fmt,(T0 *)ms10_64); rT261pretty_print_one_name(rT128item((T128*)(C)->_names,_i)); _i=(_i)+(1); } }/*ONCE_FUNCTION*/void rT261pretty_print_profile(T261 *C){ rT261pretty_print_names(C); /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT261pretty_print_arguments(C); /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(3);/*]*/ /*IF*/if (((int)(C)->_result_type)) { rT267put_string((T267*)oRBC27fmt,(T0 *)ms9_64); XrT60pretty_print((C)->_result_type); } /*FI*/}/*ONCE_FUNCTION*/void rT261pretty_print(T261 *C){ T0* _fn=NULL; /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(1);/*]*/ rT267indent((T267*)oRBC27fmt); rT261pretty_print_profile(C); rT267keyword((T267*)oRBC27fmt,(T0 *)ms1_158); /*IF*/if (((int)(C)->_obsolete_mark)) { /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT267indent((T267*)oRBC27fmt); rT267keyword((T267*)oRBC27fmt,(T0 *)ms2_158); rT78pretty_print((T78*)(C)->_obsolete_mark); } /*FI*//*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT267indent((T267*)oRBC27fmt); /*IF*/if (((int)(C)->_header_comment)) { rT61pretty_print((T61*)(C)->_header_comment); } /*FI*//*IF*/if (((int)(C)->_require_assertion)) { /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT137pretty_print((T137*)(C)->_require_assertion); } /*FI*//*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT267indent((T267*)oRBC27fmt); rT261pretty_print_routine_body(C); /*IF*/if (((int)(C)->_ensure_assertion)) { /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT159pretty_print((T159*)(C)->_ensure_assertion); } /*FI*//*IF*/if (((int)(C)->_rescue_compound)) { /*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT267indent((T267*)oRBC27fmt); rT267keyword((T267*)oRBC27fmt,(T0 *)ms3_158); rT140pretty_print((T140*)(C)->_rescue_compound); } /*FI*//*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/ rT267indent((T267*)oRBC27fmt); rT267keyword((T267*)oRBC27fmt,(T0 *)ms4_158); /*IF*/if ((((int)(C)->_end_comment))&&(!(rT61dummy((T61*)(C)->_end_comment)))) { rT61pretty_print((T61*)(C)->_end_comment); } else if (((T267*)oRBC27fmt)->_print_end_routine) { rT267put_string((T267*)oRBC27fmt,(T0 *)ms5_158); _fn=rT261first_name(C); /*IF*/if (XrT69is_prefix_name(_fn)) { rT267keyword((T267*)oRBC27fmt,(T0 *)ms6_158); rT267put_character((T267*)oRBC27fmt,'\42'); rT267put_string((T267*)oRBC27fmt,/*XrT*FEATURE_NAME*/((T68*)_fn)->_to_string); rT267put_character((T267*)oRBC27fmt,'\42'); } else if (XrT69is_infix_name(_fn)) { rT267keyword((T267*)oRBC27fmt,(T0 *)ms7_158); rT267put_character((T267*)oRBC27fmt,'\42'); rT267put_string((T267*)oRBC27fmt,/*XrT*FEATURE_NAME*/((T68*)_fn)->_to_string); rT267put_character((T267*)oRBC27fmt,'\42'); } else { rT267put_string((T267*)oRBC27fmt,/*XrT*FEATURE_NAME*/((T68*)_fn)->_to_string); } /*FI*/} /*FI*/rT267put_character((T267*)oRBC27fmt,'\12'); }/*ONCE_FUNCTION*/void rT261add_into(T261 *C,T0* a1){ T0* _fn=NULL; int _i=0; C->_base_class=rT47base_class((T47*)/*XrT*FEATURE_NAME*/((T68*)rT128item((T128*)(C)->_names,1))->_start_position); _i=1; while (!((_i)>(rT128count((T128*)(C)->_names)))) { _fn=rT128item((T128*)(C)->_names,_i); /*IF*/if (rT63has((T63*)a1,XrT69to_key(_fn))) { _fn=XrT64first_name(rT63at((T63*)a1,XrT69to_key(_fn))); rT46add_position(/*XrT*FEATURE_NAME*/((T68*)_fn)->_start_position); rT46add_position(/*XrT*FEATURE_NAME*/((T68*)rT128item((T128*)(C)->_names,_i))->_start_position); rT46error((T46*)oRBC27eh,(T0 *)ms12_64); rT46append(/*XrT*FEATURE_NAME*/((T68*)_fn)->_to_string); rT46error((T46*)oRBC27eh,(T0 *)ms102_27); } else { rT63put((T63*)a1,(T0 *)C,XrT69to_key(_fn)); } /*FI*/_i=(_i)+(1); } }/*ONCE_FUNCTION*/void rT261set_header_comment(T261 *C,T0* a1){ /*IF*/if ((((int)a1))&&((rT61count((T61*)a1))>(1))) { C->_end_comment=a1; } /*FI*/}/*ONCE_FUNCTION*/void rT261set_rescue_compound(T261 *C,T0* a1){ /*IF*/if ((((int)a1))&&(/*(IRF4*/0/*)*/)) { rT261error(rT261start_position(C),(T0 *)ms8_158); } /*FI*/C->_rescue_compound=a1; }/*ONCE_FUNCTION*/void rT261make_e_feature(T261 *C,T0* a1,T0* a2){ C->_names=a1; C->_result_type=a2; }/*ONCE_FUNCTION*/void rT261make_routine(T261 *C,T0* a1,T0* a2,T0* a3,T0* a4,T0* a5){ rT261make_e_feature(C,a1,NULL); C->_header_comment=a4; C->_arguments=a2; C->_obsolete_mark=a3; C->_require_assertion=a5; }/*ONCE_FUNCTION*/void rT261make_effective_routine(T261 *C,T0* a1,T0* a2,T0* a3,T0* a4,T0* a5,T0* a6,T0* a7){ rT261make_routine(C,a1,a2,a3,a4,a5); C->_local_vars=a6; C->_routine_body=a7; C->_use_current_state=1008; }/*ONCE_FUNCTION*/void rT261make(T261 *C,T0* a1,T0* a2,T0* a3,T0* a4,T0* a5,T0* a6,T0* a7,T0* a8){ rT261make_effective_routine(C,a1,a2,a4,a5,a6,a7,a8); C->_result_type=a3; }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.