pstatmnt.pas 50 KB

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