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

This is compile_to_c24.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_DEBUG*/T0* rT223current_type(T223 *C){
T0* R=NULL;
/*IF*/if (((int)(C)->_run_compound)) {
R=((T142*)(C)->_run_compound)->_current_type;
}
/*FI*/return R;
}
/*E_DEBUG*/T0* rT223to_runnable(T223 *C,T0* a1){
T0* R=NULL;
/*IF*/if (rT47boost((T47*)oRBC27eiffel_run_control)) {
C->_run_compound=a1;
R=(T0 *)C;
}
 else if (!((C)->_run_compound)) {
C->_run_compound=a1;
/*IF*/if (((int)(C)->_compound)) {
C->_compound=rT142to_runnable((T142*)(C)->_compound,rT223current_type(C));
}
/*FI*/R=(T0 *)C;
}
 else if (((T0 *)(C)->_run_compound)==((T0 *)a1)) {
R=(T0 *)C;
}
else {
{T223 *n=((T223*)se_new(223));
rT223make(n,(C)->_start_position,(C)->_list,(C)->_compound);
R=(T0 *)n;}
R=rT223to_runnable((T223*)R,a1);
}
/*FI*/return R;
}
/*E_DEBUG*/T0* rT223add_comment(T223 *C,T0* a1){
T0* R=NULL;
/*IF*/if ((!(a1))||((rT63count((T63*)a1))==(0))) {
R=(T0 *)C;
}
 else {/*AT*//*IF*/if ((rT63count((T63*)a1))==(1)) {
R=(T0 *)C;
}
else {
{T224 *n=((T224*)se_new(224));
rT224make(n,(T0 *)C,a1);
R=(T0 *)n;}}
/*FI*/}
/*FI*/return R;
}
/*E_DEBUG*/int rT223use_current(T223 *C){
int R=0;
/*IF*/if (rT47all_check((T47*)oRBC27eiffel_run_control)) {
/*IF*/if (((int)(C)->_compound)) {
R=rT142use_current((T142*)(C)->_compound);
}
/*FI*/}
/*FI*/return R;
}
/*E_DEBUG*/void rT223compile_to_c(T223 *C){
/*IF*/if (rT47all_check((T47*)oRBC27eiffel_run_control)) {
/*IF*/if (((int)(C)->_compound)) {
rT142compile_to_c((T142*)(C)->_compound);
}
/*FI*/}
/*FI*/}/*E_DEBUG*/void rT223make(T223 *C,T0* a1,T0* a2,T0* a3){
C->_start_position=a1;
C->_list=a2;
C->_compound=a3;
}/*CREATION_CLAUSE*/void rT134fatal_error(/*C*/T0* a1){
rT48fatal_error(a1);
}/*CREATION_CLAUSE*/T0* rT134start_position(T134 *C){
T0* R=NULL;
R=/*XrT*FEATURE_NAME*/((T70*)rT130item((T130*)(C)->_procedure_list,1))->_start_position;
return R;
}
/*CREATION_CLAUSE*/T0* rT134expanded_initializer(T134 *C,T0* a1){
T0* R=NULL;
R=rT269get_feature((T269*)XrT62run_class(a1),rT130item((T130*)(C)->_procedure_list,1));
return R;
}
/*CREATION_CLAUSE*/int rT134has(T134 *C,T0* a1){
int R=0;
R=rT130has((T130*)(C)->_procedure_list,a1);
return R;
}
/*CREATION_CLAUSE*/void rT134check_expanded_with(T134 *C,T0* a1){
T0* _rf3=NULL;
T0* _rf=NULL;
/*IF*/if ((rT130count((T130*)(C)->_procedure_list))>(1)) {
rT48add_type(a1,(T0 *)ms101_27);
rT48add_position(rT134start_position(C));
/*[IRF3:fatal_error_vtec_2*/rT134fatal_error((T0 *)ms9_27);
/*]*/
}
/*FI*/_rf=rT269get_feature((T269*)XrT62run_class(a1),rT130item((T130*)(C)->_procedure_list,1));
/*IF*/if (!(_rf)) {
rT48add_position(rT134start_position(C));
rT48append((T0 *)ms2_134);
rT48add_type(a1,(T0 *)ms3_134);
/*[IRF3:print_as_fatal_error*/rT48do_print((T0 *)ms4_48);
rT48die_with_code(1);
/*]*/
}
/*FI*/_rf3=_rf;
if ((int)_rf3) switch (((T0 *)_rf3)->id) {
case 274: 
break;
default:
_rf3 = NULL;
};/*IF*/if (!(_rf3)) {
rT48add_position(rT134start_position(C));
rT48add_position(XrT268start_position(_rf));
rT134fatal_error((T0 *)ms4_134);
}
/*FI*//*IF*/if ((rT274arg_count((T274*)_rf3))>(0)) {
rT48add_type(a1,(T0 *)ms101_27);
rT48add_position(rT134start_position(C));
rT48add_position(rT274start_position((T274*)_rf3));
rT48append((T0 *)ms5_134);
/*[IRF3:fatal_error_vtec_2*/rT134fatal_error((T0 *)ms9_27);
/*]*/
}
/*FI*/}/*CREATION_CLAUSE*/void rT134make(T134 *C,T0* a1,T0* a2,T0* a3){
C->_clients=a1;
C->_comment=a2;
{T130 *n=((T130*)se_new(130));
rT130make(n,a3);
C->_procedure_list=(T0 *)n;}
}/*CREATION_CLAUSE_LIST*/T0* rT135get_clause(T135 *C,T0* a1){
T0* R=NULL;
int _i=0;
_i=1;
while (!(((_i)>(((T136*)(C)->_list)->_upper))||(rT134has((T134*)rT136item((T136*)(C)->_list,_i),a1)))) {
_i=(_i)+(1);
}
/*IF*/if ((_i)<=(((T136*)(C)->_list)->_upper)) {
R=rT136item((T136*)(C)->_list,_i);
}
/*FI*/return R;
}
/*CREATION_CLAUSE_LIST*/void rT135fatal_error(/*C*/T0* a1){
rT48fatal_error(a1);
}/*CREATION_CLAUSE_LIST*/void rT135add_last(T135 *C,T0* a1){
rT136add_last((T136*)(C)->_list,a1);
}/*CREATION_CLAUSE_LIST*/T0* rT135expanded_initializer(T135 *C,T0* a1){
T0* R=NULL;
R=rT134expanded_initializer((T134*)rT136item((T136*)(C)->_list,1),a1);
return R;
}
/*CREATION_CLAUSE_LIST*/void rT135check_expanded_with(T135 *C,T0* a1){
/*IF*/if ((((T136*)(C)->_list)->_upper)>(1)) {
rT48add_type(a1,(T0 *)ms101_27);
rT48add_position(rT134start_position((T134*)rT136item((T136*)(C)->_list,1)));
rT48add_position(rT134start_position((T134*)rT136item((T136*)(C)->_list,2)));
/*[IRF3:fatal_error_vtec_2*/rT135fatal_error((T0 *)ms9_27);
/*]*/
}
/*FI*/rT134check_expanded_with((T134*)rT136item((T136*)(C)->_list,1),a1);
}/*IFTHENLIST*/T0* rT230to_runnable(T230 *C,T0* a1){
T0* R=NULL;
int _i=0;
int _ne=0;
/*IF*/if (((int)(C)->_run_compound)) {
{T230 *n=((T230*)se_new(230));
/*[IRF3:make*//*AW*/(n)->_list=(rT231twin((T231*)(C)->_list));/*]*/
R=(T0 *)n;}
R=rT230to_runnable((T230*)R,a1);
}
else {
C->_run_compound=a1;
_ne=/*(IRF4*/((T48*)oRBC27eh)->_nb_errors/*)*/;
_i=1;
while (!((((_i)>(((T231*)(C)->_list)->_upper))||(((/*(IRF4*/((T48*)oRBC27eh)->_nb_errors/*)*/)-(_ne))>(0))))) {
rT231put((T231*)(C)->_list,rT229to_runnable((T229*)rT231item((T231*)(C)->_list,_i),a1),_i);
_i=(_i)+(1);
}
R=(T0 *)C;
}
/*FI*/return R;
}
/*IFTHENLIST*/int rT230use_current(T230 *C){
int R=0;
int _i=0;
_i=1;
while (!(((_i)>(((T231*)(C)->_list)->_upper))||(R))) {
R=rT229use_current((T229*)rT231item((T231*)(C)->_list,_i));
_i=(_i)+(1);
}
return R;
}
/*IFTHENLIST*/void rT230add_last(T230 *C,T0* a1){
rT231add_last((T231*)(C)->_list,a1);
}/*IFTHENLIST*/int rT230compile_to_c(T230 *C){
int R=0;
int _i=0;
int _previous=0;
int _state=0;
_i=1;
while (!((_state)==(2))) {
{int iv1=_state;
if (0 == iv1) goto l476;
goto l477;
 l476: ;
/*IF*/if ((_i)>(((T231*)(C)->_list)->_upper)) {
_state=2;
R=_previous;
}
else {
_previous=rT229compile_to_c((T229*)rT231item((T231*)(C)->_list,_i),0);
{int iv2=_previous;
if (1012 == iv2) goto l479;
goto l480;
 l479: ;
_state=1;
goto l478;
 l480: ;
if (1011 == iv2) goto l481;
goto l482;
 l481: ;
goto l478;
 l482: ;
if (1010 == iv2) goto l483;
goto l484;
 l483: ;
R=1010;
_state=2;
goto l478;
 l484: ;
 l478: ;
}
}
/*FI*/goto l475;
 l477: ;
/*IF*/if ((_i)>(((T231*)(C)->_list)->_upper)) {
_state=2;
{int iv2=_previous;
if (1010 == iv2) goto l486;
goto l487;
 l486: ;
R=1010;
goto l485;
 l487: ;
R=1012;
 l485: ;
}
}
else {
_previous=rT229compile_to_c((T229*)rT231item((T231*)(C)->_list,_i),1);
{int iv2=_previous;
if (1012 == iv2) goto l489;
goto l490;
 l489: ;
goto l488;
 l490: ;
if (1011 == iv2) goto l491;
goto l492;
 l491: ;
goto l488;
 l492: ;
if (1010 == iv2) goto l493;
goto l494;
 l493: ;
_state=2;
R=1010;
goto l488;
 l494: ;
 l488: ;
}
}
/*FI*/ l475: ;
}
_i=(_i)+(1);
}
return R;
}
/*IFTHEN*/T0* rT229current_type(T229 *C){
T0* R=NULL;
R=((T142*)(C)->_run_compound)->_current_type;
return R;
}
/*IFTHEN*/T0* rT229to_runnable(T229 *C,T0* a1){
T0* R=NULL;
T0* _t=NULL;
T0* _tc=NULL;
T0* _e=NULL;
/*IF*/if (!((C)->_run_compound)) {
C->_run_compound=a1;
_e=XrT72to_runnable((C)->_expression,rT229current_type(C));
/*IF*/if (!(_e)) {
rT229error(XrT72start_position((C)->_expression),(T0 *)ms8_229);
}
else {
C->_expression=_e;
_t=XrT72result_type((C)->_expression);
/*IF*/if (!(XrT62is_boolean(_t))) {
rT48append((T0 *)ms9_229);
rT48add_type(XrT72result_type((C)->_expression),(T0 *)ms107_27);
rT48add_position(XrT72start_position((C)->_expression));
rT48print_as_error((T48*)oRBC27eh);
}
/*FI*/}
/*FI*//*IF*/if (((int)(C)->_then_compound)) {
_tc=rT142to_runnable((T142*)(C)->_then_compound,rT229current_type(C));
/*IF*/if (((int)_tc)) {
C->_then_compound=_tc;
}
/*FI*/}
/*FI*//*IF*/if ((/*(IRF4*/((T48*)oRBC27eh)->_nb_errors/*)*/)==(0)) {
R=(T0 *)C;
}
/*FI*/}
else {
{T229 *n=((T229*)se_new(229));
rT229make(n,(C)->_expression,(C)->_then_compound);
R=(T0 *)n;}
R=rT229to_runnable((T229*)R,a1);
}
/*FI*/return R;
}
/*IFTHEN*/void rT229error(/*C*/T0* a1,T0* a2){
rT48add_position(a1);
rT48error((T48*)oRBC27eh,a2);
}/*IFTHEN*/void rT229print_else(/*C*/int a1){
/*IF*/if (a1) {
rT44put_string((T44*)oRBC27cpp,(T0 *)ms10_229);
}
/*FI*/}/*IFTHEN*/int rT229use_current(T229 *C){
int R=0;
R=XrT72use_current((C)->_expression);
/*IF*/if ((!(R))&&(((int)(C)->_then_compound))) {
R=rT142use_current((T142*)(C)->_then_compound);
}
/*FI*/return R;
}
/*IFTHEN*/int rT229compile_to_c(T229 *C,int a1){
int R=0;
int _trace=0;
/*IF*/if (XrT72is_static((C)->_expression)) {
R=XrT72static_value((C)->_expression);
rT44incr_static_expression_count((T44*)oRBC27cpp);
/*IF*/if ((R)==(1)) {
rT229print_else(a1);
rT44put_string((T44*)oRBC27cpp,(T0 *)ms1_229);
/*IF*/if (((int)(C)->_then_compound)) {
rT142compile_to_c((T142*)(C)->_then_compound);
}
/*FI*/rT44put_string((T44*)oRBC27cpp,(T0 *)ms2_229);
R=1010;
}
else {
rT44put_string((T44*)oRBC27cpp,(T0 *)ms3_229);
R=1011;
}
/*FI*/}
else {
R=1012;
_trace=(!(XrT72c_simple((C)->_expression)))&&(rT47no_check((T47*)oRBC27eiffel_run_control));
rT229print_else(a1);
rT44put_string((T44*)oRBC27cpp,(T0 *)ms4_229);
/*IF*/if (_trace) {
rT44trace_boolean_expression((T44*)oRBC27cpp,(C)->_expression);
}
else {
XrT72compile_to_c((C)->_expression);
}
/*FI*/rT44put_string((T44*)oRBC27cpp,(T0 *)ms5_229);
/*IF*/if (((int)(C)->_then_compound)) {
rT142compile_to_c((T142*)(C)->_then_compound);
}
/*FI*/rT44put_string((T44*)oRBC27cpp,(T0 *)ms6_229);
}
/*FI*/return R;
}
/*IFTHEN*/void rT229make(T229 *C,T0* a1,T0* a2){
C->_expression=a1;
C->_then_compound=a2;
}/*IFTHENELSE*/T0* rT226current_type(T226 *C){
T0* R=NULL;
/*IF*/if (((int)(C)->_run_compound)) {
R=((T142*)(C)->_run_compound)->_current_type;
}
/*FI*/return R;
}
/*IFTHENELSE*/T0* rT226twin(T226 *C){
T0* R=NULL;
/*IF*//*AF*//*AE*/
R=(T0 *)se_new(C->id);AF_1
rT226copy((T226*)R,(T0 *)C);
AF_0
/*FI*/return R;
}
/*IFTHENELSE*/T0* rT226to_runnable(T226 *C,T0* a1){
T0* R=NULL;
T0* _ec=NULL;
T0* _itl=NULL;
int _ne=0;
_ne=/*(IRF4*/((T48*)oRBC27eh)->_nb_errors/*)*/;
/*IF*/if (!((C)->_run_compound)) {
C->_run_compound=a1;
_itl=rT230to_runnable((T230*)(C)->_ifthenlist,a1);
/*IF*/if (!(_itl)) {
}
else {
C->_ifthenlist=_itl;
}
/*FI*//*IF*/if ((((/*(IRF4*/((T48*)oRBC27eh)->_nb_errors/*)*/)-(_ne))==(0))&&(((int)(C)->_else_compound))) {
_ec=rT142to_runnable((T142*)(C)->_else_compound,rT226current_type(C));
/*IF*/if (!(_ec)) {
}
else {
C->_else_compound=_ec;
}
/*FI*/}
/*FI*//*IF*/if (((int)_itl)) {
R=(T0 *)C;
}
/*FI*/}
else {
R=rT226to_runnable((T226*)rT226twin(C),a1);
}
/*FI*/return R;
}
/*IFTHENELSE*/T0* rT226add_comment(T226 *C,T0* a1){
T0* R=NULL;
/*IF*/if ((!(a1))||((rT63count((T63*)a1))==(0))) {
R=(T0 *)C;
}
 else {/*AT*//*IF*/if ((rT63count((T63*)a1))==(1)) {
R=(T0 *)C;
}
else {
{T224 *n=((T224*)se_new(224));
rT224make(n,(T0 *)C,a1);
R=(T0 *)n;}}
/*FI*/}
/*FI*/return R;
}
/*IFTHENELSE*/int rT226use_current(T226 *C){
int R=0;
/*IF*/if (rT230use_current((T230*)(C)->_ifthenlist)) {
R=1;
}
 else if (((int)(C)->_else_compound)) {
R=rT142use_current((T142*)(C)->_else_compound);
}
/*FI*/return R;
}
/*IFTHENELSE*/void rT226add_if_then(T226 *C,T0* a1,T0* a2){
T0* _ifthen=NULL;
{T229 *n=((T229*)se_new(229));
rT229make(n,a1,a2);
_ifthen=(T0 *)n;}
/*IF*/if (!((C)->_ifthenlist)) {
{T230 *n=((T230*)se_new(230));
/*[IRF3:make*//*AW*/(n)->_list=(ma(231,0,1,_ifthen));/*]*/
C->_ifthenlist=(T0 *)n;}
}
else {
rT230add_last((T230*)(C)->_ifthenlist,_ifthen);
}
/*FI*/}/*IFTHENELSE*/void rT226compile_to_c(T226 *C){
int _static_value=0;
rT44put_string((T44*)oRBC27cpp,(T0 *)ms1_226);
_static_value=rT230compile_to_c((T230*)(C)->_ifthenlist);
{int iv1=_static_value;
if (1011 == iv1) goto l496;
goto l497;
 l496: ;
rT44put_string((T44*)oRBC27cpp,(T0 *)ms2_226);
/*IF*/if (((int)(C)->_else_compound)) {
rT142compile_to_c((T142*)(C)->_else_compound);
}
/*FI*/goto l495;
 l497: ;
if (1010 == iv1) goto l498;
goto l499;
 l498: ;
goto l495;
 l499: ;
if (1012 == iv1) goto l500;
goto l501;
 l500: ;
/*IF*/if (((int)(C)->_else_compound)) {
rT44put_string((T44*)oRBC27cpp,(T0 *)ms3_226);
rT142compile_to_c((T142*)(C)->_else_compound);
rT44put_string((T44*)oRBC27cpp,(T0 *)ms4_226);
}
/*FI*/goto l495;
 l501: ;
 l495: ;
}
rT44put_string((T44*)oRBC27cpp,(T0 *)ms5_226);
}/*IFTHENELSE*/void rT226copy(T226 *C,T0* a1){
C->_start_position=((T226*)a1)->_start_position;
C->_ifthenlist=((T226*)a1)->_ifthenlist;
C->_else_compound=((T226*)a1)->_else_compound;
}

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