pstatmnt.pas 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  4. Does the parsing of the statements
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. {$ifdef FPC}
  19. {$goto on}
  20. {$endif FPC}
  21. unit pstatmnt;
  22. interface
  23. uses tree;
  24. { reads a block }
  25. function block(islibrary : boolean) : ptree;
  26. { reads an assembler block }
  27. function assembler_block : ptree;
  28. implementation
  29. uses
  30. globtype,systems,tokens,
  31. strings,cobjects,globals,files,verbose,
  32. symconst,symtable,aasm,pass_1,types,scanner,
  33. {$ifdef newcg}
  34. cgbase,
  35. {$else}
  36. hcodegen,
  37. {$endif}
  38. ppu
  39. ,pbase,pexpr,pdecl,cpubase,cpuasm
  40. {$ifdef i386}
  41. ,tgeni386
  42. {$ifndef NoRa386Int}
  43. ,ra386int
  44. {$endif NoRa386Int}
  45. {$ifndef NoRa386Att}
  46. ,ra386att
  47. {$endif NoRa386Att}
  48. {$ifndef NoRa386Dir}
  49. ,ra386dir
  50. {$endif NoRa386Dir}
  51. {$endif i386}
  52. {$ifdef m68k}
  53. ,tgen68k
  54. {$ifndef NoRa68kMot}
  55. ,ra68kmot
  56. {$endif NoRa68kMot}
  57. {$endif m68k}
  58. {$ifdef alpha}
  59. ,tgeni386 { this is a dummy!! }
  60. {$endif alpha}
  61. {$ifdef powerpc}
  62. ,tgeni386 { this is a dummy!! }
  63. {$endif powerpc}
  64. ;
  65. const
  66. statement_level : longint = 0;
  67. function statement : ptree;forward;
  68. function if_statement : ptree;
  69. var
  70. ex,if_a,else_a : ptree;
  71. begin
  72. consume(_IF);
  73. ex:=comp_expr(true);
  74. consume(_THEN);
  75. if token<>_ELSE then
  76. if_a:=statement
  77. else
  78. if_a:=nil;
  79. if try_to_consume(_ELSE) then
  80. else_a:=statement
  81. else
  82. else_a:=nil;
  83. if_statement:=genloopnode(ifn,ex,if_a,else_a,false);
  84. end;
  85. { creates a block (list) of statements, til the next END token }
  86. function statements_til_end : ptree;
  87. var
  88. first,last : ptree;
  89. begin
  90. first:=nil;
  91. while token<>_END do
  92. begin
  93. if first=nil then
  94. begin
  95. last:=gennode(statementn,nil,statement);
  96. first:=last;
  97. end
  98. else
  99. begin
  100. last^.left:=gennode(statementn,nil,statement);
  101. last:=last^.left;
  102. end;
  103. if not try_to_consume(_SEMICOLON) then
  104. break;
  105. emptystats;
  106. end;
  107. consume(_END);
  108. statements_til_end:=gensinglenode(blockn,first);
  109. end;
  110. function case_statement : ptree;
  111. var
  112. { contains the label number of currently parsed case block }
  113. aktcaselabel : pasmlabel;
  114. firstlabel : boolean;
  115. root : pcaserecord;
  116. { the typ of the case expression }
  117. casedef : pdef;
  118. procedure newcaselabel(l,h : longint;first:boolean);
  119. var
  120. hcaselabel : pcaserecord;
  121. procedure insertlabel(var p : pcaserecord);
  122. begin
  123. if p=nil then p:=hcaselabel
  124. else
  125. if (p^._low>hcaselabel^._low) and
  126. (p^._low>hcaselabel^._high) then
  127. if (hcaselabel^.statement = p^.statement) and
  128. (p^._low = hcaselabel^._high + 1) then
  129. begin
  130. p^._low := hcaselabel^._low;
  131. dispose(hcaselabel);
  132. end
  133. else
  134. insertlabel(p^.less)
  135. else
  136. if (p^._high<hcaselabel^._low) and
  137. (p^._high<hcaselabel^._high) then
  138. if (hcaselabel^.statement = p^.statement) and
  139. (p^._high+1 = hcaselabel^._low) then
  140. begin
  141. p^._high := hcaselabel^._high;
  142. dispose(hcaselabel);
  143. end
  144. else
  145. insertlabel(p^.greater)
  146. else Message(parser_e_double_caselabel);
  147. end;
  148. begin
  149. new(hcaselabel);
  150. hcaselabel^.less:=nil;
  151. hcaselabel^.greater:=nil;
  152. hcaselabel^.statement:=aktcaselabel;
  153. hcaselabel^.firstlabel:=first;
  154. getlabel(hcaselabel^._at);
  155. hcaselabel^._low:=l;
  156. hcaselabel^._high:=h;
  157. insertlabel(root);
  158. end;
  159. var
  160. code,caseexpr,p,instruc,elseblock : ptree;
  161. hl1,hl2 : longint;
  162. casedeferror : boolean;
  163. begin
  164. consume(_CASE);
  165. caseexpr:=comp_expr(true);
  166. { determines result type }
  167. cleartempgen;
  168. do_firstpass(caseexpr);
  169. casedeferror:=false;
  170. casedef:=caseexpr^.resulttype;
  171. if (not assigned(casedef)) or
  172. not(is_ordinal(casedef) or is_64bitint(casedef)) then
  173. begin
  174. CGMessage(type_e_ordinal_expr_expected);
  175. { create a correct tree }
  176. disposetree(caseexpr);
  177. caseexpr:=genordinalconstnode(0,u32bitdef);
  178. { set error flag so no rangechecks are done }
  179. casedeferror:=true;
  180. end;
  181. consume(_OF);
  182. inc(statement_level);
  183. root:=nil;
  184. instruc:=nil;
  185. repeat
  186. getlabel(aktcaselabel);
  187. firstlabel:=true;
  188. { may be an instruction has more case labels }
  189. repeat
  190. p:=expr;
  191. cleartempgen;
  192. do_firstpass(p);
  193. hl1:=0;
  194. hl2:=0;
  195. if (p^.treetype=rangen) then
  196. begin
  197. { type checking for case statements }
  198. if is_subequal(casedef, p^.left^.resulttype) and
  199. is_subequal(casedef, p^.right^.resulttype) then
  200. begin
  201. hl1:=get_ordinal_value(p^.left);
  202. hl2:=get_ordinal_value(p^.right);
  203. if hl1>hl2 then
  204. CGMessage(parser_e_case_lower_less_than_upper_bound);
  205. if not casedeferror then
  206. begin
  207. testrange(casedef,hl1);
  208. testrange(casedef,hl2);
  209. end;
  210. end
  211. else
  212. CGMessage(parser_e_case_mismatch);
  213. newcaselabel(hl1,hl2,firstlabel);
  214. end
  215. else
  216. begin
  217. { type checking for case statements }
  218. if not is_subequal(casedef, p^.resulttype) then
  219. CGMessage(parser_e_case_mismatch);
  220. hl1:=get_ordinal_value(p);
  221. if not casedeferror then
  222. testrange(casedef,hl1);
  223. newcaselabel(hl1,hl1,firstlabel);
  224. end;
  225. disposetree(p);
  226. if token=_COMMA then
  227. consume(_COMMA)
  228. else
  229. break;
  230. firstlabel:=false;
  231. until false;
  232. consume(_COLON);
  233. { handles instruction block }
  234. p:=gensinglenode(labeln,statement);
  235. p^.labelnr:=aktcaselabel;
  236. { concats instruction }
  237. instruc:=gennode(statementn,instruc,p);
  238. if not((token=_ELSE) or (token=_OTHERWISE) or (token=_END)) then
  239. consume(_SEMICOLON);
  240. until (token=_ELSE) or (token=_OTHERWISE) or (token=_END);
  241. if (token=_ELSE) or (token=_OTHERWISE) then
  242. begin
  243. if not try_to_consume(_ELSE) then
  244. consume(_OTHERWISE);
  245. elseblock:=statements_til_end;
  246. end
  247. else
  248. begin
  249. elseblock:=nil;
  250. consume(_END);
  251. end;
  252. dec(statement_level);
  253. code:=gencasenode(caseexpr,instruc,root);
  254. code^.elseblock:=elseblock;
  255. case_statement:=code;
  256. end;
  257. function repeat_statement : ptree;
  258. var
  259. first,last,p_e : ptree;
  260. begin
  261. consume(_REPEAT);
  262. first:=nil;
  263. inc(statement_level);
  264. while token<>_UNTIL do
  265. begin
  266. if first=nil then
  267. begin
  268. last:=gennode(statementn,nil,statement);
  269. first:=last;
  270. end
  271. else
  272. begin
  273. last^.left:=gennode(statementn,nil,statement);
  274. last:=last^.left;
  275. end;
  276. if not try_to_consume(_SEMICOLON) then
  277. break;
  278. emptystats;
  279. end;
  280. consume(_UNTIL);
  281. dec(statement_level);
  282. first:=gensinglenode(blockn,first);
  283. p_e:=comp_expr(true);
  284. repeat_statement:=genloopnode(repeatn,p_e,first,nil,false);
  285. end;
  286. function while_statement : ptree;
  287. var
  288. p_e,p_a : ptree;
  289. begin
  290. consume(_WHILE);
  291. p_e:=comp_expr(true);
  292. consume(_DO);
  293. p_a:=statement;
  294. while_statement:=genloopnode(whilen,p_e,p_a,nil,false);
  295. end;
  296. function for_statement : ptree;
  297. var
  298. p_e,tovalue,p_a : ptree;
  299. backward : boolean;
  300. begin
  301. { parse loop header }
  302. consume(_FOR);
  303. p_e:=expr;
  304. if token=_DOWNTO then
  305. begin
  306. consume(_DOWNTO);
  307. backward:=true;
  308. end
  309. else
  310. begin
  311. consume(_TO);
  312. backward:=false;
  313. end;
  314. tovalue:=comp_expr(true);
  315. consume(_DO);
  316. { ... now the instruction }
  317. p_a:=statement;
  318. for_statement:=genloopnode(forn,p_e,tovalue,p_a,backward);
  319. end;
  320. function _with_statement : ptree;
  321. var
  322. right,p : ptree;
  323. i,levelcount : longint;
  324. withsymtable,symtab : psymtable;
  325. obj : pobjectdef;
  326. {$ifdef tp}
  327. hp : ptree;
  328. {$endif}
  329. begin
  330. p:=comp_expr(true);
  331. do_firstpass(p);
  332. set_varstate(p,false);
  333. right:=nil;
  334. if (not codegenerror) and
  335. (p^.resulttype^.deftype in [objectdef,recorddef]) then
  336. begin
  337. case p^.resulttype^.deftype of
  338. objectdef : begin
  339. obj:=pobjectdef(p^.resulttype);
  340. withsymtable:=new(pwithsymtable,init);
  341. withsymtable^.symsearch:=obj^.symtable^.symsearch;
  342. withsymtable^.defowner:=obj;
  343. symtab:=withsymtable;
  344. if (p^.treetype=loadn) and
  345. (p^.symtable=aktprocsym^.definition^.localst) then
  346. pwithsymtable(symtab)^.direct_with:=true;
  347. {symtab^.withnode:=p; not yet allocated !! }
  348. pwithsymtable(symtab)^.withrefnode:=p;
  349. levelcount:=1;
  350. obj:=obj^.childof;
  351. while assigned(obj) do
  352. begin
  353. symtab^.next:=new(pwithsymtable,init);
  354. symtab:=symtab^.next;
  355. symtab^.symsearch:=obj^.symtable^.symsearch;
  356. if (p^.treetype=loadn) and
  357. (p^.symtable=aktprocsym^.definition^.localst) then
  358. pwithsymtable(symtab)^.direct_with:=true;
  359. {symtab^.withnode:=p; not yet allocated !! }
  360. pwithsymtable(symtab)^.withrefnode:=p;
  361. symtab^.defowner:=obj;
  362. obj:=obj^.childof;
  363. inc(levelcount);
  364. end;
  365. symtab^.next:=symtablestack;
  366. symtablestack:=withsymtable;
  367. end;
  368. recorddef : begin
  369. symtab:=precorddef(p^.resulttype)^.symtable;
  370. levelcount:=1;
  371. withsymtable:=new(pwithsymtable,init);
  372. withsymtable^.symsearch:=symtab^.symsearch;
  373. withsymtable^.next:=symtablestack;
  374. if (p^.treetype=loadn) and
  375. (p^.symtable=aktprocsym^.definition^.localst) then
  376. pwithsymtable(withsymtable)^.direct_with:=true;
  377. {symtab^.withnode:=p; not yet allocated !! }
  378. pwithsymtable(withsymtable)^.withrefnode:=p;
  379. withsymtable^.defowner:=precorddef(p^.resulttype);
  380. symtablestack:=withsymtable;
  381. end;
  382. end;
  383. if token=_COMMA then
  384. begin
  385. consume(_COMMA);
  386. right:=_with_statement{$ifndef tp}(){$endif};
  387. end
  388. else
  389. begin
  390. consume(_DO);
  391. if token<>_SEMICOLON then
  392. right:=statement
  393. else
  394. right:=nil;
  395. end;
  396. for i:=1 to levelcount do
  397. symtablestack:=symtablestack^.next;
  398. _with_statement:=genwithnode(pwithsymtable(withsymtable),p,right,levelcount);
  399. end
  400. else
  401. begin
  402. Message(parser_e_false_with_expr);
  403. { try to recover from error }
  404. if token=_COMMA then
  405. begin
  406. consume(_COMMA);
  407. {$ifdef tp}
  408. hp:=_with_statement;
  409. {$else}
  410. _with_statement();
  411. {$endif}
  412. end
  413. else
  414. begin
  415. consume(_DO);
  416. { ignore all }
  417. if token<>_SEMICOLON then
  418. statement;
  419. end;
  420. _with_statement:=nil;
  421. end;
  422. end;
  423. function with_statement : ptree;
  424. begin
  425. consume(_WITH);
  426. with_statement:=_with_statement;
  427. end;
  428. function raise_statement : ptree;
  429. var
  430. p,pobj,paddr,pframe : ptree;
  431. begin
  432. pobj:=nil;
  433. paddr:=nil;
  434. pframe:=nil;
  435. consume(_RAISE);
  436. if not(token in [_SEMICOLON,_END]) then
  437. begin
  438. { object }
  439. pobj:=comp_expr(true);
  440. if try_to_consume(_AT) then
  441. begin
  442. paddr:=comp_expr(true);
  443. if try_to_consume(_COMMA) then
  444. pframe:=comp_expr(true);
  445. end;
  446. end
  447. else
  448. begin
  449. if (block_type<>bt_except) then
  450. Message(parser_e_no_reraise_possible);
  451. end;
  452. p:=gennode(raisen,pobj,paddr);
  453. p^.frametree:=pframe;
  454. raise_statement:=p;
  455. end;
  456. function try_statement : ptree;
  457. var
  458. p_try_block,p_finally_block,first,last,
  459. p_default,p_specific,hp : ptree;
  460. ot : pobjectdef;
  461. sym : pvarsym;
  462. old_block_type : tblock_type;
  463. exceptsymtable : psymtable;
  464. objname : stringid;
  465. begin
  466. procinfo^.flags:=procinfo^.flags or
  467. pi_uses_exceptions;
  468. p_default:=nil;
  469. p_specific:=nil;
  470. { read statements to try }
  471. consume(_TRY);
  472. first:=nil;
  473. inc(statement_level);
  474. while (token<>_FINALLY) and (token<>_EXCEPT) do
  475. begin
  476. if first=nil then
  477. begin
  478. last:=gennode(statementn,nil,statement);
  479. first:=last;
  480. end
  481. else
  482. begin
  483. last^.left:=gennode(statementn,nil,statement);
  484. last:=last^.left;
  485. end;
  486. if not try_to_consume(_SEMICOLON) then
  487. break;
  488. emptystats;
  489. end;
  490. p_try_block:=gensinglenode(blockn,first);
  491. if try_to_consume(_FINALLY) then
  492. begin
  493. p_finally_block:=statements_til_end;
  494. try_statement:=gennode(tryfinallyn,p_try_block,p_finally_block);
  495. dec(statement_level);
  496. end
  497. else
  498. begin
  499. consume(_EXCEPT);
  500. old_block_type:=block_type;
  501. block_type:=bt_except;
  502. p_specific:=nil;
  503. if token=_ON then
  504. { catch specific exceptions }
  505. begin
  506. repeat
  507. consume(_ON);
  508. if token=_ID then
  509. begin
  510. objname:=pattern;
  511. getsym(objname,false);
  512. consume(_ID);
  513. { is a explicit name for the exception given ? }
  514. if try_to_consume(_COLON) then
  515. begin
  516. getsym(pattern,true);
  517. consume(_ID);
  518. if srsym^.typ=unitsym then
  519. begin
  520. consume(_POINT);
  521. getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
  522. consume(_ID);
  523. end;
  524. if (srsym^.typ=typesym) and
  525. (ptypesym(srsym)^.restype.def^.deftype=objectdef) and
  526. pobjectdef(ptypesym(srsym)^.restype.def)^.is_class then
  527. begin
  528. ot:=pobjectdef(ptypesym(srsym)^.restype.def);
  529. sym:=new(pvarsym,initdef(objname,ot));
  530. end
  531. else
  532. begin
  533. sym:=new(pvarsym,initdef(objname,new(perrordef,init)));
  534. if (srsym^.typ=typesym) then
  535. Message1(type_e_class_type_expected,ptypesym(srsym)^.restype.def^.typename)
  536. else
  537. Message1(type_e_class_type_expected,ot^.typename);
  538. end;
  539. exceptsymtable:=new(psymtable,init(stt_exceptsymtable));
  540. exceptsymtable^.insert(sym);
  541. { insert the exception symtable stack }
  542. exceptsymtable^.next:=symtablestack;
  543. symtablestack:=exceptsymtable;
  544. end
  545. else
  546. begin
  547. { check if type is valid, must be done here because
  548. with "e: Exception" the e is not necessary }
  549. if srsym=nil then
  550. begin
  551. Message1(sym_e_id_not_found,objname);
  552. srsym:=generrorsym;
  553. end;
  554. { only exception type }
  555. if srsym^.typ=unitsym then
  556. begin
  557. consume(_POINT);
  558. getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
  559. consume(_ID);
  560. end;
  561. if (srsym^.typ=typesym) and
  562. (ptypesym(srsym)^.restype.def^.deftype=objectdef) and
  563. pobjectdef(ptypesym(srsym)^.restype.def)^.is_class then
  564. ot:=pobjectdef(ptypesym(srsym)^.restype.def)
  565. else
  566. begin
  567. ot:=pobjectdef(generrordef);
  568. if (srsym^.typ=typesym) then
  569. Message1(type_e_class_type_expected,ptypesym(srsym)^.restype.def^.typename)
  570. else
  571. Message1(type_e_class_type_expected,ot^.typename);
  572. end;
  573. exceptsymtable:=nil;
  574. end;
  575. end
  576. else
  577. consume(_ID);
  578. consume(_DO);
  579. hp:=gennode(onn,nil,statement);
  580. if ot^.deftype=errordef then
  581. begin
  582. disposetree(hp);
  583. hp:=genzeronode(errorn);
  584. end;
  585. if p_specific=nil then
  586. begin
  587. last:=hp;
  588. p_specific:=last;
  589. end
  590. else
  591. begin
  592. last^.left:=hp;
  593. last:=last^.left;
  594. end;
  595. { set the informations }
  596. last^.excepttype:=ot;
  597. last^.exceptsymtable:=exceptsymtable;
  598. last^.disposetyp:=dt_onn;
  599. { remove exception symtable }
  600. if assigned(exceptsymtable) then
  601. dellexlevel;
  602. if not try_to_consume(_SEMICOLON) then
  603. break;
  604. emptystats;
  605. until (token=_END) or(token=_ELSE);
  606. if token=_ELSE then
  607. { catch the other exceptions }
  608. begin
  609. consume(_ELSE);
  610. p_default:=statements_til_end;
  611. end
  612. else
  613. consume(_END);
  614. end
  615. else
  616. { catch all exceptions }
  617. begin
  618. p_default:=statements_til_end;
  619. end;
  620. dec(statement_level);
  621. block_type:=old_block_type;
  622. try_statement:=genloopnode(tryexceptn,p_try_block,p_specific,p_default,false);
  623. end;
  624. end;
  625. function exit_statement : ptree;
  626. var
  627. p : ptree;
  628. begin
  629. consume(_EXIT);
  630. if try_to_consume(_LKLAMMER) then
  631. begin
  632. p:=comp_expr(true);
  633. consume(_RKLAMMER);
  634. if (block_type=bt_except) then
  635. Message(parser_e_exit_with_argument_not__possible);
  636. if procinfo^.returntype.def=pdef(voiddef) then
  637. Message(parser_e_void_function);
  638. end
  639. else
  640. p:=nil;
  641. p:=gensinglenode(exitn,p);
  642. p^.resulttype:=procinfo^.returntype.def;
  643. exit_statement:=p;
  644. end;
  645. function _asm_statement : ptree;
  646. var
  647. asmstat : ptree;
  648. Marker : Pai;
  649. begin
  650. Inside_asm_statement:=true;
  651. case aktasmmode of
  652. asmmode_none : ; { just be there to allow to a compile without
  653. any assembler readers }
  654. {$ifdef i386}
  655. {$ifndef NoRA386Att}
  656. asmmode_i386_att:
  657. asmstat:=ra386att.assemble;
  658. {$endif NoRA386Att}
  659. {$ifndef NoRA386Int}
  660. asmmode_i386_intel:
  661. asmstat:=ra386int.assemble;
  662. {$endif NoRA386Int}
  663. {$ifndef NoRA386Dir}
  664. asmmode_i386_direct:
  665. begin
  666. if not target_asm.allowdirect then
  667. Message(parser_f_direct_assembler_not_allowed);
  668. if (pocall_inline in aktprocsym^.definition^.proccalloptions) then
  669. Begin
  670. Message1(parser_w_not_supported_for_inline,'direct asm');
  671. Message(parser_w_inlining_disabled);
  672. exclude(aktprocsym^.definition^.proccalloptions,pocall_inline);
  673. End;
  674. asmstat:=ra386dir.assemble;
  675. end;
  676. {$endif NoRA386Dir}
  677. {$endif}
  678. {$ifdef m68k}
  679. {$ifndef NoRA68kMot}
  680. asmmode_m68k_mot:
  681. asmstat:=ra68kmot.assemble;
  682. {$endif NoRA68kMot}
  683. {$endif}
  684. else
  685. Message(parser_f_assembler_reader_not_supported);
  686. end;
  687. { Read first the _ASM statement }
  688. consume(_ASM);
  689. {$ifndef newcg}
  690. { END is read }
  691. if try_to_consume(_LECKKLAMMER) then
  692. begin
  693. { it's possible to specify the modified registers }
  694. asmstat^.object_preserved:=true;
  695. if token<>_RECKKLAMMER then
  696. repeat
  697. { uppercase, because it's a CSTRING }
  698. uppervar(pattern);
  699. {$ifdef i386}
  700. if pattern='EAX' then
  701. usedinproc:=usedinproc or ($80 shr byte(R_EAX))
  702. else if pattern='EBX' then
  703. usedinproc:=usedinproc or ($80 shr byte(R_EBX))
  704. else if pattern='ECX' then
  705. usedinproc:=usedinproc or ($80 shr byte(R_ECX))
  706. else if pattern='EDX' then
  707. usedinproc:=usedinproc or ($80 shr byte(R_EDX))
  708. else if pattern='ESI' then
  709. begin
  710. usedinproc:=usedinproc or ($80 shr byte(R_ESI));
  711. asmstat^.object_preserved:=false;
  712. end
  713. else if pattern='EDI' then
  714. usedinproc:=usedinproc or ($80 shr byte(R_EDI))
  715. {$endif i386}
  716. {$ifdef m68k}
  717. if pattern='D0' then
  718. usedinproc:=usedinproc or ($800 shr word(R_D0))
  719. else if pattern='D1' then
  720. usedinproc:=usedinproc or ($800 shr word(R_D1))
  721. else if pattern='D6' then
  722. usedinproc:=usedinproc or ($800 shr word(R_D6))
  723. else if pattern='A0' then
  724. usedinproc:=usedinproc or ($800 shr word(R_A0))
  725. else if pattern='A1' then
  726. usedinproc:=usedinproc or ($800 shr word(R_A1))
  727. {$endif m68k}
  728. else consume(_RECKKLAMMER);
  729. consume(_CSTRING);
  730. if not try_to_consume(_COMMA) then
  731. break;
  732. until false;
  733. consume(_RECKKLAMMER);
  734. end
  735. else usedinproc:=$ff;
  736. {$endif newcg}
  737. { mark the start and the end of the assembler block for the optimizer }
  738. If Assigned(AsmStat^.p_asm) Then
  739. Begin
  740. Marker := New(Pai_Marker, Init(AsmBlockStart));
  741. AsmStat^.p_asm^.Insert(Marker);
  742. Marker := New(Pai_Marker, Init(AsmBlockEnd));
  743. AsmStat^.p_asm^.Concat(Marker);
  744. End;
  745. Inside_asm_statement:=false;
  746. _asm_statement:=asmstat;
  747. end;
  748. function new_dispose_statement : ptree;
  749. var
  750. p,p2 : ptree;
  751. ht : ttoken;
  752. again : boolean; { dummy for do_proc_call }
  753. destructorname : stringid;
  754. sym : psym;
  755. classh : pobjectdef;
  756. pd,pd2 : pdef;
  757. destructorpos,storepos : tfileposinfo;
  758. tt : ttreetyp;
  759. begin
  760. ht:=token;
  761. if try_to_consume(_NEW) then
  762. tt:=hnewn
  763. else
  764. begin
  765. consume(_DISPOSE);
  766. tt:=hdisposen;
  767. end;
  768. consume(_LKLAMMER);
  769. p:=comp_expr(true);
  770. { calc return type }
  771. cleartempgen;
  772. do_firstpass(p);
  773. set_varstate(p,tt=hdisposen);
  774. {var o:Pobject;
  775. begin
  776. new(o,init); (*Also a valid new statement*)
  777. end;}
  778. if try_to_consume(_COMMA) then
  779. begin
  780. { extended syntax of new and dispose }
  781. { function styled new is handled in factor }
  782. { destructors have no parameters }
  783. destructorname:=pattern;
  784. destructorpos:=tokenpos;
  785. consume(_ID);
  786. pd:=p^.resulttype;
  787. if pd=nil then
  788. pd:=generrordef;
  789. pd2:=pd;
  790. if (pd^.deftype<>pointerdef) then
  791. begin
  792. Message1(type_e_pointer_type_expected,pd^.typename);
  793. p:=factor(false);
  794. consume(_RKLAMMER);
  795. new_dispose_statement:=genzeronode(errorn);
  796. exit;
  797. end;
  798. { first parameter must be an object or class }
  799. if ppointerdef(pd)^.pointertype.def^.deftype<>objectdef then
  800. begin
  801. Message(parser_e_pointer_to_class_expected);
  802. new_dispose_statement:=factor(false);
  803. consume_all_until(_RKLAMMER);
  804. consume(_RKLAMMER);
  805. exit;
  806. end;
  807. { check, if the first parameter is a pointer to a _class_ }
  808. classh:=pobjectdef(ppointerdef(pd)^.pointertype.def);
  809. if classh^.is_class then
  810. begin
  811. Message(parser_e_no_new_or_dispose_for_classes);
  812. new_dispose_statement:=factor(false);
  813. consume_all_until(_RKLAMMER);
  814. consume(_RKLAMMER);
  815. exit;
  816. end;
  817. { search cons-/destructor, also in parent classes }
  818. storepos:=tokenpos;
  819. tokenpos:=destructorpos;
  820. sym:=search_class_member(classh,destructorname);
  821. tokenpos:=storepos;
  822. { the second parameter of new/dispose must be a call }
  823. { to a cons-/destructor }
  824. if (not assigned(sym)) or (sym^.typ<>procsym) then
  825. begin
  826. if tt=hnewn then
  827. Message(parser_e_expr_have_to_be_constructor_call)
  828. else
  829. Message(parser_e_expr_have_to_be_destructor_call);
  830. new_dispose_statement:=genzeronode(errorn);
  831. end
  832. else
  833. begin
  834. p2:=gensinglenode(tt,p);
  835. if ht=_NEW then
  836. begin
  837. { Constructors can take parameters.}
  838. p2^.resulttype:=ppointerdef(pd)^.pointertype.def;
  839. do_member_read(false,sym,p2,pd,again);
  840. end
  841. else
  842. begin
  843. if (m_tp in aktmodeswitches) then
  844. begin
  845. { Constructors can take parameters.}
  846. p2^.resulttype:=ppointerdef(pd)^.pointertype.def;
  847. do_member_read(false,sym,p2,pd,again);
  848. end
  849. else
  850. begin
  851. p2:=genmethodcallnode(pprocsym(sym),srsymtable,p2);
  852. { support dispose(p,done()); }
  853. if try_to_consume(_LKLAMMER) then
  854. begin
  855. if not try_to_consume(_RKLAMMER) then
  856. begin
  857. Message(parser_e_no_paras_for_destructor);
  858. consume_all_until(_RKLAMMER);
  859. consume(_RKLAMMER);
  860. end;
  861. end;
  862. end;
  863. end;
  864. { we need the real called method }
  865. cleartempgen;
  866. do_firstpass(p2);
  867. if not codegenerror then
  868. begin
  869. if (ht=_NEW) and (p2^.procdefinition^.proctypeoption<>potype_constructor) then
  870. Message(parser_e_expr_have_to_be_constructor_call);
  871. if (ht=_DISPOSE) and (p2^.procdefinition^.proctypeoption<>potype_destructor) then
  872. Message(parser_e_expr_have_to_be_destructor_call);
  873. if ht=_NEW then
  874. begin
  875. p2:=gennode(assignn,getcopy(p),gensinglenode(newn,p2));
  876. p2^.right^.resulttype:=pd2;
  877. end;
  878. end;
  879. new_dispose_statement:=p2;
  880. end;
  881. end
  882. else
  883. begin
  884. if p^.resulttype=nil then
  885. p^.resulttype:=generrordef;
  886. if (p^.resulttype^.deftype<>pointerdef) then
  887. Begin
  888. Message1(type_e_pointer_type_expected,p^.resulttype^.typename);
  889. new_dispose_statement:=genzeronode(errorn);
  890. end
  891. else
  892. begin
  893. if (ppointerdef(p^.resulttype)^.pointertype.def^.deftype=objectdef) and
  894. (oo_has_vmt in pobjectdef(ppointerdef(p^.resulttype)^.pointertype.def)^.objectoptions) then
  895. Message(parser_w_use_extended_syntax_for_objects);
  896. if (ppointerdef(p^.resulttype)^.pointertype.def^.deftype=orddef) and
  897. (porddef(ppointerdef(p^.resulttype)^.pointertype.def)^.typ=uvoid) then
  898. if (m_tp in aktmodeswitches) or
  899. (m_delphi in aktmodeswitches) then
  900. Message(parser_w_no_new_dispose_on_void_pointers)
  901. else
  902. Message(parser_e_no_new_dispose_on_void_pointers);
  903. case ht of
  904. _NEW : new_dispose_statement:=gensinglenode(simplenewn,p);
  905. _DISPOSE : new_dispose_statement:=gensinglenode(simpledisposen,p);
  906. end;
  907. end;
  908. end;
  909. consume(_RKLAMMER);
  910. end;
  911. function statement_block(starttoken : ttoken) : ptree;
  912. var
  913. first,last : ptree;
  914. filepos : tfileposinfo;
  915. begin
  916. first:=nil;
  917. filepos:=tokenpos;
  918. consume(starttoken);
  919. inc(statement_level);
  920. while not(token in [_END,_FINALIZATION]) do
  921. begin
  922. if first=nil then
  923. begin
  924. last:=gennode(statementn,nil,statement);
  925. first:=last;
  926. end
  927. else
  928. begin
  929. last^.left:=gennode(statementn,nil,statement);
  930. last:=last^.left;
  931. end;
  932. if (token in [_END,_FINALIZATION]) then
  933. break
  934. else
  935. begin
  936. { if no semicolon, then error and go on }
  937. if token<>_SEMICOLON then
  938. begin
  939. consume(_SEMICOLON);
  940. consume_all_until(_SEMICOLON);
  941. end;
  942. consume(_SEMICOLON);
  943. end;
  944. emptystats;
  945. end;
  946. { don't consume the finalization token, it is consumed when
  947. reading the finalization block, but allow it only after
  948. an initalization ! }
  949. if (starttoken<>_INITIALIZATION) or (token<>_FINALIZATION) then
  950. consume(_END);
  951. dec(statement_level);
  952. last:=gensinglenode(blockn,first);
  953. set_tree_filepos(last,filepos);
  954. statement_block:=last;
  955. end;
  956. function statement : ptree;
  957. var
  958. p : ptree;
  959. code : ptree;
  960. labelnr : pasmlabel;
  961. filepos : tfileposinfo;
  962. sr : plabelsym;
  963. label
  964. ready;
  965. begin
  966. filepos:=tokenpos;
  967. case token of
  968. _GOTO : begin
  969. if not(cs_support_goto in aktmoduleswitches)then
  970. Message(sym_e_goto_and_label_not_supported);
  971. consume(_GOTO);
  972. if (token<>_INTCONST) and (token<>_ID) then
  973. begin
  974. Message(sym_e_label_not_found);
  975. code:=genzeronode(errorn);
  976. end
  977. else
  978. begin
  979. getsym(pattern,true);
  980. consume(token);
  981. if srsym^.typ<>labelsym then
  982. begin
  983. Message(sym_e_id_is_no_label_id);
  984. code:=genzeronode(errorn);
  985. end
  986. else
  987. begin
  988. code:=genlabelnode(goton,plabelsym(srsym)^.lab);
  989. code^.labsym:=plabelsym(srsym);
  990. { set flag that this label is used }
  991. plabelsym(srsym)^.used:=true;
  992. end;
  993. end;
  994. end;
  995. _BEGIN : code:=statement_block(_BEGIN);
  996. _IF : code:=if_statement;
  997. _CASE : code:=case_statement;
  998. _REPEAT : code:=repeat_statement;
  999. _WHILE : code:=while_statement;
  1000. _FOR : code:=for_statement;
  1001. _NEW,_DISPOSE : code:=new_dispose_statement;
  1002. _WITH : code:=with_statement;
  1003. _TRY : code:=try_statement;
  1004. _RAISE : code:=raise_statement;
  1005. { semicolons,else until and end are ignored }
  1006. _SEMICOLON,
  1007. _ELSE,
  1008. _UNTIL,
  1009. _END:
  1010. code:=genzeronode(niln);
  1011. _FAIL : begin
  1012. { internalerror(100); }
  1013. if (aktprocsym^.definition^.proctypeoption<>potype_constructor) then
  1014. Message(parser_e_fail_only_in_constructor);
  1015. consume(_FAIL);
  1016. code:=genzeronode(failn);
  1017. end;
  1018. _EXIT : code:=exit_statement;
  1019. _ASM : begin
  1020. code:=_asm_statement;
  1021. end;
  1022. _EOF : begin
  1023. Message(scan_f_end_of_file);
  1024. end;
  1025. else
  1026. begin
  1027. if (token in [_INTCONST,_ID]) then
  1028. begin
  1029. getsym(pattern,true);
  1030. lastsymknown:=true;
  1031. lastsrsym:=srsym;
  1032. { it is NOT necessarily the owner
  1033. it can be a withsymtable !!! }
  1034. lastsrsymtable:=srsymtable;
  1035. if assigned(srsym) and (srsym^.typ=labelsym) then
  1036. begin
  1037. consume(token);
  1038. consume(_COLON);
  1039. { we must preserve srsym to set code later }
  1040. sr:=plabelsym(srsym);
  1041. if sr^.defined then
  1042. Message(sym_e_label_already_defined);
  1043. sr^.defined:=true;
  1044. { statement modifies srsym }
  1045. labelnr:=sr^.lab;
  1046. lastsymknown:=false;
  1047. { the pointer to the following instruction }
  1048. { isn't a very clean way }
  1049. code:=gensinglenode(labeln,statement{$ifndef tp}(){$endif});
  1050. code^.labelnr:=labelnr;
  1051. sr^.code:=code;
  1052. { sorry, but there is a jump the easiest way }
  1053. goto ready;
  1054. end;
  1055. end;
  1056. p:=expr;
  1057. if not(p^.treetype in [calln,assignn,breakn,inlinen,
  1058. continuen]) then
  1059. Message(cg_e_illegal_expression);
  1060. { specify that we don't use the value returned by the call }
  1061. { Question : can this be also improtant
  1062. for inlinen ??
  1063. it is used for :
  1064. - dispose of temp stack space
  1065. - dispose on FPU stack }
  1066. if p^.treetype=calln then
  1067. p^.return_value_used:=false;
  1068. code:=p;
  1069. end;
  1070. end;
  1071. ready:
  1072. if assigned(code) then
  1073. set_tree_filepos(code,filepos);
  1074. statement:=code;
  1075. end;
  1076. function block(islibrary : boolean) : ptree;
  1077. var
  1078. funcretsym : pfuncretsym;
  1079. storepos : tfileposinfo;
  1080. begin
  1081. { do we have an assembler block without the po_assembler?
  1082. we should allow this for Delphi compatibility (PFV) }
  1083. if (token=_ASM) and (m_delphi in aktmodeswitches) then
  1084. begin
  1085. include(aktprocsym^.definition^.procoptions,po_assembler);
  1086. block:=assembler_block;
  1087. exit;
  1088. end;
  1089. if procinfo^.returntype.def<>pdef(voiddef) then
  1090. begin
  1091. { if the current is a function aktprocsym is non nil }
  1092. { and there is a local symtable set }
  1093. storepos:=tokenpos;
  1094. tokenpos:=aktprocsym^.fileinfo;
  1095. funcretsym:=new(pfuncretsym,init(aktprocsym^.name,procinfo));
  1096. { insert in local symtable }
  1097. symtablestack^.insert(funcretsym);
  1098. tokenpos:=storepos;
  1099. if ret_in_acc(procinfo^.returntype.def) or (procinfo^.returntype.def^.deftype=floatdef) then
  1100. procinfo^.return_offset:=-funcretsym^.address;
  1101. procinfo^.funcretsym:=funcretsym;
  1102. { insert result also if support is on }
  1103. if (m_result in aktmodeswitches) then
  1104. begin
  1105. procinfo^.resultfuncretsym:=new(pfuncretsym,init('RESULT',procinfo));
  1106. symtablestack^.insert(procinfo^.resultfuncretsym);
  1107. end;
  1108. end;
  1109. read_declarations(islibrary);
  1110. { temporary space is set, while the BEGIN of the procedure }
  1111. if (symtablestack^.symtabletype=localsymtable) then
  1112. procinfo^.firsttemp_offset := -symtablestack^.datasize
  1113. else
  1114. procinfo^.firsttemp_offset := 0;
  1115. { space for the return value }
  1116. { !!!!! this means that we can not set the return value
  1117. in a subfunction !!!!! }
  1118. { because we don't know yet where the address is }
  1119. if procinfo^.returntype.def<>pdef(voiddef) then
  1120. begin
  1121. if ret_in_acc(procinfo^.returntype.def) or (procinfo^.returntype.def^.deftype=floatdef) then
  1122. { if (procinfo^.retdef^.deftype=orddef) or
  1123. (procinfo^.retdef^.deftype=pointerdef) or
  1124. (procinfo^.retdef^.deftype=enumdef) or
  1125. (procinfo^.retdef^.deftype=procvardef) or
  1126. (procinfo^.retdef^.deftype=floatdef) or
  1127. (
  1128. (procinfo^.retdef^.deftype=setdef) and
  1129. (psetdef(procinfo^.retdef)^.settype=smallset)
  1130. ) then }
  1131. begin
  1132. { the space has been set in the local symtable }
  1133. procinfo^.return_offset:=-funcretsym^.address;
  1134. if ((procinfo^.flags and pi_operator)<>0) and
  1135. assigned(opsym) then
  1136. {opsym^.address:=procinfo^.para_offset; is wrong PM }
  1137. opsym^.address:=-procinfo^.return_offset;
  1138. { eax is modified by a function }
  1139. {$ifndef newcg}
  1140. {$ifdef i386}
  1141. usedinproc:=usedinproc or ($80 shr byte(R_EAX));
  1142. if is_64bitint(procinfo^.returntype.def) then
  1143. usedinproc:=usedinproc or ($80 shr byte(R_EDX))
  1144. {$endif}
  1145. {$ifdef m68k}
  1146. usedinproc:=usedinproc or ($800 shr word(R_D0));
  1147. if is_64bitint(procinfo^.retdef) then
  1148. usedinproc:=usedinproc or ($800 shr byte(R_D1))
  1149. {$endif}
  1150. {$endif newcg}
  1151. end;
  1152. end;
  1153. {Unit initialization?.}
  1154. if (lexlevel=unit_init_level) and (current_module^.is_unit)
  1155. or islibrary then
  1156. begin
  1157. if (token=_END) then
  1158. begin
  1159. consume(_END);
  1160. { We need at least a node, else the entry/exit code is not
  1161. generated and thus no PASCALMAIN symbol which we need (PFV) }
  1162. if islibrary then
  1163. block:=genzeronode(nothingn)
  1164. else
  1165. block:=nil;
  1166. end
  1167. else
  1168. begin
  1169. if token=_INITIALIZATION then
  1170. begin
  1171. current_module^.flags:=current_module^.flags or uf_init;
  1172. block:=statement_block(_INITIALIZATION);
  1173. end
  1174. else if (token=_FINALIZATION) then
  1175. begin
  1176. if (current_module^.flags and uf_finalize)<>0 then
  1177. block:=statement_block(_FINALIZATION)
  1178. else
  1179. begin
  1180. { can we allow no INITIALIZATION for DLL ??
  1181. I think it should work PM }
  1182. block:=nil;
  1183. exit;
  1184. end;
  1185. end
  1186. else
  1187. begin
  1188. current_module^.flags:=current_module^.flags or uf_init;
  1189. block:=statement_block(_BEGIN);
  1190. end;
  1191. end;
  1192. end
  1193. else
  1194. block:=statement_block(_BEGIN);
  1195. end;
  1196. function assembler_block : ptree;
  1197. begin
  1198. read_declarations(false);
  1199. { temporary space is set, while the BEGIN of the procedure }
  1200. if symtablestack^.symtabletype=localsymtable then
  1201. procinfo^.firsttemp_offset := -symtablestack^.datasize
  1202. else
  1203. procinfo^.firsttemp_offset := 0;
  1204. { assembler code does not allocate }
  1205. { space for the return value }
  1206. if procinfo^.returntype.def<>pdef(voiddef) then
  1207. begin
  1208. if ret_in_acc(procinfo^.returntype.def) then
  1209. begin
  1210. { in assembler code the result should be directly in %eax
  1211. procinfo^.retoffset:=procinfo^.firsttemp-procinfo^.retdef^.size;
  1212. procinfo^.firsttemp:=procinfo^.retoffset; }
  1213. {$ifndef newcg}
  1214. {$ifdef i386}
  1215. usedinproc:=usedinproc or ($80 shr byte(R_EAX))
  1216. {$endif}
  1217. {$ifdef m68k}
  1218. usedinproc:=usedinproc or ($800 shr word(R_D0))
  1219. {$endif}
  1220. {$endif newcg}
  1221. end
  1222. {
  1223. else if not is_fpu(procinfo^.retdef) then
  1224. should we allow assembler functions of big elements ?
  1225. YES (FK)!!
  1226. Message(parser_e_asm_incomp_with_function_return);
  1227. }
  1228. end;
  1229. { set the framepointer to esp for assembler functions }
  1230. { but only if the are no local variables }
  1231. { added no parameter also (PM) }
  1232. { disable for methods, because self pointer is expected }
  1233. { at -8(%ebp) (JM) }
  1234. { why if se use %esp then self is still at the correct address PM }
  1235. if {not(assigned(procinfo^._class)) and}
  1236. (po_assembler in aktprocsym^.definition^.procoptions) and
  1237. (aktprocsym^.definition^.localst^.datasize=0) and
  1238. (aktprocsym^.definition^.parast^.datasize=0) and
  1239. not(ret_in_param(aktprocsym^.definition^.rettype.def)) then
  1240. begin
  1241. procinfo^.framepointer:=stack_pointer;
  1242. { set the right value for parameters }
  1243. dec(aktprocsym^.definition^.parast^.address_fixup,target_os.size_of_pointer);
  1244. dec(procinfo^.para_offset,target_os.size_of_pointer);
  1245. end;
  1246. { force the asm statement }
  1247. if token<>_ASM then
  1248. consume(_ASM);
  1249. procinfo^.Flags := procinfo^.Flags Or pi_is_assembler;
  1250. assembler_block:=_asm_statement;
  1251. { becuase the END is already read we need to get the
  1252. last_endtoken_filepos here (PFV) }
  1253. last_endtoken_filepos:=tokenpos;
  1254. end;
  1255. end.
  1256. {
  1257. $Log$
  1258. Revision 1.3 2000-07-13 12:08:27 michael
  1259. + patched to 1.1.0 with former 1.09patch from peter
  1260. Revision 1.2 2000/07/13 11:32:45 michael
  1261. + removed logs
  1262. }