ftp.nice.ch/pub/next/developer/languages/eiffel/SmallEiffel.0.91.N.bs.tar.gz#/SmallEiffel/bin_c/pretty18.c

This is pretty18.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"
/*LOCAL_NAME*/void rT184bracketed_print(T184 *C){
rT267put_character((T267*)oRBC27fmt,'\50');
rT184pretty_print(C);
rT267put_character((T267*)oRBC27fmt,'\51');
}/*LOCAL_NAME*/T0* rT184add_comment(T184 *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;
}
/*LOCAL_NAME*/void rT184print_as_target(T184 *C){
rT267put_string((T267*)oRBC27fmt,(C)->_to_string);
rT267put_character((T267*)oRBC27fmt,'\56');
}/*LOCAL_NAME*/void rT184pretty_print(T184 *C){
rT267put_string((T267*)oRBC27fmt,(C)->_to_string);
}/*LOCAL_NAME*/T0* rT184to_key(T184 *C){
T0* R=NULL;
R=(C)->_to_string;
return R;
}
/*LOCAL_NAME*/void rT184refer_to(T184 *C,T0* a1,T0* a2,int a3){
C->_start_position=a1;
C->_rank=a3;
C->_declaration_name=rT139name((T139*)a2,a3);
C->_to_string=((T184*)(C)->_declaration_name)->_to_string;
C->_result_type=((T184*)(C)->_declaration_name)->_result_type;
}/*LOCAL_NAME*/void rT184make(T184 *C,T0* a1,T0* a2){
C->_start_position=a1;
C->_to_string=a2;
C->_declaration_name=(T0 *)C;
}/*MANIFEST_STRING*/void rT78bracketed_print(T78 *C){
rT267put_character((T267*)oRBC27fmt,'\50');
rT78pretty_print(C);
rT267put_character((T267*)oRBC27fmt,'\51');
}T0*oRBC78tmp_string;
/*MANIFEST_STRING*/void rT78break_line(T78 *C){
/*IF*/if (!((C)->_break)) {
C->_break=ma(57,2,1,(((T7*)(C)->_to_string)->_count)+(1));
}
else {
rT57add_last((T57*)(C)->_break,(((T7*)(C)->_to_string)->_count)+(1));
}
/*FI*/}/*MANIFEST_STRING*/void rT78add_ascii(T78 *C,char a1){
rT7extend((T7*)(C)->_to_string,a1);
/*IF*/if (!((C)->_ascii)) {
C->_ascii=ma(57,2,1,((T7*)(C)->_to_string)->_count);
}
else {
rT57add_last((T57*)(C)->_ascii,((T7*)(C)->_to_string)->_count);
}
/*FI*/}/*MANIFEST_STRING*/void rT78add(T78 *C,char a1){
rT7extend((T7*)(C)->_to_string,a1);
}/*MANIFEST_STRING*/T0* rT78add_comment(T78 *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;
}
/*MANIFEST_STRING*/void rT78print_as_target(T78 *C){
rT78bracketed_print(C);
rT267put_character((T267*)oRBC27fmt,'\56');
}/*MANIFEST_STRING*/void rT78print_character(T78 *C,int a1){
int _val=0;
/*IF*/if ((((int)(C)->_percent))&&(rT57fast_has((T57*)(C)->_percent,a1))) {
/*[IRF3:clear*//*AW*/((T7*)oRBC78tmp_string)->_count=(0);/*]*/
rT78character_coding(rT7item((T7*)(C)->_to_string,a1),oRBC78tmp_string);
rT267put_string((T267*)oRBC27fmt,oRBC78tmp_string);
}
 else if ((((int)(C)->_ascii))&&(rT57fast_has((T57*)(C)->_ascii,a1))) {
_val=((unsigned char)rT7item((T7*)(C)->_to_string,a1));
rT267put_string((T267*)oRBC27fmt,(T0 *)ms3_78);
rT267put_integer((T267*)oRBC27fmt,_val);
rT267put_string((T267*)oRBC27fmt,(T0 *)ms125_27);
}
else {
rT267put_character((T267*)oRBC27fmt,rT7item((T7*)(C)->_to_string,a1));
}
/*FI*/}/*MANIFEST_STRING*/void rT78pretty_print(T78 *C){
int _column=0;
int _i=0;
_column=((T267*)oRBC27fmt)->_column;
rT267put_character((T267*)oRBC27fmt,'\42');
_i=1;
while (!((_i)>(((T7*)(C)->_to_string)->_count))) {
/*IF*/if (rT78is_on_next_line(C,_i)) {
rT267put_string((T267*)oRBC27fmt,(T0 *)ms2_78);
while (!((_column)==(((T267*)oRBC27fmt)->_column))) {
rT267put_character((T267*)oRBC27fmt,'\40');
}
rT267put_character((T267*)oRBC27fmt,'\45');
}
/*FI*/rT78print_character(C,_i);
_i=(_i)+(1);
}
rT267put_character((T267*)oRBC27fmt,'\42');
}/*MANIFEST_STRING*/void rT78from_manifest_string(T78 *C,T0* a1,int a2){
rT78copy(C,a1);
C->_mapping_c=rT7twin((T7*)((T78*)a1)->_mapping_c);
rT7extend((T7*)(C)->_mapping_c,'\137');
rT2append_in(a2,(C)->_mapping_c);
}/*MANIFEST_STRING*/int rT78is_on_next_line(T78 *C,int a1){
int R=0;
/*IF*/if (((int)(C)->_break)) {
R=rT57fast_has((T57*)(C)->_break,a1);
}
/*FI*/return R;
}
/*MANIFEST_STRING*/void rT78add_percent(T78 *C,char a1){
rT7extend((T7*)(C)->_to_string,a1);
/*IF*/if (!((C)->_percent)) {
C->_percent=ma(57,2,1,((T7*)(C)->_to_string)->_count);
}
else {
rT57add_last((T57*)(C)->_percent,((T7*)(C)->_to_string)->_count);
}
/*FI*/}/*MANIFEST_STRING*/void rT78copy(T78 *C,T0* a1){
/*IF*//*AF*//*AE*/
memcpy(C,a1,s[C->id]);
/*FI*/}/*MANIFEST_STRING*/void rT78make(T78 *C,T0* a1,int a2){
C->_start_position=a1;
{T7 *n=((T7*)se_new(7));
rT7make(n,0);
C->_to_string=(T0 *)n;}
{T7 *n=((T7*)se_new(7));
rT7make(n,12);
C->_mapping_c=(T0 *)n;}
rT7copy((T7*)(C)->_mapping_c,(T0 *)ms1_78);
rT2append_in(a2,(C)->_mapping_c);
}/*MANIFEST_STRING*/void rT78character_coding(/*C*/char a1,T0* a2){
char _special=0;
{int iv1=a1;
if (64 == iv1) goto l420;
goto l421;
 l420: ;
_special='A';
goto l419;
 l421: ;
if (8 == iv1) goto l422;
goto l423;
 l422: ;
_special='B';
goto l419;
 l423: ;
if (94 == iv1) goto l424;
goto l425;
 l424: ;
_special='C';
goto l419;
 l425: ;
if (36 == iv1) goto l426;
goto l427;
 l426: ;
_special='D';
goto l419;
 l427: ;
if (12 == iv1) goto l428;
goto l429;
 l428: ;
_special='F';
goto l419;
 l429: ;
if (92 == iv1) goto l430;
goto l431;
 l430: ;
_special='H';
goto l419;
 l431: ;
if (126 == iv1) goto l432;
goto l433;
 l432: ;
_special='L';
goto l419;
 l433: ;
if (10 == iv1) goto l434;
goto l435;
 l434: ;
_special='N';
goto l419;
 l435: ;
if (96 == iv1) goto l436;
goto l437;
 l436: ;
_special='Q';
goto l419;
 l437: ;
if (13 == iv1) goto l438;
goto l439;
 l438: ;
_special='R';
goto l419;
 l439: ;
if (35 == iv1) goto l440;
goto l441;
 l440: ;
_special='S';
goto l419;
 l441: ;
if (9 == iv1) goto l442;
goto l443;
 l442: ;
_special='T';
goto l419;
 l443: ;
if (0 == iv1) goto l444;
goto l445;
 l444: ;
_special='U';
goto l419;
 l445: ;
if (124 == iv1) goto l446;
goto l447;
 l446: ;
_special='V';
goto l419;
 l447: ;
if (37 == iv1) goto l448;
goto l449;
 l448: ;
_special='\45';
goto l419;
 l449: ;
if (39 == iv1) goto l450;
goto l451;
 l450: ;
_special='\47';
goto l419;
 l451: ;
if (34 == iv1) goto l452;
goto l453;
 l452: ;
_special='\42';
goto l419;
 l453: ;
if (91 == iv1) goto l454;
goto l455;
 l454: ;
_special='\50';
goto l419;
 l455: ;
if (93 == iv1) goto l456;
goto l457;
 l456: ;
_special='\51';
goto l419;
 l457: ;
if (123 == iv1) goto l458;
goto l459;
 l458: ;
_special='\74';
goto l419;
 l459: ;
if (125 == iv1) goto l460;
goto l461;
 l460: ;
_special='\76';
goto l419;
 l461: ;
 l419: ;
}
rT7extend((T7*)a2,'\45');
/*IF*/if ((_special)==('\0')) {
rT7extend((T7*)a2,'\57');
rT2append_in(((unsigned char)a1),a2);
rT7extend((T7*)a2,'\57');
}
else {
rT7extend((T7*)a2,_special);
}
/*FI*/}/*CLIENT_LIST*/void rT123pretty_print(T123 *C){
/*IF*/if (rT123is_omitted(C)) {
/*IF*/if (((T267*)oRBC27fmt)->_zen_mode) {
}
else {
rT267put_string((T267*)oRBC27fmt,(T0 *)ms1_123);
}
/*FI*/}
else {
/*IF*/if (!((C)->_list)) {
/*IF*/if (((T267*)oRBC27fmt)->_zen_mode) {
rT267put_string((T267*)oRBC27fmt,(T0 *)ms2_123);
}
else {
rT267put_string((T267*)oRBC27fmt,(T0 *)ms3_123);
}
/*FI*/}
else {
rT267put_character((T267*)oRBC27fmt,'\173');
/*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/
rT126pretty_print((T126*)(C)->_list);
rT267put_character((T267*)oRBC27fmt,'\175');
}
/*FI*/}
/*FI*/}/*CLIENT_LIST*/int rT123is_omitted(T123 *C){
int R=0;
R=!((C)->_start_position);
return R;
}
/*CLIENT_LIST*/void rT123make(T123 *C,T0* a1,T0* a2){
C->_start_position=a1;
/*IF*/if (((int)a2)) {
{T126 *n=((T126*)se_new(126));
rT126make(n,a2);
C->_list=(T0 *)n;}
}
/*FI*/}/*LOCAL_VAR_LIST*/T0* rT139name(T139 *C,int a1){
T0* R=NULL;
R=rT185item((T185*)(C)->_flat_list,a1);
return R;
}
/*LOCAL_VAR_LIST*/void rT139fatal_error(/*C*/T0* a1){
rT46fatal_error(a1);
}/*LOCAL_VAR_LIST*/int rT139count(T139 *C){
int R=0;
R=((T185*)(C)->_flat_list)->_upper;
return R;
}
/*LOCAL_VAR_LIST*/int rT139rank_of(T139 *C,T0* a1){
int R=0;
R=rT139count(C);
while (!(((R)==(0))||(rT7is_equal((T7*)a1,((T184*)rT139name(C,R))->_to_string)))) {
R=(R)-(1);
}
return R;
}
/*LOCAL_VAR_LIST*/void rT139pretty_print(T139 *C){
int _i=0;
/*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/
rT267indent((T267*)oRBC27fmt);
rT267keyword((T267*)oRBC27fmt,(T0 *)ms1_139);
/*IF*/if (((((T267*)oRBC27fmt)->_zen_mode)&&((rT145count((T145*)(C)->_list))==(1)))) {
XrT141pretty_print(rT145first((T145*)(C)->_list));
rT267put_character((T267*)oRBC27fmt,'\73');
}
else {
_i=1;
while (!((_i)>(((T145*)(C)->_list)->_upper))) {
/*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(3);/*]*/
rT267indent((T267*)oRBC27fmt);
XrT141pretty_print(rT145item((T145*)(C)->_list,_i));
rT267put_character((T267*)oRBC27fmt,'\73');
_i=(_i)+(1);
}
}
/*FI*//*[IRF3:set_indent_level*//*AW*/((T267*)oRBC27fmt)->_indent_level=(2);/*]*/
rT267indent((T267*)oRBC27fmt);
}/*LOCAL_VAR_LIST*/void rT139add_last(T139 *C,T0* a1){
T0* _n2=NULL;
int _i=0;
_i=1;
while (!(!(rT185item((T185*)(C)->_flat_list,_i)))) {
_n2=rT185item((T185*)(C)->_flat_list,_i);
/*IF*/if (rT7is_equal((T7*)((T184*)_n2)->_to_string,((T184*)a1)->_to_string)) {
rT46add_position(((T184*)a1)->_start_position);
rT46add_position(((T184*)_n2)->_start_position);
rT139fatal_error((T0 *)ms2_96);
}
/*FI*/_i=(_i)+(1);
}
rT185put((T185*)(C)->_flat_list,a1,_i);
/*[IRF3:set_rank*//*AW*/((T184*)a1)->_rank=(_i);/*]*/
}/*LOCAL_VAR_LIST*/void rT139make(T139 *C,T0* a1,T0* a2){
int _actual_count=0;
int _il=0;
C->_start_position=a1;
C->_list=a2;
_il=1;
while (!((_il)>(((T145*)(C)->_list)->_upper))) {
_actual_count=(_actual_count)+(XrT141count(rT145item((T145*)(C)->_list,_il)));
_il=(_il)+(1);
}
{T185 *n=((T185*)se_new(185));
rT185make(n,1,_actual_count);
C->_flat_list=(T0 *)n;}
_il=1;
while (!((_il)>(((T145*)(C)->_list)->_upper))) {
XrT141append_in(rT145item((T145*)(C)->_list,_il),(T0 *)C);
_il=(_il)+(1);
}
}/*MANIFEST_ARRAY*/void rT162bracketed_print(T162 *C){
rT267put_character((T267*)oRBC27fmt,'\50');
rT162pretty_print(C);
rT267put_character((T267*)oRBC27fmt,'\51');
}/*MANIFEST_ARRAY*/T0* rT162add_comment(T162 *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;
}
/*MANIFEST_ARRAY*/void rT162print_as_target(T162 *C){
rT162bracketed_print(C);
rT267put_character((T267*)oRBC27fmt,'\56');
}/*MANIFEST_ARRAY*/void rT162pretty_print(T162 *C){
int _i=0;
rT267put_string((T267*)oRBC27fmt,(T0 *)ms4_162);
rT267level_incr((T267*)oRBC27fmt);
/*IF*/if (((int)(C)->_list)) {
_i=1;
while (!((_i)>(/*XrT*ARRAY[EXPRESSION]*/((T83*)(C)->_list)->_upper))) {
XrT70pretty_print(/*XrT*ARRAY[EXPRESSION]*/rT83item((T83*)(C)->_list,_i));
_i=(_i)+(1);
/*IF*/if ((_i)<=(/*XrT*ARRAY[EXPRESSION]*/((T83*)(C)->_list)->_upper)) {
rT267put_character((T267*)oRBC27fmt,'\54');
}
/*FI*/}
}
/*FI*/rT267put_string((T267*)oRBC27fmt,(T0 *)ms5_162);
rT267level_decr((T267*)oRBC27fmt);
}/*MANIFEST_ARRAY*/void rT162make(T162 *C,T0* a1,T0* a2){
C->_start_position=a1;
C->_list=a2;
}/*DICTIONARY[E_FEATURE,STRING]*/void rT63resize(T63 *C,int a1){
int _p=0;
int _n=0;
int _i=0;
T0* _new_buc=NULL;
int _hash=0;
{T56 *n=((T56*)se_new(56));
rT56make(n,a1);
_new_buc=(T0 *)n;}
_i=0;
while (!((_i)>=((C)->_modulus))) {
_n=rT56item((T56*)(C)->_buckets,_i);
while (!((_n)==(0))) {
_p=rT57item((T57*)(C)->_chain,_n);
_hash=(rT7hash_code((T7*)rT45item((T45*)(C)->_keys,_n)))%(a1);
rT57put((T57*)(C)->_chain,rT56item((T56*)_new_buc,_hash),_n);
rT56put((T56*)_new_buc,_n,_hash);
_n=_p;
}
_i=(_i)+(1);
}
C->_buckets=_new_buc;
C->_modulus=a1;
C->_item_mem=0;
}/*DICTIONARY[E_FEATURE,STRING]*/T0* rT63at(T63 *C,T0* a1){
T0* R=NULL;
int _foo=0;
_foo=rT63has(C,a1);
R=rT65item((T65*)(C)->_store,(C)->_has_mem);
return R;
}
/*DICTIONARY[E_FEATURE,STRING]*/void rT63put(T63 *C,T0* a1,T0* a2){
int _hash=0;
_hash=(rT7hash_code((T7*)a2))%((C)->_modulus);
/*IF*/if ((((C)->_has_mem)==(0))||(!(rT7is_equal((T7*)a2,rT45item((T45*)(C)->_keys,(C)->_has_mem))))) {
C->_has_mem=rT56item((T56*)(C)->_buckets,_hash);
while (!((((C)->_has_mem)==(0))||(rT7is_equal((T7*)a2,rT45item((T45*)(C)->_keys,(C)->_has_mem))))) {
C->_has_mem=rT57item((T57*)(C)->_chain,(C)->_has_mem);
}
/*IF*/if (((C)->_has_mem)==(0)) {
/*IF*/if (((C)->_count)>=(rT65count((T65*)(C)->_store))) {
rT63expand(C);
}
/*FI*/rT45put((T45*)(C)->_keys,a2,(C)->_free);
rT65put((T65*)(C)->_store,a1,(C)->_free);
C->_has_mem=(C)->_free;
C->_free=rT57item((T57*)(C)->_chain,(C)->_free);
rT57put((T57*)(C)->_chain,rT56item((T56*)(C)->_buckets,_hash),(C)->_has_mem);
rT56put((T56*)(C)->_buckets,(C)->_has_mem,_hash);
C->_count=((C)->_count)+(1);
/*IF*/if (((C)->_count)>(((C)->_modulus)*(2))) {
rT63resize(C,(2)*((C)->_modulus));
}
/*FI*/}
/*FI*/}
else {
rT65put((T65*)(C)->_store,a1,(C)->_has_mem);
}
/*FI*/C->_item_mem=0;
}/*DICTIONARY[E_FEATURE,STRING]*/void rT63expand(T63 *C){
int _old_size=0;
int _i=0;
C->_item_mem=0;
_old_size=rT65count((T65*)(C)->_store);
rT57resize((T57*)(C)->_chain,1,(2)*(_old_size));
rT45resize((T45*)(C)->_keys,1,(2)*(_old_size));
rT65resize((T65*)(C)->_store,1,(2)*(_old_size));
_i=(_old_size)+(1);
while (!((_i)==(rT57count((T57*)(C)->_chain)))) {
rT57put((T57*)(C)->_chain,(_i)+(1),_i);
_i=(_i)+(1);
}
rT57put((T57*)(C)->_chain,(C)->_free,_i);
C->_free=(_old_size)+(1);
}/*DICTIONARY[E_FEATURE,STRING]*/int rT63has(T63 *C,T0* a1){
int R=0;
/*IF*/if ((((C)->_has_mem)==(0))||(!(rT7is_equal((T7*)a1,rT45item((T45*)(C)->_keys,(C)->_has_mem))))) {
C->_has_mem=rT56item((T56*)(C)->_buckets,(rT7hash_code((T7*)a1))%((C)->_modulus));
while (!((((C)->_has_mem)==(0))||(rT7is_equal((T7*)a1,rT45item((T45*)(C)->_keys,(C)->_has_mem))))) {
C->_has_mem=rT57item((T57*)(C)->_chain,(C)->_has_mem);
}
}
/*FI*/R=((C)->_has_mem)!=(0);
return R;
}
/*DICTIONARY[E_FEATURE,STRING]*/void rT63make(T63 *C){
int _i=0;
C->_modulus=32;
C->_count=0;
C->_free=1;
C->_has_mem=0;
C->_item_mem=0;
{T56 *n=((T56*)se_new(56));
rT56make(n,(C)->_modulus);
C->_buckets=(T0 *)n;}
{T57 *n=((T57*)se_new(57));
rT57make(n,1,16);
C->_chain=(T0 *)n;}
{T65 *n=((T65*)se_new(65));
rT65make(n,1,16);
C->_store=(T0 *)n;}
{T45 *n=((T45*)se_new(45));
rT45make(n,1,16);
C->_keys=(T0 *)n;}
_i=1;
while (!((_i)==(rT57count((T57*)(C)->_chain)))) {
rT57put((T57*)(C)->_chain,(_i)+(1),_i);
_i=(_i)+(1);
}
rT57put((T57*)(C)->_chain,0,_i);
_i=0;
while (!((_i)>=((C)->_modulus))) {
rT56put((T56*)(C)->_buckets,0,_i);
_i=(_i)+(1);
}
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.