ptconst.pas 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  1. {
  2. $Id$
  3. Copyright (c) 1998 by Florian Klaempfl
  4. Reads typed constants
  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 ptconst;
  19. interface
  20. uses symtable;
  21. { this procedure reads typed constants }
  22. { sym is only needed for ansi strings }
  23. { the assembler label is in the middle (PM) }
  24. procedure readtypedconst(def : pdef;sym : ptypedconstsym);
  25. implementation
  26. uses
  27. globtype,systems,tokens,
  28. cobjects,globals,scanner,aasm,tree,pass_1,
  29. hcodegen,types,verbose
  30. { parser specific stuff }
  31. ,pbase,pexpr
  32. { processor specific stuff }
  33. {$ifdef i386}
  34. ,i386
  35. {$endif}
  36. {$ifdef m68k}
  37. ,m68k
  38. {$endif}
  39. ;
  40. { this procedure reads typed constants }
  41. procedure readtypedconst(def : pdef;sym : ptypedconstsym);
  42. var
  43. {$ifdef m68k}
  44. j : longint;
  45. {$endif m68k}
  46. len : longint;
  47. p,hp : ptree;
  48. i,l,offset,
  49. strlength : longint;
  50. ll : plabel;
  51. s : string;
  52. ca : pchar;
  53. aktpos : longint;
  54. pd : pprocdef;
  55. obj : pobjectdef;
  56. symt : psymtable;
  57. hp1,hp2 : pdefcoll;
  58. value : bestreal;
  59. procedure check_range;
  60. begin
  61. if ((p^.value>porddef(def)^.high) or
  62. (p^.value<porddef(def)^.low)) then
  63. begin
  64. if (cs_check_range in aktlocalswitches) then
  65. Message(parser_e_range_check_error)
  66. else
  67. Message(parser_w_range_check_error);
  68. end;
  69. end;
  70. function is_po_equal(o1,o2:longint):boolean;
  71. begin
  72. { assembler does not affect }
  73. is_po_equal:=(o1 and not(poassembler))=
  74. (o2 and not(poassembler));
  75. end;
  76. {$R-} {Range check creates problem with init_8bit(-1) !!}
  77. begin
  78. case def^.deftype of
  79. orddef:
  80. begin
  81. p:=comp_expr(true);
  82. do_firstpass(p);
  83. case porddef(def)^.typ of
  84. s8bit,
  85. u8bit : begin
  86. if not is_constintnode(p) then
  87. { is't an int expected }
  88. Message(cg_e_illegal_expression)
  89. else
  90. begin
  91. datasegment^.concat(new(pai_const,init_8bit(p^.value)));
  92. check_range;
  93. end;
  94. end;
  95. s32bit : begin
  96. if not is_constintnode(p) then
  97. Message(cg_e_illegal_expression)
  98. else
  99. begin
  100. datasegment^.concat(new(pai_const,init_32bit(p^.value)));
  101. check_range;
  102. end;
  103. end;
  104. u32bit : begin
  105. if not is_constintnode(p) then
  106. Message(cg_e_illegal_expression)
  107. else
  108. datasegment^.concat(new(pai_const,init_32bit(p^.value)));
  109. end;
  110. bool8bit : begin
  111. if not is_constboolnode(p) then
  112. Message(cg_e_illegal_expression);
  113. datasegment^.concat(new(pai_const,init_8bit(p^.value)));
  114. end;
  115. uchar : begin
  116. if not is_constcharnode(p) then
  117. Message(cg_e_illegal_expression);
  118. datasegment^.concat(new(pai_const,init_8bit(p^.value)));
  119. end;
  120. u16bit,
  121. s16bit : begin
  122. if not is_constintnode(p) then
  123. Message(cg_e_illegal_expression);
  124. datasegment^.concat(new(pai_const,init_16bit(p^.value)));
  125. check_range;
  126. end;
  127. s64bitint,
  128. u64bit:
  129. begin
  130. if not is_constintnode(p) then
  131. Message(cg_e_illegal_expression)
  132. else
  133. begin
  134. {!!!!! hmmm, we can write yet only consts til 2^32-1 :( (FK) }
  135. datasegment^.concat(new(pai_const,init_32bit(p^.value)));
  136. datasegment^.concat(new(pai_const,init_32bit(0)));
  137. end;
  138. end;
  139. end;
  140. disposetree(p);
  141. end;
  142. floatdef:
  143. begin
  144. p:=comp_expr(true);
  145. do_firstpass(p);
  146. if is_constrealnode(p) then
  147. value:=p^.value_real
  148. else if is_constintnode(p) then
  149. value:=p^.value
  150. else
  151. Message(cg_e_illegal_expression);
  152. case pfloatdef(def)^.typ of
  153. s64real : datasegment^.concat(new(pai_double,init(value)));
  154. s32real : datasegment^.concat(new(pai_single,init(value)));
  155. s80real : datasegment^.concat(new(pai_extended,init(value)));
  156. s64bit : datasegment^.concat(new(pai_comp,init(value)));
  157. f32bit : datasegment^.concat(new(pai_const,init_32bit(trunc(value*65536))));
  158. else internalerror(18);
  159. end;
  160. disposetree(p);
  161. end;
  162. pointerdef:
  163. begin
  164. p:=comp_expr(true);
  165. do_firstpass(p);
  166. { allows horrible ofs(typeof(TButton)^) code !! }
  167. if (p^.treetype=addrn) and (p^.left^.treetype=derefn) then
  168. begin
  169. hp:=p^.left^.left;
  170. p^.left^.left:=nil;
  171. disposetree(p);
  172. p:=hp;
  173. end;
  174. { nil pointer ? }
  175. if p^.treetype=niln then
  176. datasegment^.concat(new(pai_const,init_32bit(0)))
  177. { maybe pchar ? }
  178. else
  179. if (ppointerdef(def)^.definition^.deftype=orddef) and
  180. (porddef(ppointerdef(def)^.definition)^.typ=uchar) then
  181. begin
  182. getdatalabel(ll);
  183. datasegment^.concat(new(pai_const,init_symbol(strpnew(lab2str(ll)))));
  184. consts^.concat(new(pai_label,init(ll)));
  185. if p^.treetype=stringconstn then
  186. begin
  187. getmem(ca,p^.length+2);
  188. move(p^.value_str^,ca^,p^.length+1);
  189. consts^.concat(new(pai_string,init_length_pchar(ca,p^.length+1)));
  190. end
  191. else
  192. if is_constcharnode(p) then
  193. consts^.concat(new(pai_string,init(char(byte(p^.value))+#0)))
  194. else
  195. Message(cg_e_illegal_expression);
  196. end
  197. else
  198. if p^.treetype=addrn then
  199. begin
  200. hp:=p^.left;
  201. while assigned(hp) and (hp^.treetype=subscriptn) do
  202. hp:=hp^.left;
  203. if (is_equal(ppointerdef(p^.resulttype)^.definition,ppointerdef(def)^.definition) or
  204. (is_equal(ppointerdef(p^.resulttype)^.definition,voiddef)) or
  205. (is_equal(ppointerdef(def)^.definition,voiddef))) and
  206. (hp^.treetype = loadn) then
  207. begin
  208. firstpass(p^.left);
  209. hp:=p^.left;
  210. offset:=0;
  211. while assigned(hp) and (hp^.treetype<>loadn) do
  212. begin
  213. if hp^.treetype=subscriptn then
  214. inc(offset,hp^.vs^.address)
  215. else
  216. Message(cg_e_illegal_expression);
  217. hp:=hp^.left;
  218. end;
  219. datasegment^.concat(new(pai_const_symbol_offset,init(
  220. strpnew(hp^.symtableentry^.mangledname),offset)));
  221. (*if token=POINT then
  222. begin
  223. offset:=0;
  224. while token=POINT do
  225. begin
  226. consume(POINT);
  227. lsym:=pvarsym(precdef(
  228. ppointerdef(p^.resulttype)^.definition)^.symtable^.search(pattern));
  229. if assigned(sym) then
  230. offset:=offset+lsym^.address
  231. else
  232. begin
  233. Message1(sym_e_illegal_field,pattern);
  234. end;
  235. consume(ID);
  236. end;
  237. datasegment^.concat(new(pai_const_symbol_offset,init(
  238. strpnew(p^.left^.symtableentry^.mangledname),offset)));
  239. end
  240. else
  241. begin
  242. datasegment^.concat(new(pai_const,init_symbol(
  243. strpnew(p^.left^.symtableentry^.mangledname))));
  244. end; *)
  245. maybe_concat_external(hp^.symtableentry^.owner,
  246. hp^.symtableentry^.mangledname);
  247. end
  248. else
  249. Message(cg_e_illegal_expression);
  250. end
  251. else
  252. { allow typeof(Object type)}
  253. if (p^.treetype=inlinen) and
  254. (p^.inlinenumber=in_typeof_x) then
  255. begin
  256. if (p^.left^.treetype=typen) then
  257. begin
  258. datasegment^.concat(new(pai_const,init_symbol(
  259. strpnew(pobjectdef(p^.left^.resulttype)^.vmt_mangledname))));
  260. if pobjectdef(p^.left^.resulttype)^.owner^.symtabletype=unitsymtable then
  261. concat_external(pobjectdef(p^.left^.resulttype)^.vmt_mangledname,EXT_NEAR);
  262. end
  263. else
  264. Message(cg_e_illegal_expression);
  265. end
  266. else
  267. Message(cg_e_illegal_expression);
  268. disposetree(p);
  269. end;
  270. setdef:
  271. begin
  272. p:=comp_expr(true);
  273. do_firstpass(p);
  274. if p^.treetype=setconstn then
  275. begin
  276. { we only allow const sets }
  277. if assigned(p^.left) then
  278. Message(cg_e_illegal_expression)
  279. else
  280. begin
  281. {$ifdef i386}
  282. for l:=0 to def^.savesize-1 do
  283. datasegment^.concat(new(pai_const,init_8bit(p^.value_set^[l])));
  284. {$endif}
  285. {$ifdef m68k}
  286. j:=0;
  287. for l:=0 to ((def^.savesize-1) div 4) do
  288. { HORRIBLE HACK because of endian }
  289. { now use intel endian for constant sets }
  290. begin
  291. datasegment^.concat(new(pai_const,init_8bit(p^.value_set^[j+3])));
  292. datasegment^.concat(new(pai_const,init_8bit(p^.value_set^[j+2])));
  293. datasegment^.concat(new(pai_const,init_8bit(p^.value_set^[j+1])));
  294. datasegment^.concat(new(pai_const,init_8bit(p^.value_set^[j])));
  295. Inc(j,4);
  296. end;
  297. {$endif}
  298. end;
  299. end
  300. else
  301. Message(cg_e_illegal_expression);
  302. disposetree(p);
  303. end;
  304. enumdef:
  305. begin
  306. p:=comp_expr(true);
  307. do_firstpass(p);
  308. if p^.treetype=ordconstn then
  309. begin
  310. if is_equal(p^.resulttype,def) then
  311. datasegment^.concat(new(pai_const,init_32bit(p^.value)))
  312. else
  313. Message(cg_e_illegal_expression);
  314. end
  315. else
  316. Message(cg_e_illegal_expression);
  317. disposetree(p);
  318. end;
  319. stringdef:
  320. begin
  321. p:=comp_expr(true);
  322. do_firstpass(p);
  323. { first take care of prefixes for long and ansi strings }
  324. case pstringdef(def)^.string_typ of
  325. st_shortstring:
  326. begin
  327. if p^.treetype=stringconstn then
  328. begin
  329. if p^.length>=def^.size then
  330. strlength:=def^.size-1
  331. else
  332. strlength:=p^.length;
  333. datasegment^.concat(new(pai_const,init_8bit(strlength)));
  334. { this can also handle longer strings }
  335. getmem(ca,strlength+1);
  336. move(p^.value_str^,ca^,strlength);
  337. ca[strlength]:=#0;
  338. datasegment^.concat(new(pai_string,init_length_pchar(ca,strlength)));
  339. end
  340. else if is_constcharnode(p) then
  341. begin
  342. datasegment^.concat(new(pai_string,init(#1+char(byte(p^.value)))));
  343. strlength:=1;
  344. end
  345. else Message(cg_e_illegal_expression);
  346. if def^.size>strlength then
  347. begin
  348. getmem(ca,def^.size-strlength);
  349. { def^.size contains also the leading length, so we }
  350. { we have to subtract one }
  351. fillchar(ca[0],def^.size-strlength-1,' ');
  352. ca[def^.size-strlength-1]:=#0;
  353. { this can also handle longer strings }
  354. datasegment^.concat(new(pai_string,init_length_pchar(ca,def^.size-strlength-1)));
  355. end;
  356. end;
  357. {$ifdef UseLongString}
  358. st_longstring:
  359. begin
  360. if is_constcharnode(p) then
  361. strlength:=1
  362. else
  363. strlength:=p^.length;
  364. { first write the maximum size }
  365. datasegment^.concat(new(pai_const,init_32bit(strlength)))));
  366. { fill byte }
  367. datasegment^.concat(new(pai_const,init_8bit(0)));
  368. if p^.treetype=stringconstn then
  369. begin
  370. getmem(ca,strlength+1);
  371. move(p^.value_str^,ca^,strlength);
  372. ca[strlength]:=#0;
  373. generate_pascii(consts,ca,strlength);
  374. end
  375. else if is_constcharnode(p) then
  376. begin
  377. consts^.concat(new(pai_const,init_8bit(p^.value)));
  378. end
  379. else Message(cg_e_illegal_expression);
  380. datasegment^.concat(new(pai_const,init_8bit(0)));
  381. end;
  382. {$endif UseLongString}
  383. st_ansistring:
  384. begin
  385. { an empty ansi string is nil! }
  386. if (p^.treetype=stringconstn) and (p^.length=0) then
  387. datasegment^.concat(new(pai_const,init_32bit(0)))
  388. else
  389. begin
  390. if is_constcharnode(p) then
  391. strlength:=1
  392. else
  393. strlength:=p^.length;
  394. getdatalabel(ll);
  395. datasegment^.concat(new(pai_const,init_symbol(strpnew(lab2str(ll)))));
  396. { first write the maximum size }
  397. consts^.concat(new(pai_const,init_32bit(strlength)));
  398. { second write the real length }
  399. consts^.concat(new(pai_const,init_32bit(strlength)));
  400. { redondent with maxlength but who knows ... (PM) }
  401. { third write use count (set to -1 for safety ) }
  402. consts^.concat(new(pai_const,init_32bit(-1)));
  403. consts^.concat(new(pai_label,init(ll)));
  404. if p^.treetype=stringconstn then
  405. begin
  406. getmem(ca,strlength+1);
  407. move(p^.value_str^,ca^,strlength);
  408. ca[strlength]:=#0;
  409. consts^.concat(new(pai_string,init_length_pchar(ca,strlength)));
  410. end
  411. else if is_constcharnode(p) then
  412. begin
  413. consts^.concat(new(pai_const,init_8bit(p^.value)));
  414. end
  415. else Message(cg_e_illegal_expression);
  416. consts^.concat(new(pai_const,init_8bit(0)));
  417. end;
  418. end;
  419. end;
  420. disposetree(p);
  421. end;
  422. arraydef:
  423. begin
  424. if token=LKLAMMER then
  425. begin
  426. consume(LKLAMMER);
  427. for l:=parraydef(def)^.lowrange to parraydef(def)^.highrange-1 do
  428. begin
  429. readtypedconst(parraydef(def)^.definition,nil);
  430. consume(COMMA);
  431. end;
  432. readtypedconst(parraydef(def)^.definition,nil);
  433. consume(RKLAMMER);
  434. end
  435. else
  436. begin
  437. p:=comp_expr(true);
  438. do_firstpass(p);
  439. if p^.treetype=stringconstn then
  440. begin
  441. if p^.length>255 then
  442. len:=255
  443. else
  444. len:=p^.length;
  445. {$ifndef TP}
  446. {$ifopt H+}
  447. setlength(s,len);
  448. {$else}
  449. s[0]:=chr(len);
  450. {$endif}
  451. {$else}
  452. s[0]:=chr(len);
  453. {$endif}
  454. move(p^.value_str^,s[1],len);
  455. end
  456. else
  457. if is_constcharnode(p) then
  458. s:=char(byte(p^.value))
  459. else
  460. Message(cg_e_illegal_expression);
  461. disposetree(p);
  462. l:=length(s);
  463. for i:=Parraydef(def)^.lowrange to Parraydef(def)^.highrange do
  464. begin
  465. if i+1-Parraydef(def)^.lowrange<=l then
  466. begin
  467. datasegment^.concat(new(pai_const,init_8bit(byte(s[1]))));
  468. delete(s,1,1);
  469. end
  470. else
  471. {Fill the remaining positions with #0.}
  472. datasegment^.concat(new(pai_const,init_8bit(0)));
  473. end;
  474. if length(s)>0 then
  475. Message(parser_e_invalid_string_size);
  476. end;
  477. end;
  478. procvardef:
  479. begin
  480. { Procvars and pointers are no longer compatible. }
  481. { under tp: =nil or =var under fpc: =nil or =@var }
  482. if token=_NIL then
  483. begin
  484. datasegment^.concat(new(pai_const,init_32bit(0)));
  485. consume(_NIL);
  486. exit;
  487. end
  488. else
  489. if not(m_tp_procvar in aktmodeswitches) then
  490. if token=KLAMMERAFFE then
  491. consume(KLAMMERAFFE);
  492. getsym(pattern,true);
  493. consume(ID);
  494. if srsym^.typ=unitsym then
  495. begin
  496. consume(POINT);
  497. getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
  498. consume(ID);
  499. end;
  500. if srsym^.typ<>procsym then
  501. Message(cg_e_illegal_expression)
  502. else
  503. begin
  504. pd:=pprocsym(srsym)^.definition;
  505. if assigned(pd^.nextoverloaded) then
  506. Message(parser_e_no_overloaded_procvars);
  507. if is_po_equal(pprocvardef(def)^.options,pd^.options) and
  508. is_equal(pprocvardef(def)^.retdef,pd^.retdef) then
  509. begin
  510. hp1:=pprocvardef(def)^.para1;
  511. hp2:=pd^.para1;
  512. while assigned(hp1) and assigned(hp2) do
  513. begin
  514. if not(is_equal(hp1^.data,hp2^.data)) or
  515. not(hp1^.paratyp=hp2^.paratyp) then
  516. begin
  517. Message(type_e_mismatch);
  518. break;
  519. end;
  520. hp1:=hp1^.next;
  521. hp2:=hp2^.next;
  522. end;
  523. if not((hp1=nil) and (hp2=nil)) then
  524. Message(type_e_mismatch);
  525. end
  526. else
  527. Message(type_e_mismatch);
  528. datasegment^.concat(new(pai_const,init_symbol(strpnew(pd^.mangledname))));
  529. if pd^.owner^.symtabletype=unitsymtable then
  530. concat_external(pd^.mangledname,EXT_NEAR);
  531. end;
  532. end;
  533. { reads a typed constant record }
  534. recorddef:
  535. begin
  536. consume(LKLAMMER);
  537. aktpos:=0;
  538. while token<>RKLAMMER do
  539. begin
  540. s:=pattern;
  541. consume(ID);
  542. consume(COLON);
  543. srsym:=precdef(def)^.symtable^.search(s);
  544. if srsym=nil then
  545. begin
  546. Message1(sym_e_id_not_found,s);
  547. consume_all_until(SEMICOLON);
  548. end
  549. else
  550. begin
  551. { check position }
  552. if pvarsym(srsym)^.address<aktpos then
  553. Message(parser_e_invalid_record_const);
  554. { if needed fill }
  555. if pvarsym(srsym)^.address>aktpos then
  556. for i:=1 to pvarsym(srsym)^.address-aktpos do
  557. datasegment^.concat(new(pai_const,init_8bit(0)));
  558. { new position }
  559. aktpos:=pvarsym(srsym)^.address+pvarsym(srsym)^.definition^.size;
  560. { read the data }
  561. readtypedconst(pvarsym(srsym)^.definition,nil);
  562. if token=SEMICOLON then
  563. consume(SEMICOLON)
  564. else break;
  565. end;
  566. end;
  567. for i:=1 to def^.size-aktpos do
  568. datasegment^.concat(new(pai_const,init_8bit(0)));
  569. consume(RKLAMMER);
  570. end;
  571. { reads a typed object }
  572. objectdef:
  573. begin
  574. if (pobjectdef(def)^.options and (oo_hasvmt or oo_is_class))<>0 then
  575. begin
  576. Message(parser_e_type_const_not_possible);
  577. consume_all_until(RKLAMMER);
  578. end
  579. else
  580. begin
  581. consume(LKLAMMER);
  582. aktpos:=0;
  583. while token<>RKLAMMER do
  584. begin
  585. s:=pattern;
  586. consume(ID);
  587. consume(COLON);
  588. srsym:=nil;
  589. obj:=pobjectdef(def);
  590. symt:=obj^.publicsyms;
  591. while (srsym=nil) and assigned(symt) do
  592. begin
  593. srsym:=symt^.search(s);
  594. if assigned(obj) then
  595. obj:=obj^.childof;
  596. if assigned(obj) then
  597. symt:=obj^.publicsyms
  598. else
  599. symt:=nil;
  600. end;
  601. if srsym=nil then
  602. begin
  603. Message1(sym_e_id_not_found,s);
  604. consume_all_until(SEMICOLON);
  605. end
  606. else
  607. begin
  608. { check position }
  609. if pvarsym(srsym)^.address<aktpos then
  610. Message(parser_e_invalid_record_const);
  611. { if needed fill }
  612. if pvarsym(srsym)^.address>aktpos then
  613. for i:=1 to pvarsym(srsym)^.address-aktpos do
  614. datasegment^.concat(new(pai_const,init_8bit(0)));
  615. { new position }
  616. aktpos:=pvarsym(srsym)^.address+pvarsym(srsym)^.definition^.size;
  617. { read the data }
  618. readtypedconst(pvarsym(srsym)^.definition,nil);
  619. if token=SEMICOLON then
  620. consume(SEMICOLON)
  621. else break;
  622. end;
  623. end;
  624. for i:=1 to def^.size-aktpos do
  625. datasegment^.concat(new(pai_const,init_8bit(0)));
  626. consume(RKLAMMER);
  627. end;
  628. end;
  629. else Message(parser_e_type_const_not_possible);
  630. end;
  631. end;
  632. end.
  633. {
  634. $Log$
  635. Revision 1.32 1998-12-11 16:50:23 florian
  636. + typed const int64 and qword
  637. + unary minus-operator q1:=-q2;
  638. + not-operator
  639. Revision 1.31 1998/12/11 00:03:41 peter
  640. + globtype,tokens,version unit splitted from globals
  641. Revision 1.30 1998/11/27 14:34:42 peter
  642. * give error when string[0] decl is found
  643. Revision 1.29 1998/11/23 18:26:44 pierre
  644. * fix for bug0182
  645. Revision 1.28 1998/11/17 10:40:16 peter
  646. * H+ fixes
  647. Revision 1.27 1998/11/16 12:12:23 peter
  648. - generate_pascii which is obsolete
  649. Revision 1.26 1998/11/10 17:53:06 peter
  650. * fixed const string
  651. Revision 1.25 1998/11/10 16:10:47 peter
  652. * fixed const pchar
  653. Revision 1.24 1998/11/05 12:02:55 peter
  654. * released useansistring
  655. * removed -Sv, its now available in fpc modes
  656. Revision 1.23 1998/11/04 10:11:45 peter
  657. * ansistring fixes
  658. Revision 1.22 1998/10/20 08:06:56 pierre
  659. * several memory corruptions due to double freemem solved
  660. => never use p^.loc.location:=p^.left^.loc.location;
  661. + finally I added now by default
  662. that ra386dir translates global and unit symbols
  663. + added a first field in tsymtable and
  664. a nextsym field in tsym
  665. (this allows to obtain ordered type info for
  666. records and objects in gdb !)
  667. Revision 1.21 1998/10/19 08:55:03 pierre
  668. * wrong stabs info corrected once again !!
  669. + variable vmt offset with vmt field only if required
  670. implemented now !!!
  671. Revision 1.20 1998/10/16 08:51:49 peter
  672. + target_os.stackalignment
  673. + stack can be aligned at 2 or 4 byte boundaries
  674. Revision 1.19 1998/10/12 12:20:58 pierre
  675. + added tai_const_symbol_offset
  676. for r : pointer = @var.field;
  677. * better message for different arg names on implementation
  678. of function
  679. Revision 1.18 1998/10/12 09:50:05 florian
  680. + support of <procedure var type>:=<pointer> in delphi mode added
  681. Revision 1.17 1998/10/09 08:56:29 pierre
  682. * several memory leaks fixed
  683. Revision 1.16 1998/09/24 23:49:18 peter
  684. + aktmodeswitches
  685. Revision 1.15 1998/09/07 18:46:11 peter
  686. * update smartlinking, uses getdatalabel
  687. * renamed ptree.value vars to value_str,value_real,value_set
  688. Revision 1.14 1998/09/04 08:42:07 peter
  689. * updated some error messages
  690. Revision 1.13 1998/09/01 09:05:36 peter
  691. * fixed string[4]='.library'
  692. Revision 1.12 1998/08/31 12:26:32 peter
  693. * m68k and palmos updates from surebugfixes
  694. Revision 1.11 1998/08/10 14:50:20 peter
  695. + localswitches, moduleswitches, globalswitches splitting
  696. Revision 1.10 1998/07/21 11:16:25 florian
  697. * bug0147 fixed
  698. Revision 1.9 1998/07/20 22:17:16 florian
  699. * hex constants in numeric char (#$54#$43 ...) are now allowed
  700. * there was a bug in record_var_dec which prevents the used
  701. of nested variant records (for example drivers.tevent of tv)
  702. Revision 1.8 1998/07/20 18:40:15 florian
  703. * handling of ansi string constants should now work
  704. Revision 1.7 1998/07/18 22:54:29 florian
  705. * some ansi/wide/longstring support fixed:
  706. o parameter passing
  707. o returning as result from functions
  708. Revision 1.6 1998/06/08 22:59:52 peter
  709. * smartlinking works for win32
  710. * some defines to exclude some compiler parts
  711. Revision 1.5 1998/06/03 22:49:01 peter
  712. + wordbool,longbool
  713. * rename bis,von -> high,low
  714. * moved some systemunit loading/creating to psystem.pas
  715. Revision 1.4 1998/05/05 12:05:42 florian
  716. * problems with properties fixed
  717. * crash fixed: i:=l when i and l are undefined, was a problem with
  718. implementation of private/protected
  719. Revision 1.3 1998/04/29 10:34:00 pierre
  720. + added some code for ansistring (not complete nor working yet)
  721. * corrected operator overloading
  722. * corrected nasm output
  723. + started inline procedures
  724. + added starstarn : use ** for exponentiation (^ gave problems)
  725. + started UseTokenInfo cond to get accurate positions
  726. }