pstatmnt.pas 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424
  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(is_ordinal(casedef) or is_64bitint(casedef)) then
  171. begin
  172. Message(type_e_ordinal_expr_expected);
  173. { set error flag so no rangechecks are done }
  174. casedeferror:=true;
  175. end;
  176. consume(_OF);
  177. inc(statement_level);
  178. root:=nil;
  179. instruc:=nil;
  180. repeat
  181. getlabel(aktcaselabel);
  182. firstlabel:=true;
  183. { may be an instruction has more case labels }
  184. repeat
  185. p:=expr;
  186. cleartempgen;
  187. do_firstpass(p);
  188. hl1:=0;
  189. hl2:=0;
  190. if (p^.treetype=rangen) then
  191. begin
  192. { type checking for case statements }
  193. if is_subequal(casedef, p^.left^.resulttype) and
  194. is_subequal(casedef, p^.right^.resulttype) then
  195. begin
  196. hl1:=get_ordinal_value(p^.left);
  197. hl2:=get_ordinal_value(p^.right);
  198. if hl1>hl2 then
  199. Message(parser_e_case_lower_less_than_upper_bound);
  200. if not casedeferror then
  201. begin
  202. testrange(casedef,hl1);
  203. testrange(casedef,hl2);
  204. end;
  205. end
  206. else
  207. Message(parser_e_case_mismatch);
  208. newcaselabel(hl1,hl2,firstlabel);
  209. end
  210. else
  211. begin
  212. { type checking for case statements }
  213. if not is_subequal(casedef, p^.resulttype) then
  214. Message(parser_e_case_mismatch);
  215. hl1:=get_ordinal_value(p);
  216. if not casedeferror then
  217. testrange(casedef,hl1);
  218. newcaselabel(hl1,hl1,firstlabel);
  219. end;
  220. disposetree(p);
  221. if token=_COMMA then
  222. consume(_COMMA)
  223. else
  224. break;
  225. firstlabel:=false;
  226. until false;
  227. consume(_COLON);
  228. { handles instruction block }
  229. p:=gensinglenode(labeln,statement);
  230. p^.labelnr:=aktcaselabel;
  231. { concats instruction }
  232. instruc:=gennode(statementn,instruc,p);
  233. if not((token=_ELSE) or (token=_OTHERWISE) or (token=_END)) then
  234. consume(_SEMICOLON);
  235. until (token=_ELSE) or (token=_OTHERWISE) or (token=_END);
  236. if (token=_ELSE) or (token=_OTHERWISE) then
  237. begin
  238. if not try_to_consume(_ELSE) then
  239. consume(_OTHERWISE);
  240. elseblock:=statements_til_end;
  241. end
  242. else
  243. begin
  244. elseblock:=nil;
  245. consume(_END);
  246. end;
  247. dec(statement_level);
  248. code:=gencasenode(caseexpr,instruc,root);
  249. code^.elseblock:=elseblock;
  250. case_statement:=code;
  251. end;
  252. function repeat_statement : ptree;
  253. var
  254. first,last,p_e : ptree;
  255. begin
  256. consume(_REPEAT);
  257. first:=nil;
  258. inc(statement_level);
  259. while token<>_UNTIL do
  260. begin
  261. if first=nil then
  262. begin
  263. last:=gennode(statementn,nil,statement);
  264. first:=last;
  265. end
  266. else
  267. begin
  268. last^.left:=gennode(statementn,nil,statement);
  269. last:=last^.left;
  270. end;
  271. if not try_to_consume(_SEMICOLON) then
  272. break;
  273. emptystats;
  274. end;
  275. consume(_UNTIL);
  276. dec(statement_level);
  277. first:=gensinglenode(blockn,first);
  278. p_e:=comp_expr(true);
  279. repeat_statement:=genloopnode(repeatn,p_e,first,nil,false);
  280. end;
  281. function while_statement : ptree;
  282. var
  283. p_e,p_a : ptree;
  284. begin
  285. consume(_WHILE);
  286. p_e:=comp_expr(true);
  287. consume(_DO);
  288. p_a:=statement;
  289. while_statement:=genloopnode(whilen,p_e,p_a,nil,false);
  290. end;
  291. function for_statement : ptree;
  292. var
  293. p_e,tovalue,p_a : ptree;
  294. backward : boolean;
  295. begin
  296. { parse loop header }
  297. consume(_FOR);
  298. p_e:=expr;
  299. if token=_DOWNTO then
  300. begin
  301. consume(_DOWNTO);
  302. backward:=true;
  303. end
  304. else
  305. begin
  306. consume(_TO);
  307. backward:=false;
  308. end;
  309. tovalue:=comp_expr(true);
  310. consume(_DO);
  311. { ... now the instruction }
  312. p_a:=statement;
  313. for_statement:=genloopnode(forn,p_e,tovalue,p_a,backward);
  314. end;
  315. function _with_statement : ptree;
  316. var
  317. right,hp,p : ptree;
  318. i,levelcount : longint;
  319. withsymtable,symtab : psymtable;
  320. obj : pobjectdef;
  321. begin
  322. Must_be_valid:=false;
  323. p:=comp_expr(true);
  324. do_firstpass(p);
  325. right:=nil;
  326. if (not codegenerror) and
  327. (p^.resulttype^.deftype in [objectdef,recorddef]) then
  328. begin
  329. case p^.resulttype^.deftype of
  330. objectdef : begin
  331. obj:=pobjectdef(p^.resulttype);
  332. withsymtable:=new(pwithsymtable,init);
  333. withsymtable^.symsearch:=obj^.symtable^.symsearch;
  334. withsymtable^.defowner:=obj;
  335. symtab:=withsymtable;
  336. if (p^.treetype=loadn) and
  337. (p^.symtable=aktprocsym^.definition^.localst) then
  338. pwithsymtable(symtab)^.direct_with:=true;
  339. {symtab^.withnode:=p; not yet allocated !! }
  340. pwithsymtable(symtab)^.withrefnode:=p;
  341. levelcount:=1;
  342. obj:=obj^.childof;
  343. while assigned(obj) do
  344. begin
  345. symtab^.next:=new(pwithsymtable,init);
  346. symtab:=symtab^.next;
  347. symtab^.symsearch:=obj^.symtable^.symsearch;
  348. if (p^.treetype=loadn) and
  349. (p^.symtable=aktprocsym^.definition^.localst) then
  350. pwithsymtable(symtab)^.direct_with:=true;
  351. {symtab^.withnode:=p; not yet allocated !! }
  352. pwithsymtable(symtab)^.withrefnode:=p;
  353. symtab^.defowner:=obj;
  354. obj:=obj^.childof;
  355. inc(levelcount);
  356. end;
  357. symtab^.next:=symtablestack;
  358. symtablestack:=withsymtable;
  359. end;
  360. recorddef : begin
  361. symtab:=precorddef(p^.resulttype)^.symtable;
  362. levelcount:=1;
  363. withsymtable:=new(pwithsymtable,init);
  364. withsymtable^.symsearch:=symtab^.symsearch;
  365. withsymtable^.next:=symtablestack;
  366. if (p^.treetype=loadn) and
  367. (p^.symtable=aktprocsym^.definition^.localst) then
  368. pwithsymtable(withsymtable)^.direct_with:=true;
  369. {symtab^.withnode:=p; not yet allocated !! }
  370. pwithsymtable(withsymtable)^.withrefnode:=p;
  371. withsymtable^.defowner:=obj;
  372. symtablestack:=withsymtable;
  373. end;
  374. end;
  375. if token=_COMMA then
  376. begin
  377. consume(_COMMA);
  378. {$ifdef tp}
  379. right:=_with_statement;
  380. {$else}
  381. right:=_with_statement();
  382. {$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. hp:=_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)^.definition^.deftype=objectdef) and
  517. pobjectdef(ptypesym(srsym)^.definition)^.is_class then
  518. ot:=pobjectdef(ptypesym(srsym)^.definition)
  519. else
  520. begin
  521. ot:=pobjectdef(generrordef);
  522. if (srsym^.typ=typesym) then
  523. Message1(type_e_class_type_expected,ptypesym(srsym)^.definition^.typename)
  524. else
  525. Message1(type_e_class_type_expected,ot^.typename);
  526. end;
  527. sym:=new(pvarsym,init(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)^.definition^.deftype=objectdef) and
  545. pobjectdef(ptypesym(srsym)^.definition)^.is_class then
  546. ot:=pobjectdef(ptypesym(srsym)^.definition)
  547. else
  548. begin
  549. ot:=pobjectdef(generrordef);
  550. if (srsym^.typ=typesym) then
  551. Message1(type_e_class_type_expected,ptypesym(srsym)^.definition^.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^.retdef=pdef(voiddef) then
  619. Message(parser_e_void_function);
  620. {
  621. else
  622. procinfo^.funcret_is_valid:=true;
  623. }
  624. end
  625. else
  626. p:=nil;
  627. p:=gensinglenode(exitn,p);
  628. p^.resulttype:=procinfo^.retdef;
  629. exit_statement:=p;
  630. end;
  631. function _asm_statement : ptree;
  632. var
  633. asmstat : ptree;
  634. Marker : Pai;
  635. begin
  636. Inside_asm_statement:=true;
  637. case aktasmmode of
  638. asmmode_none : ; { just be there to allow to a compile without
  639. any assembler readers }
  640. {$ifdef i386}
  641. {$ifndef NoRA386Att}
  642. asmmode_i386_att:
  643. asmstat:=ra386att.assemble;
  644. {$endif NoRA386Att}
  645. {$ifndef NoRA386Int}
  646. asmmode_i386_intel:
  647. asmstat:=ra386int.assemble;
  648. {$endif NoRA386Int}
  649. {$ifndef NoRA386Dir}
  650. asmmode_i386_direct:
  651. begin
  652. if not target_asm.allowdirect then
  653. Message(parser_f_direct_assembler_not_allowed);
  654. if (pocall_inline in aktprocsym^.definition^.proccalloptions) then
  655. Begin
  656. Message1(parser_w_not_supported_for_inline,'direct asm');
  657. Message(parser_w_inlining_disabled);
  658. {$ifdef INCLUDEOK}
  659. exclude(aktprocsym^.definition^.proccalloptions,pocall_inline);
  660. {$else}
  661. aktprocsym^.definition^.proccalloptions:=aktprocsym^.definition^.proccalloptions-[pocall_inline];
  662. {$endif}
  663. End;
  664. asmstat:=ra386dir.assemble;
  665. end;
  666. {$endif NoRA386Dir}
  667. {$endif}
  668. {$ifdef m68k}
  669. {$ifndef NoRA68kMot}
  670. asmmode_m68k_mot:
  671. asmstat:=ra68kmot.assemble;
  672. {$endif NoRA68kMot}
  673. {$endif}
  674. else
  675. Message(parser_f_assembler_reader_not_supported);
  676. end;
  677. { Read first the _ASM statement }
  678. consume(_ASM);
  679. {$ifndef newcg}
  680. { END is read }
  681. if try_to_consume(_LECKKLAMMER) then
  682. begin
  683. { it's possible to specify the modified registers }
  684. asmstat^.object_preserved:=true;
  685. if token<>_RECKKLAMMER then
  686. repeat
  687. { uppercase, because it's a CSTRING }
  688. uppervar(pattern);
  689. {$ifdef i386}
  690. if pattern='EAX' then
  691. usedinproc:=usedinproc or ($80 shr byte(R_EAX))
  692. else if pattern='EBX' then
  693. usedinproc:=usedinproc or ($80 shr byte(R_EBX))
  694. else if pattern='ECX' then
  695. usedinproc:=usedinproc or ($80 shr byte(R_ECX))
  696. else if pattern='EDX' then
  697. usedinproc:=usedinproc or ($80 shr byte(R_EDX))
  698. else if pattern='ESI' then
  699. begin
  700. usedinproc:=usedinproc or ($80 shr byte(R_ESI));
  701. asmstat^.object_preserved:=false;
  702. end
  703. else if pattern='EDI' then
  704. usedinproc:=usedinproc or ($80 shr byte(R_EDI))
  705. {$endif i386}
  706. {$ifdef m68k}
  707. if pattern='D0' then
  708. usedinproc:=usedinproc or ($800 shr word(R_D0))
  709. else if pattern='D1' then
  710. usedinproc:=usedinproc or ($800 shr word(R_D1))
  711. else if pattern='D6' then
  712. usedinproc:=usedinproc or ($800 shr word(R_D6))
  713. else if pattern='A0' then
  714. usedinproc:=usedinproc or ($800 shr word(R_A0))
  715. else if pattern='A1' then
  716. usedinproc:=usedinproc or ($800 shr word(R_A1))
  717. {$endif m68k}
  718. else consume(_RECKKLAMMER);
  719. consume(_CSTRING);
  720. if not try_to_consume(_COMMA) then
  721. break;
  722. until false;
  723. consume(_RECKKLAMMER);
  724. end
  725. else usedinproc:=$ff;
  726. {$endif newcg}
  727. { mark the start and the end of the assembler block for the optimizer }
  728. If Assigned(AsmStat^.p_asm) Then
  729. Begin
  730. Marker := New(Pai_Marker, Init(AsmBlockStart));
  731. AsmStat^.p_asm^.Insert(Marker);
  732. Marker := New(Pai_Marker, Init(AsmBlockEnd));
  733. AsmStat^.p_asm^.Concat(Marker);
  734. End;
  735. Inside_asm_statement:=false;
  736. _asm_statement:=asmstat;
  737. end;
  738. function new_dispose_statement : ptree;
  739. var
  740. p,p2 : ptree;
  741. ht : ttoken;
  742. again : boolean; { dummy for do_proc_call }
  743. destrukname : stringid;
  744. sym : psym;
  745. classh : pobjectdef;
  746. pd,pd2 : pdef;
  747. store_valid : boolean;
  748. destructorpos,storepos : tfileposinfo;
  749. tt : ttreetyp;
  750. begin
  751. ht:=token;
  752. if try_to_consume(_NEW) then
  753. tt:=hnewn
  754. else
  755. begin
  756. consume(_DISPOSE);
  757. tt:=hdisposen;
  758. end;
  759. consume(_LKLAMMER);
  760. { displaced here to avoid warnings in BP mode (PM) }
  761. Store_valid := Must_be_valid;
  762. if tt=hnewn then
  763. Must_be_valid := False
  764. else
  765. Must_be_valid:=true;
  766. p:=comp_expr(true);
  767. { calc return type }
  768. cleartempgen;
  769. do_firstpass(p);
  770. Must_be_valid := Store_valid;
  771. {var o:Pobject;
  772. begin
  773. new(o,init); (*Also a valid new statement*)
  774. end;}
  775. if try_to_consume(_COMMA) then
  776. begin
  777. { extended syntax of new and dispose }
  778. { function styled new is handled in factor }
  779. { destructors have no parameters }
  780. destrukname:=pattern;
  781. destructorpos:=tokenpos;
  782. consume(_ID);
  783. pd:=p^.resulttype;
  784. if pd=nil then
  785. pd:=generrordef;
  786. pd2:=pd;
  787. if (pd^.deftype<>pointerdef) then
  788. begin
  789. Message1(type_e_pointer_type_expected,pd^.typename);
  790. p:=factor(false);
  791. consume(_RKLAMMER);
  792. new_dispose_statement:=genzeronode(errorn);
  793. exit;
  794. end;
  795. { first parameter must be an object or class }
  796. if ppointerdef(pd)^.definition^.deftype<>objectdef then
  797. begin
  798. Message(parser_e_pointer_to_class_expected);
  799. new_dispose_statement:=factor(false);
  800. consume_all_until(_RKLAMMER);
  801. consume(_RKLAMMER);
  802. exit;
  803. end;
  804. { check, if the first parameter is a pointer to a _class_ }
  805. classh:=pobjectdef(ppointerdef(pd)^.definition);
  806. if classh^.is_class then
  807. begin
  808. Message(parser_e_no_new_or_dispose_for_classes);
  809. new_dispose_statement:=factor(false);
  810. consume_all_until(_RKLAMMER);
  811. consume(_RKLAMMER);
  812. exit;
  813. end;
  814. { search cons-/destructor, also in parent classes }
  815. storepos:=tokenpos;
  816. tokenpos:=destructorpos;
  817. sym:=search_class_member(classh,pattern);
  818. tokenpos:=storepos;
  819. { the second parameter of new/dispose must be a call }
  820. { to a cons-/destructor }
  821. if (not assigned(sym)) or (sym^.typ<>procsym) then
  822. begin
  823. Message(parser_e_expr_have_to_be_destructor_call);
  824. new_dispose_statement:=genzeronode(errorn);
  825. end
  826. else
  827. begin
  828. p2:=gensinglenode(tt,p);
  829. if ht=_NEW then
  830. begin
  831. { Constructors can take parameters.}
  832. p2^.resulttype:=ppointerdef(pd)^.definition;
  833. do_member_read(false,sym,p2,pd,again);
  834. end
  835. else
  836. { destructors can't.}
  837. p2:=genmethodcallnode(pprocsym(sym),srsymtable,p2);
  838. { we need the real called method }
  839. cleartempgen;
  840. do_firstpass(p2);
  841. if not codegenerror then
  842. begin
  843. if (ht=_NEW) and (p2^.procdefinition^.proctypeoption<>potype_constructor) then
  844. Message(parser_e_expr_have_to_be_constructor_call);
  845. if (ht=_DISPOSE) and (p2^.procdefinition^.proctypeoption<>potype_destructor) then
  846. Message(parser_e_expr_have_to_be_destructor_call);
  847. if ht=_NEW then
  848. begin
  849. p2:=gennode(assignn,getcopy(p),gensinglenode(newn,p2));
  850. p2^.right^.resulttype:=pd2;
  851. end;
  852. end;
  853. new_dispose_statement:=p2;
  854. end;
  855. end
  856. else
  857. begin
  858. if p^.resulttype=nil then
  859. p^.resulttype:=generrordef;
  860. if (p^.resulttype^.deftype<>pointerdef) then
  861. Begin
  862. Message1(type_e_pointer_type_expected,p^.resulttype^.typename);
  863. new_dispose_statement:=genzeronode(errorn);
  864. end
  865. else
  866. begin
  867. if (ppointerdef(p^.resulttype)^.definition^.deftype=objectdef) and
  868. (oo_has_vmt in pobjectdef(ppointerdef(p^.resulttype)^.definition)^.objectoptions) then
  869. Message(parser_w_use_extended_syntax_for_objects);
  870. if (ppointerdef(p^.resulttype)^.definition^.deftype=orddef) and
  871. (porddef(ppointerdef(p^.resulttype)^.definition)^.typ=uvoid) then
  872. if (m_tp in aktmodeswitches) or
  873. (m_delphi in aktmodeswitches) then
  874. Message(parser_w_no_new_dispose_on_void_pointers)
  875. else
  876. Message(parser_e_no_new_dispose_on_void_pointers);
  877. case ht of
  878. _NEW : new_dispose_statement:=gensinglenode(simplenewn,p);
  879. _DISPOSE : new_dispose_statement:=gensinglenode(simpledisposen,p);
  880. end;
  881. end;
  882. end;
  883. consume(_RKLAMMER);
  884. end;
  885. function statement_block(starttoken : ttoken) : ptree;
  886. var
  887. first,last : ptree;
  888. filepos : tfileposinfo;
  889. begin
  890. first:=nil;
  891. filepos:=tokenpos;
  892. consume(starttoken);
  893. inc(statement_level);
  894. while not(token in [_END,_FINALIZATION]) do
  895. begin
  896. if first=nil then
  897. begin
  898. last:=gennode(statementn,nil,statement);
  899. first:=last;
  900. end
  901. else
  902. begin
  903. last^.left:=gennode(statementn,nil,statement);
  904. last:=last^.left;
  905. end;
  906. if (token in [_END,_FINALIZATION]) then
  907. break
  908. else
  909. begin
  910. { if no semicolon, then error and go on }
  911. if token<>_SEMICOLON then
  912. begin
  913. consume(_SEMICOLON);
  914. consume_all_until(_SEMICOLON);
  915. end;
  916. consume(_SEMICOLON);
  917. end;
  918. emptystats;
  919. end;
  920. { don't consume the finalization token, it is consumed when
  921. reading the finalization block, but allow it only after
  922. an initalization ! }
  923. if (starttoken<>_INITIALIZATION) or (token<>_FINALIZATION) then
  924. consume(_END);
  925. dec(statement_level);
  926. last:=gensinglenode(blockn,first);
  927. set_tree_filepos(last,filepos);
  928. statement_block:=last;
  929. end;
  930. function statement : ptree;
  931. var
  932. p : ptree;
  933. code : ptree;
  934. labelnr : pasmlabel;
  935. filepos : tfileposinfo;
  936. label
  937. ready;
  938. begin
  939. filepos:=tokenpos;
  940. case token of
  941. _GOTO : begin
  942. if not(cs_support_goto in aktmoduleswitches)then
  943. Message(sym_e_goto_and_label_not_supported);
  944. consume(_GOTO);
  945. if (token<>_INTCONST) and (token<>_ID) then
  946. begin
  947. Message(sym_e_label_not_found);
  948. code:=genzeronode(errorn);
  949. end
  950. else
  951. begin
  952. getsym(pattern,true);
  953. consume(token);
  954. if srsym^.typ<>labelsym then
  955. begin
  956. Message(sym_e_id_is_no_label_id);
  957. code:=genzeronode(errorn);
  958. end
  959. else
  960. begin
  961. code:=genlabelnode(goton,plabelsym(srsym)^.lab);
  962. { set flag that this label is used }
  963. plabelsym(srsym)^.used:=true;
  964. end;
  965. end;
  966. end;
  967. _BEGIN : code:=statement_block(_BEGIN);
  968. _IF : code:=if_statement;
  969. _CASE : code:=case_statement;
  970. _REPEAT : code:=repeat_statement;
  971. _WHILE : code:=while_statement;
  972. _FOR : code:=for_statement;
  973. _NEW,_DISPOSE : code:=new_dispose_statement;
  974. _WITH : code:=with_statement;
  975. _TRY : code:=try_statement;
  976. _RAISE : code:=raise_statement;
  977. { semicolons,else until and end are ignored }
  978. _SEMICOLON,
  979. _ELSE,
  980. _UNTIL,
  981. _END:
  982. code:=genzeronode(niln);
  983. _FAIL : begin
  984. { internalerror(100); }
  985. if (aktprocsym^.definition^.proctypeoption<>potype_constructor) then
  986. Message(parser_e_fail_only_in_constructor);
  987. consume(_FAIL);
  988. code:=genzeronode(failn);
  989. end;
  990. _EXIT : code:=exit_statement;
  991. _ASM : begin
  992. code:=_asm_statement;
  993. end;
  994. _EOF : begin
  995. Message(scan_f_end_of_file);
  996. end;
  997. else
  998. begin
  999. if (token in [_INTCONST,_ID]) then
  1000. begin
  1001. getsym(pattern,true);
  1002. lastsymknown:=true;
  1003. lastsrsym:=srsym;
  1004. { it is NOT necessarily the owner
  1005. it can be a withsymtable !!! }
  1006. lastsrsymtable:=srsymtable;
  1007. if assigned(srsym) and (srsym^.typ=labelsym) then
  1008. begin
  1009. consume(token);
  1010. consume(_COLON);
  1011. if plabelsym(srsym)^.defined then
  1012. Message(sym_e_label_already_defined);
  1013. plabelsym(srsym)^.defined:=true;
  1014. { statement modifies srsym }
  1015. labelnr:=plabelsym(srsym)^.lab;
  1016. lastsymknown:=false;
  1017. { the pointer to the following instruction }
  1018. { isn't a very clean way }
  1019. code:=gensinglenode(labeln,statement{$ifndef tp}(){$endif});
  1020. code^.labelnr:=labelnr;
  1021. { sorry, but there is a jump the easiest way }
  1022. goto ready;
  1023. end;
  1024. end;
  1025. p:=expr;
  1026. if not(p^.treetype in [calln,assignn,breakn,inlinen,
  1027. continuen]) then
  1028. Message(cg_e_illegal_expression);
  1029. { specify that we don't use the value returned by the call }
  1030. { Question : can this be also improtant
  1031. for inlinen ??
  1032. it is used for :
  1033. - dispose of temp stack space
  1034. - dispose on FPU stack }
  1035. if p^.treetype=calln then
  1036. p^.return_value_used:=false;
  1037. code:=p;
  1038. end;
  1039. end;
  1040. ready:
  1041. if assigned(code) then
  1042. set_tree_filepos(code,filepos);
  1043. statement:=code;
  1044. end;
  1045. function block(islibrary : boolean) : ptree;
  1046. var
  1047. funcretsym : pfuncretsym;
  1048. storepos : tfileposinfo;
  1049. begin
  1050. if procinfo^.retdef<>pdef(voiddef) then
  1051. begin
  1052. { if the current is a function aktprocsym is non nil }
  1053. { and there is a local symtable set }
  1054. storepos:=tokenpos;
  1055. tokenpos:=aktprocsym^.fileinfo;
  1056. funcretsym:=new(pfuncretsym,init(aktprocsym^.name,procinfo));
  1057. { insert in local symtable }
  1058. symtablestack^.insert(funcretsym);
  1059. tokenpos:=storepos;
  1060. if ret_in_acc(procinfo^.retdef) or (procinfo^.retdef^.deftype=floatdef) then
  1061. procinfo^.retoffset:=-funcretsym^.address;
  1062. procinfo^.funcretsym:=funcretsym;
  1063. { insert result also if support is on }
  1064. if (m_result in aktmodeswitches) then
  1065. begin
  1066. procinfo^.resultfuncretsym:=new(pfuncretsym,init('RESULT',procinfo));
  1067. symtablestack^.insert(procinfo^.resultfuncretsym);
  1068. end;
  1069. end;
  1070. read_declarations(islibrary);
  1071. { temporary space is set, while the BEGIN of the procedure }
  1072. if (symtablestack^.symtabletype=localsymtable) then
  1073. procinfo^.firsttemp := -symtablestack^.datasize
  1074. else procinfo^.firsttemp := 0;
  1075. { space for the return value }
  1076. { !!!!! this means that we can not set the return value
  1077. in a subfunction !!!!! }
  1078. { because we don't know yet where the address is }
  1079. if procinfo^.retdef<>pdef(voiddef) then
  1080. begin
  1081. if ret_in_acc(procinfo^.retdef) or (procinfo^.retdef^.deftype=floatdef) then
  1082. { if (procinfo^.retdef^.deftype=orddef) or
  1083. (procinfo^.retdef^.deftype=pointerdef) or
  1084. (procinfo^.retdef^.deftype=enumdef) or
  1085. (procinfo^.retdef^.deftype=procvardef) or
  1086. (procinfo^.retdef^.deftype=floatdef) or
  1087. (
  1088. (procinfo^.retdef^.deftype=setdef) and
  1089. (psetdef(procinfo^.retdef)^.settype=smallset)
  1090. ) then }
  1091. begin
  1092. { the space has been set in the local symtable }
  1093. procinfo^.retoffset:=-funcretsym^.address;
  1094. if ((procinfo^.flags and pi_operator)<>0) and
  1095. assigned(opsym) then
  1096. {opsym^.address:=procinfo^.call_offset; is wrong PM }
  1097. opsym^.address:=-procinfo^.retoffset;
  1098. { eax is modified by a function }
  1099. {$ifndef newcg}
  1100. {$ifdef i386}
  1101. usedinproc:=usedinproc or ($80 shr byte(R_EAX));
  1102. if is_64bitint(procinfo^.retdef) then
  1103. usedinproc:=usedinproc or ($80 shr byte(R_EDX))
  1104. {$endif}
  1105. {$ifdef m68k}
  1106. usedinproc:=usedinproc or ($800 shr word(R_D0));
  1107. if is_64bitint(procinfo^.retdef) then
  1108. usedinproc:=usedinproc or ($800 shr byte(R_D1))
  1109. {$endif}
  1110. {$endif newcg}
  1111. end;
  1112. end;
  1113. {Unit initialization?.}
  1114. if (lexlevel=unit_init_level) and (current_module^.is_unit) then
  1115. if (token=_END) then
  1116. begin
  1117. consume(_END);
  1118. block:=nil;
  1119. end
  1120. else
  1121. begin
  1122. if token=_INITIALIZATION then
  1123. begin
  1124. current_module^.flags:=current_module^.flags or uf_init;
  1125. block:=statement_block(_INITIALIZATION);
  1126. end
  1127. else if (token=_FINALIZATION) then
  1128. begin
  1129. if (current_module^.flags and uf_finalize)<>0 then
  1130. block:=statement_block(_FINALIZATION)
  1131. else
  1132. begin
  1133. block:=nil;
  1134. exit;
  1135. end;
  1136. end
  1137. else
  1138. begin
  1139. current_module^.flags:=current_module^.flags or uf_init;
  1140. block:=statement_block(_BEGIN);
  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 := -symtablestack^.datasize
  1152. else
  1153. procinfo^.firsttemp := 0;
  1154. { assembler code does not allocate }
  1155. { space for the return value }
  1156. if procinfo^.retdef<>pdef(voiddef) then
  1157. begin
  1158. if ret_in_acc(procinfo^.retdef) 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^.retdef)) 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.109 1999-11-15 22:00:48 peter
  1208. * labels used but not defined give error instead of warning, the warning
  1209. is now only with declared but not defined and not used.
  1210. Revision 1.108 1999/11/10 00:24:02 pierre
  1211. * more browser details
  1212. Revision 1.107 1999/11/09 13:02:46 peter
  1213. * fixed 'raise end;'
  1214. Revision 1.106 1999/11/06 14:34:23 peter
  1215. * truncated log to 20 revs
  1216. Revision 1.105 1999/10/22 10:39:35 peter
  1217. * split type reading from pdecl to ptype unit
  1218. * parameter_dec routine is now used for procedure and procvars
  1219. Revision 1.104 1999/10/14 14:57:54 florian
  1220. - removed the hcodegen use in the new cg, use cgbase instead
  1221. Revision 1.103 1999/09/27 23:44:56 peter
  1222. * procinfo is now a pointer
  1223. * support for result setting in sub procedure
  1224. Revision 1.102 1999/09/16 23:05:54 florian
  1225. * m68k compiler is again compilable (only gas writer, no assembler reader)
  1226. Revision 1.101 1999/09/10 18:48:09 florian
  1227. * some bug fixes (e.g. must_be_valid and procinfo^.funcret_is_valid)
  1228. * most things for stored properties fixed
  1229. Revision 1.100 1999/09/07 14:12:36 jonas
  1230. * framepointer cannot be changed to esp for methods
  1231. Revision 1.99 1999/08/26 21:10:08 peter
  1232. * better error recovery for case
  1233. Revision 1.98 1999/08/05 16:53:05 peter
  1234. * V_Fatal=1, all other V_ are also increased
  1235. * Check for local procedure when assigning procvar
  1236. * fixed comment parsing because directives
  1237. * oldtp mode directives better supported
  1238. * added some messages to errore.msg
  1239. Revision 1.97 1999/08/04 13:02:59 jonas
  1240. * all tokens now start with an underscore
  1241. * PowerPC compiles!!
  1242. Revision 1.96 1999/08/04 00:23:19 florian
  1243. * renamed i386asm and i386base to cpuasm and cpubase
  1244. Revision 1.95 1999/08/03 22:03:03 peter
  1245. * moved bitmask constants to sets
  1246. * some other type/const renamings
  1247. Revision 1.94 1999/08/03 17:09:39 florian
  1248. * the alpha compiler can be compiled now
  1249. Revision 1.93 1999/08/02 21:28:59 florian
  1250. * the main branch psub.pas is now used for
  1251. newcg compiler
  1252. Revision 1.92 1999/07/26 09:42:14 florian
  1253. * bugs 494-496 fixed
  1254. Revision 1.91 1999/06/30 22:16:22 florian
  1255. * use of is_ordinal checked: often a qword/int64 isn't allowed (case/for ...)
  1256. * small qword problems fixed
  1257. Revision 1.90 1999/06/22 16:24:43 pierre
  1258. * local browser stuff corrected
  1259. Revision 1.89 1999/06/17 13:19:54 pierre
  1260. * merged from 0_99_12 branch
  1261. Revision 1.88.2.1 1999/06/17 12:51:46 pierre
  1262. * changed is_assignment_overloaded into
  1263. function assignment_overloaded : pprocdef
  1264. to allow overloading of assignment with only different result type
  1265. Revision 1.88 1999/06/15 13:19:46 pierre
  1266. * better uninitialized var tests for TP mode
  1267. Revision 1.87 1999/05/27 19:44:50 peter
  1268. * removed oldasm
  1269. * plabel -> pasmlabel
  1270. * -a switches to source writing automaticly
  1271. * assembler readers OOPed
  1272. * asmsymbol automaticly external
  1273. * jumptables and other label fixes for asm readers
  1274. }