pstatmnt.pas 49 KB

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