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

This is compile_to_c8.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"
/*E_RESULT*/int rT176static_value(T176 *C){
int R=0;
R=(C)->_static_value_mem;
return R;
}
/*E_RESULT*/T0* rT176to_runnable(T176 *C,T0* a1){
T0* R=NULL;
/*IF*/if (!((C)->_current_type)) {
C->_current_type=a1;
C->_result_type=/*XrT*RUN_FEATURE*/((T274*)rT55top_rf((T55*)oRBC27small_eiffel))->_result_type;
R=(T0 *)C;
}
else {
{T176 *n=((T176*)se_new(176));
rT176make(n,(C)->_start_position);
R=(T0 *)n;}
R=rT176to_runnable((T176*)R,a1);
}
/*FI*/return R;
}
/*E_RESULT*/void rT176error(/*C*/T0* a1,T0* a2){
rT48add_position(a1);
rT48error((T48*)oRBC27eh,a2);
}/*E_RESULT*/T0* rT176add_comment(T176 *C,T0* a1){
T0* R=NULL;
/*IF*/if ((!(a1))||((rT63count((T63*)a1))==(0))) {
R=(T0 *)C;
}
else {
{T228 *n=((T228*)se_new(228));
rT228make(n,(T0 *)C,a1);
R=(T0 *)n;}}
/*FI*/return R;
}
/*E_RESULT*/T0* rT176to_key(T176 *C){
T0* R=NULL;
R=(C)->_to_string;
return R;
}
/*E_RESULT*/int rT176to_integer(T176 *C){
int R=0;
rT176error((C)->_start_position,(T0 *)ms104_27);
return R;
}
/*E_RESULT*/int rT176is_a(T176 *C,T0* a1){
int R=0;
R=XrT62is_a(XrT62run_type((C)->_result_type),XrT62run_type(XrT72result_type(a1)));
/*IF*/if (!(R)) {
rT48add_position((C)->_start_position);
rT176error(XrT72start_position(a1),(T0 *)ms2_72);
}
/*FI*/return R;
}
/*E_RESULT*/void rT176make(T176 *C,T0* a1){
C->_to_string=(T0 *)ms119_27;
C->_start_position=a1;
}/*E_CURRENT*/int rT94static_value(T94 *C){
int R=0;
R=(C)->_static_value_mem;
return R;
}
/*E_CURRENT*/T0* rT94to_runnable(T94 *C,T0* a1){
T0* R=NULL;
/*IF*/if (!((C)->_current_type)) {
C->_current_type=a1;
R=(T0 *)C;
}
 else if (((T0 *)(C)->_current_type)==((T0 *)a1)) {
R=(T0 *)C;
}
else {
{T94 *n=((T94*)se_new(94));
rT94make(n,(C)->_start_position,(C)->_is_written);
R=(T0 *)n;}
/*[IRF3:set_current_type*//*AW*/((T94*)R)->_current_type=(a1);/*]*/
}
/*FI*/return R;
}
/*E_CURRENT*/void rT94error(/*C*/T0* a1,T0* a2){
rT48add_position(a1);
rT48error((T48*)oRBC27eh,a2);
}/*E_CURRENT*/T0* rT94add_comment(T94 *C,T0* a1){
T0* R=NULL;
/*IF*/if ((!(a1))||((rT63count((T63*)a1))==(0))) {
R=(T0 *)C;
}
else {
{T228 *n=((T228*)se_new(228));
rT228make(n,(T0 *)C,a1);
R=(T0 *)n;}}
/*FI*/return R;
}
/*E_CURRENT*/T0* rT94result_type(T94 *C){
T0* R=NULL;
R=(C)->_current_type;
return R;
}
/*E_CURRENT*/T0* rT94to_key(T94 *C){
T0* R=NULL;
R=(C)->_to_string;
return R;
}
/*E_CURRENT*/int rT94to_integer(T94 *C){
int R=0;
rT94error((C)->_start_position,(T0 *)ms104_27);
return R;
}
/*E_CURRENT*/int rT94is_a(T94 *C,T0* a1){
int R=0;
R=XrT62is_a(XrT62run_type(rT94result_type(C)),XrT62run_type(XrT72result_type(a1)));
/*IF*/if (!(R)) {
rT48add_position((C)->_start_position);
rT94error(XrT72start_position(a1),(T0 *)ms2_72);
}
/*FI*/return R;
}
/*E_CURRENT*/void rT94make(T94 *C,T0* a1,int a2){
C->_start_position=a1;
C->_is_written=a2;
}/*EXPORT_ITEM*/int rT124for_all(T124 *C){
int R=0;
R=!((C)->_list);
return R;
}
/*EXPORT_ITEM*/int rT124affect(T124 *C,T0* a1){
int R=0;
/*IF*/if (rT124for_all(C)) {
R=1;
}
else {
R=rT130has((T130*)(C)->_list,a1);
}
/*FI*/return R;
}
/*EXPORT_ITEM*/void rT124make_all(T124 *C,T0* a1){
C->_clients=a1;
C->_list=NULL;
}/*EXPORT_ITEM*/void rT124make(T124 *C,T0* a1,T0* a2){
C->_clients=a1;
{T130 *n=((T130*)se_new(130));
rT130make(n,a2);
C->_list=(T0 *)n;}
}/*EXPORT_LIST*/T0* rT126clients_for(T126 *C,T0* a1){
T0* R=NULL;
T0* _ei=NULL;
int _i=0;
_i=1;
while (!((((int)R))||((_i)>(((T129*)(C)->_items)->_upper)))) {
_ei=rT129item((T129*)(C)->_items,_i);
/*IF*/if (rT124affect((T124*)_ei,a1)) {
R=((T124*)_ei)->_clients;
}
else {
_i=(_i)+(1);
}
/*FI*/}
return R;
}
/*EXPORT_LIST*/void rT126make(T126 *C,T0* a1,T0* a2){
C->_start_position=a1;
C->_items=a2;
}/*E_RETRY*/T0* rT232to_runnable(T232 *C,T0* a1){
T0* R=NULL;
/*IF*/if (!((C)->_run_compound)) {
C->_run_compound=a1;
R=(T0 *)C;
}
 else if (((T0 *)(C)->_run_compound)==((T0 *)a1)) {
R=(T0 *)C;
}
else {
{T232 *n=((T232*)se_new(232));
/*[IRF3:make*//*AW*/(n)->_start_position=((C)->_start_position);/*]*/
R=(T0 *)n;}
R=rT232to_runnable((T232*)R,a1);
}
/*FI*/return R;
}
/*E_RETRY*/void rT232error(/*C*/T0* a1,T0* a2){
rT48add_position(a1);
rT48error((T48*)oRBC27eh,a2);
}/*E_RETRY*/T0* rT232add_comment(T232 *C,T0* a1){
T0* R=NULL;
/*IF*/if ((!(a1))||((rT63count((T63*)a1))==(0))) {
R=(T0 *)C;
}
/*AF*/else {
{T224 *n=((T224*)se_new(224));
rT224make(n,(T0 *)C,a1);
R=(T0 *)n;}}
/*FI*/return R;
}
/*E_RETRY*/void rT232compile_to_c(T232 *C){
rT232error((C)->_start_position,(T0 *)ms1_232);
}/*POSITION*/void rT49show(T49 *C){
T0* _the_line=NULL;
T0* _str=NULL;
T0* _n=NULL;
int _nb=0;
int _c=0;
_n=((T51*)(C)->_base_class_name)->_to_string;
rT38put_string((T38*)oRBC1std_error,(T0 *)ms3_49);
rT38put_integer((T38*)oRBC1std_error,(C)->_line);
rT38put_string((T38*)oRBC1std_error,(T0 *)ms4_49);
rT38put_integer((T38*)oRBC1std_error,(C)->_column);
rT38put_string((T38*)oRBC1std_error,(T0 *)ms5_49);
rT38put_string((T38*)oRBC1std_error,_n);
_str=rT49path(C);
/*IF*/if (((int)_str)) {
rT38put_string((T38*)oRBC1std_error,(T0 *)ms6_49);
rT38put_string((T38*)oRBC1std_error,_str);
rT38put_character((T38*)oRBC1std_error,'\51');
}
/*FI*/rT38put_string((T38*)oRBC1std_error,(T0 *)ms7_49);
/*IF*/if ((/*(IRF4*/((T54*)oRBC27eiffel_parser)->_is_running/*)*/)&&(rT7is_equal((T7*)((T51*)rT54current_class_name((T54*)oRBC27eiffel_parser))->_to_string,_n))) {
_the_line=((/*UT*/(void)(T64*)oRBC54text),
rT64item((C)->_line));
}
 else if (((int)rT49path(C))) {
rT64read((T64*)oRBC54text,((T53*)rT49base_class(C))->_path);
_the_line=((/*UT*/(void)(T64*)oRBC54text),
rT64item((C)->_line));
}
/*FI*//*IF*/if (((int)_the_line)) {
_c=(C)->_column;
rT38put_string((T38*)oRBC1std_error,_the_line);
rT38put_new_line((T38*)oRBC1std_error);
_nb=1;
while (!((_nb)==(_c))) {
/*IF*/if ((rT7item((T7*)_the_line,_nb))==('\11')) {
rT38put_character((T38*)oRBC1std_error,'\11');
}
else {
rT38put_character((T38*)oRBC1std_error,'\40');
}
/*FI*/_nb=(_nb)+(1);
}
rT38put_string((T38*)oRBC1std_error,(T0 *)ms8_49);
}
else {
rT38put_string((T38*)oRBC1std_error,(T0 *)ms9_49);
rT38put_string((T38*)oRBC1std_error,_n);
rT38put_string((T38*)oRBC1std_error,(T0 *)ms10_49);
}
/*FI*/}/*POSITION*/void rT49fatal_error(/*C*/T0* a1){
rT48fatal_error(a1);
}/*POSITION*/T0* rT49path(T49 *C){
T0* R=NULL;
T0* _bc=NULL;
/*IF*/if (/*(IRF4*/((T54*)oRBC27eiffel_parser)->_is_running/*)*/) {
/*IF*/if (rT55is_used(((T51*)(C)->_base_class_name)->_to_string)) {
_bc=rT51base_class((T51*)(C)->_base_class_name);
}
/*FI*/}
else {
_bc=rT51base_class((T51*)(C)->_base_class_name);
}
/*FI*//*IF*/if (((int)_bc)) {
R=((T53*)_bc)->_path;
}
/*FI*/return R;
}
/*POSITION*/int rT49before(T49 *C,T0* a1){
int R=0;
/*IF*/if (((C)->_line)<(((T49*)a1)->_line)) {
R=1;
}
 else if (((C)->_line)==(((T49*)a1)->_line)) {
R=((C)->_column)<(((T49*)a1)->_column);
}
/*FI*/return R;
}
/*POSITION*/int rT49is_equal(T49 *C,T0* a1){
int R=0;
R=((((((C)->_line)==(((T49*)a1)->_line))&&(((C)->_column)==(((T49*)a1)->_column)))&&(((int)(C)->_base_class_name)))&&(((int)((T49*)a1)->_base_class_name)))&&(((T0 *)((T51*)(C)->_base_class_name)->_to_string)==((T0 *)((T51*)((T49*)a1)->_base_class_name)->_to_string));
return R;
}
/*POSITION*/T0* rT49base_class(T49 *C){
T0* R=NULL;
/*IF*/if (/*(IRF4*/((T54*)oRBC27eiffel_parser)->_is_running/*)*/) {
/*IF*/if (rT7empty((T7*)((T51*)(C)->_base_class_name)->_to_string)) {
rT49fatal_error((T0 *)ms1_49);
}
 else if (rT55is_used(((T51*)(C)->_base_class_name)->_to_string)) {
R=rT51base_class((T51*)(C)->_base_class_name);
}
else {
rT49fatal_error((T0 *)ms2_49);
}
/*FI*/}
else {
R=rT51base_class((T51*)(C)->_base_class_name);
}
/*FI*/return R;
}
/*POSITION*/void rT49with(T49 *C,int a1,int a2,T0* a3){
C->_line=a1;
C->_column=a2;
C->_base_class_name=a3;
}/*POSITION*/void rT49make(T49 *C,int a1,int a2){
C->_line=a1;
C->_column=a2;
C->_base_class_name=rT54current_class_name((T54*)oRBC27eiffel_parser);
}/*STD_ERROR*/void rT38put_integer(T38 *C,int a1){
/*[IRF3:clear*//*AW*/((T7*)oRBC39tmp_string)->_count=(0);/*]*/
rT2append_in(a1,oRBC39tmp_string);
rT38put_string(C,oRBC39tmp_string);
}T0*oRBC39tmp_string;
/*STD_ERROR*/void rT38put_new_line(T38 *C){
rT38put_character(C,'\12');
}/*STD_ERROR*/void rT38die_with_code(/*C*/int a1){
exit(a1);
}/*STD_ERROR*/void rT38put_string(T38 *C,T0* a1){
int _i=0;
_i=1;
while (!((_i)>(((T7*)a1)->_count))) {
rT38put_character(C,rT7item((T7*)a1,_i));
_i=(_i)+(1);
}
}/*STD_ERROR*/int rT38is_connected(T38 *C){
int R=0;
R=((int)(C)->_path);
return R;
}
/*STD_ERROR*/void rT38disconnect(T38 *C){
int _err=0;
_err=fclose((C)->_output_stream);
C->_path=NULL;
C->_output_stream=stderr;
}/*STD_ERROR*/void rT38connect_to(T38 *C,T0* a1){
C->_mode=(T0 *)ms1_39;
C->_output_stream=rT38fopen(a1,(C)->_mode);
/*IF*/{/*AT*/C->_path=a1;
}
/*FI*/}/*STD_ERROR*/void * rT38fopen(/*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_ERROR*/void rT38put_character(T38 *C,char a1){
char _err=0;
_err=fputc(a1,(C)->_output_stream);
/*IF*/if ((_err)!=(a1)) {
rT38put_string((T38*)oRBC1std_error,(T0 *)ms2_39);
/*[IRF3:crash*/rsp();
rT38die_with_code(1);
/*]*/
}
/*FI*/}/*STD_ERROR*/void rT38make(T38 *C){
C->_output_stream=stderr;
}

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