/*===========================================================================*/
/*   (Engine/interp.scm)                                                     */
/*   Bigloo (2.6b)                                                           */
/*   Inria -- Sophia Antipolis (c)       Mon Dec 15 12:14:36 CET 2003        */
/*===========================================================================*/
/* COMPILATION: (/users/serrano/prgm/project/bigloo/bin/bigloo -q -afile .afile -fsharing -fno-reflection -cc gcc-2.95 -lib-dir /users/serrano/prgm/project/bigloo/lib/2.6b -unsafev -no-hello -O2 -rm -unsafe -s -indent Engine/interp.scm)*/
/* GC selection */
#define THE_GC BOEHM_GC

#include <bigloo.h>

BGL_EXPORTED_DECL obj_t BGl_modulezd2initializa7ationz75zzengine_interpz00(long, char *);
extern obj_t BGl_modulezd2initializa7ationz75zzengine_paramz00(long, char *);
BGL_IMPORT obj_t BGl_modulezd2initializa7ationz75zz__errorz00(long, char *);
BGL_IMPORT obj_t BGl_modulezd2initializa7ationz75zz__osz00(long, char *);
BGL_IMPORT obj_t BGl_modulezd2initializa7ationz75zz__readerz00(long, char *);
BGL_IMPORT obj_t BGl_modulezd2initializa7ationz75zz__evalz00(long, char *);
BGL_IMPORT obj_t BGl_modulezd2initializa7ationz75zz__r4_pairs_and_lists_6_3z00(long, char *);
BGL_IMPORT obj_t command_line;
BGL_IMPORT obj_t BGl_findzd2filezf2pathz20zz__osz00(obj_t, obj_t);
static obj_t BGl_interpzd2parsezd2argsz00zzengine_interpz00(obj_t);
extern obj_t BGl_za2srczd2filesza2zd2zzengine_paramz00;
BGL_IMPORT obj_t bgl_reverse(obj_t);
BGL_IMPORT obj_t BGl_readz00zz__readerz00(obj_t);
BGL_IMPORT obj_t BGl_loadqz00zz__evalz00(obj_t);
BGL_IMPORT obj_t BGl_evalz00zz__evalz00(obj_t, obj_t);
BGL_IMPORT obj_t display_string(obj_t, obj_t);
BGL_IMPORT obj_t BGl_replz00zz__evalz00();
BGL_IMPORT obj_t BGl_getenvz00zz__osz00(char *);
BGL_EXPORTED_DECL obj_t BGl_interpz00zzengine_interpz00(obj_t, obj_t, obj_t, obj_t, obj_t, obj_t);
BGL_IMPORT bool_t bigloo_strcmp(obj_t, obj_t);
BGL_IMPORT obj_t bgl_append2(obj_t, obj_t);
static obj_t BGl_importedzd2moduleszd2initz00zzengine_interpz00();
BGL_IMPORT obj_t BGl_warningz00zz__errorz00(obj_t);
static obj_t BGl_requirezd2initializa7ationz75zzengine_interpz00 = BUNSPEC;
BGL_IMPORT obj_t BGl_za2bigloozd2interpreterza2zd2zz__readerz00;
static obj_t BGl__interpz00zzengine_interpz00(obj_t, obj_t, obj_t, obj_t, obj_t, obj_t, obj_t);
static obj_t BGl_libraryzd2moduleszd2initz00zzengine_interpz00();
BGL_IMPORT obj_t BGl_memberz00zz__r4_pairs_and_lists_6_3z00(obj_t, obj_t);
static bool_t BGl_loadzd2stdinzd2zzengine_interpz00();
static obj_t *__cnst;


DEFINE_EXPORT_PROCEDURE( BGl_interpzd2envzd2zzengine_interpz00, BgL_bgl__interpza700za7za7engine_interpza7001153z00, BGl__interpz00zzengine_interpz00, 0L, 6 );
DEFINE_STRING( BGl_string1142z00zzengine_interpz00, BgL_bgl_string1142za700za7za7engine_interpza7001154z00, "-i", 2 );
DEFINE_STRING( BGl_string1141z00zzengine_interpz00, BgL_bgl_string1141za700za7za7engine_interpza7001155z00, "interp", 6 );
DEFINE_STRING( BGl_string1140z00zzengine_interpz00, BgL_bgl_string1140za700za7za7engine_interpza7001156z00, "Can't file startup file -- ", 27 );
DEFINE_STRING( BGl_string1139z00zzengine_interpz00, BgL_bgl_string1139za700za7za7engine_interpza7001157z00, "Welcome to the interpreter", 26 );



/* module-initialization */
BGL_EXPORTED_DEF obj_t BGl_modulezd2initializa7ationz75zzengine_interpz00(long BgL_checksumz00_86, char * BgL_fromz00_87)
{ AN_OBJECT;
{ 
if(
CBOOL(BGl_requirezd2initializa7ationz75zzengine_interpz00))
{ 
BGl_requirezd2initializa7ationz75zzengine_interpz00 = 
BBOOL(((bool_t)0)); 
BGl_libraryzd2moduleszd2initz00zzengine_interpz00(); 
BGl_importedzd2moduleszd2initz00zzengine_interpz00(); 
return BUNSPEC;}  else 
{ 
return BUNSPEC;} } 
}



/* library-modules-init */
obj_t BGl_libraryzd2moduleszd2initz00zzengine_interpz00()
{ AN_OBJECT;
{ /* ./Engine/interp.scm 15 */
BGl_modulezd2initializa7ationz75zz__osz00(((long)0), "engine_interp"); 
BGl_modulezd2initializa7ationz75zz__r4_pairs_and_lists_6_3z00(((long)0), "engine_interp"); 
BGl_modulezd2initializa7ationz75zz__readerz00(((long)0), "engine_interp"); 
BGl_modulezd2initializa7ationz75zz__evalz00(((long)0), "engine_interp"); 
BGl_modulezd2initializa7ationz75zz__errorz00(((long)0), "engine_interp"); 
return BUNSPEC;} 
}



/* interp */
BGL_EXPORTED_DEF obj_t BGl_interpz00zzengine_interpz00(obj_t BgL_versionz00_1, obj_t BgL_verbosez00_2, obj_t BgL_filesz00_3, obj_t BgL_startupz00_4, obj_t BgL_pathz00_5, obj_t BgL_argsz00_6)
{ AN_OBJECT;
{ /* ./Engine/interp.scm 22 */
BGl_za2bigloozd2interpreterza2zd2zz__readerz00 = BTRUE; 
{ /* ./Engine/interp.scm 24 */
bool_t BgL_test1006z00_8;
{ /* ./Engine/interp.scm 24 */
bool_t BgL_testz00_98;
{ /* ./Engine/interp.scm 24 */
long BgL_auxz00_99;
BgL_auxz00_99 = 
(long)CINT(BgL_verbosez00_2); 
BgL_testz00_98 = 
(BgL_auxz00_99>=((long)0)); } 
if(BgL_testz00_98)
{ /* ./Engine/interp.scm 24 */
if(
PAIRP(BgL_filesz00_3))
{ /* ./Engine/interp.scm 24 */
BgL_test1006z00_8 = ((bool_t)0); }  else 
{ /* ./Engine/interp.scm 24 */
BgL_test1006z00_8 = ((bool_t)1); } }  else 
{ /* ./Engine/interp.scm 24 */
BgL_test1006z00_8 = ((bool_t)0); } } 
if(BgL_test1006z00_8)
{ /* ./Engine/interp.scm 24 */
PROCEDURE_ENTRY(BgL_versionz00_1)(BgL_versionz00_1, BEOA); 
{ /* ./Engine/interp.scm 27 */
obj_t BgL_port1003z00_9;
BgL_port1003z00_9 = 
BGL_CURRENT_OUTPUT_PORT(); 
display_string(BGl_string1139z00zzengine_interpz00, BgL_port1003z00_9); 
WRITE_CHAR(((unsigned char)'\n'), BgL_port1003z00_9); } }  else 
{ /* ./Engine/interp.scm 24 */BFALSE; } } 
command_line = 
BGl_interpzd2parsezd2argsz00zzengine_interpz00(BgL_argsz00_6); 
{ /* ./Engine/interp.scm 31 */
bool_t BgL_test1016z00_12;
BgL_test1016z00_12 = 
STRINGP(BgL_startupz00_4); 
if(BgL_test1016z00_12)
{ /* ./Engine/interp.scm 32 */
obj_t BgL_pathz00_13;
{ /* ./Engine/interp.scm 32 */
obj_t BgL_homez00_21;
BgL_homez00_21 = 
BGl_getenvz00zz__osz00("HOME"); 
{ /* ./Engine/interp.scm 33 */
bool_t BgL_test1033z00_22;
BgL_test1033z00_22 = 
STRINGP(BgL_homez00_21); 
if(BgL_test1033z00_22)
{ /* ./Engine/interp.scm 33 */
BgL_pathz00_13 = 
MAKE_PAIR(BgL_homez00_21, BgL_pathz00_5); }  else 
{ /* ./Engine/interp.scm 33 */
BgL_pathz00_13 = BgL_pathz00_5; } } } 
{ /* ./Engine/interp.scm 36 */
obj_t BgL_fstartupz00_14;
BgL_fstartupz00_14 = 
BGl_findzd2filezf2pathz20zz__osz00(BgL_startupz00_4, BgL_pathz00_13); 
if(
CBOOL(BgL_fstartupz00_14))
{ /* ./Engine/interp.scm 37 */
BGl_loadqz00zz__evalz00(BgL_startupz00_4); }  else 
{ /* ./Engine/interp.scm 39 */
obj_t BgL_list1019z00_15;
{ /* ./Engine/interp.scm 39 */
obj_t BgL_arg1022z00_17;
{ /* ./Engine/interp.scm 39 */
obj_t BgL_arg1025z00_18;
{ /* ./Engine/interp.scm 39 */
obj_t BgL_arg1029z00_20;
BgL_arg1029z00_20 = 
MAKE_PAIR(BgL_startupz00_4, BNIL); 
BgL_arg1025z00_18 = 
MAKE_PAIR(BGl_string1140z00zzengine_interpz00, BgL_arg1029z00_20); } 
{ /* ./Engine/interp.scm 39 */
obj_t BgL_auxz00_123;
BgL_auxz00_123 = 
BCHAR(((unsigned char)'\n')); 
BgL_arg1022z00_17 = 
MAKE_PAIR(BgL_auxz00_123, BgL_arg1025z00_18); } } 
BgL_list1019z00_15 = 
MAKE_PAIR(BGl_string1141z00zzengine_interpz00, BgL_arg1022z00_17); } 
BGl_warningz00zz__errorz00(BgL_list1019z00_15); } } }  else 
{ /* ./Engine/interp.scm 31 */BFALSE; } } 
{ /* ./Engine/interp.scm 43 */
bool_t BgL_test1038z00_23;
BgL_test1038z00_23 = 
PAIRP(BgL_filesz00_3); 
if(BgL_test1038z00_23)
{ 
obj_t BgL_l1004z00_24;
{ /* ./Engine/interp.scm 44 */
bool_t BgL_auxz00_130;
BgL_l1004z00_24 = BgL_filesz00_3; 
BgL_forzd2each1005zd2_25:
{ /* ./Engine/interp.scm 44 */
bool_t BgL_test1040z00_26;
BgL_test1040z00_26 = 
PAIRP(BgL_l1004z00_24); 
if(BgL_test1040z00_26)
{ /* ./Engine/interp.scm 44 */
{ /* ./Engine/interp.scm 44 */
obj_t BgL_fz00_27;
BgL_fz00_27 = 
CAR(BgL_l1004z00_24); 
{ /* ./Engine/interp.scm 44 */
bool_t BgL_test1041z00_28;
BgL_test1041z00_28 = 
STRINGP(BgL_fz00_27); 
if(BgL_test1041z00_28)
{ /* ./Engine/interp.scm 44 */
BGl_loadqz00zz__evalz00(BgL_fz00_27); }  else 
{ /* ./Engine/interp.scm 44 */
bool_t BgL_auxz00_137;
BgL_auxz00_137 = 
BGl_loadzd2stdinzd2zzengine_interpz00(); 
BBOOL(BgL_auxz00_137); } } } 
{ /* ./Engine/interp.scm 44 */
obj_t BgL_arg1047z00_29;
BgL_arg1047z00_29 = 
CDR(BgL_l1004z00_24); 
{ 
obj_t BgL_l1004z00_141;
BgL_l1004z00_141 = BgL_arg1047z00_29; 
BgL_l1004z00_24 = BgL_l1004z00_141; 
goto BgL_forzd2each1005zd2_25;} } }  else 
{ /* ./Engine/interp.scm 44 */
BgL_auxz00_130 = ((bool_t)1); } } 
BBOOL(BgL_auxz00_130); } }  else 
{ /* ./Engine/interp.scm 43 */
BGl_replz00zz__evalz00(); } } 
return 
BINT(((long)0));} 
}



/* _interp */
obj_t BGl__interpz00zzengine_interpz00(obj_t BgL_envz00_79, obj_t BgL_versionz00_80, obj_t BgL_verbosez00_81, obj_t BgL_filesz00_82, obj_t BgL_startupz00_83, obj_t BgL_pathz00_84, obj_t BgL_argsz00_85)
{ AN_OBJECT;
{ /* ./Engine/interp.scm 22 */
return 
BGl_interpz00zzengine_interpz00(BgL_versionz00_80, BgL_verbosez00_81, BgL_filesz00_82, BgL_startupz00_83, BgL_pathz00_84, BgL_argsz00_85);} 
}



/* load-stdin */
bool_t BGl_loadzd2stdinzd2zzengine_interpz00()
{ AN_OBJECT;
{ /* ./Engine/interp.scm 51 */
{ 
obj_t BgL_ez00_30;
{ /* ./Engine/interp.scm 52 */
obj_t BgL_arg1054z00_32;
{ /* ./Engine/interp.scm 52 */
obj_t BgL_arg1058z00_33;
BgL_arg1058z00_33 = 
BGL_CURRENT_INPUT_PORT(); 
{ /* ./Engine/interp.scm 52 */
obj_t BgL_list1060z00_34;
BgL_list1060z00_34 = 
MAKE_PAIR(BgL_arg1058z00_33, BNIL); 
BgL_arg1054z00_32 = 
BGl_readz00zz__readerz00(BgL_list1060z00_34); } } 
BgL_ez00_30 = BgL_arg1054z00_32; 
BgL_loopz00_31:
{ /* ./Engine/interp.scm 53 */
bool_t BgL_test1063z00_35;
BgL_test1063z00_35 = 
EOF_OBJECTP(BgL_ez00_30); 
if(BgL_test1063z00_35)
{ /* ./Engine/interp.scm 53 */
return ((bool_t)0);}  else 
{ /* ./Engine/interp.scm 53 */
BGl_evalz00zz__evalz00(BgL_ez00_30, BNIL); 
{ /* ./Engine/interp.scm 56 */
obj_t BgL_arg1067z00_37;
{ /* ./Engine/interp.scm 56 */
obj_t BgL_arg1075z00_38;
BgL_arg1075z00_38 = 
BGL_CURRENT_INPUT_PORT(); 
{ /* ./Engine/interp.scm 56 */
obj_t BgL_list1077z00_39;
BgL_list1077z00_39 = 
MAKE_PAIR(BgL_arg1075z00_38, BNIL); 
BgL_arg1067z00_37 = 
BGl_readz00zz__readerz00(BgL_list1077z00_39); } } 
{ 
obj_t BgL_ez00_155;
BgL_ez00_155 = BgL_arg1067z00_37; 
BgL_ez00_30 = BgL_ez00_155; 
goto BgL_loopz00_31;} } } } } } } 
}



/* interp-parse-args */
obj_t BGl_interpzd2parsezd2argsz00zzengine_interpz00(obj_t BgL_argsz00_7)
{ AN_OBJECT;
{ /* ./Engine/interp.scm 61 */
{ 
obj_t BgL_argsz00_40;obj_t BgL_resz00_41;
{ /* ./Engine/interp.scm 62 */
obj_t BgL_arg1084z00_43;
BgL_arg1084z00_43 = 
CDR(BgL_argsz00_7); 
BgL_argsz00_40 = BgL_arg1084z00_43; 
BgL_resz00_41 = BNIL; 
BgL_loopz00_42:
{ /* ./Engine/interp.scm 65 */
bool_t BgL_test1088z00_45;
BgL_test1088z00_45 = 
NULLP(BgL_argsz00_40); 
if(BgL_test1088z00_45)
{ /* ./Engine/interp.scm 65 */
{ /* ./Engine/interp.scm 66 */
obj_t BgL_arg1090z00_46;
BgL_arg1090z00_46 = 
bgl_reverse(BgL_resz00_41); 
return 
bgl_append2(BGl_za2srczd2filesza2zd2zzengine_paramz00, BgL_arg1090z00_46);} }  else 
{ /* ./Engine/interp.scm 67 */
bool_t BgL_test1093z00_47;
{ /* ./Engine/interp.scm 67 */
obj_t BgL_arg1118z00_55;
BgL_arg1118z00_55 = 
CAR(BgL_argsz00_40); 
BgL_test1093z00_47 = 
bigloo_strcmp(BgL_arg1118z00_55, BGl_string1142z00zzengine_interpz00); } 
if(BgL_test1093z00_47)
{ /* ./Engine/interp.scm 67 */
{ /* ./Engine/interp.scm 68 */
obj_t BgL_arg1096z00_48;
BgL_arg1096z00_48 = 
CDR(BgL_argsz00_40); 
{ 
obj_t BgL_argsz00_165;
BgL_argsz00_165 = BgL_arg1096z00_48; 
BgL_argsz00_40 = BgL_argsz00_165; 
goto BgL_loopz00_42;} } }  else 
{ /* ./Engine/interp.scm 69 */
bool_t BgL_test1099z00_49;
{ /* ./Engine/interp.scm 69 */
obj_t BgL_arg1114z00_54;
BgL_arg1114z00_54 = 
CAR(BgL_argsz00_40); 
{ /* ./Engine/interp.scm 69 */
obj_t BgL_auxz00_167;
BgL_auxz00_167 = 
BGl_memberz00zz__r4_pairs_and_lists_6_3z00(BgL_arg1114z00_54, BGl_za2srczd2filesza2zd2zzengine_paramz00); 
BgL_test1099z00_49 = 
CBOOL(BgL_auxz00_167); } } 
if(BgL_test1099z00_49)
{ /* ./Engine/interp.scm 69 */
{ /* ./Engine/interp.scm 70 */
obj_t BgL_arg1101z00_50;
BgL_arg1101z00_50 = 
CDR(BgL_argsz00_40); 
{ 
obj_t BgL_argsz00_172;
BgL_argsz00_172 = BgL_arg1101z00_50; 
BgL_argsz00_40 = BgL_argsz00_172; 
goto BgL_loopz00_42;} } }  else 
{ /* ./Engine/interp.scm 69 */
{ /* ./Engine/interp.scm 72 */
obj_t BgL_arg1105z00_51;obj_t BgL_arg1106z00_52;
BgL_arg1105z00_51 = 
CDR(BgL_argsz00_40); 
{ /* ./Engine/interp.scm 72 */
obj_t BgL_arg1110z00_53;
BgL_arg1110z00_53 = 
CAR(BgL_argsz00_40); 
BgL_arg1106z00_52 = 
MAKE_PAIR(BgL_arg1110z00_53, BgL_resz00_41); } 
{ 
obj_t BgL_resz00_177;obj_t BgL_argsz00_176;
BgL_argsz00_176 = BgL_arg1105z00_51; 
BgL_resz00_177 = BgL_arg1106z00_52; 
BgL_resz00_41 = BgL_resz00_177; 
BgL_argsz00_40 = BgL_argsz00_176; 
goto BgL_loopz00_42;} } } } } } } } } 
}



/* imported-modules-init */
obj_t BGl_importedzd2moduleszd2initz00zzengine_interpz00()
{ AN_OBJECT;
{ /* ./Engine/interp.scm 15 */
return 
BGl_modulezd2initializa7ationz75zzengine_paramz00(((long)14260), "engine_interp");} 
}

