ptconst.pas 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791
  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 in [subscriptn,vecn]) 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. do_firstpass(p^.left);
  209. hp:=p^.left;
  210. offset:=0;
  211. while assigned(hp) and (hp^.treetype<>loadn) do
  212. begin
  213. case hp^.treetype of
  214. vecn : internalerror(9779);
  215. subscriptn : inc(offset,hp^.vs^.address)
  216. else
  217. Message(cg_e_illegal_expression);
  218. end;
  219. hp:=hp^.left;
  220. end;
  221. datasegment^.concat(new(pai_const_symbol_offset,init(
  222. strpnew(hp^.symtableentry^.mangledname),offset)));
  223. (*if token=POINT then
  224. begin
  225. offset:=0;
  226. while token=POINT do
  227. begin
  228. consume(POINT);
  229. lsym:=pvarsym(precdef(
  230. ppointerdef(p^.resulttype)^.definition)^.symtable^.search(pattern));
  231. if assigned(sym) then
  232. offset:=offset+lsym^.address
  233. else
  234. begin
  235. Message1(sym_e_illegal_field,pattern);
  236. end;
  237. consume(ID);
  238. end;
  239. datasegment^.concat(new(pai_const_symbol_offset,init(
  240. strpnew(p^.left^.symtableentry^.mangledname),offset)));
  241. end
  242. else
  243. begin
  244. datasegment^.concat(new(pai_const,init_symbol(
  245. strpnew(p^.left^.symtableentry^.mangledname))));
  246. end; *)
  247. maybe_concat_external(hp^.symtableentry^.owner,
  248. hp^.symtableentry^.mangledname);
  249. end
  250. else
  251. Message(cg_e_illegal_expression);
  252. end
  253. else
  254. { allow typeof(Object type)}
  255. if (p^.treetype=inlinen) and
  256. (p^.inlinenumber=in_typeof_x) then
  257. begin
  258. if (p^.left^.treetype=typen) then
  259. begin
  260. datasegment^.concat(new(pai_const,init_symbol(
  261. strpnew(pobjectdef(p^.left^.resulttype)^.vmt_mangledname))));
  262. if pobjectdef(p^.left^.resulttype)^.owner^.symtabletype=unitsymtable then
  263. concat_external(pobjectdef(p^.left^.resulttype)^.vmt_mangledname,EXT_NEAR);
  264. end
  265. else
  266. Message(cg_e_illegal_expression);
  267. end
  268. else
  269. Message(cg_e_illegal_expression);
  270. disposetree(p);
  271. end;
  272. setdef:
  273. begin
  274. p:=comp_expr(true);
  275. do_firstpass(p);
  276. if p^.treetype=setconstn then
  277. begin
  278. { we only allow const sets }
  279. if assigned(p^.left) then
  280. Message(cg_e_illegal_expression)
  281. else
  282. begin
  283. {$ifdef i386}
  284. for l:=0 to def^.savesize-1 do
  285. datasegment^.concat(new(pai_const,init_8bit(p^.value_set^[l])));
  286. {$endif}
  287. {$ifdef m68k}
  288. j:=0;
  289. for l:=0 to ((def^.savesize-1) div 4) do
  290. { HORRIBLE HACK because of endian }
  291. { now use intel endian for constant sets }
  292. begin
  293. datasegment^.concat(new(pai_const,init_8bit(p^.value_set^[j+3])));
  294. datasegment^.concat(new(pai_const,init_8bit(p^.value_set^[j+2])));
  295. datasegment^.concat(new(pai_const,init_8bit(p^.value_set^[j+1])));
  296. datasegment^.concat(new(pai_const,init_8bit(p^.value_set^[j])));
  297. Inc(j,4);
  298. end;
  299. {$endif}
  300. end;
  301. end
  302. else
  303. Message(cg_e_illegal_expression);
  304. disposetree(p);
  305. end;
  306. enumdef:
  307. begin
  308. p:=comp_expr(true);
  309. do_firstpass(p);
  310. if p^.treetype=ordconstn then
  311. begin
  312. if is_equal(p^.resulttype,def) then
  313. datasegment^.concat(new(pai_const,init_32bit(p^.value)))
  314. else
  315. Message(cg_e_illegal_expression);
  316. end
  317. else
  318. Message(cg_e_illegal_expression);
  319. disposetree(p);
  320. end;
  321. stringdef:
  322. begin
  323. p:=comp_expr(true);
  324. do_firstpass(p);
  325. { first take care of prefixes for long and ansi strings }
  326. case pstringdef(def)^.string_typ of
  327. st_shortstring:
  328. begin
  329. if p^.treetype=stringconstn then
  330. begin
  331. if p^.length>=def^.size then
  332. strlength:=def^.size-1
  333. else
  334. strlength:=p^.length;
  335. datasegment^.concat(new(pai_const,init_8bit(strlength)));
  336. { this can also handle longer strings }
  337. getmem(ca,strlength+1);
  338. move(p^.value_str^,ca^,strlength);
  339. ca[strlength]:=#0;
  340. datasegment^.concat(new(pai_string,init_length_pchar(ca,strlength)));
  341. end
  342. else if is_constcharnode(p) then
  343. begin
  344. datasegment^.concat(new(pai_string,init(#1+char(byte(p^.value)))));
  345. strlength:=1;
  346. end
  347. else Message(cg_e_illegal_expression);
  348. if def^.size>strlength then
  349. begin
  350. getmem(ca,def^.size-strlength);
  351. { def^.size contains also the leading length, so we }
  352. { we have to subtract one }
  353. fillchar(ca[0],def^.size-strlength-1,' ');
  354. ca[def^.size-strlength-1]:=#0;
  355. { this can also handle longer strings }
  356. datasegment^.concat(new(pai_string,init_length_pchar(ca,def^.size-strlength-1)));
  357. end;
  358. end;
  359. {$ifdef UseLongString}
  360. st_longstring:
  361. begin
  362. if is_constcharnode(p) then
  363. strlength:=1
  364. else
  365. strlength:=p^.length;
  366. { first write the maximum size }
  367. datasegment^.concat(new(pai_const,init_32bit(strlength)))));
  368. { fill byte }
  369. datasegment^.concat(new(pai_const,init_8bit(0)));
  370. if p^.treetype=stringconstn then
  371. begin
  372. getmem(ca,strlength+1);
  373. move(p^.value_str^,ca^,strlength);
  374. ca[strlength]:=#0;
  375. generate_pascii(consts,ca,strlength);
  376. end
  377. else if is_constcharnode(p) then
  378. begin
  379. consts^.concat(new(pai_const,init_8bit(p^.value)));
  380. end
  381. else Message(cg_e_illegal_expression);
  382. datasegment^.concat(new(pai_const,init_8bit(0)));
  383. end;
  384. {$endif UseLongString}
  385. st_ansistring:
  386. begin
  387. { an empty ansi string is nil! }
  388. if (p^.treetype=stringconstn) and (p^.length=0) then
  389. datasegment^.concat(new(pai_const,init_32bit(0)))
  390. else
  391. begin
  392. if is_constcharnode(p) then
  393. strlength:=1
  394. else
  395. strlength:=p^.length;
  396. getdatalabel(ll);
  397. datasegment^.concat(new(pai_const,init_symbol(strpnew(lab2str(ll)))));
  398. { first write the maximum size }
  399. consts^.concat(new(pai_const,init_32bit(strlength)));
  400. { second write the real length }
  401. consts^.concat(new(pai_const,init_32bit(strlength)));
  402. { redondent with maxlength but who knows ... (PM) }
  403. { third write use count (set to -1 for safety ) }
  404. consts^.concat(new(pai_const,init_32bit(-1)));
  405. consts^.concat(new(pai_label,init(ll)));
  406. if p^.treetype=stringconstn then
  407. begin
  408. getmem(ca,strlength+1);
  409. move(p^.value_str^,ca^,strlength);
  410. ca[strlength]:=#0;
  411. consts^.concat(new(pai_string,init_length_pchar(ca,strlength)));
  412. end
  413. else if is_constcharnode(p) then
  414. begin
  415. consts^.concat(new(pai_const,init_8bit(p^.value)));
  416. end
  417. else Message(cg_e_illegal_expression);
  418. consts^.concat(new(pai_const,init_8bit(0)));
  419. end;
  420. end;
  421. end;
  422. disposetree(p);
  423. end;
  424. arraydef:
  425. begin
  426. if token=LKLAMMER then
  427. begin
  428. consume(LKLAMMER);
  429. for l:=parraydef(def)^.lowrange to parraydef(def)^.highrange-1 do
  430. begin
  431. readtypedconst(parraydef(def)^.definition,nil);
  432. consume(COMMA);
  433. end;
  434. readtypedconst(parraydef(def)^.definition,nil);
  435. consume(RKLAMMER);
  436. end
  437. else
  438. begin
  439. p:=comp_expr(true);
  440. do_firstpass(p);
  441. if p^.treetype=stringconstn then
  442. begin
  443. if p^.length>255 then
  444. len:=255
  445. else
  446. len:=p^.length;
  447. {$ifndef TP}
  448. {$ifopt H+}
  449. setlength(s,len);
  450. {$else}
  451. s[0]:=chr(len);
  452. {$endif}
  453. {$else}
  454. s[0]:=chr(len);
  455. {$endif}
  456. move(p^.value_str^,s[1],len);
  457. end
  458. else
  459. if is_constcharnode(p) then
  460. s:=char(byte(p^.value))
  461. else
  462. Message(cg_e_illegal_expression);
  463. disposetree(p);
  464. l:=length(s);
  465. for i:=Parraydef(def)^.lowrange to Parraydef(def)^.highrange do
  466. begin
  467. if i+1-Parraydef(def)^.lowrange<=l then
  468. begin
  469. datasegment^.concat(new(pai_const,init_8bit(byte(s[1]))));
  470. delete(s,1,1);
  471. end
  472. else
  473. {Fill the remaining positions with #0.}
  474. datasegment^.concat(new(pai_const,init_8bit(0)));
  475. end;
  476. if length(s)>0 then
  477. Message(parser_e_invalid_string_size);
  478. end;
  479. end;
  480. procvardef:
  481. begin
  482. { Procvars and pointers are no longer compatible. }
  483. { under tp: =nil or =var under fpc: =nil or =@var }
  484. if token=_NIL then
  485. begin
  486. datasegment^.concat(new(pai_const,init_32bit(0)));
  487. consume(_NIL);
  488. exit;
  489. end
  490. else
  491. if not(m_tp_procvar in aktmodeswitches) then
  492. if token=KLAMMERAFFE then
  493. consume(KLAMMERAFFE);
  494. getsym(pattern,true);
  495. consume(ID);
  496. if srsym^.typ=unitsym then
  497. begin
  498. consume(POINT);
  499. getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
  500. consume(ID);
  501. end;
  502. if srsym^.typ<>procsym then
  503. Message(cg_e_illegal_expression)
  504. else
  505. begin
  506. pd:=pprocsym(srsym)^.definition;
  507. if assigned(pd^.nextoverloaded) then
  508. Message(parser_e_no_overloaded_procvars);
  509. if is_po_equal(pprocvardef(def)^.options,pd^.options) and
  510. is_equal(pprocvardef(def)^.retdef,pd^.retdef) then
  511. begin
  512. hp1:=pprocvardef(def)^.para1;
  513. hp2:=pd^.para1;
  514. while assigned(hp1) and assigned(hp2) do
  515. begin
  516. if not(is_equal(hp1^.data,hp2^.data)) or
  517. not(hp1^.paratyp=hp2^.paratyp) then
  518. begin
  519. Message(type_e_mismatch);
  520. break;
  521. end;
  522. hp1:=hp1^.next;
  523. hp2:=hp2^.next;
  524. end;
  525. if not((hp1=nil) and (hp2=nil)) then
  526. Message(type_e_mismatch);
  527. end
  528. else
  529. Message(type_e_mismatch);
  530. datasegment^.concat(new(pai_const,init_symbol(strpnew(pd^.mangledname))));
  531. if pd^.owner^.symtabletype=unitsymtable then
  532. concat_external(pd^.mangledname,EXT_NEAR);
  533. end;
  534. end;
  535. { reads a typed constant record }
  536. recorddef:
  537. begin
  538. consume(LKLAMMER);
  539. aktpos:=0;
  540. while token<>RKLAMMER do
  541. begin
  542. s:=pattern;
  543. consume(ID);
  544. consume(COLON);
  545. srsym:=precdef(def)^.symtable^.search(s);
  546. if srsym=nil then
  547. begin
  548. Message1(sym_e_id_not_found,s);
  549. consume_all_until(SEMICOLON);
  550. end
  551. else
  552. begin
  553. { check position }
  554. if pvarsym(srsym)^.address<aktpos then
  555. Message(parser_e_invalid_record_const);
  556. { if needed fill }
  557. if pvarsym(srsym)^.address>aktpos then
  558. for i:=1 to pvarsym(srsym)^.address-aktpos do
  559. datasegment^.concat(new(pai_const,init_8bit(0)));
  560. { new position }
  561. aktpos:=pvarsym(srsym)^.address+pvarsym(srsym)^.definition^.size;
  562. { read the data }
  563. readtypedconst(pvarsym(srsym)^.definition,nil);
  564. if token=SEMICOLON then
  565. consume(SEMICOLON)
  566. else break;
  567. end;
  568. end;
  569. for i:=1 to def^.size-aktpos do
  570. datasegment^.concat(new(pai_const,init_8bit(0)));
  571. consume(RKLAMMER);
  572. end;
  573. { reads a typed object }
  574. objectdef:
  575. begin
  576. if (pobjectdef(def)^.options and (oo_hasvmt or oo_is_class))<>0 then
  577. begin
  578. Message(parser_e_type_const_not_possible);
  579. consume_all_until(RKLAMMER);
  580. end
  581. else
  582. begin
  583. consume(LKLAMMER);
  584. aktpos:=0;
  585. while token<>RKLAMMER do
  586. begin
  587. s:=pattern;
  588. consume(ID);
  589. consume(COLON);
  590. srsym:=nil;
  591. obj:=pobjectdef(def);
  592. symt:=obj^.publicsyms;
  593. while (srsym=nil) and assigned(symt) do
  594. begin
  595. srsym:=symt^.search(s);
  596. if assigned(obj) then
  597. obj:=obj^.childof;
  598. if assigned(obj) then
  599. symt:=obj^.publicsyms
  600. else
  601. symt:=nil;
  602. end;
  603. if srsym=nil then
  604. begin
  605. Message1(sym_e_id_not_found,s);
  606. consume_all_until(SEMICOLON);
  607. end
  608. else
  609. begin
  610. { check position }
  611. if pvarsym(srsym)^.address<aktpos then
  612. Message(parser_e_invalid_record_const);
  613. { if needed fill }
  614. if pvarsym(srsym)^.address>aktpos then
  615. for i:=1 to pvarsym(srsym)^.address-aktpos do
  616. datasegment^.concat(new(pai_const,init_8bit(0)));
  617. { new position }
  618. aktpos:=pvarsym(srsym)^.address+pvarsym(srsym)^.definition^.size;
  619. { read the data }
  620. readtypedconst(pvarsym(srsym)^.definition,nil);
  621. if token=SEMICOLON then
  622. consume(SEMICOLON)
  623. else break;
  624. end;
  625. end;
  626. for i:=1 to def^.size-aktpos do
  627. datasegment^.concat(new(pai_const,init_8bit(0)));
  628. consume(RKLAMMER);
  629. end;
  630. end;
  631. else Message(parser_e_type_const_not_possible);
  632. end;
  633. end;
  634. end.
  635. {
  636. $Log$
  637. Revision 1.34 1999-01-05 08:20:08 florian
  638. * mainly problem with invalid case ranges fixed (reported by Jonas)
  639. Revision 1.33 1998/12/15 17:16:01 peter
  640. * fixed const s : ^string
  641. * first things for const pchar : @string[1]
  642. Revision 1.32 1998/12/11 16:50:23 florian
  643. + typed const int64 and qword
  644. + unary minus-operator q1:=-q2;
  645. + not-operator
  646. Revision 1.31 1998/12/11 00:03:41 peter
  647. + globtype,tokens,version unit splitted from globals
  648. Revision 1.30 1998/11/27 14:34:42 peter
  649. * give error when string[0] decl is found
  650. Revision 1.29 1998/11/23 18:26:44 pierre
  651. * fix for bug0182
  652. Revision 1.28 1998/11/17 10:40:16 peter
  653. * H+ fixes
  654. Revision 1.27 1998/11/16 12:12:23 peter
  655. - generate_pascii which is obsolete
  656. Revision 1.26 1998/11/10 17:53:06 peter
  657. * fixed const string
  658. Revision 1.25 1998/11/10 16:10:47 peter
  659. * fixed const pchar
  660. Revision 1.24 1998/11/05 12:02:55 peter
  661. * released useansistring
  662. * removed -Sv, its now available in fpc modes
  663. Revision 1.23 1998/11/04 10:11:45 peter
  664. * ansistring fixes
  665. Revision 1.22 1998/10/20 08:06:56 pierre
  666. * several memory corruptions due to double freemem solved
  667. => never use p^.loc.location:=p^.left^.loc.location;
  668. + finally I added now by default
  669. that ra386dir translates global and unit symbols
  670. + added a first field in tsymtable and
  671. a nextsym field in tsym
  672. (this allows to obtain ordered type info for
  673. records and objects in gdb !)
  674. Revision 1.21 1998/10/19 08:55:03 pierre
  675. * wrong stabs info corrected once again !!
  676. + variable vmt offset with vmt field only if required
  677. implemented now !!!
  678. Revision 1.20 1998/10/16 08:51:49 peter
  679. + target_os.stackalignment
  680. + stack can be aligned at 2 or 4 byte boundaries
  681. Revision 1.19 1998/10/12 12:20:58 pierre
  682. + added tai_const_symbol_offset
  683. for r : pointer = @var.field;
  684. * better message for different arg names on implementation
  685. of function
  686. Revision 1.18 1998/10/12 09:50:05 florian
  687. + support of <procedure var type>:=<pointer> in delphi mode added
  688. Revision 1.17 1998/10/09 08:56:29 pierre
  689. * several memory leaks fixed
  690. Revision 1.16 1998/09/24 23:49:18 peter
  691. + aktmodeswitches
  692. Revision 1.15 1998/09/07 18:46:11 peter
  693. * update smartlinking, uses getdatalabel
  694. * renamed ptree.value vars to value_str,value_real,value_set
  695. Revision 1.14 1998/09/04 08:42:07 peter
  696. * updated some error messages
  697. Revision 1.13 1998/09/01 09:05:36 peter
  698. * fixed string[4]='.library'
  699. Revision 1.12 1998/08/31 12:26:32 peter
  700. * m68k and palmos updates from surebugfixes
  701. Revision 1.11 1998/08/10 14:50:20 peter
  702. + localswitches, moduleswitches, globalswitches splitting
  703. Revision 1.10 1998/07/21 11:16:25 florian
  704. * bug0147 fixed
  705. Revision 1.9 1998/07/20 22:17:16 florian
  706. * hex constants in numeric char (#$54#$43 ...) are now allowed
  707. * there was a bug in record_var_dec which prevents the used
  708. of nested variant records (for example drivers.tevent of tv)
  709. Revision 1.8 1998/07/20 18:40:15 florian
  710. * handling of ansi string constants should now work
  711. Revision 1.7 1998/07/18 22:54:29 florian
  712. * some ansi/wide/longstring support fixed:
  713. o parameter passing
  714. o returning as result from functions
  715. Revision 1.6 1998/06/08 22:59:52 peter
  716. * smartlinking works for win32
  717. * some defines to exclude some compiler parts
  718. Revision 1.5 1998/06/03 22:49:01 peter
  719. + wordbool,longbool
  720. * rename bis,von -> high,low
  721. * moved some systemunit loading/creating to psystem.pas
  722. Revision 1.4 1998/05/05 12:05:42 florian
  723. * problems with properties fixed
  724. * crash fixed: i:=l when i and l are undefined, was a problem with
  725. implementation of private/protected
  726. Revision 1.3 1998/04/29 10:34:00 pierre
  727. + added some code for ansistring (not complete nor working yet)
  728. * corrected operator overloading
  729. * corrected nasm output
  730. + started inline procedures
  731. + added starstarn : use ** for exponentiation (^ gave problems)
  732. + started UseTokenInfo cond to get accurate positions
  733. }