tcinl.pas 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl
  4. Type checking and register allocation for inline nodes
  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 tcinl;
  19. interface
  20. uses
  21. tree;
  22. procedure firstinline(var p : ptree);
  23. implementation
  24. uses
  25. cobjects,verbose,globals,systems,
  26. globtype,
  27. symconst,symtable,aasm,types,
  28. hcodegen,htypechk,pass_1,
  29. tccal,cpubase
  30. {$ifdef i386}
  31. ,tgeni386
  32. {$endif}
  33. ;
  34. {*****************************************************************************
  35. FirstInLine
  36. *****************************************************************************}
  37. procedure firstinline(var p : ptree);
  38. var
  39. vl,vl2 : longint;
  40. vr : bestreal;
  41. p1,hp,hpp : ptree;
  42. {$ifndef NOCOLONCHECK}
  43. frac_para,length_para : ptree;
  44. {$endif ndef NOCOLONCHECK}
  45. store_count_ref,
  46. isreal,
  47. dowrite,
  48. store_valid,
  49. file_is_typed : boolean;
  50. procedure do_lowhigh(adef : pdef);
  51. var
  52. v : longint;
  53. enum : penumsym;
  54. begin
  55. case Adef^.deftype of
  56. orddef:
  57. begin
  58. if p^.inlinenumber=in_low_x then
  59. v:=porddef(Adef)^.low
  60. else
  61. v:=porddef(Adef)^.high;
  62. hp:=genordinalconstnode(v,adef);
  63. firstpass(hp);
  64. disposetree(p);
  65. p:=hp;
  66. end;
  67. enumdef:
  68. begin
  69. enum:=Penumdef(Adef)^.firstenum;
  70. if p^.inlinenumber=in_high_x then
  71. while enum^.nextenum<>nil do
  72. enum:=enum^.nextenum;
  73. hp:=genenumnode(enum);
  74. disposetree(p);
  75. p:=hp;
  76. end;
  77. arraydef:
  78. begin
  79. halt;
  80. end;
  81. end;
  82. end;
  83. begin
  84. store_valid:=must_be_valid;
  85. store_count_ref:=count_ref;
  86. count_ref:=false;
  87. if not (p^.inlinenumber in [in_read_x,in_readln_x,in_sizeof_x,
  88. in_typeof_x,in_ord_x,in_str_x_string,in_val_x,
  89. in_reset_typedfile,in_rewrite_typedfile]) then
  90. must_be_valid:=true
  91. else
  92. must_be_valid:=false;
  93. { if we handle writeln; p^.left contains no valid address }
  94. if assigned(p^.left) then
  95. begin
  96. if p^.left^.treetype=callparan then
  97. firstcallparan(p^.left,nil)
  98. else
  99. firstpass(p^.left);
  100. left_right_max(p);
  101. set_location(p^.location,p^.left^.location);
  102. end;
  103. { handle intern constant functions in separate case }
  104. if p^.inlineconst then
  105. begin
  106. hp:=nil;
  107. { no parameters? }
  108. if not assigned(p^.left) then
  109. begin
  110. case p^.inlinenumber of
  111. in_const_pi :
  112. hp:=genrealconstnode(pi,bestrealdef^);
  113. else
  114. internalerror(89);
  115. end;
  116. end
  117. else
  118. { process constant expression with parameter }
  119. begin
  120. vl:=0;
  121. vl2:=0; { second parameter Ex: ptr(vl,vl2) }
  122. vr:=0;
  123. isreal:=false;
  124. case p^.left^.treetype of
  125. realconstn :
  126. begin
  127. isreal:=true;
  128. vr:=p^.left^.value_real;
  129. end;
  130. ordconstn :
  131. vl:=p^.left^.value;
  132. callparan :
  133. begin
  134. { both exists, else it was not generated }
  135. vl:=p^.left^.left^.value;
  136. vl2:=p^.left^.right^.left^.value;
  137. end;
  138. else
  139. CGMessage(cg_e_illegal_expression);
  140. end;
  141. case p^.inlinenumber of
  142. in_const_trunc :
  143. begin
  144. if isreal then
  145. begin
  146. if (vr>=2147483648.0) or (vr<=-2147483649.0) then
  147. begin
  148. CGMessage(parser_e_range_check_error);
  149. hp:=genordinalconstnode(1,s32bitdef)
  150. end
  151. else
  152. hp:=genordinalconstnode(trunc(vr),s32bitdef)
  153. end
  154. else
  155. hp:=genordinalconstnode(trunc(vl),s32bitdef);
  156. end;
  157. in_const_round :
  158. begin
  159. if isreal then
  160. begin
  161. if (vr>=2147483647.5) or (vr<=-2147483648.5) then
  162. begin
  163. CGMessage(parser_e_range_check_error);
  164. hp:=genordinalconstnode(1,s32bitdef)
  165. end
  166. else
  167. hp:=genordinalconstnode(round(vr),s32bitdef)
  168. end
  169. else
  170. hp:=genordinalconstnode(round(vl),s32bitdef);
  171. end;
  172. in_const_frac :
  173. begin
  174. if isreal then
  175. hp:=genrealconstnode(frac(vr),bestrealdef^)
  176. else
  177. hp:=genrealconstnode(frac(vl),bestrealdef^);
  178. end;
  179. in_const_int :
  180. begin
  181. if isreal then
  182. hp:=genrealconstnode(int(vr),bestrealdef^)
  183. else
  184. hp:=genrealconstnode(int(vl),bestrealdef^);
  185. end;
  186. in_const_abs :
  187. begin
  188. if isreal then
  189. hp:=genrealconstnode(abs(vr),bestrealdef^)
  190. else
  191. hp:=genordinalconstnode(abs(vl),p^.left^.resulttype);
  192. end;
  193. in_const_sqr :
  194. begin
  195. if isreal then
  196. hp:=genrealconstnode(sqr(vr),bestrealdef^)
  197. else
  198. hp:=genordinalconstnode(sqr(vl),p^.left^.resulttype);
  199. end;
  200. in_const_odd :
  201. begin
  202. if isreal then
  203. CGMessage1(type_e_integer_expr_expected,p^.left^.resulttype^.typename)
  204. else
  205. hp:=genordinalconstnode(byte(odd(vl)),booldef);
  206. end;
  207. in_const_swap_word :
  208. begin
  209. if isreal then
  210. CGMessage1(type_e_integer_expr_expected,p^.left^.resulttype^.typename)
  211. else
  212. hp:=genordinalconstnode((vl and $ff) shl 8+(vl shr 8),p^.left^.resulttype);
  213. end;
  214. in_const_swap_long :
  215. begin
  216. if isreal then
  217. CGMessage(type_e_mismatch)
  218. else
  219. hp:=genordinalconstnode((vl and $ffff) shl 16+(vl shr 16),p^.left^.resulttype);
  220. end;
  221. in_const_ptr :
  222. begin
  223. if isreal then
  224. CGMessage(type_e_mismatch)
  225. else
  226. hp:=genordinalconstnode((vl2 shl 16) or vl,voidpointerdef);
  227. end;
  228. in_const_sqrt :
  229. begin
  230. if isreal then
  231. begin
  232. if vr<0.0 then
  233. CGMessage(type_e_wrong_math_argument)
  234. else
  235. hp:=genrealconstnode(sqrt(vr),bestrealdef^)
  236. end
  237. else
  238. begin
  239. if vl<0 then
  240. CGMessage(type_e_wrong_math_argument)
  241. else
  242. hp:=genrealconstnode(sqrt(vl),bestrealdef^);
  243. end;
  244. end;
  245. in_const_arctan :
  246. begin
  247. if isreal then
  248. hp:=genrealconstnode(arctan(vr),bestrealdef^)
  249. else
  250. hp:=genrealconstnode(arctan(vl),bestrealdef^);
  251. end;
  252. in_const_cos :
  253. begin
  254. if isreal then
  255. hp:=genrealconstnode(cos(vr),bestrealdef^)
  256. else
  257. hp:=genrealconstnode(cos(vl),bestrealdef^);
  258. end;
  259. in_const_sin :
  260. begin
  261. if isreal then
  262. hp:=genrealconstnode(sin(vr),bestrealdef^)
  263. else
  264. hp:=genrealconstnode(sin(vl),bestrealdef^);
  265. end;
  266. in_const_exp :
  267. begin
  268. if isreal then
  269. hp:=genrealconstnode(exp(vr),bestrealdef^)
  270. else
  271. hp:=genrealconstnode(exp(vl),bestrealdef^);
  272. end;
  273. in_const_ln :
  274. begin
  275. if isreal then
  276. begin
  277. if vr<=0.0 then
  278. CGMessage(type_e_wrong_math_argument)
  279. else
  280. hp:=genrealconstnode(ln(vr),bestrealdef^)
  281. end
  282. else
  283. begin
  284. if vl<=0 then
  285. CGMessage(type_e_wrong_math_argument)
  286. else
  287. hp:=genrealconstnode(ln(vl),bestrealdef^);
  288. end;
  289. end;
  290. else
  291. internalerror(88);
  292. end;
  293. end;
  294. disposetree(p);
  295. if hp=nil then
  296. hp:=genzeronode(errorn);
  297. firstpass(hp);
  298. p:=hp;
  299. end
  300. else
  301. begin
  302. case p^.inlinenumber of
  303. in_lo_qword,
  304. in_hi_qword,
  305. in_lo_long,
  306. in_hi_long,
  307. in_lo_word,
  308. in_hi_word:
  309. begin
  310. if p^.registers32<1 then
  311. p^.registers32:=1;
  312. if p^.inlinenumber in [in_lo_word,in_hi_word] then
  313. p^.resulttype:=u8bitdef
  314. else if p^.inlinenumber in [in_lo_qword,in_hi_qword] then
  315. begin
  316. p^.resulttype:=u32bitdef;
  317. if (m_tp in aktmodeswitches) or
  318. (m_delphi in aktmodeswitches) then
  319. CGMessage(type_w_maybe_wrong_hi_lo);
  320. end
  321. else
  322. begin
  323. p^.resulttype:=u16bitdef;
  324. if (m_tp in aktmodeswitches) or
  325. (m_delphi in aktmodeswitches) then
  326. CGMessage(type_w_maybe_wrong_hi_lo);
  327. end;
  328. p^.location.loc:=LOC_REGISTER;
  329. if not is_integer(p^.left^.resulttype) then
  330. CGMessage(type_e_mismatch)
  331. else
  332. begin
  333. if p^.left^.treetype=ordconstn then
  334. begin
  335. case p^.inlinenumber of
  336. in_lo_word : hp:=genordinalconstnode(p^.left^.value and $ff,p^.left^.resulttype);
  337. in_hi_word : hp:=genordinalconstnode(p^.left^.value shr 8,p^.left^.resulttype);
  338. in_lo_long : hp:=genordinalconstnode(p^.left^.value and $ffff,p^.left^.resulttype);
  339. in_hi_long : hp:=genordinalconstnode(p^.left^.value shr 16,p^.left^.resulttype);
  340. in_lo_qword : hp:=genordinalconstnode(p^.left^.value and $ffffffff,p^.left^.resulttype);
  341. in_hi_qword : hp:=genordinalconstnode(p^.left^.value shr 32,p^.left^.resulttype);
  342. end;
  343. disposetree(p);
  344. firstpass(hp);
  345. p:=hp;
  346. end;
  347. end;
  348. end;
  349. in_sizeof_x:
  350. begin
  351. if push_high_param(p^.left^.resulttype) then
  352. begin
  353. getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
  354. hp:=gennode(addn,genloadnode(pvarsym(srsym),p^.left^.symtable),
  355. genordinalconstnode(1,s32bitdef));
  356. if (p^.left^.resulttype^.deftype=arraydef) and
  357. (parraydef(p^.left^.resulttype)^.elesize<>1) then
  358. hp:=gennode(muln,hp,genordinalconstnode(parraydef(p^.left^.resulttype)^.elesize,s32bitdef));
  359. disposetree(p);
  360. p:=hp;
  361. firstpass(p);
  362. end;
  363. if p^.registers32<1 then
  364. p^.registers32:=1;
  365. p^.resulttype:=s32bitdef;
  366. p^.location.loc:=LOC_REGISTER;
  367. end;
  368. in_typeof_x:
  369. begin
  370. if p^.registers32<1 then
  371. p^.registers32:=1;
  372. p^.location.loc:=LOC_REGISTER;
  373. p^.resulttype:=voidpointerdef;
  374. end;
  375. in_ord_x:
  376. begin
  377. if (p^.left^.treetype=ordconstn) then
  378. begin
  379. hp:=genordinalconstnode(p^.left^.value,s32bitdef);
  380. disposetree(p);
  381. p:=hp;
  382. firstpass(p);
  383. end
  384. else
  385. begin
  386. if (p^.left^.resulttype^.deftype=orddef) then
  387. if (porddef(p^.left^.resulttype)^.typ in [uchar,bool8bit]) then
  388. begin
  389. if porddef(p^.left^.resulttype)^.typ=bool8bit then
  390. begin
  391. hp:=gentypeconvnode(p^.left,u8bitdef);
  392. putnode(p);
  393. p:=hp;
  394. p^.convtyp:=tc_bool_2_int;
  395. p^.explizit:=true;
  396. firstpass(p);
  397. end
  398. else
  399. begin
  400. hp:=gentypeconvnode(p^.left,u8bitdef);
  401. putnode(p);
  402. p:=hp;
  403. p^.explizit:=true;
  404. firstpass(p);
  405. end;
  406. end
  407. { can this happen ? }
  408. else if (porddef(p^.left^.resulttype)^.typ=uvoid) then
  409. CGMessage(type_e_mismatch)
  410. else
  411. { all other orddef need no transformation }
  412. begin
  413. hp:=p^.left;
  414. putnode(p);
  415. p:=hp;
  416. end
  417. else if (p^.left^.resulttype^.deftype=enumdef) then
  418. begin
  419. hp:=gentypeconvnode(p^.left,s32bitdef);
  420. putnode(p);
  421. p:=hp;
  422. p^.explizit:=true;
  423. firstpass(p);
  424. end
  425. else
  426. begin
  427. { can anything else be ord() ?}
  428. CGMessage(type_e_mismatch);
  429. end;
  430. end;
  431. end;
  432. in_chr_byte:
  433. begin
  434. hp:=gentypeconvnode(p^.left,cchardef);
  435. putnode(p);
  436. p:=hp;
  437. p^.explizit:=true;
  438. firstpass(p);
  439. end;
  440. in_length_string:
  441. begin
  442. if is_ansistring(p^.left^.resulttype) then
  443. p^.resulttype:=s32bitdef
  444. else
  445. p^.resulttype:=u8bitdef;
  446. { we don't need string conversations here }
  447. if (p^.left^.treetype=typeconvn) and
  448. (p^.left^.left^.resulttype^.deftype=stringdef) then
  449. begin
  450. hp:=p^.left^.left;
  451. putnode(p^.left);
  452. p^.left:=hp;
  453. end;
  454. { check the type, must be string or char }
  455. if (p^.left^.resulttype^.deftype<>stringdef) and
  456. (not is_char(p^.left^.resulttype)) then
  457. CGMessage(type_e_mismatch);
  458. { evaluates length of constant strings direct }
  459. if (p^.left^.treetype=stringconstn) then
  460. begin
  461. hp:=genordinalconstnode(p^.left^.length,s32bitdef);
  462. disposetree(p);
  463. firstpass(hp);
  464. p:=hp;
  465. end
  466. { length of char is one allways }
  467. else if is_constcharnode(p^.left) then
  468. begin
  469. hp:=genordinalconstnode(1,s32bitdef);
  470. disposetree(p);
  471. firstpass(hp);
  472. p:=hp;
  473. end;
  474. end;
  475. in_assigned_x:
  476. begin
  477. p^.resulttype:=booldef;
  478. p^.location.loc:=LOC_FLAGS;
  479. end;
  480. in_pred_x,
  481. in_succ_x:
  482. begin
  483. inc(p^.registers32);
  484. p^.resulttype:=p^.left^.resulttype;
  485. p^.location.loc:=LOC_REGISTER;
  486. if not is_ordinal(p^.resulttype) then
  487. CGMessage(type_e_ordinal_expr_expected)
  488. else
  489. begin
  490. if (p^.resulttype^.deftype=enumdef) and
  491. (penumdef(p^.resulttype)^.has_jumps) then
  492. CGMessage(type_e_succ_and_pred_enums_with_assign_not_possible)
  493. else
  494. if p^.left^.treetype=ordconstn then
  495. begin
  496. if p^.inlinenumber=in_succ_x then
  497. hp:=genordinalconstnode(p^.left^.value+1,p^.left^.resulttype)
  498. else
  499. hp:=genordinalconstnode(p^.left^.value-1,p^.left^.resulttype);
  500. disposetree(p);
  501. firstpass(hp);
  502. p:=hp;
  503. end;
  504. end;
  505. end;
  506. in_inc_x,
  507. in_dec_x:
  508. begin
  509. p^.resulttype:=voiddef;
  510. if assigned(p^.left) then
  511. begin
  512. firstcallparan(p^.left,nil);
  513. if codegenerror then
  514. exit;
  515. { first param must be var }
  516. if p^.left^.left^.location.loc<>LOC_REFERENCE then
  517. CGMessage(type_e_argument_must_be_lvalue);
  518. { check type }
  519. if (p^.left^.resulttype^.deftype in [enumdef,pointerdef]) or
  520. is_ordinal(p^.left^.resulttype) then
  521. begin
  522. { two paras ? }
  523. if assigned(p^.left^.right) then
  524. begin
  525. { insert a type conversion }
  526. { the second param is always longint }
  527. p^.left^.right^.left:=gentypeconvnode(p^.left^.right^.left,s32bitdef);
  528. { check the type conversion }
  529. firstpass(p^.left^.right^.left);
  530. { need we an additional register ? }
  531. if not(is_constintnode(p^.left^.right^.left)) and
  532. (p^.left^.right^.left^.location.loc in [LOC_MEM,LOC_REFERENCE]) and
  533. (p^.left^.right^.left^.registers32<=1) then
  534. inc(p^.registers32);
  535. if assigned(p^.left^.right^.right) then
  536. CGMessage(cg_e_illegal_expression);
  537. end;
  538. end
  539. else
  540. CGMessage(type_e_ordinal_expr_expected);
  541. end
  542. else
  543. CGMessage(type_e_mismatch);
  544. end;
  545. in_read_x,
  546. in_readln_x,
  547. in_write_x,
  548. in_writeln_x :
  549. begin
  550. { needs a call }
  551. procinfo.flags:=procinfo.flags or pi_do_call;
  552. p^.resulttype:=voiddef;
  553. { we must know if it is a typed file or not }
  554. { but we must first do the firstpass for it }
  555. file_is_typed:=false;
  556. if assigned(p^.left) then
  557. begin
  558. dowrite:=(p^.inlinenumber in [in_write_x,in_writeln_x]);
  559. firstcallparan(p^.left,nil);
  560. { now we can check }
  561. hp:=p^.left;
  562. while assigned(hp^.right) do
  563. hp:=hp^.right;
  564. { if resulttype is not assigned, then automatically }
  565. { file is not typed. }
  566. if assigned(hp) and assigned(hp^.resulttype) then
  567. Begin
  568. if (hp^.resulttype^.deftype=filedef) and
  569. (pfiledef(hp^.resulttype)^.filetype=ft_typed) then
  570. begin
  571. file_is_typed:=true;
  572. { test the type }
  573. hpp:=p^.left;
  574. while (hpp<>hp) do
  575. begin
  576. if (hpp^.left^.treetype=typen) then
  577. CGMessage(type_e_cant_read_write_type);
  578. if not is_equal(hpp^.resulttype,pfiledef(hp^.resulttype)^.typed_as) then
  579. CGMessage(type_e_mismatch);
  580. { generate the high() value for the shortstring }
  581. if ((not dowrite) and is_shortstring(hpp^.left^.resulttype)) or
  582. (is_chararray(hpp^.left^.resulttype)) then
  583. gen_high_tree(hpp,true);
  584. hpp:=hpp^.right;
  585. end;
  586. end;
  587. end; { endif assigned(hp) }
  588. { insert type conversions for write(ln) }
  589. if (not file_is_typed) then
  590. begin
  591. hp:=p^.left;
  592. while assigned(hp) do
  593. begin
  594. if (hp^.left^.treetype=typen) then
  595. CGMessage(type_e_cant_read_write_type);
  596. if assigned(hp^.left^.resulttype) then
  597. begin
  598. isreal:=false;
  599. { support writeln(procvar) }
  600. if (hp^.left^.resulttype^.deftype=procvardef) then
  601. begin
  602. p1:=gencallnode(nil,nil);
  603. p1^.right:=hp^.left;
  604. p1^.resulttype:=pprocvardef(hp^.left^.resulttype)^.retdef;
  605. firstpass(p1);
  606. hp^.left:=p1;
  607. end;
  608. case hp^.left^.resulttype^.deftype of
  609. filedef :
  610. begin
  611. { only allowed as first parameter }
  612. if assigned(hp^.right) then
  613. CGMessage(type_e_cant_read_write_type);
  614. end;
  615. stringdef :
  616. begin
  617. { generate the high() value for the shortstring }
  618. if (not dowrite) and
  619. is_shortstring(hp^.left^.resulttype) then
  620. gen_high_tree(hp,true);
  621. end;
  622. pointerdef :
  623. begin
  624. if not is_pchar(hp^.left^.resulttype) then
  625. CGMessage(type_e_cant_read_write_type);
  626. end;
  627. floatdef :
  628. begin
  629. isreal:=true;
  630. end;
  631. orddef :
  632. begin
  633. case porddef(hp^.left^.resulttype)^.typ of
  634. uchar,
  635. u32bit,s32bit,
  636. u64bit,s64bit:
  637. ;
  638. u8bit,s8bit,
  639. u16bit,s16bit :
  640. if dowrite then
  641. hp^.left:=gentypeconvnode(hp^.left,s32bitdef);
  642. bool8bit,
  643. bool16bit,
  644. bool32bit :
  645. if dowrite then
  646. hp^.left:=gentypeconvnode(hp^.left,booldef)
  647. else
  648. CGMessage(type_e_cant_read_write_type);
  649. else
  650. CGMessage(type_e_cant_read_write_type);
  651. end;
  652. end;
  653. arraydef :
  654. begin
  655. if is_chararray(hp^.left^.resulttype) then
  656. gen_high_tree(hp,true)
  657. else
  658. CGMessage(type_e_cant_read_write_type);
  659. end;
  660. else
  661. CGMessage(type_e_cant_read_write_type);
  662. end;
  663. { some format options ? }
  664. if hp^.is_colon_para then
  665. begin
  666. if hp^.right^.is_colon_para then
  667. begin
  668. frac_para:=hp;
  669. length_para:=hp^.right;
  670. hp:=hp^.right;
  671. hpp:=hp^.right;
  672. end
  673. else
  674. begin
  675. length_para:=hp;
  676. frac_para:=nil;
  677. hpp:=hp^.right;
  678. end;
  679. isreal:=(hpp^.left^.resulttype^.deftype=floatdef);
  680. if (not is_integer(length_para^.left^.resulttype)) then
  681. CGMessage1(type_e_integer_expr_expected,length_para^.left^.resulttype^.typename)
  682. else
  683. length_para^.left:=gentypeconvnode(length_para^.left,s32bitdef);
  684. if assigned(frac_para) then
  685. begin
  686. if isreal then
  687. begin
  688. if (not is_integer(frac_para^.left^.resulttype)) then
  689. CGMessage1(type_e_integer_expr_expected,frac_para^.left^.resulttype^.typename)
  690. else
  691. frac_para^.left:=gentypeconvnode(frac_para^.left,s32bitdef);
  692. end
  693. else
  694. CGMessage(parser_e_illegal_colon_qualifier);
  695. end;
  696. { do the checking for the colon'd arg }
  697. hp:=length_para;
  698. end;
  699. end;
  700. hp:=hp^.right;
  701. end;
  702. end;
  703. { pass all parameters again for the typeconversions }
  704. if codegenerror then
  705. exit;
  706. must_be_valid:=true;
  707. firstcallparan(p^.left,nil);
  708. { calc registers }
  709. left_right_max(p);
  710. end;
  711. end;
  712. in_settextbuf_file_x :
  713. begin
  714. { warning here p^.left is the callparannode
  715. not the argument directly }
  716. { p^.left^.left is text var }
  717. { p^.left^.right^.left is the buffer var }
  718. { firstcallparan(p^.left,nil);
  719. already done in firstcalln }
  720. { now we know the type of buffer }
  721. getsymonlyin(systemunit,'SETTEXTBUF');
  722. hp:=gencallnode(pprocsym(srsym),systemunit);
  723. hp^.left:=gencallparanode(
  724. genordinalconstnode(p^.left^.left^.resulttype^.size,s32bitdef),p^.left);
  725. putnode(p);
  726. p:=hp;
  727. firstpass(p);
  728. end;
  729. { the firstpass of the arg has been done in firstcalln ? }
  730. in_reset_typedfile,
  731. in_rewrite_typedfile :
  732. begin
  733. procinfo.flags:=procinfo.flags or pi_do_call;
  734. { to be sure the right definition is loaded }
  735. p^.left^.resulttype:=nil;
  736. firstpass(p^.left);
  737. p^.resulttype:=voiddef;
  738. end;
  739. in_str_x_string :
  740. begin
  741. procinfo.flags:=procinfo.flags or pi_do_call;
  742. p^.resulttype:=voiddef;
  743. { check the amount of parameters }
  744. if not(assigned(p^.left)) or
  745. not(assigned(p^.left^.right)) then
  746. begin
  747. CGMessage(parser_e_wrong_parameter_size);
  748. exit;
  749. end;
  750. { first pass just the string for first local use }
  751. hp:=p^.left^.right;
  752. must_be_valid:=false;
  753. count_ref:=true;
  754. p^.left^.right:=nil;
  755. firstcallparan(p^.left,nil);
  756. { remove warning when result is passed }
  757. if (p^.left^.left^.treetype=funcretn) then
  758. procinfo.funcret_is_valid:=true;
  759. must_be_valid:=true;
  760. p^.left^.right:=hp;
  761. firstcallparan(p^.left^.right,nil);
  762. hp:=p^.left;
  763. { valid string ? }
  764. if not assigned(hp) or
  765. (hp^.left^.resulttype^.deftype<>stringdef) or
  766. (hp^.right=nil) or
  767. (hp^.left^.location.loc<>LOC_REFERENCE) then
  768. CGMessage(cg_e_illegal_expression);
  769. { generate the high() value for the shortstring }
  770. if is_shortstring(hp^.left^.resulttype) then
  771. gen_high_tree(hp,true);
  772. { !!!! check length of string }
  773. while assigned(hp^.right) do
  774. hp:=hp^.right;
  775. { check and convert the first param }
  776. if hp^.is_colon_para then
  777. CGMessage(cg_e_illegal_expression);
  778. isreal:=false;
  779. case hp^.resulttype^.deftype of
  780. orddef :
  781. begin
  782. case porddef(hp^.left^.resulttype)^.typ of
  783. u32bit,s32bit,
  784. s64bit,u64bit:
  785. ;
  786. u8bit,s8bit,
  787. u16bit,s16bit:
  788. hp^.left:=gentypeconvnode(hp^.left,s32bitdef);
  789. else
  790. CGMessage(type_e_integer_or_real_expr_expected);
  791. end;
  792. end;
  793. floatdef :
  794. begin
  795. isreal:=true;
  796. end;
  797. else
  798. CGMessage(type_e_integer_or_real_expr_expected);
  799. end;
  800. { some format options ? }
  801. hpp:=p^.left^.right;
  802. if assigned(hpp) and hpp^.is_colon_para then
  803. begin
  804. if (not is_integer(hpp^.resulttype)) then
  805. CGMessage1(type_e_integer_expr_expected,hpp^.resulttype^.typename)
  806. else
  807. hpp^.left:=gentypeconvnode(hpp^.left,s32bitdef);
  808. hpp:=hpp^.right;
  809. if assigned(hpp) and hpp^.is_colon_para then
  810. begin
  811. if isreal then
  812. begin
  813. if (not is_integer(hpp^.resulttype)) then
  814. CGMessage1(type_e_integer_expr_expected,hpp^.resulttype^.typename)
  815. else
  816. hpp^.left:=gentypeconvnode(hpp^.left,s32bitdef);
  817. end
  818. else
  819. CGMessage(parser_e_illegal_colon_qualifier);
  820. end;
  821. end;
  822. { for first local use }
  823. must_be_valid:=false;
  824. count_ref:=true;
  825. { pass all parameters again for the typeconversions }
  826. if codegenerror then
  827. exit;
  828. must_be_valid:=true;
  829. firstcallparan(p^.left,nil);
  830. { calc registers }
  831. left_right_max(p);
  832. end;
  833. in_val_x :
  834. begin
  835. procinfo.flags:=procinfo.flags or pi_do_call;
  836. p^.resulttype:=voiddef;
  837. { check the amount of parameters }
  838. if not(assigned(p^.left)) or
  839. not(assigned(p^.left^.right)) then
  840. begin
  841. CGMessage(parser_e_wrong_parameter_size);
  842. exit;
  843. end;
  844. If Assigned(p^.left^.right^.right) Then
  845. {there is a "code" parameter}
  846. Begin
  847. { first pass just the code parameter for first local use}
  848. hp := p^.left^.right;
  849. p^.left^.right := nil;
  850. must_be_valid := false;
  851. count_ref := true;
  852. make_not_regable(p^.left^.left);
  853. firstcallparan(p^.left, nil);
  854. if codegenerror then exit;
  855. p^.left^.right := hp;
  856. {code has to be a var parameter}
  857. if (p^.left^.left^.location.loc<>LOC_REFERENCE) then
  858. CGMessage(type_e_variable_id_expected)
  859. else
  860. if (p^.left^.left^.resulttype^.deftype <> orddef) or
  861. not(porddef(p^.left^.left^.resulttype)^.typ in
  862. [u16bit,s16bit,u32bit,s32bit]) then
  863. CGMessage(type_e_mismatch);
  864. hpp := p^.left^.right
  865. End
  866. Else hpp := p^.left;
  867. {now hpp = the destination value tree}
  868. { first pass just the destination parameter for first local use}
  869. hp:=hpp^.right;
  870. must_be_valid:=false;
  871. count_ref:=true;
  872. hpp^.right:=nil;
  873. {hpp = destination}
  874. make_not_regable(hpp^.left);
  875. firstcallparan(hpp,nil);
  876. if codegenerror then
  877. exit;
  878. { remove warning when result is passed }
  879. if (hpp^.left^.treetype=funcretn) then
  880. procinfo.funcret_is_valid:=true;
  881. hpp^.right := hp;
  882. if (hpp^.left^.location.loc<>LOC_REFERENCE) then
  883. CGMessage(type_e_variable_id_expected)
  884. else
  885. If Not((hpp^.left^.resulttype^.deftype = floatdef) or
  886. ((hpp^.left^.resulttype^.deftype = orddef) And
  887. (POrdDef(hpp^.left^.resulttype)^.typ in
  888. [u32bit,s32bit,
  889. u8bit,s8bit,u16bit,s16bit,s64bit,u64bit])))
  890. Then CGMessage(type_e_mismatch);
  891. must_be_valid:=true;
  892. {hp = source (String)}
  893. count_ref := false;
  894. must_be_valid := true;
  895. firstcallparan(hp,nil);
  896. if codegenerror then
  897. exit;
  898. { if not a stringdef then insert a type conv which
  899. does the other type checking }
  900. If (hp^.left^.resulttype^.deftype<>stringdef) then
  901. begin
  902. hp^.left:=gentypeconvnode(hp^.left,cshortstringdef);
  903. firstpass(hp);
  904. end;
  905. { calc registers }
  906. left_right_max(p);
  907. { val doesn't calculate the registers really }
  908. { correct, we need one register extra (FK) }
  909. if is_64bitint(hpp^.left^.resulttype) then
  910. inc(p^.registers32,2)
  911. else
  912. inc(p^.registers32,1);
  913. end;
  914. in_include_x_y,
  915. in_exclude_x_y:
  916. begin
  917. p^.resulttype:=voiddef;
  918. if assigned(p^.left) then
  919. begin
  920. firstcallparan(p^.left,nil);
  921. p^.registers32:=p^.left^.registers32;
  922. p^.registersfpu:=p^.left^.registersfpu;
  923. {$ifdef SUPPORT_MMX}
  924. p^.registersmmx:=p^.left^.registersmmx;
  925. {$endif SUPPORT_MMX}
  926. { remove warning when result is passed }
  927. if (p^.left^.left^.treetype=funcretn) then
  928. procinfo.funcret_is_valid:=true;
  929. { first param must be var }
  930. if (p^.left^.left^.location.loc<>LOC_REFERENCE) and
  931. (p^.left^.left^.location.loc<>LOC_CREGISTER) then
  932. CGMessage(cg_e_illegal_expression);
  933. { check type }
  934. if (p^.left^.resulttype^.deftype=setdef) then
  935. begin
  936. { two paras ? }
  937. if assigned(p^.left^.right) then
  938. begin
  939. { insert a type conversion }
  940. { to the type of the set elements }
  941. p^.left^.right^.left:=gentypeconvnode(
  942. p^.left^.right^.left,
  943. psetdef(p^.left^.resulttype)^.setof);
  944. { check the type conversion }
  945. firstpass(p^.left^.right^.left);
  946. { only three parameters are allowed }
  947. if assigned(p^.left^.right^.right) then
  948. CGMessage(cg_e_illegal_expression);
  949. end;
  950. end
  951. else
  952. CGMessage(type_e_mismatch);
  953. end
  954. else
  955. CGMessage(type_e_mismatch);
  956. end;
  957. in_low_x,
  958. in_high_x:
  959. begin
  960. if p^.left^.treetype in [typen,loadn,subscriptn] then
  961. begin
  962. case p^.left^.resulttype^.deftype of
  963. orddef,enumdef:
  964. begin
  965. do_lowhigh(p^.left^.resulttype);
  966. firstpass(p);
  967. end;
  968. setdef:
  969. begin
  970. do_lowhigh(Psetdef(p^.left^.resulttype)^.setof);
  971. firstpass(p);
  972. end;
  973. arraydef:
  974. begin
  975. if p^.inlinenumber=in_low_x then
  976. begin
  977. hp:=genordinalconstnode(Parraydef(p^.left^.resulttype)^.lowrange,
  978. Parraydef(p^.left^.resulttype)^.rangedef);
  979. disposetree(p);
  980. p:=hp;
  981. firstpass(p);
  982. end
  983. else
  984. begin
  985. if is_open_array(p^.left^.resulttype) or
  986. is_array_of_const(p^.left^.resulttype) then
  987. begin
  988. getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
  989. hp:=genloadnode(pvarsym(srsym),p^.left^.symtable);
  990. disposetree(p);
  991. p:=hp;
  992. firstpass(p);
  993. end
  994. else
  995. begin
  996. hp:=genordinalconstnode(Parraydef(p^.left^.resulttype)^.highrange,
  997. Parraydef(p^.left^.resulttype)^.rangedef);
  998. disposetree(p);
  999. p:=hp;
  1000. firstpass(p);
  1001. end;
  1002. end;
  1003. end;
  1004. stringdef:
  1005. begin
  1006. if p^.inlinenumber=in_low_x then
  1007. begin
  1008. hp:=genordinalconstnode(0,u8bitdef);
  1009. disposetree(p);
  1010. p:=hp;
  1011. firstpass(p);
  1012. end
  1013. else
  1014. begin
  1015. if is_open_string(p^.left^.resulttype) then
  1016. begin
  1017. getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
  1018. hp:=genloadnode(pvarsym(srsym),p^.left^.symtable);
  1019. disposetree(p);
  1020. p:=hp;
  1021. firstpass(p);
  1022. end
  1023. else
  1024. begin
  1025. hp:=genordinalconstnode(Pstringdef(p^.left^.resulttype)^.len,u8bitdef);
  1026. disposetree(p);
  1027. p:=hp;
  1028. firstpass(p);
  1029. end;
  1030. end;
  1031. end;
  1032. else
  1033. CGMessage(type_e_mismatch);
  1034. end;
  1035. end
  1036. else
  1037. CGMessage(type_e_varid_or_typeid_expected);
  1038. end;
  1039. {$ifdef SUPPORT_MMX}
  1040. in_mmx_pcmpeqb..in_mmx_pcmpgtw:
  1041. begin
  1042. end;
  1043. {$endif SUPPORT_MMX}
  1044. in_assert_x_y :
  1045. begin
  1046. p^.resulttype:=voiddef;
  1047. if assigned(p^.left) then
  1048. begin
  1049. firstcallparan(p^.left,nil);
  1050. p^.registers32:=p^.left^.registers32;
  1051. p^.registersfpu:=p^.left^.registersfpu;
  1052. {$ifdef SUPPORT_MMX}
  1053. p^.registersmmx:=p^.left^.registersmmx;
  1054. {$endif SUPPORT_MMX}
  1055. { check type }
  1056. if is_boolean(p^.left^.resulttype) then
  1057. begin
  1058. { must always be a string }
  1059. p^.left^.right^.left:=gentypeconvnode(p^.left^.right^.left,cshortstringdef);
  1060. firstpass(p^.left^.right^.left);
  1061. end
  1062. else
  1063. CGMessage(type_e_mismatch);
  1064. end
  1065. else
  1066. CGMessage(type_e_mismatch);
  1067. end;
  1068. else
  1069. internalerror(8);
  1070. end;
  1071. end;
  1072. { generate an error if no resulttype is set }
  1073. if not assigned(p^.resulttype) then
  1074. p^.resulttype:=generrordef;
  1075. must_be_valid:=store_valid;
  1076. count_ref:=store_count_ref;
  1077. end;
  1078. end.
  1079. {
  1080. $Log$
  1081. Revision 1.49 1999-08-28 15:34:21 florian
  1082. * bug 519 fixed
  1083. Revision 1.48 1999/08/23 23:41:04 pierre
  1084. * in_inc_x register allocation corrected
  1085. Revision 1.47 1999/08/06 12:43:13 jonas
  1086. * fix for regvars with the val code
  1087. Revision 1.46 1999/08/05 16:53:23 peter
  1088. * V_Fatal=1, all other V_ are also increased
  1089. * Check for local procedure when assigning procvar
  1090. * fixed comment parsing because directives
  1091. * oldtp mode directives better supported
  1092. * added some messages to errore.msg
  1093. Revision 1.45 1999/08/04 00:23:40 florian
  1094. * renamed i386asm and i386base to cpuasm and cpubase
  1095. Revision 1.44 1999/08/03 22:03:32 peter
  1096. * moved bitmask constants to sets
  1097. * some other type/const renamings
  1098. Revision 1.43 1999/07/30 12:28:43 peter
  1099. * fixed crash with unknown id and colon parameter in write
  1100. Revision 1.42 1999/07/18 14:47:35 florian
  1101. * bug 487 fixed, (inc(<property>) isn't allowed)
  1102. * more fixes to compile with Delphi
  1103. Revision 1.41 1999/07/05 20:25:40 peter
  1104. * merged
  1105. Revision 1.40 1999/07/05 20:13:18 peter
  1106. * removed temp defines
  1107. Revision 1.39 1999/07/03 14:14:31 florian
  1108. + start of val(int64/qword)
  1109. * longbool, wordbool constants weren't written, fixed
  1110. Revision 1.38 1999/07/01 15:49:22 florian
  1111. * int64/qword type release
  1112. + lo/hi for int64/qword
  1113. Revision 1.37 1999/06/25 10:02:56 florian
  1114. * bug 459 fixed
  1115. Revision 1.36 1999/06/15 18:58:36 peter
  1116. * merged
  1117. Revision 1.35.2.2 1999/07/05 20:06:46 peter
  1118. * give error instead of warning for ln(0) and sqrt(0)
  1119. Revision 1.35.2.1 1999/06/15 18:54:54 peter
  1120. * more procvar fixes
  1121. Revision 1.35 1999/05/27 19:45:19 peter
  1122. * removed oldasm
  1123. * plabel -> pasmlabel
  1124. * -a switches to source writing automaticly
  1125. * assembler readers OOPed
  1126. * asmsymbol automaticly external
  1127. * jumptables and other label fixes for asm readers
  1128. Revision 1.34 1999/05/23 18:42:20 florian
  1129. * better error recovering in typed constants
  1130. * some problems with arrays of const fixed, some problems
  1131. due my previous
  1132. - the location type of array constructor is now LOC_MEM
  1133. - the pushing of high fixed
  1134. - parameter copying fixed
  1135. - zero temp. allocation removed
  1136. * small problem in the assembler writers fixed:
  1137. ref to nil wasn't written correctly
  1138. Revision 1.33 1999/05/06 09:05:35 peter
  1139. * generic write_float and str_float
  1140. * fixed constant float conversions
  1141. Revision 1.32 1999/05/05 22:25:21 florian
  1142. * fixed register allocation for val
  1143. Revision 1.31 1999/05/02 21:33:57 florian
  1144. * several bugs regarding -Or fixed
  1145. Revision 1.30 1999/05/01 13:24:53 peter
  1146. * merged nasm compiler
  1147. * old asm moved to oldasm/
  1148. Revision 1.29 1999/04/28 06:02:15 florian
  1149. * changes of Bruessel:
  1150. + message handler can now take an explicit self
  1151. * typinfo fixed: sometimes the type names weren't written
  1152. * the type checking for pointer comparisations and subtraction
  1153. and are now more strict (was also buggy)
  1154. * small bug fix to link.pas to support compiling on another
  1155. drive
  1156. * probable bug in popt386 fixed: call/jmp => push/jmp
  1157. transformation didn't count correctly the jmp references
  1158. + threadvar support
  1159. * warning if ln/sqrt gets an invalid constant argument
  1160. Revision 1.28 1999/04/26 18:28:12 peter
  1161. * better read/write array
  1162. Revision 1.27 1999/04/26 09:32:22 peter
  1163. * try to convert to string for val()
  1164. Revision 1.26 1999/04/15 14:10:51 pierre
  1165. * fix for bug0238.pp
  1166. Revision 1.25 1999/04/15 10:00:35 peter
  1167. * writeln(procvar) support for tp7 mode
  1168. Revision 1.24 1999/04/14 09:15:07 peter
  1169. * first things to store the symbol/def number in the ppu
  1170. Revision 1.23 1999/04/08 10:16:48 peter
  1171. * funcret_valid flag is set for inline functions
  1172. Revision 1.22 1999/03/26 00:05:48 peter
  1173. * released valintern
  1174. + deffile is now removed when compiling is finished
  1175. * ^( compiles now correct
  1176. + static directive
  1177. * shrd fixed
  1178. Revision 1.21 1999/03/24 23:17:37 peter
  1179. * fixed bugs 212,222,225,227,229,231,233
  1180. Revision 1.20 1999/03/16 17:52:55 jonas
  1181. * changes for internal Val code (do a "make cycle OPT=-dvalintern" to test)
  1182. * in cgi386inl: also range checking for subrange types (compile with "-dreadrangecheck")
  1183. * in cgai386: also small fixes to emitrangecheck
  1184. Revision 1.19 1999/02/22 12:36:34 florian
  1185. + warning for lo/hi(longint/dword) in -So and -Sd mode added
  1186. Revision 1.18 1999/02/22 02:15:49 peter
  1187. * updates for ag386bin
  1188. Revision 1.17 1999/02/01 00:00:50 florian
  1189. * compiler crash fixed when constant arguments passed to round/trunc
  1190. exceeds the longint range
  1191. Revision 1.16 1999/01/28 19:43:43 peter
  1192. * fixed high generation for ansistrings with str,writeln
  1193. Revision 1.15 1999/01/27 16:28:22 pierre
  1194. * bug0157 solved : write(x:5.3) is rejected now
  1195. Revision 1.14 1999/01/21 22:10:50 peter
  1196. * fixed array of const
  1197. * generic platform independent high() support
  1198. Revision 1.13 1998/12/30 22:13:13 peter
  1199. * check the amount of paras for Str()
  1200. Revision 1.12 1998/12/15 10:23:31 peter
  1201. + -iSO, -iSP, -iTO, -iTP
  1202. Revision 1.11 1998/12/11 23:36:08 florian
  1203. + again more stuff for int64/qword:
  1204. - comparision operators
  1205. - code generation for: str, read(ln), write(ln)
  1206. Revision 1.10 1998/11/27 14:50:53 peter
  1207. + open strings, $P switch support
  1208. Revision 1.9 1998/11/24 17:04:28 peter
  1209. * fixed length(char) when char is a variable
  1210. Revision 1.8 1998/11/14 10:51:33 peter
  1211. * fixed low/high for record.field
  1212. Revision 1.7 1998/11/13 10:15:52 peter
  1213. * fixed ptr() with constants
  1214. Revision 1.6 1998/11/05 12:03:05 peter
  1215. * released useansistring
  1216. * removed -Sv, its now available in fpc modes
  1217. Revision 1.5 1998/10/20 11:16:47 pierre
  1218. + length(c) where C is a char is allways 1
  1219. Revision 1.4 1998/10/06 20:49:11 peter
  1220. * m68k compiler compiles again
  1221. Revision 1.3 1998/10/05 12:32:49 peter
  1222. + assert() support
  1223. Revision 1.2 1998/10/02 09:24:23 peter
  1224. * more constant expression evaluators
  1225. Revision 1.1 1998/09/23 20:42:24 peter
  1226. * splitted pass_1
  1227. }