pexpr.pas 78 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006
  1. {
  2. $Id$
  3. Copyright (c) 1998 by Florian Klaempfl
  4. Does parsing of expression for Free Pascal
  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 pexpr;
  19. interface
  20. uses symtable,tree;
  21. { reads a whole expression }
  22. function expr : ptree;
  23. { reads an expression without assignements and .. }
  24. function comp_expr(accept_equal : boolean):Ptree;
  25. { reads a single factor }
  26. function factor(getaddr : boolean) : ptree;
  27. { the ID token has to be consumed before calling this function }
  28. procedure do_member_read(getaddr : boolean;const sym : psym;var p1 : ptree;
  29. var pd : pdef;var again : boolean);
  30. function get_intconst:longint;
  31. function get_stringconst:string;
  32. implementation
  33. uses
  34. cobjects,globals,scanner,aasm,pass_1,systems,
  35. hcodegen,types,verbose,strings
  36. { parser specific stuff }
  37. ,pbase,pdecl
  38. { processor specific stuff }
  39. {$ifdef i386}
  40. ,i386
  41. {$endif}
  42. {$ifdef m68k}
  43. ,m68k
  44. {$endif}
  45. ;
  46. function parse_paras(_colon,in_prop_paras : boolean) : ptree;
  47. var
  48. p1,p2 : ptree;
  49. end_of_paras : ttoken;
  50. begin
  51. if in_prop_paras then
  52. end_of_paras:=RECKKLAMMER
  53. else
  54. end_of_paras:=RKLAMMER;
  55. if token=end_of_paras then
  56. begin
  57. parse_paras:=nil;
  58. exit;
  59. end;
  60. p2:=nil;
  61. inc(parsing_para_level);
  62. while true do
  63. begin
  64. p1:=comp_expr(true);
  65. p2:=gencallparanode(p1,p2);
  66. { it's for the str(l:5,s); }
  67. if _colon and (token=COLON) then
  68. begin
  69. consume(COLON);
  70. p1:=comp_expr(true);
  71. p2:=gencallparanode(p1,p2);
  72. p2^.is_colon_para:=true;
  73. if token=COLON then
  74. begin
  75. consume(COLON);
  76. p1:=comp_expr(true);
  77. p2:=gencallparanode(p1,p2);
  78. p2^.is_colon_para:=true;
  79. end
  80. end;
  81. if token=COMMA then
  82. consume(COMMA)
  83. else
  84. break;
  85. end;
  86. dec(parsing_para_level);
  87. parse_paras:=p2;
  88. end;
  89. function statement_syssym(l : longint;var pd : pdef) : ptree;
  90. var
  91. p1,p2 : ptree;
  92. paras : ptree;
  93. prev_in_args : boolean;
  94. Store_valid : boolean;
  95. begin
  96. prev_in_args:=in_args;
  97. Store_valid:=Must_be_valid;
  98. case l of
  99. in_ord_x : begin
  100. consume(LKLAMMER);
  101. in_args:=true;
  102. Must_be_valid:=true;
  103. p1:=comp_expr(true);
  104. consume(RKLAMMER);
  105. do_firstpass(p1);
  106. p1:=geninlinenode(in_ord_x,false,p1);
  107. do_firstpass(p1);
  108. statement_syssym := p1;
  109. pd:=p1^.resulttype;
  110. end;
  111. in_break : begin
  112. statement_syssym:=genzeronode(breakn);
  113. pd:=voiddef;
  114. end;
  115. in_continue : begin
  116. statement_syssym:=genzeronode(continuen);
  117. pd:=voiddef;
  118. end;
  119. in_typeof_x : begin
  120. consume(LKLAMMER);
  121. in_args:=true;
  122. p1:=comp_expr(true);
  123. consume(RKLAMMER);
  124. pd:=voidpointerdef;
  125. if p1^.treetype=typen then
  126. begin
  127. if (p1^.resulttype=nil) then
  128. begin
  129. Message(type_e_mismatch);
  130. statement_syssym:=genzeronode(errorn);
  131. end
  132. else
  133. if p1^.resulttype^.deftype=objectdef then
  134. statement_syssym:=geninlinenode(in_typeof_x,false,p1)
  135. else
  136. begin
  137. Message(type_e_mismatch);
  138. statement_syssym:=genzeronode(errorn);
  139. end;
  140. end
  141. else
  142. begin
  143. Must_be_valid:=false;
  144. do_firstpass(p1);
  145. if (p1^.resulttype=nil) then
  146. begin
  147. Message(type_e_mismatch);
  148. statement_syssym:=genzeronode(errorn)
  149. end
  150. else
  151. if p1^.resulttype^.deftype=objectdef then
  152. statement_syssym:=geninlinenode(in_typeof_x,false,p1)
  153. else
  154. begin
  155. Message(type_e_mismatch);
  156. statement_syssym:=genzeronode(errorn)
  157. end;
  158. end;
  159. end;
  160. in_sizeof_x : begin
  161. consume(LKLAMMER);
  162. in_args:=true;
  163. p1:=comp_expr(true);
  164. consume(RKLAMMER);
  165. pd:=s32bitdef;
  166. if p1^.treetype=typen then
  167. begin
  168. statement_syssym:=genordinalconstnode(p1^.resulttype^.size,pd);
  169. { p1 not needed !}
  170. disposetree(p1);
  171. end
  172. else
  173. begin
  174. Must_be_valid:=false;
  175. do_firstpass(p1);
  176. if ((p1^.resulttype^.deftype=objectdef) and
  177. ((pobjectdef(p1^.resulttype)^.options and oo_hasvirtual)<>0))
  178. or is_open_array(p1^.resulttype) then
  179. statement_syssym:=geninlinenode(in_sizeof_x,false,p1)
  180. else
  181. begin
  182. statement_syssym:=genordinalconstnode(p1^.resulttype^.size,pd);
  183. { p1 not needed !}
  184. disposetree(p1);
  185. end;
  186. end;
  187. end;
  188. in_assigned_x : begin
  189. consume(LKLAMMER);
  190. in_args:=true;
  191. p1:=comp_expr(true);
  192. Must_be_valid:=true;
  193. do_firstpass(p1);
  194. case p1^.resulttype^.deftype of
  195. pointerdef,
  196. procvardef,
  197. classrefdef : ;
  198. objectdef : if not(pobjectdef(p1^.resulttype)^.isclass) then
  199. Message(parser_e_illegal_parameter_list);
  200. else
  201. Message(parser_e_illegal_parameter_list);
  202. end;
  203. p2:=gencallparanode(p1,nil);
  204. p2:=geninlinenode(in_assigned_x,false,p2);
  205. consume(RKLAMMER);
  206. pd:=booldef;
  207. statement_syssym:=p2;
  208. end;
  209. in_ofs_x : begin
  210. consume(LKLAMMER);
  211. in_args:=true;
  212. p1:=comp_expr(true);
  213. p1:=gensinglenode(addrn,p1);
  214. Must_be_valid:=false;
  215. do_firstpass(p1);
  216. { Ofs() returns a longint, not a pointer }
  217. p1^.resulttype:=u32bitdef;
  218. pd:=p1^.resulttype;
  219. consume(RKLAMMER);
  220. statement_syssym:=p1;
  221. end;
  222. in_seg_x : begin
  223. consume(LKLAMMER);
  224. in_args:=true;
  225. p1:=comp_expr(true);
  226. do_firstpass(p1);
  227. if p1^.location.loc<>LOC_REFERENCE then
  228. Message(cg_e_illegal_expression);
  229. p1:=genordinalconstnode(0,s32bitdef);
  230. Must_be_valid:=false;
  231. pd:=s32bitdef;
  232. consume(RKLAMMER);
  233. statement_syssym:=p1;
  234. end;
  235. in_high_x,
  236. in_low_x : begin
  237. consume(LKLAMMER);
  238. in_args:=true;
  239. p1:=comp_expr(true);
  240. do_firstpass(p1);
  241. Must_be_valid:=false;
  242. p2:=geninlinenode(l,false,p1);
  243. consume(RKLAMMER);
  244. pd:=s32bitdef;
  245. statement_syssym:=p2;
  246. end;
  247. in_succ_x,
  248. in_pred_x : begin
  249. consume(LKLAMMER);
  250. in_args:=true;
  251. p1:=comp_expr(true);
  252. do_firstpass(p1);
  253. Must_be_valid:=false;
  254. p2:=geninlinenode(l,false,p1);
  255. consume(RKLAMMER);
  256. pd:=p1^.resulttype;
  257. statement_syssym:=p2;
  258. end;
  259. in_inc_x,
  260. in_dec_x : begin
  261. consume(LKLAMMER);
  262. in_args:=true;
  263. p1:=comp_expr(true);
  264. Must_be_valid:=false;
  265. if token=COMMA then
  266. begin
  267. consume(COMMA);
  268. p2:=gencallparanode(comp_expr(true),nil);
  269. end
  270. else
  271. p2:=nil;
  272. p2:=gencallparanode(p1,p2);
  273. statement_syssym:=geninlinenode(l,false,p2);
  274. consume(RKLAMMER);
  275. pd:=voiddef;
  276. end;
  277. in_concat_x : begin
  278. consume(LKLAMMER);
  279. in_args:=true;
  280. p2:=nil;
  281. while true do
  282. begin
  283. p1:=comp_expr(true);
  284. Must_be_valid:=true;
  285. do_firstpass(p1);
  286. if not((p1^.resulttype^.deftype=stringdef) or
  287. ((p1^.resulttype^.deftype=orddef) and
  288. (porddef(p1^.resulttype)^.typ=uchar))) then
  289. Message(parser_e_illegal_parameter_list);
  290. if p2<>nil then
  291. p2:=gennode(addn,p2,p1)
  292. else
  293. p2:=p1;
  294. if token=COMMA then
  295. consume(COMMA)
  296. else
  297. break;
  298. end;
  299. consume(RKLAMMER);
  300. pd:=cstringdef;
  301. statement_syssym:=p2;
  302. end;
  303. in_read_x,
  304. in_readln_x : begin
  305. if token=LKLAMMER then
  306. begin
  307. consume(LKLAMMER);
  308. in_args:=true;
  309. Must_be_valid:=false;
  310. paras:=parse_paras(false,false);
  311. consume(RKLAMMER);
  312. end
  313. else
  314. paras:=nil;
  315. pd:=voiddef;
  316. p1:=geninlinenode(l,false,paras);
  317. do_firstpass(p1);
  318. statement_syssym := p1;
  319. end;
  320. in_write_x,
  321. in_writeln_x : begin
  322. if token=LKLAMMER then
  323. begin
  324. consume(LKLAMMER);
  325. in_args:=true;
  326. Must_be_valid:=true;
  327. paras:=parse_paras(true,false);
  328. consume(RKLAMMER);
  329. end
  330. else
  331. paras:=nil;
  332. pd:=voiddef;
  333. p1 := geninlinenode(l,false,paras);
  334. do_firstpass(p1);
  335. statement_syssym := p1;
  336. end;
  337. in_str_x_string : begin
  338. consume(LKLAMMER);
  339. in_args:=true;
  340. paras:=parse_paras(true,false);
  341. consume(RKLAMMER);
  342. p1 := geninlinenode(l,false,paras);
  343. do_firstpass(p1);
  344. statement_syssym := p1;
  345. pd:=voiddef;
  346. end;
  347. in_include_x_y,
  348. in_exclude_x_y : begin
  349. consume(LKLAMMER);
  350. in_args:=true;
  351. p1:=comp_expr(true);
  352. Must_be_valid:=false;
  353. consume(COMMA);
  354. p2:=comp_expr(true);
  355. { just a bit lisp feeling }
  356. statement_syssym:=geninlinenode(l,false,gencallparanode(p1,gencallparanode(p2,nil)));
  357. consume(RKLAMMER);
  358. pd:=voiddef;
  359. end;
  360. {in_val_x : begin
  361. consume(LKLAMMER);
  362. paras:=parse_paras(false);
  363. consume(RKLAMMER);
  364. p1 := geninlinenode(l,false,paras);
  365. do_firstpass(p1);
  366. statement_syssym := p1;
  367. pd:=voiddef;
  368. end; }
  369. else
  370. internalerror(15);
  371. end;
  372. in_args:=prev_in_args;
  373. Must_be_valid:=Store_valid;
  374. end;
  375. { reads the parameter for a subroutine call }
  376. procedure do_proc_call(getaddr : boolean;var again : boolean;var p1:Ptree;var pd:Pdef);
  377. var
  378. prev_in_args : boolean;
  379. prevafterassn : boolean;
  380. begin
  381. prev_in_args:=in_args;
  382. prevafterassn:=afterassignment;
  383. afterassignment:=false;
  384. { want we only determine the address of }
  385. { a subroutine ? }
  386. if not(getaddr) then
  387. begin
  388. if token=LKLAMMER then
  389. begin
  390. consume(LKLAMMER);
  391. in_args:=true;
  392. p1^.left:=parse_paras(false,false);
  393. consume(RKLAMMER);
  394. end
  395. else p1^.left:=nil;
  396. { do firstpass because we need the }
  397. { result type }
  398. do_firstpass(p1);
  399. end
  400. else
  401. begin
  402. { address operator @: }
  403. p1^.left:=nil;
  404. { forget pd }
  405. pd:=nil;
  406. { no postfix operators }
  407. again:=false;
  408. end;
  409. pd:=p1^.resulttype;
  410. in_args:=prev_in_args;
  411. afterassignment:=prevafterassn;
  412. end;
  413. { the following procedure handles the access to a property symbol }
  414. procedure handle_propertysym(sym : psym;st : psymtable;var p1 : ptree;
  415. var pd : pdef);
  416. var
  417. paras : ptree;
  418. p2 : ptree;
  419. begin
  420. paras:=nil;
  421. { property parameters? }
  422. if token=LECKKLAMMER then
  423. begin
  424. consume(LECKKLAMMER);
  425. paras:=parse_paras(false,true);
  426. consume(RECKKLAMMER);
  427. end;
  428. { indexed property }
  429. if (ppropertysym(sym)^.options and ppo_indexed)<>0 then
  430. begin
  431. p2:=genordinalconstnode(ppropertysym(sym)^.index,s32bitdef);
  432. paras:=gencallparanode(p2,paras);
  433. end;
  434. if not(afterassignment) and not(in_args) then
  435. begin
  436. { write property: }
  437. { no result }
  438. pd:=voiddef;
  439. if assigned(ppropertysym(sym)^.writeaccesssym) then
  440. begin
  441. if ppropertysym(sym)^.writeaccesssym^.typ=procsym then
  442. begin
  443. { generate the method call }
  444. p1:=genmethodcallnode(pprocsym(
  445. ppropertysym(sym)^.writeaccesssym),st,p1);
  446. { we know the procedure to call, so
  447. force the usage of that procedure }
  448. p1^.procdefinition:=pprocdef(ppropertysym(sym)^.writeaccessdef);
  449. p1^.left:=paras;
  450. consume(ASSIGNMENT);
  451. { read the expression }
  452. p2:=comp_expr(true);
  453. p1^.left:=gencallparanode(p2,p1^.left);
  454. end
  455. else if ppropertysym(sym)^.writeaccesssym^.typ=varsym then
  456. begin
  457. if assigned(paras) then
  458. message(parser_e_no_paras_allowed);
  459. { subscribed access? }
  460. if p1=nil then
  461. begin
  462. p1:=genloadnode(pvarsym(ppropertysym(sym)^.readaccesssym),st);
  463. end
  464. else
  465. p1:=gensubscriptnode(pvarsym(
  466. ppropertysym(sym)^.readaccesssym),p1);
  467. consume(ASSIGNMENT);
  468. { read the expression }
  469. p2:=comp_expr(true);
  470. p1:=gennode(assignn,p1,p2);
  471. end
  472. else
  473. begin
  474. p1:=genzeronode(errorn);
  475. Message(parser_e_no_procedure_to_access_property);
  476. end;
  477. end
  478. else
  479. begin
  480. p1:=genzeronode(errorn);
  481. Message(parser_e_no_procedure_to_access_property);
  482. end;
  483. end
  484. else
  485. begin
  486. { read property: }
  487. pd:=ppropertysym(sym)^.proptype;
  488. if assigned(ppropertysym(sym)^.readaccesssym) then
  489. begin
  490. if ppropertysym(sym)^.readaccesssym^.typ=varsym then
  491. begin
  492. if assigned(paras) then
  493. message(parser_e_no_paras_allowed);
  494. { subscribed access? }
  495. if p1=nil then
  496. begin
  497. p1:=genloadnode(pvarsym(
  498. ppropertysym(sym)^.readaccesssym),st);
  499. end
  500. else
  501. p1:=gensubscriptnode(pvarsym(
  502. ppropertysym(sym)^.readaccesssym),p1);
  503. end
  504. else if ppropertysym(sym)^.readaccesssym^.typ=procsym then
  505. begin
  506. { generate the method call }
  507. p1:=genmethodcallnode(pprocsym(
  508. ppropertysym(sym)^.readaccesssym),st,p1);
  509. { we know the procedure to call, so
  510. force the usage of that procedure }
  511. p1^.procdefinition:=pprocdef(ppropertysym(sym)^.readaccessdef);
  512. { insert paras }
  513. p1^.left:=paras;
  514. { if we should be delphi compatible }
  515. { then force type conversion }
  516. { }
  517. { isn't neccessary, the result types }
  518. { have to match excatly }
  519. {if cs_delphi2_compatible in aktswitches then
  520. p1:=gentypeconvnode(p1,pd);
  521. }
  522. end
  523. else
  524. begin
  525. p1:=genzeronode(errorn);
  526. Message(type_e_mismatch);
  527. end;
  528. end
  529. else
  530. begin
  531. { error, no function to read property }
  532. p1:=genzeronode(errorn);
  533. Message(parser_e_no_procedure_to_access_property);
  534. end;
  535. end;
  536. end;
  537. { the ID token has to be consumed before calling this function }
  538. procedure do_member_read(getaddr : boolean;const sym : psym;var p1 : ptree;
  539. var pd : pdef;var again : boolean);
  540. var
  541. static_name : string;
  542. isclassref : boolean;
  543. begin
  544. if sym=nil then
  545. begin
  546. { pattern is still valid unless
  547. there is another ID just after the ID of sym }
  548. Message1(sym_e_id_no_member,pattern);
  549. disposetree(p1);
  550. p1:=genzeronode(errorn);
  551. { try to clean up }
  552. pd:=generrordef;
  553. again:=false;
  554. end
  555. else
  556. begin
  557. isclassref:=pd^.deftype=classrefdef;
  558. { check protected and private members }
  559. if ((sym^.properties and sp_private)<>0) and
  560. (pobjectdef(sym^.owner^.defowner)^.owner^.symtabletype=unitsymtable) then
  561. Message(parser_e_cant_access_private_member);
  562. { this is wrong protected should not be overwritten but
  563. can be called !! PM
  564. if ((sym^.properties and sp_protected)<>0) and
  565. (pobjectdef(pd)^.owner^.symtabletype=unitsymtable) then
  566. Message(parser_e_cant_access_protected_member); }
  567. { we assume, that only procsyms and varsyms are in an object }
  568. { symbol table, for classes, properties are allowed }
  569. case sym^.typ of
  570. procsym:
  571. begin
  572. p1:=genmethodcallnode(pprocsym(sym),srsymtable,p1);
  573. do_proc_call(getaddr or
  574. (getprocvar and
  575. proc_to_procvar_equal(getprocvardef,pprocsym(sym)^.definition))
  576. ,again,p1,pd);
  577. { now we know the real method e.g. we can check for }
  578. { a class method }
  579. if isclassref and ((p1^.procdefinition^.options and (poclassmethod or poconstructor))=0) then
  580. Message(parser_e_only_class_methods_via_class_ref);
  581. end;
  582. varsym:
  583. begin
  584. if ((sym^.properties and sp_protected)<>0) and
  585. (pobjectdef(pd)^.owner^.symtabletype=unitsymtable) and
  586. not(afterassignment) and
  587. not(in_args) then
  588. Message(parser_e_cant_access_protected_member);
  589. if isclassref then
  590. Message(parser_e_only_class_methods_via_class_ref);
  591. if (sym^.properties and sp_static)<>0 then
  592. begin
  593. static_name:=lower(srsymtable^.name^)+'_'+sym^.name;
  594. getsym(static_name,true);
  595. disposetree(p1);
  596. p1:=genloadnode(pvarsym(srsym),srsymtable);
  597. end
  598. else
  599. p1:=gensubscriptnode(pvarsym(sym),p1);
  600. pd:=pvarsym(sym)^.definition;
  601. end;
  602. propertysym:
  603. begin
  604. if isclassref then
  605. Message(parser_e_only_class_methods_via_class_ref);
  606. handle_propertysym(sym,srsymtable,p1,pd);
  607. end;
  608. else internalerror(16);
  609. end;
  610. end;
  611. end;
  612. {****************************************************************************
  613. Factor
  614. ****************************************************************************}
  615. function factor(getaddr : boolean) : ptree;
  616. var
  617. l : longint;
  618. oldp1,
  619. p1,p2,p3 : ptree;
  620. code : integer;
  621. pd,pd2 : pdef;
  622. possible_error,
  623. unit_specific,
  624. again : boolean;
  625. sym : pvarsym;
  626. classh : pobjectdef;
  627. d : bestreal;
  628. static_name : string;
  629. propsym : ppropertysym;
  630. filepos : tfileposinfo;
  631. {---------------------------------------------
  632. Is_func_ret
  633. ---------------------------------------------}
  634. function is_func_ret(sym : psym) : boolean;
  635. var
  636. p : pprocinfo;
  637. storesymtablestack : psymtable;
  638. begin
  639. is_func_ret:=false;
  640. if (sym^.typ<>funcretsym) and ((procinfo.flags and pi_operator)=0) then
  641. exit;
  642. p:=@procinfo;
  643. while system.assigned(p) do
  644. begin
  645. { is this an access to a function result ? }
  646. if assigned(p^.funcretsym) and
  647. ((pfuncretsym(sym)=p^.funcretsym) or
  648. ((pvarsym(sym)=opsym) and
  649. ((p^.flags and pi_operator)<>0))) and
  650. (p^.retdef<>pdef(voiddef)) and
  651. (token<>LKLAMMER) and
  652. (not ((m_tp in aktmodeswitches) and
  653. (afterassignment or in_args))) then
  654. begin
  655. p1:=genzeronode(funcretn);
  656. pd:=p^.retdef;
  657. p1^.funcretprocinfo:=p;
  658. p1^.retdef:=pd;
  659. is_func_ret:=true;
  660. exit;
  661. end;
  662. p:=p^.parent;
  663. end;
  664. { we must use the function call }
  665. if(sym^.typ=funcretsym) then
  666. begin
  667. storesymtablestack:=symtablestack;
  668. symtablestack:=srsymtable^.next;
  669. getsym(sym^.name,true);
  670. if srsym^.typ<>procsym then
  671. Message(cg_e_illegal_expression);
  672. symtablestack:=storesymtablestack;
  673. end;
  674. end;
  675. {---------------------------------------------
  676. Factor_read_id
  677. ---------------------------------------------}
  678. procedure factor_read_id;
  679. begin
  680. { allow post fix operators }
  681. again:=true;
  682. if (m_result in aktmodeswitches) and
  683. (pattern='RESULT') and
  684. assigned(aktprocsym) and
  685. (procinfo.retdef<>pdef(voiddef)) then
  686. begin
  687. consume(ID);
  688. p1:=genzeronode(funcretn);
  689. pd:=procinfo.retdef;
  690. p1^.funcretprocinfo:=pointer(@procinfo);
  691. p1^.retdef:=pd;
  692. end
  693. else
  694. begin
  695. if lastsymknown then
  696. begin
  697. srsym:=lastsrsym;
  698. srsymtable:=lastsrsymtable;
  699. lastsymknown:=false;
  700. end
  701. else
  702. getsym(pattern,true);
  703. consume(ID);
  704. if not is_func_ret(srsym) then
  705. { else it's a normal symbol }
  706. begin
  707. { is it defined like UNIT.SYMBOL ? }
  708. if srsym^.typ=unitsym then
  709. begin
  710. consume(POINT);
  711. getsymonlyin(punitsym(srsym)^.unitsymtable,pattern);
  712. unit_specific:=true;
  713. consume(ID);
  714. end
  715. else
  716. unit_specific:=false;
  717. if not assigned(srsym) then
  718. Begin
  719. p1:=genzeronode(errorn);
  720. { try to clean up }
  721. pd:=generrordef;
  722. end
  723. else
  724. Begin
  725. { check semantics of private }
  726. if (srsym^.typ in [propertysym,procsym,varsym]) and
  727. (srsymtable^.symtabletype=objectsymtable) then
  728. begin
  729. if ((srsym^.properties and sp_private)<>0) and
  730. (pobjectdef(srsym^.owner^.defowner)^.owner^.symtabletype=unitsymtable) then
  731. Message(parser_e_cant_access_private_member);
  732. end;
  733. case srsym^.typ of
  734. absolutesym : begin
  735. p1:=genloadnode(pvarsym(srsym),srsymtable);
  736. pd:=pabsolutesym(srsym)^.definition;
  737. end;
  738. varsym : begin
  739. { are we in a class method ? }
  740. if (srsymtable^.symtabletype=objectsymtable) and
  741. assigned(aktprocsym) and
  742. ((aktprocsym^.definition^.options and poclassmethod)<>0) then
  743. Message(parser_e_only_class_methods);
  744. if (srsym^.properties and sp_static)<>0 then
  745. begin
  746. static_name:=lower(srsymtable^.name^)+'_'+srsym^.name;
  747. getsym(static_name,true);
  748. end;
  749. p1:=genloadnode(pvarsym(srsym),srsymtable);
  750. if pvarsym(srsym)^.is_valid=0 then
  751. begin
  752. p1^.is_first := true;
  753. { set special between first loaded until checked in firstpass }
  754. pvarsym(srsym)^.is_valid:=2;
  755. end;
  756. pd:=pvarsym(srsym)^.definition;
  757. end;
  758. typedconstsym : begin
  759. p1:=gentypedconstloadnode(ptypedconstsym(srsym),srsymtable);
  760. pd:=ptypedconstsym(srsym)^.definition;
  761. end;
  762. syssym : p1:=statement_syssym(psyssym(srsym)^.number,pd);
  763. typesym : begin
  764. pd:=ptypesym(srsym)^.definition;
  765. { if we read a type declaration }
  766. { we have to return the type and }
  767. { nothing else }
  768. if block_type=bt_type then
  769. begin
  770. p1:=genzeronode(typen);
  771. p1^.resulttype:=pd;
  772. pd:=voiddef;
  773. end
  774. else
  775. begin
  776. if token=LKLAMMER then
  777. begin
  778. consume(LKLAMMER);
  779. p1:=comp_expr(true);
  780. consume(RKLAMMER);
  781. p1:=gentypeconvnode(p1,pd);
  782. p1^.explizit:=true;
  783. end
  784. else
  785. if (token=POINT) and
  786. (pd^.deftype=objectdef) and
  787. ((pobjectdef(pd)^.options and oois_class)=0) then
  788. begin
  789. consume(POINT);
  790. if assigned(procinfo._class) then
  791. begin
  792. if procinfo._class^.isrelated(pobjectdef(pd)) then
  793. begin
  794. p1:=genzeronode(typen);
  795. p1^.resulttype:=pd;
  796. srsymtable:=pobjectdef(pd)^.publicsyms;
  797. sym:=pvarsym(srsymtable^.search(pattern));
  798. { search also in inherited methods }
  799. while sym=nil do
  800. begin
  801. pd:=pobjectdef(pd)^.childof;
  802. srsymtable:=pobjectdef(pd)^.publicsyms;
  803. sym:=pvarsym(srsymtable^.search(pattern));
  804. end;
  805. consume(ID);
  806. do_member_read(false,sym,p1,pd,again);
  807. end
  808. else
  809. begin
  810. Message(parser_e_no_super_class);
  811. pd:=generrordef;
  812. again:=false;
  813. end;
  814. end
  815. else
  816. begin
  817. { allows @TObject.Load }
  818. { also allows static methods and variables }
  819. p1:=genzeronode(typen);
  820. p1^.resulttype:=pd;
  821. { srsymtable:=pobjectdef(pd)^.publicsyms;
  822. sym:=pvarsym(srsymtable^.search(pattern)); }
  823. { TP allows also @TMenu.Load if Load is only }
  824. { defined in an anchestor class }
  825. sym:=pvarsym(search_class_member(pobjectdef(pd),pattern));
  826. if not(getaddr) and ((sym^.properties and sp_static)=0) then
  827. Message(sym_e_only_static_in_static)
  828. else
  829. begin
  830. consume(ID);
  831. do_member_read(getaddr,sym,p1,pd,again);
  832. end;
  833. end;
  834. end
  835. else
  836. begin
  837. { class reference ? }
  838. if (pd^.deftype=objectdef)
  839. and ((pobjectdef(pd)^.options and oois_class)<>0) then
  840. begin
  841. p1:=genzeronode(typen);
  842. p1^.resulttype:=pd;
  843. pd:=new(pclassrefdef,init(pd));
  844. p1:=gensinglenode(loadvmtn,p1);
  845. p1^.resulttype:=pd;
  846. end
  847. else
  848. begin
  849. { generate a type node }
  850. { (for typeof etc) }
  851. p1:=genzeronode(typen);
  852. p1^.resulttype:=pd;
  853. pd:=voiddef;
  854. end;
  855. end;
  856. end;
  857. end;
  858. enumsym : begin
  859. p1:=genenumnode(penumsym(srsym));
  860. pd:=p1^.resulttype;
  861. end;
  862. constsym : begin
  863. case pconstsym(srsym)^.consttype of
  864. constint : p1:=genordinalconstnode(pconstsym(srsym)^.value,s32bitdef);
  865. conststring : p1:=genstringconstnode(pstring(pconstsym(srsym)^.value)^);
  866. constchar : p1:=genordinalconstnode(pconstsym(srsym)^.value,cchardef);
  867. constreal : p1:=genrealconstnode(pbestreal(pconstsym(srsym)^.value)^);
  868. constbool : p1:=genordinalconstnode(pconstsym(srsym)^.value,booldef);
  869. constset : p1:=gensetconstnode(pconstset(pconstsym(srsym)^.value),
  870. psetdef(pconstsym(srsym)^.definition));
  871. constord : p1:=genordinalconstnode(pconstsym(srsym)^.value,
  872. pconstsym(srsym)^.definition);
  873. end;
  874. pd:=p1^.resulttype;
  875. end;
  876. procsym : begin
  877. { are we in a class method ? }
  878. possible_error:=(srsymtable^.symtabletype=objectsymtable) and
  879. assigned(aktprocsym) and
  880. ((aktprocsym^.definition^.options and poclassmethod)<>0);
  881. p1:=gencallnode(pprocsym(srsym),srsymtable);
  882. p1^.unit_specific:=unit_specific;
  883. do_proc_call(getaddr or
  884. (getprocvar and
  885. proc_to_procvar_equal(getprocvardef,pprocsym(srsym)^.definition)),
  886. again,p1,pd);
  887. if possible_error and
  888. ((p1^.procdefinition^.options and poclassmethod)=0) then
  889. Message(parser_e_only_class_methods);
  890. end;
  891. propertysym : begin
  892. { access to property in a method }
  893. { are we in a class method ? }
  894. if (srsymtable^.symtabletype=objectsymtable) and
  895. assigned(aktprocsym) and
  896. ((aktprocsym^.definition^.options and poclassmethod)<>0) then
  897. Message(parser_e_only_class_methods);
  898. { no method pointer }
  899. p1:=nil;
  900. handle_propertysym(srsym,srsymtable,p1,pd);
  901. end;
  902. errorsym : begin
  903. p1:=genzeronode(errorn);
  904. pd:=generrordef;
  905. if token=LKLAMMER then
  906. begin
  907. consume(LKLAMMER);
  908. parse_paras(false,false);
  909. consume(RKLAMMER);
  910. end;
  911. end;
  912. else
  913. begin
  914. p1:=genzeronode(errorn);
  915. pd:=generrordef;
  916. Message(cg_e_illegal_expression);
  917. end;
  918. end; { end case }
  919. end;
  920. end;
  921. end;
  922. end;
  923. {---------------------------------------------
  924. Factor_Read_Set
  925. ---------------------------------------------}
  926. { Read a set between [] }
  927. function factor_read_set:ptree;
  928. var
  929. p1,
  930. lastp,
  931. buildp : ptree;
  932. begin
  933. buildp:=nil;
  934. { be sure that a least one arrayconstructn is used, also for an
  935. empty [] }
  936. if token=RECKKLAMMER then
  937. buildp:=gennode(arrayconstructn,nil,buildp)
  938. else
  939. begin
  940. while true do
  941. begin
  942. p1:=comp_expr(true);
  943. do_firstpass(p1);
  944. if codegenerror then
  945. break;
  946. if token=POINTPOINT then
  947. begin
  948. consume(POINTPOINT);
  949. p2:=comp_expr(true);
  950. do_firstpass(p2);
  951. if codegenerror then
  952. break;
  953. p1:=gennode(arrayconstructrangen,p1,p2);
  954. end;
  955. { insert at the end of the tree, to get the correct order }
  956. if not assigned(buildp) then
  957. begin
  958. buildp:=gensinglenode(arrayconstructn,p1);
  959. lastp:=buildp;
  960. end
  961. else
  962. begin
  963. lastp^.right:=gensinglenode(arrayconstructn,p1);
  964. lastp:=lastp^.right;
  965. end;
  966. { there could be more elements }
  967. if token=COMMA then
  968. consume(COMMA)
  969. else
  970. break;
  971. end;
  972. end;
  973. factor_read_set:=buildp;
  974. end;
  975. {---------------------------------------------
  976. Helpers
  977. ---------------------------------------------}
  978. procedure check_tokenpos;
  979. begin
  980. if (p1<>oldp1) then
  981. begin
  982. if assigned(p1) then
  983. set_tree_filepos(p1,filepos);
  984. oldp1:=p1;
  985. filepos:=tokenpos;
  986. end;
  987. end;
  988. {---------------------------------------------
  989. PostFixOperators
  990. ---------------------------------------------}
  991. procedure postfixoperators;
  992. { p1 and p2 must contain valid value_str }
  993. begin
  994. check_tokenpos;
  995. while again do
  996. begin
  997. case token of
  998. CARET : begin
  999. consume(CARET);
  1000. if pd^.deftype<>pointerdef then
  1001. begin
  1002. { ^ as binary operator is a problem!!!! (FK) }
  1003. again:=false;
  1004. Message(cg_e_invalid_qualifier);
  1005. disposetree(p1);
  1006. p1:=genzeronode(errorn);
  1007. end
  1008. else
  1009. begin
  1010. p1:=gensinglenode(derefn,p1);
  1011. pd:=ppointerdef(pd)^.definition;
  1012. end;
  1013. end;
  1014. LECKKLAMMER : begin
  1015. if (pd^.deftype=objectdef) and pobjectdef(pd)^.isclass then
  1016. begin
  1017. { default property }
  1018. propsym:=search_default_property(pobjectdef(pd));
  1019. if not(assigned(propsym)) then
  1020. begin
  1021. disposetree(p1);
  1022. p1:=genzeronode(errorn);
  1023. again:=false;
  1024. message(parser_e_no_default_property_available);
  1025. end
  1026. else
  1027. begin
  1028. p1:=nil;
  1029. handle_propertysym(propsym,propsym^.owner,p1,pd);
  1030. end;
  1031. end
  1032. else
  1033. begin
  1034. consume(LECKKLAMMER);
  1035. repeat
  1036. case pd^.deftype of
  1037. pointerdef : begin
  1038. p2:=comp_expr(true);
  1039. p1:=gennode(vecn,p1,p2);
  1040. pd:=ppointerdef(pd)^.definition;
  1041. end;
  1042. stringdef : begin
  1043. p2:=comp_expr(true);
  1044. p1:=gennode(vecn,p1,p2);
  1045. pd:=cchardef
  1046. end;
  1047. arraydef : begin
  1048. p2:=comp_expr(true);
  1049. {$ifdef i386}
  1050. { support SEG:OFS for go32v2 Mem[] }
  1051. if (target_info.target=target_GO32V2) and
  1052. (p1^.treetype=loadn) and
  1053. assigned(p1^.symtableentry) and
  1054. assigned(p1^.symtableentry^.owner^.name) and
  1055. (p1^.symtableentry^.owner^.name^='SYSTEM') and
  1056. ((p1^.symtableentry^.name='MEM') or
  1057. (p1^.symtableentry^.name='MEMW') or
  1058. (p1^.symtableentry^.name='MEML')) then
  1059. begin
  1060. if (token=COLON) then
  1061. begin
  1062. consume(COLON);
  1063. p3:=gennode(muln,genordinalconstnode($10,s32bitdef),p2);
  1064. p2:=comp_expr(true);
  1065. p2:=gennode(addn,p2,p3);
  1066. p1:=gennode(vecn,p1,p2);
  1067. p1^.memseg:=true;
  1068. p1^.memindex:=true;
  1069. end
  1070. else
  1071. begin
  1072. p1:=gennode(vecn,p1,p2);
  1073. p1^.memindex:=true;
  1074. end;
  1075. end
  1076. else
  1077. {$endif}
  1078. p1:=gennode(vecn,p1,p2);
  1079. pd:=parraydef(pd)^.definition;
  1080. end;
  1081. else
  1082. begin
  1083. Message(cg_e_invalid_qualifier);
  1084. disposetree(p1);
  1085. p1:=genzeronode(errorn);
  1086. again:=false;
  1087. end;
  1088. end;
  1089. if token=COMMA then
  1090. consume(COMMA)
  1091. else
  1092. break;
  1093. until false;
  1094. consume(RECKKLAMMER);
  1095. end;
  1096. end;
  1097. POINT : begin
  1098. consume(POINT);
  1099. case pd^.deftype of
  1100. recorddef : begin
  1101. sym:=pvarsym(precdef(pd)^.symtable^.search(pattern));
  1102. consume(ID);
  1103. if sym=nil then
  1104. begin
  1105. Message(sym_e_illegal_field);
  1106. disposetree(p1);
  1107. p1:=genzeronode(errorn);
  1108. end
  1109. else
  1110. begin
  1111. p1:=gensubscriptnode(sym,p1);
  1112. pd:=sym^.definition;
  1113. end;
  1114. end;
  1115. classrefdef : begin
  1116. classh:=pobjectdef(pclassrefdef(pd)^.definition);
  1117. sym:=nil;
  1118. while assigned(classh) do
  1119. begin
  1120. sym:=pvarsym(classh^.publicsyms^.search(pattern));
  1121. srsymtable:=classh^.publicsyms;
  1122. if assigned(sym) then
  1123. break;
  1124. classh:=classh^.childof;
  1125. end;
  1126. consume(ID);
  1127. do_member_read(false,sym,p1,pd,again);
  1128. end;
  1129. objectdef : begin
  1130. classh:=pobjectdef(pd);
  1131. sym:=nil;
  1132. while assigned(classh) do
  1133. begin
  1134. sym:=pvarsym(classh^.publicsyms^.search(pattern));
  1135. srsymtable:=classh^.publicsyms;
  1136. if assigned(sym) then
  1137. break;
  1138. classh:=classh^.childof;
  1139. end;
  1140. consume(ID);
  1141. do_member_read(false,sym,p1,pd,again);
  1142. end;
  1143. pointerdef : begin
  1144. Message(cg_e_invalid_qualifier);
  1145. if ppointerdef(pd)^.definition^.deftype in [recorddef,objectdef,classrefdef] then
  1146. Message(parser_h_maybe_deref_caret_missing);
  1147. end;
  1148. else
  1149. begin
  1150. Message(cg_e_invalid_qualifier);
  1151. disposetree(p1);
  1152. p1:=genzeronode(errorn);
  1153. end;
  1154. end;
  1155. end;
  1156. else
  1157. begin
  1158. { is this a procedure variable ? }
  1159. if assigned(pd) then
  1160. begin
  1161. if (pd^.deftype=procvardef) then
  1162. begin
  1163. if getprocvar and proc_to_procvar_equal(pprocvardef(pd),getprocvardef) then
  1164. again:=false
  1165. else
  1166. if (token=LKLAMMER) or
  1167. ((pprocvardef(pd)^.para1=nil) and
  1168. (not((token in [ASSIGNMENT,UNEQUAL,EQUAL]))) and
  1169. (not afterassignment) and
  1170. (not in_args)) then
  1171. begin
  1172. { do this in a strange way }
  1173. { it's not a clean solution }
  1174. p2:=p1;
  1175. p1:=gencallnode(nil,nil);
  1176. p1^.right:=p2;
  1177. p1^.unit_specific:=unit_specific;
  1178. p1^.symtableprocentry:=sym;
  1179. if token=LKLAMMER then
  1180. begin
  1181. consume(LKLAMMER);
  1182. p1^.left:=parse_paras(false,false);
  1183. consume(RKLAMMER);
  1184. end;
  1185. pd:=pprocvardef(pd)^.retdef;
  1186. { proc():= is never possible }
  1187. if token=ASSIGNMENT then
  1188. begin
  1189. Message(cg_e_illegal_expression);
  1190. p1:=genzeronode(errorn);
  1191. again:=false;
  1192. end;
  1193. p1^.resulttype:=pd;
  1194. end
  1195. else
  1196. again:=false;
  1197. p1^.resulttype:=pd;
  1198. end
  1199. else
  1200. again:=false;
  1201. end
  1202. else
  1203. again:=false;
  1204. end;
  1205. end;
  1206. check_tokenpos;
  1207. end; { while again }
  1208. end;
  1209. {---------------------------------------------
  1210. Factor (Main)
  1211. ---------------------------------------------}
  1212. begin
  1213. oldp1:=nil;
  1214. filepos:=tokenpos;
  1215. if token=ID then
  1216. begin
  1217. factor_read_id;
  1218. { handle post fix operators }
  1219. postfixoperators;
  1220. end
  1221. else
  1222. case token of
  1223. _NEW : begin
  1224. consume(_NEW);
  1225. consume(LKLAMMER);
  1226. p1:=factor(false);
  1227. if p1^.treetype<>typen then
  1228. Message(type_e_type_id_expected);
  1229. pd:=p1^.resulttype;
  1230. pd2:=pd;
  1231. if (pd^.deftype<>pointerdef) or
  1232. (ppointerdef(pd)^.definition^.deftype<>objectdef) then
  1233. begin
  1234. Message(parser_e_pointer_to_class_expected);
  1235. { if an error occurs, read til the end of
  1236. the new statement }
  1237. p1:=genzeronode(errorn);
  1238. l:=1;
  1239. while true do
  1240. begin
  1241. case token of
  1242. LKLAMMER : inc(l);
  1243. RKLAMMER : dec(l);
  1244. end;
  1245. consume(token);
  1246. if l=0 then
  1247. break;
  1248. end;
  1249. end
  1250. else
  1251. begin
  1252. disposetree(p1);
  1253. p1:=genzeronode(hnewn);
  1254. p1^.resulttype:=ppointerdef(pd)^.definition;
  1255. consume(COMMA);
  1256. afterassignment:=false;
  1257. { determines the current object defintion }
  1258. classh:=pobjectdef(ppointerdef(pd)^.definition);
  1259. { check for an abstract class }
  1260. if (classh^.options and oois_abstract)<>0 then
  1261. Message(sym_e_no_instance_of_abstract_object);
  1262. { search the constructor also in the symbol tables of
  1263. the parents }
  1264. { no constructor found }
  1265. sym:=nil;
  1266. while assigned(classh) do
  1267. begin
  1268. sym:=pvarsym(classh^.publicsyms^.search(pattern));
  1269. srsymtable:=classh^.publicsyms;
  1270. if assigned(sym) then
  1271. break;
  1272. classh:=classh^.childof;
  1273. end;
  1274. consume(ID);
  1275. do_member_read(false,sym,p1,pd,again);
  1276. if (p1^.treetype<>calln) or
  1277. (assigned(p1^.procdefinition) and
  1278. ((p1^.procdefinition^.options and poconstructor)=0)) then
  1279. Message(parser_e_expr_have_to_be_constructor_call);
  1280. p1:=gensinglenode(newn,p1);
  1281. { set the resulttype }
  1282. p1^.resulttype:=pd2;
  1283. consume(RKLAMMER);
  1284. end;
  1285. end;
  1286. _SELF : begin
  1287. again:=true;
  1288. consume(_SELF);
  1289. if not assigned(procinfo._class) then
  1290. begin
  1291. p1:=genzeronode(errorn);
  1292. pd:=generrordef;
  1293. again:=false;
  1294. Message(parser_e_self_not_in_method);
  1295. end
  1296. else
  1297. begin
  1298. if (aktprocsym^.definition^.options and poclassmethod)<>0 then
  1299. begin
  1300. { self in class methods is a class reference type }
  1301. pd:=new(pclassrefdef,init(procinfo._class));
  1302. p1:=genselfnode(pd);
  1303. p1^.resulttype:=pd;
  1304. end
  1305. else
  1306. begin
  1307. p1:=genselfnode(procinfo._class);
  1308. p1^.resulttype:=procinfo._class;
  1309. end;
  1310. pd:=p1^.resulttype;
  1311. postfixoperators;
  1312. end;
  1313. end;
  1314. _INHERITED : begin
  1315. again:=true;
  1316. consume(_INHERITED);
  1317. if assigned(procinfo._class) then
  1318. begin
  1319. classh:=procinfo._class^.childof;
  1320. while assigned(classh) do
  1321. begin
  1322. srsymtable:=pobjectdef(classh)^.publicsyms;
  1323. sym:=pvarsym(srsymtable^.search(pattern));
  1324. if assigned(sym) then
  1325. begin
  1326. p1:=genzeronode(typen);
  1327. p1^.resulttype:=classh;
  1328. pd:=p1^.resulttype;
  1329. consume(ID);
  1330. do_member_read(false,sym,p1,pd,again);
  1331. break;
  1332. end;
  1333. classh:=classh^.childof;
  1334. end;
  1335. if classh=nil then
  1336. begin
  1337. Message1(sym_e_id_no_member,pattern);
  1338. again:=false;
  1339. pd:=generrordef;
  1340. p1:=genzeronode(errorn);
  1341. end;
  1342. end
  1343. else
  1344. Message(parser_e_generic_methods_only_in_methods);
  1345. postfixoperators;
  1346. end;
  1347. INTCONST : begin
  1348. valint(pattern,l,code);
  1349. if code<>0 then
  1350. begin
  1351. val(pattern,d,code);
  1352. if code<>0 then
  1353. begin
  1354. Message(cg_e_invalid_integer);
  1355. consume(INTCONST);
  1356. l:=1;
  1357. p1:=genordinalconstnode(l,s32bitdef);
  1358. end
  1359. else
  1360. begin
  1361. consume(INTCONST);
  1362. p1:=genrealconstnode(d);
  1363. end;
  1364. end
  1365. else
  1366. begin
  1367. consume(INTCONST);
  1368. p1:=genordinalconstnode(l,s32bitdef);
  1369. end;
  1370. end;
  1371. REALNUMBER : begin
  1372. val(pattern,d,code);
  1373. if code<>0 then
  1374. begin
  1375. Message(parser_e_error_in_real);
  1376. d:=1.0;
  1377. end;
  1378. consume(REALNUMBER);
  1379. p1:=genrealconstnode(d);
  1380. end;
  1381. _STRING : begin
  1382. { STRING can be also a type cast }
  1383. pd:=stringtype;
  1384. consume(LKLAMMER);
  1385. p1:=comp_expr(true);
  1386. consume(RKLAMMER);
  1387. p1:=gentypeconvnode(p1,pd);
  1388. p1^.explizit:=true;
  1389. { handle postfix operators here e.g. string(a)[10] }
  1390. again:=true;
  1391. postfixoperators;
  1392. end;
  1393. _FILE : begin
  1394. { FILE can be also a type cast }
  1395. pd:=cfiledef;
  1396. consume(_FILE);
  1397. if token=LKLAMMER then
  1398. begin
  1399. consume(LKLAMMER);
  1400. p1:=comp_expr(true);
  1401. consume(RKLAMMER);
  1402. p1:=gentypeconvnode(p1,pd);
  1403. end
  1404. else
  1405. begin
  1406. p1:=genzeronode(typen);
  1407. p1^.resulttype:=pd;
  1408. end;
  1409. p1^.explizit:=true;
  1410. { handle postfix operators here e.g. string(a)[10] }
  1411. again:=true;
  1412. postfixoperators;
  1413. end;
  1414. CSTRING : begin
  1415. p1:=genstringconstnode(pattern);
  1416. consume(CSTRING);
  1417. end;
  1418. CCHAR : begin
  1419. p1:=genordinalconstnode(ord(pattern[1]),cchardef);
  1420. consume(CCHAR);
  1421. end;
  1422. KLAMMERAFFE : begin
  1423. consume(KLAMMERAFFE);
  1424. p1:=factor(true);
  1425. p1:=gensinglenode(addrn,p1);
  1426. end;
  1427. LKLAMMER : begin
  1428. consume(LKLAMMER);
  1429. p1:=comp_expr(true);
  1430. consume(RKLAMMER);
  1431. { it's not a good solution }
  1432. { but (a+b)^ makes some problems }
  1433. if token in [CARET,POINT,LECKKLAMMER] then
  1434. begin
  1435. { we need the resulttype }
  1436. { of the expression in pd }
  1437. do_firstpass(p1);
  1438. pd:=p1^.resulttype;
  1439. again:=true;
  1440. postfixoperators;
  1441. end;
  1442. end;
  1443. LECKKLAMMER : begin
  1444. consume(LECKKLAMMER);
  1445. p1:=factor_read_set;
  1446. consume(RECKKLAMMER);
  1447. end;
  1448. PLUS : begin
  1449. consume(PLUS);
  1450. p1:=factor(false);
  1451. end;
  1452. MINUS : begin
  1453. consume(MINUS);
  1454. p1:=factor(false);
  1455. p1:=gensinglenode(umminusn,p1);
  1456. end;
  1457. _NOT : begin
  1458. consume(_NOT);
  1459. p1:=factor(false);
  1460. p1:=gensinglenode(notn,p1);
  1461. end;
  1462. _TRUE : begin
  1463. consume(_TRUE);
  1464. p1:=genordinalconstnode(1,booldef);
  1465. end;
  1466. _FALSE : begin
  1467. consume(_FALSE);
  1468. p1:=genordinalconstnode(0,booldef);
  1469. end;
  1470. _NIL : begin
  1471. consume(_NIL);
  1472. p1:=genzeronode(niln);
  1473. end;
  1474. else
  1475. begin
  1476. p1:=genzeronode(errorn);
  1477. consume(token);
  1478. Message(cg_e_illegal_expression);
  1479. end;
  1480. end;
  1481. factor:=p1;
  1482. check_tokenpos;
  1483. end;
  1484. {****************************************************************************
  1485. Sub_Expr
  1486. ****************************************************************************}
  1487. type
  1488. Toperator_precedence=(opcompare,opaddition,opmultiply);
  1489. Ttok2nodeRec=record
  1490. tok : ttoken;
  1491. nod : ttreetyp;
  1492. end;
  1493. const
  1494. tok2nodes=23;
  1495. tok2node:array[1..tok2nodes] of ttok2noderec=(
  1496. (tok:PLUS ;nod:addn),
  1497. (tok:MINUS ;nod:subn),
  1498. (tok:STAR ;nod:muln),
  1499. (tok:SLASH ;nod:slashn),
  1500. (tok:EQUAL ;nod:equaln),
  1501. (tok:GT ;nod:gtn),
  1502. (tok:LT ;nod:ltn),
  1503. (tok:GTE ;nod:gten),
  1504. (tok:LTE ;nod:lten),
  1505. (tok:SYMDIF ;nod:symdifn),
  1506. (tok:STARSTAR;nod:starstarn),
  1507. (tok:CARET ;nod:caretn),
  1508. (tok:UNEQUAL ;nod:unequaln),
  1509. (tok:_AS ;nod:asn),
  1510. (tok:_IN ;nod:inn),
  1511. (tok:_IS ;nod:isn),
  1512. (tok:_OR ;nod:orn),
  1513. (tok:_AND ;nod:andn),
  1514. (tok:_DIV ;nod:divn),
  1515. (tok:_MOD ;nod:modn),
  1516. (tok:_SHL ;nod:shln),
  1517. (tok:_SHR ;nod:shrn),
  1518. (tok:_XOR ;nod:xorn)
  1519. );
  1520. operator_levels:array[Toperator_precedence] of set of Ttoken=
  1521. ([LT,LTE,GT,GTE,EQUAL,UNEQUAL,_IN,_IS],
  1522. [PLUS,MINUS,_OR,_XOR],
  1523. [CARET,SYMDIF,STARSTAR,STAR,SLASH,_DIV,_MOD,_AND,_SHL,_SHR,_AS]);
  1524. function sub_expr(pred_level:Toperator_precedence;accept_equal : boolean):Ptree;
  1525. {Reads a subexpression while the operators are of the current precedence
  1526. level, or any higher level. Replaces the old term, simpl_expr and
  1527. simpl2_expr.}
  1528. var
  1529. low,high,mid : longint;
  1530. p1,p2 : Ptree;
  1531. oldt : Ttoken;
  1532. filepos : tfileposinfo;
  1533. begin
  1534. if pred_level=opmultiply then
  1535. p1:=factor(false)
  1536. else
  1537. p1:=sub_expr(succ(pred_level),true);
  1538. repeat
  1539. if (token in operator_levels[pred_level]) and
  1540. ((token<>EQUAL) or accept_equal) then
  1541. begin
  1542. oldt:=token;
  1543. filepos:=tokenpos;
  1544. consume(token);
  1545. if pred_level=opmultiply then
  1546. p2:=factor(false)
  1547. else
  1548. p2:=sub_expr(succ(pred_level),true);
  1549. low:=1;
  1550. high:=tok2nodes;
  1551. while (low<high) do
  1552. begin
  1553. mid:=(low+high+1) shr 1;
  1554. if oldt<tok2node[mid].tok then
  1555. high:=mid-1
  1556. else
  1557. low:=mid;
  1558. end;
  1559. if tok2node[high].tok=oldt then
  1560. p1:=gennode(tok2node[high].nod,p1,p2)
  1561. else
  1562. p1:=gennode(nothingn,p1,p2);
  1563. set_tree_filepos(p1,filepos);
  1564. end
  1565. else
  1566. break;
  1567. until false;
  1568. sub_expr:=p1;
  1569. end;
  1570. function comp_expr(accept_equal : boolean):Ptree;
  1571. var
  1572. oldafterassignment : boolean;
  1573. begin
  1574. oldafterassignment:=afterassignment;
  1575. afterassignment:=true;
  1576. comp_expr:=sub_expr(opcompare,accept_equal);
  1577. afterassignment:=oldafterassignment;
  1578. end;
  1579. function expr : ptree;
  1580. var
  1581. p1,p2 : ptree;
  1582. oldafterassignment : boolean;
  1583. oldp1 : ptree;
  1584. filepos : tfileposinfo;
  1585. begin
  1586. oldafterassignment:=afterassignment;
  1587. p1:=sub_expr(opcompare,true);
  1588. if token in [ASSIGNMENT,_PLUSASN,_MINUSASN,_STARASN,_SLASHASN] then
  1589. afterassignment:=true;
  1590. filepos:=tokenpos;
  1591. oldp1:=p1;
  1592. case token of
  1593. POINTPOINT : begin
  1594. consume(POINTPOINT);
  1595. p2:=sub_expr(opcompare,true);
  1596. p1:=gennode(rangen,p1,p2);
  1597. end;
  1598. ASSIGNMENT : begin
  1599. consume(ASSIGNMENT);
  1600. { avoid a firstpass of a procedure if
  1601. it must be assigned to a procvar }
  1602. { should be recursive for a:=b:=c !!! }
  1603. if (p1^.resulttype<>nil) and (p1^.resulttype^.deftype=procvardef) then
  1604. begin
  1605. getprocvar:=true;
  1606. getprocvardef:=pprocvardef(p1^.resulttype);
  1607. end;
  1608. p2:=sub_expr(opcompare,true);
  1609. if getprocvar and (p2^.treetype=calln) and
  1610. (proc_to_procvar_equal(getprocvardef,pprocsym(p2^.symtableentry)^.definition)) then
  1611. begin
  1612. p2^.treetype:=loadn;
  1613. p2^.resulttype:=pprocsym(p2^.symtableprocentry)^.definition;
  1614. p2^.symtableentry:=p2^.symtableprocentry;
  1615. end;
  1616. getprocvar:=false;
  1617. p1:=gennode(assignn,p1,p2);
  1618. end;
  1619. { this is the code for C like assignements }
  1620. { from an improvement of Peter Schaefer }
  1621. _PLUSASN : begin
  1622. consume(_PLUSASN );
  1623. p2:=sub_expr(opcompare,true);
  1624. p1:=gennode(assignn,p1,gennode(addn,getcopy(p1),p2));
  1625. { was first
  1626. p1:=gennode(assignn,p1,gennode(addn,p1,p2));
  1627. but disposetree assumes that we have a real
  1628. *** tree *** }
  1629. end;
  1630. _MINUSASN : begin
  1631. consume(_MINUSASN );
  1632. p2:=sub_expr(opcompare,true);
  1633. p1:=gennode(assignn,p1,gennode(subn,getcopy(p1),p2));
  1634. end;
  1635. _STARASN : begin
  1636. consume(_STARASN );
  1637. p2:=sub_expr(opcompare,true);
  1638. p1:=gennode(assignn,p1,gennode(muln,getcopy(p1),p2));
  1639. end;
  1640. _SLASHASN : begin
  1641. consume(_SLASHASN );
  1642. p2:=sub_expr(opcompare,true);
  1643. p1:=gennode(assignn,p1,gennode(slashn,getcopy(p1),p2));
  1644. end;
  1645. end;
  1646. afterassignment:=oldafterassignment;
  1647. if p1<>oldp1 then
  1648. set_tree_filepos(p1,filepos);
  1649. expr:=p1;
  1650. end;
  1651. function get_intconst:longint;
  1652. {Reads an expression, tries to evalute it and check if it is an integer
  1653. constant. Then the constant is returned.}
  1654. var
  1655. p:Ptree;
  1656. begin
  1657. p:=comp_expr(true);
  1658. do_firstpass(p);
  1659. if (p^.treetype<>ordconstn) and
  1660. (p^.resulttype^.deftype=orddef) and
  1661. not(Porddef(p^.resulttype)^.typ in [uvoid,uchar,bool8bit,bool16bit,bool32bit]) then
  1662. Message(cg_e_illegal_expression)
  1663. else
  1664. get_intconst:=p^.value;
  1665. disposetree(p);
  1666. end;
  1667. function get_stringconst:string;
  1668. {Reads an expression, tries to evaluate it and checks if it is a string
  1669. constant. Then the constant is returned.}
  1670. var
  1671. p:Ptree;
  1672. begin
  1673. get_stringconst:='';
  1674. p:=comp_expr(true);
  1675. do_firstpass(p);
  1676. if p^.treetype<>stringconstn then
  1677. begin
  1678. if (p^.treetype=ordconstn) and
  1679. (p^.resulttype^.deftype=orddef) and
  1680. (Porddef(p^.resulttype)^.typ=uchar) then
  1681. get_stringconst:=char(p^.value)
  1682. else
  1683. Message(cg_e_illegal_expression);
  1684. end
  1685. else
  1686. {$ifdef UseAnsiString}
  1687. get_stringconst:=strpas(p^.value_str);
  1688. {$else UseAnsiString}
  1689. get_stringconst:=p^.value_str^;
  1690. {$endif UseAnsiString}
  1691. disposetree(p);
  1692. end;
  1693. end.
  1694. {
  1695. $Log$
  1696. Revision 1.57 1998-09-28 16:18:16 florian
  1697. * two fixes to get ansi strings work
  1698. Revision 1.56 1998/09/26 17:45:36 peter
  1699. + idtoken and only one token table
  1700. Revision 1.55 1998/09/24 23:49:10 peter
  1701. + aktmodeswitches
  1702. Revision 1.54 1998/09/23 15:46:39 florian
  1703. * problem with with and classes fixed
  1704. Revision 1.53 1998/09/23 09:58:54 peter
  1705. * first working array of const things
  1706. Revision 1.52 1998/09/20 09:38:45 florian
  1707. * hasharray for defs fixed
  1708. * ansistring code generation corrected (init/final, assignement)
  1709. Revision 1.51 1998/09/18 16:03:43 florian
  1710. * some changes to compile with Delphi
  1711. Revision 1.50 1998/09/17 13:41:18 pierre
  1712. sizeof(TPOINT) problem
  1713. Revision 1.49.2.1 1998/09/17 08:42:31 pierre
  1714. TPOINT sizeof fix
  1715. Revision 1.49 1998/09/09 11:50:53 pierre
  1716. * forward def are not put in record or objects
  1717. + added check for forwards also in record and objects
  1718. * dummy parasymtable for unit initialization removed from
  1719. symtable stack
  1720. Revision 1.48 1998/09/07 22:25:53 peter
  1721. * fixed str(boolean,string) which was allowed
  1722. * fixed write(' ':<int expression>) only constants where allowed :(
  1723. Revision 1.47 1998/09/07 18:46:10 peter
  1724. * update smartlinking, uses getdatalabel
  1725. * renamed ptree.value vars to value_str,value_real,value_set
  1726. Revision 1.46 1998/09/04 08:42:03 peter
  1727. * updated some error messages
  1728. Revision 1.45 1998/09/01 17:39:49 peter
  1729. + internal constant functions
  1730. Revision 1.44 1998/08/28 10:54:24 peter
  1731. * fixed smallset generation from elements, it has never worked before!
  1732. Revision 1.43 1998/08/23 16:07:24 florian
  1733. * internalerror with mod/div fixed
  1734. Revision 1.42 1998/08/21 14:08:50 pierre
  1735. + TEST_FUNCRET now default (old code removed)
  1736. works also for m68k (at least compiles)
  1737. Revision 1.41 1998/08/20 21:36:39 peter
  1738. * fixed 'with object do' bug
  1739. Revision 1.40 1998/08/20 09:26:41 pierre
  1740. + funcret setting in underproc testing
  1741. compile with _dTEST_FUNCRET
  1742. Revision 1.39 1998/08/18 16:48:48 pierre
  1743. * bug for -So proc assignment to p^rocvar fixed
  1744. Revision 1.38 1998/08/18 14:17:09 pierre
  1745. * bug about assigning the return value of a function to
  1746. a procvar fixed : warning
  1747. assigning a proc to a procvar need @ in FPC mode !!
  1748. * missing file/line info restored
  1749. Revision 1.37 1998/08/18 09:24:43 pierre
  1750. * small warning position bug fixed
  1751. * support_mmx switches splitting was missing
  1752. * rhide error and warning output corrected
  1753. Revision 1.36 1998/08/15 16:50:29 peter
  1754. * fixed proc()=expr which was not allowed anymore by my previous fix
  1755. Revision 1.35 1998/08/14 18:18:46 peter
  1756. + dynamic set contruction
  1757. * smallsets are now working (always longint size)
  1758. Revision 1.34 1998/08/13 11:00:12 peter
  1759. * fixed procedure<>procedure construct
  1760. Revision 1.33 1998/08/11 15:31:39 peter
  1761. * write extended to ppu file
  1762. * new version 0.99.7
  1763. Revision 1.32 1998/08/11 14:05:32 peter
  1764. * fixed sizeof(array of char)
  1765. Revision 1.31 1998/08/10 14:50:11 peter
  1766. + localswitches, moduleswitches, globalswitches splitting
  1767. Revision 1.30 1998/07/28 21:52:54 florian
  1768. + implementation of raise and try..finally
  1769. + some misc. exception stuff
  1770. Revision 1.29 1998/07/27 21:57:13 florian
  1771. * fix to allow tv like stream registration:
  1772. @tmenu.load doesn't work if load had parameters or if load was only
  1773. declared in an anchestor class of tmenu
  1774. Revision 1.28 1998/07/14 21:46:51 peter
  1775. * updated messages file
  1776. Revision 1.27 1998/06/25 14:04:23 peter
  1777. + internal inc/dec
  1778. Revision 1.26 1998/06/09 16:01:46 pierre
  1779. + added procedure directive parsing for procvars
  1780. (accepted are popstack cdecl and pascal)
  1781. + added C vars with the following syntax
  1782. var C calias 'true_c_name';(can be followed by external)
  1783. reason is that you must add the Cprefix
  1784. which is target dependent
  1785. Revision 1.25 1998/06/05 14:37:33 pierre
  1786. * fixes for inline for operators
  1787. * inline procedure more correctly restricted
  1788. Revision 1.24 1998/06/04 23:51:52 peter
  1789. * m68k compiles
  1790. + .def file creation moved to gendef.pas so it could also be used
  1791. for win32
  1792. Revision 1.23 1998/06/04 09:55:40 pierre
  1793. * demangled name of procsym reworked to become independant of the mangling scheme
  1794. Revision 1.22 1998/06/02 17:03:03 pierre
  1795. * with node corrected for objects
  1796. * small bugs for SUPPORT_MMX fixed
  1797. Revision 1.21 1998/05/27 19:45:05 peter
  1798. * symtable.pas splitted into includefiles
  1799. * symtable adapted for $ifdef NEWPPU
  1800. Revision 1.20 1998/05/26 07:53:59 pierre
  1801. * bug fix for empty sets (nil pd was dereferenced )
  1802. Revision 1.19 1998/05/25 17:11:43 pierre
  1803. * firstpasscount bug fixed
  1804. now all is already set correctly the first time
  1805. under EXTDEBUG try -gp to skip all other firstpasses
  1806. it works !!
  1807. * small bug fixes
  1808. - for smallsets with -dTESTSMALLSET
  1809. - some warnings removed (by correcting code !)
  1810. Revision 1.18 1998/05/23 01:21:20 peter
  1811. + aktasmmode, aktoptprocessor, aktoutputformat
  1812. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  1813. + $LIBNAME to set the library name where the unit will be put in
  1814. * splitted cgi386 a bit (codeseg to large for bp7)
  1815. * nasm, tasm works again. nasm moved to ag386nsm.pas
  1816. Revision 1.17 1998/05/22 12:37:03 carl
  1817. * crash bugfix (patched msanually to main branch)
  1818. Revision 1.16 1998/05/21 19:33:32 peter
  1819. + better procedure directive handling and only one table
  1820. Revision 1.15 1998/05/20 09:42:35 pierre
  1821. + UseTokenInfo now default
  1822. * unit in interface uses and implementation uses gives error now
  1823. * only one error for unknown symbol (uses lastsymknown boolean)
  1824. the problem came from the label code !
  1825. + first inlined procedures and function work
  1826. (warning there might be allowed cases were the result is still wrong !!)
  1827. * UseBrower updated gives a global list of all position of all used symbols
  1828. with switch -gb
  1829. Revision 1.14 1998/05/11 13:07:56 peter
  1830. + $ifdef NEWPPU for the new ppuformat
  1831. + $define GDB not longer required
  1832. * removed all warnings and stripped some log comments
  1833. * no findfirst/findnext anymore to remove smartlink *.o files
  1834. Revision 1.13 1998/05/06 08:38:45 pierre
  1835. * better position info with UseTokenInfo
  1836. UseTokenInfo greatly simplified
  1837. + added check for changed tree after first time firstpass
  1838. (if we could remove all the cases were it happen
  1839. we could skip all firstpass if firstpasscount > 1)
  1840. Only with ExtDebug
  1841. Revision 1.12 1998/05/05 12:05:42 florian
  1842. * problems with properties fixed
  1843. * crash fixed: i:=l when i and l are undefined, was a problem with
  1844. implementation of private/protected
  1845. Revision 1.11 1998/05/04 11:22:26 florian
  1846. * problem with DOM solved: it crashes when accessing a property in a method
  1847. Revision 1.10 1998/05/01 16:38:45 florian
  1848. * handling of private and protected fixed
  1849. + change_keywords_to_tp implemented to remove
  1850. keywords which aren't supported by tp
  1851. * break and continue are now symbols of the system unit
  1852. + widestring, longstring and ansistring type released
  1853. Revision 1.9 1998/04/29 10:33:58 pierre
  1854. + added some code for ansistring (not complete nor working yet)
  1855. * corrected operator overloading
  1856. * corrected nasm output
  1857. + started inline procedures
  1858. + added starstarn : use ** for exponentiation (^ gave problems)
  1859. + started UseTokenInfo cond to get accurate positions
  1860. Revision 1.8 1998/04/14 23:27:03 florian
  1861. + exclude/include with constant second parameter added
  1862. Revision 1.7 1998/04/09 23:02:15 florian
  1863. * small problems solved to get remake3 work
  1864. Revision 1.6 1998/04/09 22:16:35 florian
  1865. * problem with previous REGALLOC solved
  1866. * improved property support
  1867. Revision 1.5 1998/04/08 10:26:09 florian
  1868. * correct error handling of virtual constructors
  1869. * problem with new type declaration handling fixed
  1870. Revision 1.4 1998/04/07 22:45:05 florian
  1871. * bug0092, bug0115 and bug0121 fixed
  1872. + packed object/class/array
  1873. Revision 1.3 1998/04/07 13:19:46 pierre
  1874. * bugfixes for reset_gdb_info
  1875. in MEM parsing for go32v2
  1876. better external symbol creation
  1877. support for rhgdb.exe (lowercase file names)
  1878. }