pstatmnt.pas 50 KB

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