pstatmnt.pas 51 KB

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