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

This is pretty8.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"
/*INSTRUCTION_WITH_COMMENT*/T0* rT222add_comment(/*C*/T0* a1){
T0* R=NULL;
return R;
}
/*INSTRUCTION_WITH_COMMENT*/void rT222pretty_print(T222 *C){
XrT179pretty_print((C)->_instruction);
rT267level_incr((T267*)oRBC27fmt);
rT267indent((T267*)oRBC27fmt);
rT267level_decr((T267*)oRBC27fmt);
rT61pretty_print((T61*)(C)->_comment);
}/*INSTRUCTION_WITH_COMMENT*/void rT222make(T222 *C,T0* a1,T0* a2){
C->_instruction=a1;
C->_comment=a2;
}/*STD_FILE_READ*/int rT43feof(T43 *C,void * a1){
int R=0;
R=feof((FILE*)C->_input_stream);
return R;
}
/*STD_FILE_READ*/int rT43end_of_input(T43 *C){
int R=0;
R=rT43feof(C,(C)->_input_stream);
return R;
}
/*STD_FILE_READ*/int rT43is_connected(T43 *C){
int R=0;
R=((int)(C)->_path);
return R;
}
/*STD_FILE_READ*/void rT43disconnect(T43 *C){
int _err=0;
_err=fclose((C)->_input_stream);
C->_path=NULL;
}T0*oRBC43last_string;
/*STD_FILE_READ*/char rT43last_character(T43 *C){
char R=0;
R=(C)->_last_character_memory;
return R;
}
/*STD_FILE_READ*/void rT43connect_to(T43 *C,T0* a1){
/*[IRF3:make*//*AW*/(C)->_mode=((T0 *)ms1_43);/*]*/
C->_input_stream=rT43fopen(a1,(C)->_mode);
/*IF*/{/*AT*/C->_path=a1;
}
/*FI*/}/*STD_FILE_READ*/void rT43skip_separators(T43 *C){
while (!((rT43end_of_input(C))||(!(rT3is_separator(rT43last_character(C)))))) {
rT43read_character(C);
}
}/*STD_FILE_READ*/void * rT43fopen(/*C*/T0* a1,T0* a2){
void * R=0;
void * _pm=0;
void * _pf=0;
_pf=rT7to_external((T7*)a1);
_pm=rT7to_external((T7*)a2);
R=(void*)fopen(((char*)_pf),((char*)_pm));
return R;
}
/*STD_FILE_READ*/void rT43read_word(T43 *C){
rT43skip_separators(C);
/*[IRF3:clear*//*AW*/((T7*)oRBC43last_string)->_count=(0);/*]*/
while (!((rT43end_of_input(C))||(rT3is_separator(rT43last_character(C))))) {
rT7extend((T7*)oRBC43last_string,rT43last_character(C));
rT43read_character(C);
}
}/*STD_FILE_READ*/void rT43read_line_in(T43 *C,T0* a1){
/*[IRF3:clear*//*AW*/((T7*)a1)->_count=(0);/*]*/
rT43read_character(C);
while (!((rT43end_of_input(C))||((rT43last_character(C))==('\12')))) {
rT7extend((T7*)a1,rT43last_character(C));
rT43read_character(C);
}
}/*STD_FILE_READ*/void rT43read_line(T43 *C){
rT43read_line_in(C,oRBC43last_string);
}/*STD_FILE_READ*/void rT43read_character(T43 *C){
C->_last_character_memory=fgetc((C)->_input_stream);
}/*STRING*/T0* rT7twin(T7 *C){
T0* R=NULL;
/*IF*//*AF*//*AE*/
R=(T0 *)se_new(C->id);AF_1
rT7copy((T7*)R,(T0 *)C);
AF_0
/*FI*/return R;
}
/*STRING*/int rT7hash_code(T7 *C){
int R=0;
int _i=0;
_i=(C)->_count;
/*IF*/if ((_i)>(5)) {
_i=5;
}
/*FI*/while (!((_i)==(0))) {
R=(R)+(((unsigned char)rT7item(C,_i)));
_i=(_i)-(1);
}
return R;
}
/*STRING*/void rT7extend(T7 *C,char a1){
T37 _mem={0/*dummy*/};
/*IF*/if (((C)->_capacity)>((C)->_count)) {
}
 else if (((C)->_capacity)==(0)) {
C->_capacity=32;
C->_storage=malloc((C)->_capacity);
}
else {
C->_capacity=((C)->_capacity)+(32);
C->_storage=realloc((C)->_storage,(C)->_capacity);
}
/*FI*/C->_count=((C)->_count)+(1);
rT7put(C,a1,(C)->_count);
}/*STRING*/int rT7same_as(T7 *C,T0* a1){
int R=0;
int _i=0;
/*IF*/if (((T0 *)a1)==((T0 *)C)) {
R=1;
}
else {
/*IF*/if ((((T7*)a1)->_count)!=((C)->_count)) {
}
else {
_i=(C)->_count;
while (!(((_i)==(0))||(!(rT3same_as(rT7item(C,_i),rT7item((T7*)a1,_i)))))) {
_i=(_i)-(1);
}
R=(_i)==(0);
}
/*FI*/}
/*FI*/return R;
}
/*STRING*/void rT7to_upper(T7 *C){
int _i=0;
_i=(C)->_count;
while (!((_i)==(0))) {
rT7put(C,rT3to_upper(rT7item(C,_i)),_i);
_i=(_i)-(1);
}
}/*STRING*/char rT7first(T7 *C){
char R=0;
R=rT7item(C,1);
return R;
}
/*STRING*/void rT7remove_last(T7 *C,int a1){
C->_count=((C)->_count)-(a1);
}/*STRING*/void rT7remove_suffix(T7 *C,T0* a1){
rT7remove_last(C,((T7*)a1)->_count);
}/*STRING*/int rT7has_string(T7 *C,T0* a1){
int R=0;
R=(rT7index_of_string(C,a1))!=(((C)->_count)+(1));
return R;
}
/*STRING*/int rT7has_suffix(T7 *C,T0* a1){
int R=0;
int _i2=0;
int _i1=0;
/*IF*/if ((((T7*)a1)->_count)<=((C)->_count)) {
_i1=(((C)->_count)-(((T7*)a1)->_count))+(1);
_i2=1;
while (!((((_i1)>((C)->_count))||((_i2)>(((T7*)a1)->_count)))||((rT7item(C,_i1))!=(rT7item((T7*)a1,_i2))))) {
_i1=(_i1)+(1);
_i2=(_i2)+(1);
}
R=(_i1)>((C)->_count);
}
/*FI*/return R;
}
/*STRING*/int rT7empty(T7 *C){
int R=0;
R=((C)->_count)==(0);
return R;
}
/*STRING*/char rT7item(T7 *C,int a1){
char R=0;
R=(C->_storage)[a1-1];
return R;
}
/*STRING*/T0* rT7substring(T7 *C,int a1,int a2){
T0* R=NULL;
int _i=0;
{T7 *n=((T7*)se_new(7));
rT7make(n,((a2)-(a1))+(1));
R=(T0 *)n;}
_i=a1;
while (!((_i)>(a2))) {
rT7extend((T7*)R,rT7item(C,_i));
_i=(_i)+(1);
}
return R;
}
/*STRING*/int rT7is_equal(T7 *C,T0* a1){
int R=0;
int _i=0;
/*IF*/if (((T0 *)C)==((T0 *)a1)) {
R=1;
}
else {
_i=(C)->_count;
R=(_i)==(((T7*)a1)->_count);
while (!(((!(R))||((_i)==(0))))) {
R=(rT7item(C,_i))==(rT7item((T7*)a1,_i));
_i=(_i)-(1);
}
}
/*FI*/return R;
}
/*STRING*/void rT7append(T7 *C,T0* a1){
int _i=0;
_i=1;
while (!((_i)>(((T7*)a1)->_count))) {
rT7extend(C,rT7item((T7*)a1,_i));
_i=(_i)+(1);
}
}/*STRING*/char rT7last(T7 *C){
char R=0;
R=rT7item(C,(C)->_count);
return R;
}
/*STRING*/int rT7index_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*)a1)->_count;
_i3=_i2;
while (!((R)!=(0))) {
/*IF*/if ((_i2)>((C)->_count)) {
R=((C)->_count)+(1);
}
else {
_stop=0;
while (!(_stop)) {
/*IF*/if ((_i3)==(0)) {
_stop=1;
R=_i1;
}
 else if ((rT7item((T7*)a1,_i3))!=(rT7item(C,_i2))) {
_stop=1;
}
/*FI*/_i3=(_i3)-(1);
_i2=(_i2)-(1);
}
}
/*FI*/_i1=(_i1)+(1);
_i3=((T7*)a1)->_count;
_i2=((_i1)+(_i3))-(1);
}
return R;
}
/*STRING*/void rT7put(T7 *C,char a1,int a2){
(C->_storage)[a2-1]=a1;
}/*STRING*/void rT7swap(T7 *C,int a1,int a2){
char _tmp=0;
_tmp=rT7item(C,a1);
rT7put(C,rT7item(C,a2),a1);
rT7put(C,_tmp,a2);
}/*STRING*/void rT7copy(T7 *C,T0* a1){
int _i=0;
/*IF*/if (((C)->_capacity)<(((T7*)a1)->_count)) {
rT7make(C,((T7*)a1)->_count);
}
/*FI*/_i=((T7*)a1)->_count;
C->_count=_i;
while (!((_i)==(0))) {
rT7put(C,rT7item((T7*)a1,_i),_i);
_i=(_i)-(1);
}
}/*STRING*/void rT7prepend(T7 *C,T0* a1){
int _old_count=0;
int _i=0;
_old_count=(C)->_count;
_i=((T7*)a1)->_count;
while (!((_i)==(0))) {
rT7extend(C,'\40');
_i=(_i)-(1);
}
_i=(C)->_count;
while (!((_old_count)==(0))) {
rT7put(C,rT7item(C,_old_count),_i);
_i=(_i)-(1);
_old_count=(_old_count)-(1);
}
_i=((T7*)a1)->_count;
while (!((_i)==(0))) {
rT7put(C,rT7item((T7*)a1,_i),_i);
_i=(_i)-(1);
}
}/*STRING*/void rT7to_lower(T7 *C){
int _i=0;
_i=(C)->_count;
while (!((_i)==(0))) {
rT7put(C,rT3to_lower(rT7item(C,_i)),_i);
_i=(_i)-(1);
}
}/*STRING*/void rT7make(T7 *C,int a1){
T37 _mem={0/*dummy*/};
/*IF*/if ((a1)>(0)) {
/*IF*/if (((C)->_capacity)<(a1)) {
/*IF*/if (((C)->_capacity)==(0)) {
C->_storage=malloc(a1);
}
else {
C->_storage=realloc((C)->_storage,a1);
}
/*FI*/C->_capacity=a1;
}
/*FI*/}
/*FI*/C->_count=0;
}/*STRING*/char * rT7to_external(T7 *C){
char * R=0;
rT7extend(C,'\0');
C->_count=((C)->_count)-(1);
R=(C)->_storage;
return R;
}
/*WHEN_ITEM_2*/void rT239pretty_print(T239 *C){
XrT70pretty_print((C)->_lower);
rT267put_string((T267*)oRBC27fmt,(T0 *)ms5_239);
XrT70pretty_print((C)->_upper);
}/*WHEN_ITEM_2*/void rT239make(T239 *C,T0* a1,T0* a2){
C->_lower=a1;
C->_upper=a2;
}/*WHEN_LIST*/void rT237pretty_print(T237 *C){
int _i=0;
_i=1;
while (!((_i)>(((T238*)(C)->_list)->_upper))) {
rT232pretty_print((T232*)rT238item((T238*)(C)->_list,_i));
_i=(_i)+(1);
/*IF*/if ((_i)<=(((T238*)(C)->_list)->_upper)) {
rT267put_character((T267*)oRBC27fmt,'\12');
rT267indent((T267*)oRBC27fmt);
}
/*FI*/}
}/*WHEN_LIST*/void rT237add_last(T237 *C,T0* a1){
rT238add_last((T238*)(C)->_list,a1);
}

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