home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / eiffel / smalleif.97 / se.t / SmallEiffel / bin_c / compile1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-02  |  24.2 KB  |  1,135 lines

  1. /* ANSI C code generated by SmallEiffel. */
  2. /*
  3. -- SmallEiffel  -- Release (- 0.97)    --      FRANCE
  4. -- Copyright (C), 1994 - Dominique COLNET and Suzanne COLLIN 
  5. -- University Henri Poincare' - Nancy 1 - email colnet@loria.fr 
  6. -- CRIN (Centre de Recherche en Informatique de Nancy)
  7. -- FRANCE 
  8. */
  9. #include "compile.h"
  10. T0 *new(int id){
  11. int sz=s[id];
  12. T0 *n=malloc(sz);
  13. memset(n,0,sz);
  14. n->id=id;
  15. return n;
  16. }
  17. void rT33die_with_code(T33 *C,int a1){
  18. exit(a1);
  19. }
  20. void rT33put_string(T33 *C,T0* a1){
  21. int _i=0;
  22. _i=1;
  23. while (!((_i)>(((T7*)a1)->_count))) {
  24. rT33put_character(C,rT7_ix64((T7*)a1,_i));
  25. _i=(_i)+(1);
  26. }
  27. }
  28. T0*oRBC1std_error;
  29. void rT33crash(T33 *C){
  30. rsp();
  31. rT33die_with_code(C,1);
  32. }
  33. void rT33copy(T33 *C,T0 * a1){
  34. /*IF*//*AF*//*AE*/
  35. memcpy(C,a1,s[C->id]);
  36. /*FI*/}
  37. void rT33put_character(T33 *C,char a1){
  38. char _err='\0';
  39. _err=fputc(a1,(C)->_output_stream);
  40. /*IF*/if ((_err)!=(a1)) {
  41. rT33put_string((T33*)oRBC1std_error,(T0 *)ms1);
  42. rT33crash(C);
  43. }
  44. /*FI*/}
  45. void rT33make(T33 *C){
  46. C->_output_stream=stderr;
  47. }
  48. int rT39end_of_input(T39 *C){
  49. int R=0;
  50. R=feof((FILE *)(C)->_input_stream);
  51. return R;
  52. }
  53. int rT39is_connected(T39 *C){
  54. int R=0;
  55. R=((int)(C)->_path);
  56. return R;
  57. }
  58. void rT39disconnect(T39 *C){
  59. int _err=0;
  60. _err=fclose((C)->_input_stream);
  61. C->_path=NULL;
  62. }
  63. T0*oRBC39last_string;
  64. char rT39last_character(T39 *C){
  65. char R='\0';
  66. R=(C)->_last_character_memory;
  67. return R;
  68. }
  69. void rT39connect_to(T39 *C,T0* a1){
  70. /*(IRF3*/((C)->_mode)=((T0 *)ms26);
  71. /*)*/C->_input_stream=rT39fopen(C,a1,(C)->_mode);
  72. /*IF*/{/*AT*/C->_path=a1;
  73. }
  74. /*FI*/}
  75. void rT39skip_separators(T39 *C){
  76. while (!((rT39end_of_input(C))||(!(rT3is_separator(rT39last_character(C)))))) {
  77. rT39read_character(C);
  78. }
  79. }
  80. void * rT39fopen(T39 *C,T0* a1,T0* a2){
  81. void * R=NULL;
  82. rT7extend((T7*)a1,'\0');
  83. rT7extend((T7*)a2,'\0');
  84. R=(T0 *)fopen(((Tstring *)a1)->_storage,((Tstring *)a2)->_storage);
  85. rT7remove_last((T7*)a1,1);
  86. rT7remove_last((T7*)a2,1);
  87. return R;
  88. }
  89. void rT39copy(T39 *C,T0 * a1){
  90. /*IF*//*AF*//*AE*/
  91. memcpy(C,a1,s[C->id]);
  92. /*FI*/}
  93. void rT39read_line_in(T39 *C,T0* a1){
  94. /*(IRF3*/(((T7*)a1)->_count)=(0);
  95. /*)*/rT39read_character(C);
  96. while (!((rT39end_of_input(C))||((rT39last_character(C))==('\12')))) {
  97. rT7extend((T7*)a1,rT39last_character(C));
  98. rT39read_character(C);
  99. }
  100. }
  101. void rT39read_line(T39 *C){
  102. rT39read_line_in(C,oRBC39last_string);
  103. }
  104. void rT39read_word(T39 *C){
  105. rT39skip_separators(C);
  106. /*(IRF3*/(((T7*)oRBC39last_string)->_count)=(0);
  107. /*)*/while (!((rT39end_of_input(C))||(rT3is_separator(rT39last_character(C))))) {
  108. rT7extend((T7*)oRBC39last_string,rT39last_character(C));
  109. rT39read_character(C);
  110. }
  111. }
  112. void rT39read_character(T39 *C){
  113. C->_last_character_memory=fgetc((C)->_input_stream);
  114. }
  115. char rT7_ix64(T7 *C,int a1){
  116. char R='\0';
  117. R=(C->_storage)[a1-1];
  118. return R;
  119. }
  120. void rT7extend(T7 *C,char a1){
  121. C->_count=((C)->_count)+(1);
  122. /*IF*/if (((C)->_capacity)<((C)->_count)) {
  123. /*IF*/if (((C)->_capacity)==(0)) {
  124. C->_capacity=16;
  125. C->_storage=(char *)malloc((size_t)C->_capacity);
  126. }
  127. else {
  128. C->_capacity=((C)->_capacity)+(16);
  129. C->_storage=(char *)realloc(C->_storage,(size_t)C->_capacity);
  130. }
  131. /*FI*/}
  132. /*FI*/rT7put(C,a1,(C)->_count);
  133. }
  134. void rT7to_upper(T7 *C){
  135. int _i=0;
  136. _i=(C)->_count;
  137. while (!((_i)==(0))) {
  138. rT7put(C,rT3to_upper(rT7item(C,_i)),_i);
  139. _i=(_i)-(1);
  140. }
  141. }
  142. void rT7remove_suffix(T7 *C,T0* a1){
  143. rT7remove_last(C,((T7*)a1)->_count);
  144. }
  145. void rT7remove_between(T7 *C,int a1,int a2){
  146. int _i=0;
  147. _i=a2;
  148. while (!((_i)>=((C)->_count))) {
  149. rT7put(C,rT7item(C,(_i)+(1)),((a1)+(_i))-(a2));
  150. _i=(_i)+(1);
  151. }
  152. C->_count=((C)->_count)-(((a2)-(a1))+(1));
  153. }
  154. void rT7remove_first(T7 *C,int a1){
  155. /*IF*/if ((a1)>(0)) {
  156. rT7remove_between(C,1,a1);
  157. }
  158. /*FI*/}
  159. void rT7remove_last(T7 *C,int a1){
  160. C->_count=((C)->_count)-(a1);
  161. }
  162. int rT7has_suffix(T7 *C,T0* a1){
  163. int R=0;
  164. int _i2=0;
  165. int _i1=0;
  166. /*IF*/if ((((T7*)a1)->_count)<=((C)->_count)) {
  167. _i1=(((C)->_count)-(((T7*)a1)->_count))+(1);
  168. _i2=1;
  169. while (!((((_i1)>((C)->_count))||((_i2)>(((T7*)a1)->_count)))||((rT7item(C,_i1))!=(rT7item((T7*)a1,_i2))))) {
  170. _i1=(_i1)+(1);
  171. _i2=(_i2)+(1);
  172. }
  173. R=(_i1)>((C)->_count);
  174. }
  175. /*FI*/return R;
  176. }
  177. char rT7item(T7 *C,int a1){
  178. char R='\0';
  179. R=(C->_storage)[a1-1];
  180. return R;
  181. }
  182. int rT7is_equal(T7 *C,T0* a1){
  183. int R=0;
  184. int _i=0;
  185. /*IF*/if (((T0 *)C)==((T0 *)a1)) {
  186. R=1;
  187. }
  188. else {
  189. _i=(C)->_count;
  190. R=(_i)==(((T7*)a1)->_count);
  191. while (!((!(R))||((_i)==(0)))) {
  192. R=(rT7item(C,_i))==(rT7item((T7*)a1,_i));
  193. _i=(_i)-(1);
  194. }
  195. }
  196. /*FI*/return R;
  197. }
  198. void rT7append(T7 *C,T0* a1){
  199. int _i=0;
  200. _i=1;
  201. while (!((_i)>(((T7*)a1)->_count))) {
  202. rT7extend(C,rT7_ix64((T7*)a1,_i));
  203. _i=(_i)+(1);
  204. }
  205. }
  206. char rT7last(T7 *C){
  207. char R='\0';
  208. R=rT7item(C,(C)->_count);
  209. return R;
  210. }
  211. void rT7put(T7 *C,char a1,int a2){
  212. (C->_storage)[a2-1]=a1;
  213. }
  214. void rT7swap(T7 *C,int a1,int a2){
  215. char _tmp='\0';
  216. _tmp=rT7item(C,a1);
  217. rT7put(C,rT7item(C,a2),a1);
  218. rT7put(C,_tmp,a2);
  219. }
  220. void rT7copy(T7 *C,T0* a1){
  221. int _i=0;
  222. _i=((T7*)a1)->_count;
  223. C->_count=_i;
  224. /*IF*/if ((_i)>(0)) {
  225. /*IF*/if (((C)->_capacity)<(_i)) {
  226. /*IF*/if (((C)->_capacity)==(0)) {
  227. C->_storage=(char *)malloc((size_t)_i);
  228. }
  229. else {
  230. C->_storage=(char *)realloc(C->_storage,(size_t)_i);
  231. }
  232. /*FI*/C->_capacity=_i;
  233. }
  234. /*FI*/while (!((_i)==(0))) {
  235. rT7put(C,rT7item((T7*)a1,_i),_i);
  236. _i=(_i)-(1);
  237. }
  238. }
  239. /*FI*/}
  240. void rT7to_lower(T7 *C){
  241. int _i=0;
  242. _i=(C)->_count;
  243. while (!((_i)==(0))) {
  244. rT7put(C,rT3to_lower(rT7item(C,_i)),_i);
  245. _i=(_i)-(1);
  246. }
  247. }
  248. void rT7make(T7 *C,int a1){
  249. C->_count=0;
  250. /*IF*/if ((a1)>(0)) {
  251. /*IF*/if (((C)->_capacity)<(a1)) {
  252. /*IF*/if (((C)->_capacity)==(0)) {
  253. C->_storage=(char *)malloc((size_t)a1);
  254. }
  255. else {
  256. C->_storage=(char *)realloc(C->_storage,(size_t)a1);
  257. }
  258. /*FI*/C->_capacity=a1;
  259. }
  260. /*FI*/}
  261. /*FI*/}
  262. int rT2min(T2 C,int a1){
  263. int R=0;
  264. /*IF*/if ((C)<(a1)) {
  265. R=C;
  266. }
  267. else {
  268. R=a1;
  269. }
  270. /*FI*/return R;
  271. }
  272. int rT2max(T2 C,int a1){
  273. int R=0;
  274. /*IF*/if ((a1)<(C)) {
  275. R=C;
  276. }
  277. else {
  278. R=a1;
  279. }
  280. /*FI*/return R;
  281. }
  282. char rT2digit(T2 C){
  283. char R='\0';
  284. R=rT7item(ms69,(C)+(1));
  285. return R;
  286. }
  287. void rT2append_in(T2 C,T0* a1){
  288. int _i=0;
  289. int _val=0;
  290. /*IF*/if ((C)==(0)) {
  291. rT7extend((T7*)a1,'0');
  292. }
  293. else {
  294. /*IF*/if ((C)<(0)) {
  295. rT7extend((T7*)a1,'\55');
  296. rT2append_in(-(C),a1);
  297. }
  298. else {
  299. _i=(((T7*)a1)->_count)+(1);
  300. _val=C;
  301. while (!((_val)==(0))) {
  302. rT7extend((T7*)a1,rT2digit((_val)%(10)));
  303. _val=(_val)/(10);
  304. }
  305. _val=((T7*)a1)->_count;
  306. while (!((_i)>=(_val))) {
  307. rT7swap((T7*)a1,_i,_val);
  308. _val=(_val)-(1);
  309. _i=(_i)+(1);
  310. }
  311. }
  312. /*FI*/}
  313. /*FI*/}
  314. T0* rT26get_environment_variable(T26 *C,T0* a1){
  315. T0* R=NULL;
  316. rT7extend((T7*)a1,'\0');
  317. R=((T0 *)getenv(((T7 *)a1)->_storage));
  318. if (R) R=((T0 *)e2s((char *)R));
  319. rT7remove_last((T7*)a1,1);
  320. return R;
  321. }
  322. int ofBC27x_suffix=0;
  323. T0*oRBC27x_suffix;
  324. T0* rT26x_suffix(T26 *C){
  325. T0* R=NULL;
  326. if (ofBC27x_suffix==0){
  327. ofBC27x_suffix=1;
  328. /*IF*/if (((T0 *)(T0 *)ms32)==((T0 *)rT26system_name(C))) {
  329. R=(T0 *)ms47;
  330. }
  331. else {
  332. R=(T0 *)ms48;
  333. }
  334. /*FI*/oRBC27x_suffix=R;}
  335. return oRBC27x_suffix;}
  336. void rT26automat(T26 *C){
  337. T0* _a=NULL;
  338. int _arg=0;
  339. int _state=0;
  340. _arg=1;
  341. while (!(((_arg)>(argument_count))||((_state)>(2)))) {
  342. _a=argument[_arg];
  343. /*IF*/if (rT7is_equal(ms53,_a)) {
  344. C->_c_code=1;
  345. }
  346. else {
  347. rT7extend((T7*)(T0 *)ms29,'\40');
  348. rT7append((T7*)(T0 *)ms29,_a);
  349. {int iv1=_state;
  350. if (0 == iv1) goto l2;
  351. goto l3;
  352.  l2: ;
  353. /*IF*/if ((rT7item((T7*)_a,1))!=('\55')) {
  354. /*IF*/if (rT7has_suffix((T7*)_a,(T0 *)ms54)) {
  355. }
  356.  else if (rT7has_suffix((T7*)_a,(T0 *)ms55)) {
  357. }
  358.  else if (!((C)->_root)) {
  359. C->_root=rT26to_bcn(C,_a);
  360. rT7to_lower((T7*)(C)->_root);
  361. _state=2;
  362. }
  363. /*FI*/}
  364.  else if (rT7is_equal(ms57,_a)) {
  365. _state=1;
  366. }
  367. /*FI*/goto l1;
  368.  l3: ;
  369. if (1 == iv1) goto l4;
  370. goto l5;
  371.  l4: ;
  372. _state=0;
  373. goto l1;
  374.  l5: ;
  375. if (2 == iv1) goto l6;
  376. goto l7;
  377.  l6: ;
  378. _state=0;
  379. goto l1;
  380.  l7: ;
  381.  l1: ;
  382. }
  383. }
  384. /*FI*/_arg=(_arg)+(1);
  385. }
  386. }
  387. T0* rT26to_bcn(T26 *C,T0* a1){
  388. T0* R=NULL;
  389. char _c='\0';
  390. int _i=0;
  391. R=rT26clone(C,a1);
  392. /*IF*/if (rT7has_suffix((T7*)R,(T0 *)ms56)) {
  393. rT7remove_last((T7*)R,2);
  394. }
  395. /*FI*/_i=((T7*)R)->_count;
  396. while (!((_i)==(0))) {
  397. _c=rT7item((T7*)R,_i);
  398. /*IF*/if (rT3is_letter(_c)) {
  399. _i=(_i)-(1);
  400. }
  401.  else if ((_c)==('\137')) {
  402. _i=(_i)-(1);
  403. }
  404.  else if (rT3is_digit(_c)) {
  405. _i=(_i)-(1);
  406. }
  407. else {
  408. rT7remove_first((T7*)R,_i);
  409. _i=0;
  410. }
  411. /*FI*/}
  412. rT7to_upper((T7*)R);
  413. return R;
  414. }
  415. int ofBC27directory_separator=0;
  416. T3 oRBC27directory_separator;
  417. char rT26directory_separator(T26 *C){
  418. char R='\0';
  419. if (ofBC27directory_separator==0){
  420. ofBC27directory_separator=1;
  421. R=rT7last((T7*)rT26small_eiffel_directory(C));
  422. oRBC27directory_separator=R;}
  423. return oRBC27directory_separator;}
  424. void rT26die_with_code(T26 *C,int a1){
  425. exit(a1);
  426. }
  427. void rT26remove(T26 *C){
  428. rT38put_character((T38*)oRBC1std_output,'\40');
  429. rT38put_string((T38*)oRBC1std_output,(T0 *)ms29);
  430. rT26remove_file(C,(T0 *)ms29);
  431. }
  432. void rT26remove_file(T26 *C,T0* a1){
  433. rT7extend((T7*)a1,'\0');
  434. remove(((T7 *)a1)->_storage);
  435. rT7remove_last((T7*)a1,1);
  436. }
  437. T0*oRBC27hlp_file_name;
  438. void rT26add_directory(T26 *C,T0* a1,T0* a2){
  439. rT7append((T7*)a1,a2);
  440. rT7extend((T7*)a1,rT26directory_separator(C));
  441. }
  442. void rT26print_hlp(T26 *C,T0* a1){
  443. rT7copy((T7*)oRBC27hlp_file_name,rT26small_eiffel_directory(C));
  444. rT26add_directory(C,oRBC27hlp_file_name,(T0 *)ms21);
  445. rT7append((T7*)oRBC27hlp_file_name,a1);
  446. /*IF*/if (!(rT7has_suffix((T7*)oRBC27hlp_file_name,(T0 *)ms22))) {
  447. rT7append((T7*)oRBC27hlp_file_name,(T0 *)ms22);
  448. }
  449. /*FI*//*IF*/if (!(rT26file_exists(C,oRBC27hlp_file_name))) {
  450. rT33put_string((T33*)oRBC1std_error,(T0 *)ms24);
  451. rT33put_string((T33*)oRBC1std_error,oRBC27hlp_file_name);
  452. rT33put_string((T33*)oRBC1std_error,(T0 *)ms25);
  453. rT26die_with_code(C,1);
  454. }
  455. /*FI*/rT38append_file((T38*)oRBC1std_output,oRBC27hlp_file_name);
  456. }
  457. void rT26open_read(T26 *C,T0 * a1,T0* a2){
  458. rT39connect_to((T39*)a1,a2);
  459. /*IF*/if (!(rT39is_connected((T39*)a1))) {
  460. rT33put_string((T33*)oRBC1std_error,(T0 *)ms37);
  461. rT33put_string((T33*)oRBC1std_error,a2);
  462. rT33put_string((T33*)oRBC1std_error,(T0 *)ms38);
  463. rT26die_with_code(C,1);
  464. }
  465. /*FI*/}
  466. T0* rT26clone(T26 *C,T0* a1){
  467. T0* R=NULL;
  468. /*IF*/if (((int)a1)) {
  469. R=(T0 *)new(a1->id);
  470. AF_1
  471. XrT28copy(R,a1);
  472. AF_0
  473. }
  474. /*FI*/return R;
  475. }
  476. int ofBC27tmp_file_read=0;
  477. T0*oRBC27tmp_file_read;
  478. T0 * rT26tmp_file_read(/*C*/void){
  479. T0 * R=NULL;
  480. if (ofBC27tmp_file_read==0){
  481. ofBC27tmp_file_read=1;
  482. {T39 *n=((T39*)new(39));
  483. /*(IRF3*/((n)->_mode)=((T0 *)ms26);
  484. /*)*/R=(T0 *)n;}
  485. oRBC27tmp_file_read=R;}
  486. return oRBC27tmp_file_read;}
  487. void rT26system(T26 *C,T0* a1){
  488. rT7extend((T7*)a1,'\0');
  489. system(((T7 *)a1)->_storage);
  490. rT7remove_last((T7*)a1,1);
  491. }
  492. T0*oRBC27system_list;
  493. int ofBC27system_name=0;
  494. T0*oRBC27system_name;
  495. T0* rT26system_name(T26 *C){
  496. T0* R=NULL;
  497. int _i=0;
  498. T0* _path=NULL;
  499. if (ofBC27system_name==0){
  500. ofBC27system_name=1;
  501. _path=rT26clone(C,rT26small_eiffel_directory(C));
  502. rT26add_directory(C,_path,(T0 *)ms33);
  503. rT7append((T7*)_path,(T0 *)ms34);
  504. /*IF*/if (!(rT26file_exists(C,_path))) {
  505. rT33put_string((T33*)oRBC1std_error,(T0 *)ms35);
  506. rT33put_string((T33*)oRBC1std_error,_path);
  507. rT33put_string((T33*)oRBC1std_error,(T0 *)ms36);
  508. rT26die_with_code(C,1);
  509. }
  510. /*FI*/rT26open_read(C,rT26tmp_file_read(),_path);
  511. rT39read_word((T39*)rT26tmp_file_read());
  512. R=oRBC39last_string;
  513. rT39disconnect((T39*)rT26tmp_file_read());
  514. _i=rT40index_of((T40*)oRBC27system_list,R);
  515. /*IF*/if ((_i)>(((T40*)oRBC27system_list)->_upper)) {
  516. rT33put_string((T33*)oRBC1std_error,(T0 *)ms45);
  517. rT33put_string((T33*)oRBC1std_error,_path);
  518. rT33put_string((T33*)oRBC1std_error,(T0 *)ms46);
  519. _i=1;
  520. while (!((_i)>(((T40*)oRBC27system_list)->_upper))) {
  521. rT33put_string((T33*)oRBC1std_error,rT40item((T40*)oRBC27system_list,_i));
  522. rT33put_character((T33*)oRBC1std_error,'\12');
  523. _i=(_i)+(1);
  524. }
  525. }
  526. else {
  527. R=rT40item((T40*)oRBC27system_list,_i);
  528. }
  529. /*FI*/oRBC27system_name=R;}
  530. return oRBC27system_name;}
  531. T0*oRBC1std_output;
  532. int ofBC27small_eiffel_directory=0;
  533. T0*oRBC27small_eiffel_directory;
  534. T0* rT26small_eiffel_directory(T26 *C){
  535. T0* R=NULL;
  536. char _slash='\0';
  537. int _i=0;
  538. if (ofBC27small_eiffel_directory==0){
  539. ofBC27small_eiffel_directory=1;
  540. R=rT26get_environment_variable(C,(T0 *)ms14);
  541. /*IF*/if (!(R)) {
  542. R=rT26clone(C,(T0 *)ms14);
  543. rT7to_upper((T7*)R);
  544. R=rT26get_environment_variable(C,R);
  545. /*IF*/if (((int)R)) {
  546. rT7to_upper((T7*)(T0 *)ms14);
  547. }
  548. /*FI*/}
  549. /*FI*//*IF*/if (!(R)) {
  550. R=(T0 *)ms20;
  551. }
  552. /*FI*/_i=((T7*)R)->_count;
  553. while (!((_i)<(0))) {
  554. _slash=rT7item((T7*)R,_i);
  555. /*IF*/if ((rT3is_letter(_slash))||(rT3is_digit(_slash))) {
  556. _i=(_i)-(1);
  557. }
  558. else {
  559. _i=-(1);
  560. }
  561. /*FI*/}
  562. /*IF*/if ((_i)==(0)) {
  563. rT7extend((T7*)R,'\57');
  564. }
  565.  else if (!((rT7last((T7*)R))==(_slash))) {
  566. rT7extend((T7*)R,_slash);
  567. }
  568. /*FI*/oRBC27small_eiffel_directory=R;}
  569. return oRBC27small_eiffel_directory;}
  570. void rT26copy(T26 *C,T0 * a1){
  571. /*IF*//*AF*//*AE*/
  572. memcpy(C,a1,s[C->id]);
  573. /*FI*/}
  574. int ofBC26make_file=0;
  575. T0*oRBC26make_file;
  576. T0 * rT26make_file(/*C*/void){
  577. T0 * R=NULL;
  578. if (ofBC26make_file==0){
  579. ofBC26make_file=1;
  580. {T39 *n=((T39*)new(39));
  581. /*(IRF3*/((n)->_mode)=((T0 *)ms26);
  582. /*)*/R=(T0 *)n;}
  583. oRBC26make_file=R;}
  584. return oRBC26make_file;}
  585. int ofBC27make_suffix=0;
  586. T0*oRBC27make_suffix;
  587. T0* rT26make_suffix(T26 *C){
  588. T0* R=NULL;
  589. if (ofBC27make_suffix==0){
  590. ofBC27make_suffix=1;
  591. /*IF*/if (((T0 *)(T0 *)ms32)==((T0 *)rT26system_name(C))) {
  592. R=(T0 *)ms58;
  593. }
  594.  else if (((T0 *)(T0 *)ms42)==((T0 *)rT26system_name(C))) {
  595. R=(T0 *)ms59;
  596. }
  597. else {
  598. R=(T0 *)ms60;
  599. }
  600. /*FI*/oRBC27make_suffix=R;}
  601. return oRBC27make_suffix;}
  602. void rT26echo_system(T26 *C){
  603. rT38put_string((T38*)oRBC1std_output,(T0 *)ms29);
  604. rT38put_character((T38*)oRBC1std_output,'\12');
  605. rT26system(C,(T0 *)ms29);
  606. }
  607. void rT26make(T26 *C){
  608. int _i=0;
  609. T0* _str=NULL;
  610. /*IF*/if ((argument_count)<(2)) {
  611. rT33put_string((T33*)oRBC1std_error,(T0 *)ms5);
  612. rT26print_hlp(C,(T0 *)ms28);
  613. rT26die_with_code(C,1);
  614. }
  615. /*FI*//*(IRF3*/(((T7*)(T0 *)ms29)->_count)=(0);
  616. /*)*/rT7append((T7*)(T0 *)ms29,rT26small_eiffel_directory(C));
  617. rT26add_directory(C,(T0 *)ms29,(T0 *)ms30);
  618. rT7append((T7*)(T0 *)ms29,(T0 *)ms31);
  619. rT7append((T7*)(T0 *)ms29,rT26x_suffix(C));
  620. /*IF*/if (!(rT26file_exists(C,(T0 *)ms29))) {
  621. rT33put_string((T33*)oRBC1std_error,(T0 *)ms49);
  622. rT33put_string((T33*)oRBC1std_error,(T0 *)ms50);
  623. rT33put_string((T33*)oRBC1std_error,(T0 *)ms29);
  624. rT33put_string((T33*)oRBC1std_error,(T0 *)ms51);
  625. rT33put_string((T33*)oRBC1std_error,(T0 *)ms14);
  626. rT33put_string((T33*)oRBC1std_error,(T0 *)ms52);
  627. rT26die_with_code(C,1);
  628. }
  629. /*FI*/rT26automat(C);
  630. _str=rT26clone(C,(C)->_root);
  631. rT7append((T7*)_str,rT26make_suffix(C));
  632. /*IF*/if (rT26file_exists(C,_str)) {
  633. rT26remove_file(C,_str);
  634. }
  635. /*FI*/rT26echo_system(C);
  636. /*IF*/if (!(rT26file_exists(C,_str))) {
  637. rT33put_string((T33*)oRBC1std_error,(T0 *)ms63);
  638. rT33put_string((T33*)oRBC1std_error,_str);
  639. rT33put_string((T33*)oRBC1std_error,(T0 *)ms64);
  640. rT26die_with_code(C,1);
  641. }
  642. /*FI*/rT38put_string((T38*)oRBC1std_output,(T0 *)ms65);
  643. rT38put_string((T38*)oRBC1std_output,_str);
  644. rT38put_string((T38*)oRBC1std_output,(T0 *)ms66);
  645. rT26open_read(C,rT26make_file(),_str);
  646. rT39read_line((T39*)rT26make_file());
  647. while (!(rT39end_of_input((T39*)rT26make_file()))) {
  648. rT7copy((T7*)(T0 *)ms29,oRBC39last_string);
  649. rT26echo_system(C);
  650. rT39read_line((T39*)rT26make_file());
  651. }
  652. /*IF*/if ((C)->_c_code) {
  653. rT38put_string((T38*)oRBC1std_output,(T0 *)ms67);
  654. }
  655. else {
  656. rT38put_string((T38*)oRBC1std_output,(T0 *)ms68);
  657. _i=1;
  658. while (!((_i)==(0))) {
  659. /*(IRF3*/(((T7*)(T0 *)ms29)->_count)=(0);
  660. /*)*/rT7append((T7*)(T0 *)ms29,(C)->_root);
  661. rT2append_in(_i,(T0 *)ms29);
  662. rT7append((T7*)(T0 *)ms29,(T0 *)ms55);
  663. /*IF*/if (rT26file_exists(C,(T0 *)ms29)) {
  664. rT26remove(C);
  665. rT7remove_suffix((T7*)(T0 *)ms29,(T0 *)ms55);
  666. rT7append((T7*)(T0 *)ms29,(T0 *)ms54);
  667. rT26remove(C);
  668. _i=(_i)+(1);
  669. }
  670. else {
  671. _i=0;
  672. }
  673. /*FI*/}
  674. /*(IRF3*/(((T7*)(T0 *)ms29)->_count)=(0);
  675. /*)*/rT7append((T7*)(T0 *)ms29,(C)->_root);
  676. rT7append((T7*)(T0 *)ms29,(T0 *)ms70);
  677. rT26remove(C);
  678. /*(IRF3*/(((T7*)(T0 *)ms29)->_count)=(0);
  679. /*)*/rT7append((T7*)(T0 *)ms29,(C)->_root);
  680. rT7append((T7*)(T0 *)ms29,rT26make_suffix(C));
  681. rT26remove(C);
  682. rT38put_character((T38*)oRBC1std_output,'\12');
  683. }
  684. /*FI*/rT38put_string((T38*)oRBC1std_output,(T0 *)ms71);
  685. }
  686. int rT26file_exists(T26 *C,T0* a1){
  687. int R=0;
  688. rT7extend((T7*)a1,'\0');
  689. {FILE *f=fopen(((T7 *)a1)->_storage,"r");
  690. R=(f != NULL);
  691. fclose(f);}
  692. rT7remove_last((T7*)a1,1);
  693. return R;
  694. }
  695. void rT38die_with_code(T38 *C,int a1){
  696. exit(a1);
  697. }
  698. void rT38put_string(T38 *C,T0* a1){
  699. int _i=0;
  700. _i=1;
  701. while (!((_i)>(((T7*)a1)->_count))) {
  702. rT38put_character(C,rT7_ix64((T7*)a1,_i));
  703. _i=(_i)+(1);
  704. }
  705. }
  706. void rT38crash(T38 *C){
  707. rsp();
  708. rT38die_with_code(C,1);
  709. }
  710. void rT38append_file(T38 *C,T0* a1){
  711. char _c='\0';
  712. rT39connect_to((T39*)rT38tmp_file_read(),a1);
  713. rT39read_character((T39*)rT38tmp_file_read());
  714. while (!(rT39end_of_input((T39*)rT38tmp_file_read()))) {
  715. _c=rT39last_character((T39*)rT38tmp_file_read());
  716. rT38put_character(C,_c);
  717. rT39read_character((T39*)rT38tmp_file_read());
  718. }
  719. rT39disconnect((T39*)rT38tmp_file_read());
  720. }
  721. int ofBC34tmp_file_read=0;
  722. T0*oRBC34tmp_file_read;
  723. T0 * rT38tmp_file_read(/*C*/void){
  724. T0 * R=NULL;
  725. if (ofBC34tmp_file_read==0){
  726. ofBC34tmp_file_read=1;
  727. {T39 *n=((T39*)new(39));
  728. /*(IRF3*/((n)->_mode)=((T0 *)ms26);
  729. /*)*/R=(T0 *)n;}
  730. oRBC34tmp_file_read=R;}
  731. return oRBC34tmp_file_read;}
  732. void rT38copy(T38 *C,T0 * a1){
  733. /*IF*//*AF*//*AE*/
  734. memcpy(C,a1,s[C->id]);
  735. /*FI*/}
  736. void rT38put_character(T38 *C,char a1){
  737. char _err='\0';
  738. _err=fputc(a1,(C)->_output_stream);
  739. /*IF*/if ((_err)!=(a1)) {
  740. rT33put_string((T33*)oRBC1std_error,(T0 *)ms1);
  741. rT38crash(C);
  742. }
  743. /*FI*/}
  744. void rT38make(T38 *C){
  745. C->_output_stream=stdout;
  746. }
  747. void rT40clear_all(T40 *C){
  748. T0* _value=NULL;
  749. rT40set_all_with(C,_value);
  750. }
  751. void rT40set_all_with(T40 *C,T0* a1){
  752. int _i=0;
  753. _i=(C)->_upper;
  754. while (!((_i)<((C)->_lower))) {
  755. rT40put(C,a1,_i);
  756. _i=(_i)-(1);
  757. }
  758. }
  759. void rT40resize(T40 *C,int a1,int a2){
  760. int _up=0;
  761. int _i=0;
  762. T0* _other=NULL;
  763. {T40 *n=((T40*)new(40));
  764. rT40make(n,a1,a2);
  765. _other=(T0 *)n;}
  766. _i=rT2max((C)->_lower,((T40*)_other)->_lower);
  767. _up=rT2min((C)->_upper,((T40*)_other)->_upper);
  768. while (!((_i)>(_up))) {
  769. rT40put((T40*)_other,rT40item(C,_i),_i);
  770. _i=(_i)+(1);
  771. }
  772. /*IF*/{/*AT*/free(C->_storage);
  773. }
  774. /*FI*/memcpy(C,_other,sizeof(*C));free(_other);
  775. }
  776. T0* rT40item(T40 *C,int a1){
  777. T0* R=NULL;
  778. R=(C->_storage)[a1-(C->_lower)];
  779. return R;
  780. }
  781. int rT40equal_like(/*C*/T0* a1,T0* a2){
  782. int R=0;
  783. /*IF*//*AF*/if (((T0 *)a1)==((T0 *)a2)) {
  784. R=1;
  785. }
  786.  else if ((!(a1))||(!(a2))) {
  787. }
  788. else {
  789. R=rT7is_equal((T7*)a1,a2);
  790. }
  791. /*FI*/return R;
  792. }
  793. int rT40index_of(T40 *C,T0* a1){
  794. int R=0;
  795. R=(C)->_lower;
  796. while (!(((R)>((C)->_upper))||(rT40equal_like(a1,rT40item(C,R))))) {
  797. R=(R)+(1);
  798. }
  799. return R;
  800. }
  801. void rT40put(T40 *C,T0* a1,int a2){
  802. (C->_storage)[a2-(C->_lower)]=a1;
  803. }
  804. void rT40copy(T40 *C,T0* a1){
  805. int _i=0;
  806. C->_upper=((C)->_lower)-(1);
  807. /*IF*/if (((C)->_capacity)==(0)) {
  808. rT40make(C,((T40*)a1)->_lower,((T40*)a1)->_upper);
  809. }
  810. else {
  811. rT40resize(C,((T40*)a1)->_lower,((T40*)a1)->_upper);
  812. }
  813. /*FI*/_i=(C)->_lower;
  814. while (!((_i)>((C)->_upper))) {
  815. rT40put(C,rT40item((T40*)a1,_i),_i);
  816. _i=(_i)+(1);
  817. }
  818. }
  819. void rT40make(T40 *C,int a1,int a2){
  820. /*IF*/{/*AT*/free(C->_storage);
  821. }
  822. /*FI*/C->_lower=a1;
  823. C->_upper=a2;
  824. C->_capacity=(((C)->_upper)-((C)->_lower))+(1);
  825. C->_storage=NULL;
  826. /*IF*/if (((C)->_capacity)>(0)) {
  827. C->_capacity=((C)->_capacity)+(16);
  828. C->_storage=malloc((size_t)((C->_capacity)*sizeof(*(C->_storage))));
  829. rT40clear_all(C);
  830. }
  831. /*FI*/}
  832. char rT3to_upper(T3 C){
  833. char R='\0';
  834. /*IF*/if ((((unsigned char)C))<(97)) {
  835. R=C;
  836. }
  837.  else if ((((unsigned char)C))>(122)) {
  838. R=C;
  839. }
  840. else {
  841. R=(((unsigned char)C))-(32);
  842. }
  843. /*FI*/return R;
  844. }
  845. int rT3is_digit(T3 C){
  846. int R=0;
  847. {int iv1=C;
  848. if ((48 <= iv1) && (iv1<= 57)) goto l9;
  849. goto l10;
  850.  l9: ;
  851. R=1;
  852. goto l8;
  853.  l10: ;
  854.  l8: ;
  855. }
  856. return R;
  857. }
  858. int rT3is_letter(T3 C){
  859. int R=0;
  860. {int iv1=C;
  861. if ((65 <= iv1) && (iv1<= 90)) goto l12;
  862. if ((97 <= iv1) && (iv1<= 122)) goto l12;
  863. goto l13;
  864.  l12: ;
  865. R=1;
  866. goto l11;
  867.  l13: ;
  868.  l11: ;
  869. }
  870. return R;
  871. }
  872. int rT3is_separator(T3 C){
  873. int R=0;
  874. {int iv1=C;
  875. if (0 == iv1) goto l15;
  876. if ((9 <= iv1) && (iv1<= 10)) goto l15;
  877. if (13 == iv1) goto l15;
  878. if (32 == iv1) goto l15;
  879. goto l16;
  880.  l15: ;
  881. R=1;
  882. goto l14;
  883.  l16: ;
  884.  l14: ;
  885. }
  886. return R;
  887. }
  888. char rT3to_lower(T3 C){
  889. char R='\0';
  890. /*IF*/if ((((unsigned char)C))<(65)) {
  891. R=C;
  892. }
  893.  else if ((((unsigned char)C))>(90)) {
  894. R=C;
  895. }
  896. else {
  897. R=(((unsigned char)C))+(32);
  898. }
  899. /*FI*/return R;
  900. }
  901. int argument_count;
  902. T0 **argument;
  903. void main(int argc, char *argv[]) {initialize();{T26 *n=((T26*)new(26));
  904. int i;
  905. argument_count = argc - 1;
  906. argument = (T0 **)malloc(sizeof(Tstring *)*argc);
  907. for (i = 0; i < argc ; i++) 
  908. argument[i] = (T0 *)e2s(argv[i]);
  909. signal(SIGINT,sigrsp);
  910. signal(SIGQUIT,sigrsp);
  911. signal(SIGKILL,sigrsp);
  912. ms1=e2s("Error while writing character.");
  913. ms5=e2s("Bad use of command `compile\'.\n");
  914. ms14=e2s("SmallEiffel");
  915. ms17=e2s("C=a1;");
  916. ms18=e2s("memcpy(C,a1,s[C->id]);");
  917. ms20=e2s("/usr/local/logiciel/SmallEiffel");
  918. ms21=e2s("man");
  919. ms22=e2s(".hlp");
  920. ms24=e2s("Unable to find help file \"");
  921. ms25=e2s("\".\n");
  922. ms26=e2s("r");
  923. ms28=e2s("compile");
  924. ms29=e2s("................................................");
  925. ms30=e2s("bin");
  926. ms31=e2s("compile_to_c");
  927. ms32=e2s("DOS");
  928. ms33=e2s("bin");
  929. ms34=e2s("system.se");
  930. ms35=e2s("Unable to find system name file\n\"");
  931. ms36=e2s("\".\n");
  932. ms37=e2s("Cannot read file \"");
  933. ms38=e2s("\".\n");
  934. ms39=e2s("UNIX");
  935. ms40=e2s("DOS");
  936. ms41=e2s("Macintosh");
  937. ms42=e2s("OS2");
  938. ms43=e2s("Amiga");
  939. ms45=e2s("Unknow system name in file\n\"");
  940. ms46=e2s("\".\nCurrently handled system :\n");
  941. ms47=e2s(".EXE");
  942. ms48=e2s("");
  943. ms49=e2s("Cannot find command `compile_to_c\'.\n");
  944. ms50=e2s("File \"");
  945. ms51=e2s("\" not found.\nEnvironment variable \"");
  946. ms52=e2s("\" must be set to a correct value.\nOr install not done correctly.\n");
  947. ms53=e2s("-c_code");
  948. ms54=e2s(".o");
  949. ms55=e2s(".c");
  950. ms56=e2s(".e");
  951. ms57=e2s("-o");
  952. ms58=e2s(".BAT");
  953. ms59=e2s(".CMD");
  954. ms60=e2s(".make");
  955. ms63=e2s("File \"");
  956. ms64=e2s("\" not found. Error(s) during `compile_to_c\'.\n");
  957. ms65=e2s("C compiling using \"");
  958. ms66=e2s("\" command file.\n");
  959. ms67=e2s("C code not removed (-c_code).\n");
  960. ms68=e2s("Removing: ");
  961. ms69=e2s("0123456789");
  962. ms70=e2s(".h");
  963. ms71=e2s("Done.\n");
  964. {T0 *R;
  965. {T33 *n=((T33*)new(33));
  966. rT33make(n);
  967. R=(T0 *)n;}
  968. oRBC1std_error=R;}/*PCO*/
  969. {T0 *R;
  970. {T38 *n=((T38*)new(38));
  971. rT38make(n);
  972. R=(T0 *)n;}
  973. oRBC1std_output=R;}/*PCO*/
  974. {T0 *R;
  975. R=ma(40,0,6,(T0 *)ms39,(T0 *)ms40,(T0 *)ms41,(T0 *)ms32,(T0 *)ms42,(T0 *)ms43);
  976. oRBC27system_list=R;}/*PCO*/
  977. {T0 *R;
  978. {T7 *n=((T7*)new(7));
  979. rT7make(n,256);
  980. R=(T0 *)n;}
  981. oRBC27hlp_file_name=R;}/*PCO*/
  982. {T0 *R;
  983. {T7 *n=((T7*)new(7));
  984. rT7make(n,256);
  985. R=(T0 *)n;}
  986. oRBC39last_string=R;}/*PCO*/
  987. rT26make(n);
  988. exit(0);}}
  989. char *s2e(Tstring *s){
  990. char *e = (char *)malloc((s->_count)+1);
  991. memcpy(e,s->_storage,s->_count);
  992. e[s->_count] = '\0';
  993. return e;
  994. }
  995. Tstring *e2s(char *e){
  996. Tstring *s = (Tstring *)new(stringId);
  997. if (e != NULL) {
  998. s->_capacity = strlen(e) + 1;
  999. s->_count = (s->_capacity) - 1;
  1000. s->_storage = (char *)malloc(sizeof(char)*s->_capacity);
  1001. strcpy(s->_storage,e);}
  1002. return s;
  1003. }
  1004. T0 *ma(int aid,int eid,int argc,...){
  1005. va_list pa;
  1006. Tarray *a=((Tarray *)new(aid));
  1007. char *store=0;
  1008. a->_capacity=argc;
  1009. a->_lower=1;
  1010. a->_upper=argc;
  1011. a->_storage=0;
  1012. if (argc) {va_start(pa,argc);
  1013. if (eid) store=(char *)malloc(argc*(s[eid]));
  1014. else store=(char *)malloc(argc*(sizeof(T0*)));
  1015. a->_storage=(T0 **)store;
  1016. switch (eid){
  1017. case 0:
  1018. while (argc--){*((T0 **)store)=va_arg(pa,T0 *);
  1019. store+=sizeof(T0 *);}break;
  1020. case 2:case 6:
  1021. while (argc--){*((int *)store)=va_arg(pa,int);
  1022. store+=sizeof(int);}break;
  1023. case 3:
  1024. while (argc--){*((char *)store)=((char)va_arg(pa,int));
  1025. store+=sizeof(char);}break;
  1026. case 4:
  1027. while (argc--){*((float *)store)=va_arg(pa,double);
  1028. store+=sizeof(float);}break;
  1029. case 5:
  1030. while (argc--){*((double *)store)=va_arg(pa,double);
  1031. store+=sizeof(double);}break;
  1032. while (argc--){
  1033. memcpy(*((T0 **)va_arg(pa,T0 *)),store,s[eid]);
  1034. store+=s[eid];}}
  1035. va_end(pa);}
  1036. return (T0 *)a;
  1037. }
  1038. Tstring *ms1;
  1039. Tstring *ms5;
  1040. Tstring *ms14;
  1041. Tstring *ms17;
  1042. Tstring *ms18;
  1043. Tstring *ms20;
  1044. Tstring *ms21;
  1045. Tstring *ms22;
  1046. Tstring *ms24;
  1047. Tstring *ms25;
  1048. Tstring *ms26;
  1049. Tstring *ms28;
  1050. Tstring *ms29;
  1051. Tstring *ms30;
  1052. Tstring *ms31;
  1053. Tstring *ms32;
  1054. Tstring *ms33;
  1055. Tstring *ms34;
  1056. Tstring *ms35;
  1057. Tstring *ms36;
  1058. Tstring *ms37;
  1059. Tstring *ms38;
  1060. Tstring *ms39;
  1061. Tstring *ms40;
  1062. Tstring *ms41;
  1063. Tstring *ms42;
  1064. Tstring *ms43;
  1065. Tstring *ms45;
  1066. Tstring *ms46;
  1067. Tstring *ms47;
  1068. Tstring *ms48;
  1069. Tstring *ms49;
  1070. Tstring *ms50;
  1071. Tstring *ms51;
  1072. Tstring *ms52;
  1073. Tstring *ms53;
  1074. Tstring *ms54;
  1075. Tstring *ms55;
  1076. Tstring *ms56;
  1077. Tstring *ms57;
  1078. Tstring *ms58;
  1079. Tstring *ms59;
  1080. Tstring *ms60;
  1081. Tstring *ms63;
  1082. Tstring *ms64;
  1083. Tstring *ms65;
  1084. Tstring *ms66;
  1085. Tstring *ms67;
  1086. Tstring *ms68;
  1087. Tstring *ms69;
  1088. Tstring *ms70;
  1089. Tstring *ms71;
  1090. void rsp(void){
  1091. printf("Eiffel program crash at run time.\n");
  1092. printf("No trace when using option \"-boost\"\n");
  1093. exit(1);
  1094. }
  1095. void sigrsp(int sig){
  1096. printf("Received signal %d (man signal).\n",sig);
  1097. rsp();
  1098. exit(1);
  1099. }
  1100. void  XrT28copy(void *C,T0* a1){
  1101. int id=((T0 *)C)->id;
  1102. if (id <= 33) {
  1103. if (id <= 26) {
  1104. if (id <= 7) {
  1105. rT7copy((T7 *)C,a1);
  1106. } else {
  1107. rT26copy((T26 *)C,a1);
  1108. }} else {
  1109. rT33copy((T33 *)C,a1);
  1110. }} else {
  1111. if (id <= 39) {
  1112. if (id <= 38) {
  1113. rT38copy((T38 *)C,a1);
  1114. } else {
  1115. rT39copy((T39 *)C,a1);
  1116. }} else {
  1117. rT40copy((T40 *)C,a1);
  1118. }}}
  1119. size_t s[43];
  1120. Tstring * gt[43];
  1121. Tstring * g[43];
  1122. char * p[43];
  1123. void initialize(void){
  1124. s[8]=sizeof(T8);
  1125. s[33]=sizeof(T33);
  1126. s[39]=sizeof(T39);
  1127. s[7]=sizeof(T7);
  1128. s[6]=sizeof(T6);
  1129. s[2]=sizeof(T2);
  1130. s[26]=sizeof(T26);
  1131. s[38]=sizeof(T38);
  1132. s[40]=sizeof(T40);
  1133. s[3]=sizeof(T3);
  1134. }
  1135.