scanner.pas 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626
  1. {
  2. $Id$
  3. Copyright (c) 1993,97 by Florian Klaempfl
  4. This unit implements the scanner part and handling of the switches
  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. {$ifdef tp}
  19. {$F+,N+,E+,R-}
  20. {$endif}
  21. unit scanner;
  22. interface
  23. uses
  24. cobjects,globals,verbose,comphook,files;
  25. const
  26. {$ifdef TP}
  27. maxmacrolen=1024;
  28. {$else}
  29. maxmacrolen=16*1024;
  30. {$endif}
  31. Newline = #10;
  32. type
  33. pmacrobuffer = ^tmacrobuffer;
  34. tmacrobuffer = array[0..maxmacrolen-1] of char;
  35. ppreprocstack = ^tpreprocstack;
  36. tpreprocstack = object
  37. accept : boolean;
  38. next : ppreprocstack;
  39. name : stringid;
  40. line_nb : longint;
  41. constructor init(a:boolean;n:ppreprocstack);
  42. destructor done;
  43. end;
  44. pscannerfile = ^tscannerfile;
  45. tscannerfile = object
  46. inputfile : pinputfile; { current inputfile list }
  47. inputbuffer, { input buffer }
  48. inputpointer : pchar;
  49. inputstart : longint;
  50. line_no, { line }
  51. lastlinepos : longint;
  52. lasttokenpos : longint; { token }
  53. lasttoken : ttoken;
  54. do_special, { 1=point after nr, 2=caret after id }
  55. comment_level,
  56. yylexcount : longint;
  57. lastasmgetchar : char;
  58. preprocstack : ppreprocstack;
  59. constructor init(const fn:string);
  60. destructor done;
  61. { File buffer things }
  62. function openinputfile:boolean;
  63. procedure closeinputfile;
  64. function tempopeninputfile:boolean;
  65. procedure tempcloseinputfile;
  66. procedure saveinputfile;
  67. procedure restoreinputfile;
  68. procedure nextfile;
  69. procedure addfile(hp:pinputfile);
  70. procedure reload;
  71. procedure insertmacro(p:pchar;len:longint);
  72. { Scanner things }
  73. procedure gettokenpos;
  74. procedure inc_comment_level;
  75. procedure dec_comment_level;
  76. procedure checkpreprocstack;
  77. procedure poppreprocstack;
  78. procedure addpreprocstack(a:boolean;const s:string;w:tmsgconst);
  79. procedure elsepreprocstack;
  80. procedure linebreak;
  81. procedure readchar;
  82. procedure readstring;
  83. procedure readnumber;
  84. function readid:string;
  85. function readval:longint;
  86. function readcomment:string;
  87. function readstate:char;
  88. procedure skipspace;
  89. procedure skipuntildirective;
  90. procedure skipcomment;
  91. procedure skipdelphicomment;
  92. procedure skipoldtpcomment;
  93. procedure readtoken;
  94. function readpreproc:ttoken;
  95. function asmgetchar:char;
  96. end;
  97. var
  98. c : char;
  99. orgpattern,
  100. pattern : string;
  101. current_scanner : pscannerfile;
  102. implementation
  103. uses
  104. dos,systems,symtable,switches;
  105. {*****************************************************************************
  106. Helper routines
  107. *****************************************************************************}
  108. type
  109. tokenidxrec=record
  110. first,last : ttoken;
  111. end;
  112. var
  113. tokenidx:array[2..tokenidlen] of tokenidxrec;
  114. procedure create_tokenidx;
  115. { create an index with the first and last token for every possible token
  116. length, so a search only will be done in that small part }
  117. var
  118. t : ttoken;
  119. begin
  120. for t:=low(ttoken) to high(ttoken) do
  121. begin
  122. if not tokens[t].special then
  123. begin
  124. if ord(tokenidx[length(tokens[t].str)].first)=0 then
  125. tokenidx[length(tokens[t].str)].first:=t;
  126. tokenidx[length(tokens[t].str)].last:=t;
  127. end;
  128. end;
  129. end;
  130. function is_keyword(const s:string):boolean;
  131. var
  132. low,high,mid : longint;
  133. begin
  134. if not (length(s) in [2..tokenidlen]) then
  135. begin
  136. is_keyword:=false;
  137. exit;
  138. end;
  139. low:=ord(tokenidx[length(s)].first);
  140. high:=ord(tokenidx[length(s)].last);
  141. while low<high do
  142. begin
  143. mid:=(high+low+1) shr 1;
  144. if pattern<tokens[ttoken(mid)].str then
  145. high:=mid-1
  146. else
  147. low:=mid;
  148. end;
  149. is_keyword:=(pattern=tokens[ttoken(high)].str) and
  150. (tokens[ttoken(high)].keyword in aktmodeswitches);
  151. end;
  152. {*****************************************************************************
  153. TPreProcStack
  154. *****************************************************************************}
  155. constructor tpreprocstack.init(a:boolean;n:ppreprocstack);
  156. begin
  157. accept:=a;
  158. next:=n;
  159. end;
  160. destructor tpreprocstack.done;
  161. begin
  162. end;
  163. {****************************************************************************
  164. TSCANNERFILE
  165. ****************************************************************************}
  166. constructor tscannerfile.init(const fn:string);
  167. begin
  168. inputfile:=new(pinputfile,init(fn));
  169. current_module^.sourcefiles^.register_file(inputfile);
  170. { reset localinput }
  171. inputbuffer:=nil;
  172. inputpointer:=nil;
  173. inputstart:=0;
  174. { reset scanner }
  175. preprocstack:=nil;
  176. comment_level:=0;
  177. do_special:=0;
  178. yylexcount:=0;
  179. block_type:=bt_general;
  180. line_no:=0;
  181. lastlinepos:=0;
  182. lasttokenpos:=0;
  183. lasttoken:=_END;
  184. lastasmgetchar:=#0;
  185. { load block }
  186. if not openinputfile then
  187. Message1(scan_f_cannot_open_input,fn);
  188. reload;
  189. end;
  190. destructor tscannerfile.done;
  191. begin
  192. checkpreprocstack;
  193. { close file, but only if we are the first compile }
  194. if not current_module^.in_second_compile then
  195. begin
  196. if not inputfile^.closed then
  197. closeinputfile;
  198. end;
  199. end;
  200. function tscannerfile.openinputfile:boolean;
  201. begin
  202. openinputfile:=inputfile^.open;
  203. { load buffer }
  204. inputbuffer:=inputfile^.buf;
  205. inputpointer:=inputfile^.buf;
  206. inputstart:=inputfile^.bufstart;
  207. { line }
  208. line_no:=0;
  209. lastlinepos:=0;
  210. lasttokenpos:=0;
  211. end;
  212. procedure tscannerfile.closeinputfile;
  213. begin
  214. inputfile^.close;
  215. { reset buffer }
  216. inputbuffer:=nil;
  217. inputpointer:=nil;
  218. inputstart:=0;
  219. { reset line }
  220. line_no:=0;
  221. lastlinepos:=0;
  222. lasttokenpos:=0;
  223. end;
  224. function tscannerfile.tempopeninputfile:boolean;
  225. begin
  226. tempopeninputfile:=inputfile^.tempopen;
  227. { reload buffer }
  228. inputbuffer:=inputfile^.buf;
  229. inputpointer:=inputfile^.buf;
  230. inputstart:=inputfile^.bufstart;
  231. end;
  232. procedure tscannerfile.tempcloseinputfile;
  233. begin
  234. inputfile^.setpos(inputstart+(inputpointer-inputbuffer));
  235. inputfile^.tempclose;
  236. { reset buffer }
  237. inputbuffer:=nil;
  238. inputpointer:=nil;
  239. inputstart:=0;
  240. end;
  241. procedure tscannerfile.saveinputfile;
  242. begin
  243. inputfile^.saveinputpointer:=inputpointer;
  244. inputfile^.savelastlinepos:=lastlinepos;
  245. inputfile^.saveline_no:=line_no;
  246. end;
  247. procedure tscannerfile.restoreinputfile;
  248. begin
  249. inputpointer:=inputfile^.saveinputpointer;
  250. lastlinepos:=inputfile^.savelastlinepos;
  251. line_no:=inputfile^.saveline_no;
  252. end;
  253. procedure tscannerfile.nextfile;
  254. begin
  255. if assigned(inputfile^.next) then
  256. begin
  257. inputfile:=inputfile^.next;
  258. restoreinputfile;
  259. end;
  260. end;
  261. procedure tscannerfile.addfile(hp:pinputfile);
  262. begin
  263. saveinputfile;
  264. { add to list }
  265. hp^.next:=inputfile;
  266. inputfile:=hp;
  267. { load new inputfile }
  268. restoreinputfile;
  269. end;
  270. procedure tscannerfile.reload;
  271. begin
  272. with inputfile^ do
  273. begin
  274. repeat
  275. { still more to read?, then change the #0 to a space so its seen
  276. as a seperator }
  277. if (bufsize>0) and (inputpointer-inputbuffer<bufsize) then
  278. begin
  279. c:=' ';
  280. inc(longint(inputpointer));
  281. exit;
  282. end;
  283. { can we read more from this file ? }
  284. if not endoffile then
  285. begin
  286. readbuf;
  287. inputpointer:=buf;
  288. inputbuffer:=buf;
  289. inputstart:=bufstart;
  290. { first line? }
  291. if line_no=0 then
  292. begin
  293. line_no:=1;
  294. if cs_asm_source in aktglobalswitches then
  295. inputfile^.setline(line_no,bufstart);
  296. end;
  297. end
  298. else
  299. begin
  300. closeinputfile;
  301. { no next module, than EOF }
  302. if not assigned(inputfile^.next) then
  303. begin
  304. c:=#26;
  305. exit;
  306. end;
  307. { load next file and reopen it }
  308. nextfile;
  309. tempopeninputfile;
  310. { status }
  311. Message1(scan_d_back_in,name^);
  312. end;
  313. { load next char }
  314. c:=inputpointer^;
  315. inc(longint(inputpointer));
  316. until c<>#0; { if also end, then reload again }
  317. end;
  318. end;
  319. procedure tscannerfile.insertmacro(p:pchar;len:longint);
  320. var
  321. hp : pinputfile;
  322. begin
  323. { save old postion }
  324. dec(longint(inputpointer));
  325. tempcloseinputfile;
  326. { create macro 'file' }
  327. hp:=new(pinputfile,init('Macro'));
  328. addfile(hp);
  329. with inputfile^ do
  330. begin
  331. setmacro(p,len);
  332. { local buffer }
  333. inputbuffer:=buf;
  334. inputpointer:=buf;
  335. inputstart:=bufstart;
  336. end;
  337. { reset line }
  338. line_no:=0;
  339. lastlinepos:=0;
  340. lasttokenpos:=0;
  341. { load new c }
  342. c:=inputpointer^;
  343. inc(longint(inputpointer));
  344. end;
  345. procedure tscannerfile.gettokenpos;
  346. { load the values of tokenpos and lasttokenpos }
  347. begin
  348. lasttokenpos:=inputstart+(inputpointer-inputbuffer);
  349. tokenpos.line:=line_no;
  350. tokenpos.column:=lasttokenpos-lastlinepos;
  351. tokenpos.fileindex:=inputfile^.ref_index;
  352. aktfilepos:=tokenpos;
  353. end;
  354. procedure tscannerfile.inc_comment_level;
  355. var
  356. oldaktfilepos : tfileposinfo;
  357. begin
  358. inc(comment_level);
  359. if (comment_level>1) then
  360. begin
  361. oldaktfilepos:=aktfilepos;
  362. gettokenpos; { update for warning }
  363. Message1(scan_w_comment_level,tostr(comment_level));
  364. aktfilepos:=oldaktfilepos;
  365. end;
  366. end;
  367. procedure tscannerfile.dec_comment_level;
  368. begin
  369. if (m_nested_comment in aktmodeswitches) then
  370. dec(comment_level)
  371. else
  372. comment_level:=0;
  373. end;
  374. procedure tscannerfile.linebreak;
  375. var
  376. cur : char;
  377. oldtokenpos,
  378. oldaktfilepos : tfileposinfo;
  379. begin
  380. with inputfile^ do
  381. begin
  382. if (byte(inputpointer^)=0) and not(endoffile) then
  383. begin
  384. cur:=c;
  385. reload;
  386. if byte(cur)+byte(c)<>23 then
  387. dec(longint(inputpointer));
  388. end
  389. else
  390. begin
  391. { Fix linebreak to be only newline (=#10) for all types of linebreaks }
  392. if (byte(inputpointer^)+byte(c)=23) then
  393. inc(longint(inputpointer));
  394. end;
  395. c:=newline;
  396. { increase line counters }
  397. lastlinepos:=bufstart+(inputpointer-inputbuffer);
  398. inc(line_no);
  399. { update linebuffer }
  400. if cs_asm_source in aktglobalswitches then
  401. inputfile^.setline(line_no,lastlinepos);
  402. { update for status and call the show status routine,
  403. but don't touch aktfilepos ! }
  404. oldaktfilepos:=aktfilepos;
  405. oldtokenpos:=tokenpos;
  406. gettokenpos; { update for v_status }
  407. inc(status.compiledlines);
  408. ShowStatus;
  409. aktfilepos:=oldaktfilepos;
  410. tokenpos:=oldtokenpos;
  411. end;
  412. end;
  413. procedure tscannerfile.checkpreprocstack;
  414. begin
  415. { check for missing ifdefs }
  416. while assigned(preprocstack) do
  417. begin
  418. Message3(scan_e_endif_expected,'$IF(N)(DEF)',preprocstack^.name,tostr(preprocstack^.line_nb));
  419. poppreprocstack;
  420. end;
  421. end;
  422. procedure tscannerfile.poppreprocstack;
  423. var
  424. hp : ppreprocstack;
  425. begin
  426. if assigned(preprocstack) then
  427. begin
  428. hp:=preprocstack^.next;
  429. dispose(preprocstack,done);
  430. preprocstack:=hp;
  431. end
  432. else
  433. Message(scan_e_endif_without_if);
  434. end;
  435. procedure tscannerfile.addpreprocstack(a:boolean;const s:string;w:tmsgconst);
  436. begin
  437. preprocstack:=new(ppreprocstack,init(((preprocstack=nil) or preprocstack^.accept) and a,preprocstack));
  438. preprocstack^.name:=s;
  439. preprocstack^.line_nb:=line_no;
  440. if preprocstack^.accept then
  441. Message2(w,preprocstack^.name,'accepted')
  442. else
  443. Message2(w,preprocstack^.name,'rejected');
  444. end;
  445. procedure tscannerfile.elsepreprocstack;
  446. begin
  447. if assigned(preprocstack) then
  448. begin
  449. if not(assigned(preprocstack^.next)) or (preprocstack^.next^.accept) then
  450. preprocstack^.accept:=not preprocstack^.accept;
  451. if preprocstack^.accept then
  452. Message2(scan_c_else_found,preprocstack^.name,'accepted')
  453. else
  454. Message2(scan_c_else_found,preprocstack^.name,'rejected');
  455. end
  456. else
  457. Message(scan_e_endif_without_if);
  458. end;
  459. procedure tscannerfile.readchar;
  460. begin
  461. c:=inputpointer^;
  462. if c=#0 then
  463. reload
  464. else
  465. inc(longint(inputpointer));
  466. if c in [#10,#13] then
  467. linebreak;
  468. end;
  469. procedure tscannerfile.readstring;
  470. var
  471. i : longint;
  472. begin
  473. i:=0;
  474. repeat
  475. case c of
  476. '_',
  477. '0'..'9',
  478. 'A'..'Z' : begin
  479. if i<255 then
  480. begin
  481. inc(i);
  482. orgpattern[i]:=c;
  483. pattern[i]:=c;
  484. end;
  485. c:=inputpointer^;
  486. inc(longint(inputpointer));
  487. end;
  488. 'a'..'z' : begin
  489. if i<255 then
  490. begin
  491. inc(i);
  492. orgpattern[i]:=c;
  493. pattern[i]:=chr(ord(c)-32)
  494. end;
  495. c:=inputpointer^;
  496. inc(longint(inputpointer));
  497. end;
  498. #0 : reload;
  499. #13,#10 : begin
  500. linebreak;
  501. break;
  502. end;
  503. else
  504. break;
  505. end;
  506. until false;
  507. orgpattern[0]:=chr(i);
  508. pattern[0]:=chr(i);
  509. end;
  510. procedure tscannerfile.readnumber;
  511. var
  512. base,
  513. i : longint;
  514. begin
  515. case c of
  516. '%' : begin
  517. readchar;
  518. base:=2;
  519. pattern[1]:='%';
  520. i:=1;
  521. end;
  522. '$' : begin
  523. readchar;
  524. base:=16;
  525. pattern[1]:='$';
  526. i:=1;
  527. end;
  528. else
  529. begin
  530. base:=10;
  531. i:=0;
  532. end;
  533. end;
  534. while ((base>=10) and (c in ['0'..'9'])) or
  535. ((base=16) and (c in ['A'..'F','a'..'f'])) or
  536. ((base=2) and (c in ['0'..'1'])) do
  537. begin
  538. if i<255 then
  539. begin
  540. inc(i);
  541. pattern[i]:=c;
  542. end;
  543. { get next char }
  544. c:=inputpointer^;
  545. if c=#0 then
  546. reload
  547. else
  548. inc(longint(inputpointer));
  549. end;
  550. { was the next char a linebreak ? }
  551. if c in [#10,#13] then
  552. linebreak;
  553. pattern[0]:=chr(i);
  554. end;
  555. function tscannerfile.readid:string;
  556. begin
  557. readstring;
  558. readid:=pattern;
  559. end;
  560. function tscannerfile.readval:longint;
  561. var
  562. l : longint;
  563. w : integer;
  564. begin
  565. readnumber;
  566. valint(pattern,l,w);
  567. readval:=l;
  568. end;
  569. function tscannerfile.readcomment:string;
  570. var
  571. i : longint;
  572. begin
  573. i:=0;
  574. repeat
  575. case c of
  576. '}' : begin
  577. readchar;
  578. dec_comment_level;
  579. break;
  580. end;
  581. #26 : Message(scan_f_end_of_file);
  582. else
  583. begin
  584. if (i<255) then
  585. begin
  586. inc(i);
  587. readcomment[i]:=c;
  588. end;
  589. end;
  590. end;
  591. c:=inputpointer^;
  592. if c=#0 then
  593. reload
  594. else
  595. inc(longint(inputpointer));
  596. if c in [#10,#13] then
  597. linebreak;
  598. until false;
  599. readcomment[0]:=chr(i);
  600. end;
  601. function tscannerfile.readstate:char;
  602. var
  603. state : char;
  604. begin
  605. state:=' ';
  606. if c=' ' then
  607. begin
  608. current_scanner^.skipspace;
  609. current_scanner^.readid;
  610. if pattern='ON' then
  611. state:='+'
  612. else
  613. if pattern='OFF' then
  614. state:='-';
  615. end
  616. else
  617. state:=c;
  618. if not (state in ['+','-']) then
  619. Message(scan_e_wrong_switch_toggle);
  620. readstate:=state;
  621. end;
  622. procedure tscannerfile.skipspace;
  623. begin
  624. while c in [' ',#9..#13] do
  625. begin
  626. c:=inputpointer^;
  627. if c=#0 then
  628. reload
  629. else
  630. inc(longint(inputpointer));
  631. if c in [#10,#13] then
  632. linebreak;
  633. end;
  634. end;
  635. procedure tscannerfile.skipuntildirective;
  636. var
  637. found : longint;
  638. begin
  639. found:=0;
  640. repeat
  641. case c of
  642. #26 : Message(scan_f_end_of_file);
  643. '{' : begin
  644. if comment_level=0 then
  645. found:=1;
  646. inc_comment_level;
  647. end;
  648. '}' : begin
  649. dec_comment_level;
  650. found:=0;
  651. end;
  652. '$' : begin
  653. if found=1 then
  654. found:=2;
  655. end;
  656. else
  657. found:=0;
  658. end;
  659. c:=inputpointer^;
  660. if c=#0 then
  661. reload
  662. else
  663. inc(longint(inputpointer));
  664. if c in [#10,#13] then
  665. linebreak;
  666. until (found=2);
  667. end;
  668. {$i scandir.inc}
  669. procedure tscannerfile.skipcomment;
  670. begin
  671. readchar;
  672. inc_comment_level;
  673. { handle compiler switches }
  674. if (c='$') then
  675. handledirectives;
  676. { handle_switches can dec comment_level, }
  677. while (comment_level>0) do
  678. begin
  679. case c of
  680. '{' : inc_comment_level;
  681. '}' : dec_comment_level;
  682. #26 : Message(scan_f_end_of_file);
  683. end;
  684. c:=inputpointer^;
  685. if c=#0 then
  686. reload
  687. else
  688. inc(longint(inputpointer));
  689. if c in [#10,#13] then
  690. linebreak;
  691. end;
  692. end;
  693. procedure tscannerfile.skipdelphicomment;
  694. begin
  695. inc_comment_level;
  696. readchar;
  697. { this is currently not supported }
  698. if c='$' then
  699. Message(scan_e_wrong_styled_switch);
  700. { skip comment }
  701. while c<>newline do
  702. begin
  703. if c=#26 then
  704. Message(scan_f_end_of_file);
  705. readchar;
  706. end;
  707. dec_comment_level;
  708. end;
  709. procedure tscannerfile.skipoldtpcomment;
  710. var
  711. found : longint;
  712. begin
  713. inc_comment_level;
  714. readchar;
  715. { this is currently not supported }
  716. if c='$' then
  717. Message(scan_e_wrong_styled_switch);
  718. { skip comment }
  719. while (comment_level>0) do
  720. begin
  721. found:=0;
  722. repeat
  723. case c of
  724. #26 : Message(scan_f_end_of_file);
  725. '*' : begin
  726. if found=3 then
  727. inc_comment_level
  728. else
  729. found:=1;
  730. end;
  731. ')' : begin
  732. if found=1 then
  733. begin
  734. dec_comment_level;
  735. if comment_level=0 then
  736. found:=2;
  737. end;
  738. end;
  739. '(' : found:=3;
  740. else
  741. found:=0;
  742. end;
  743. c:=inputpointer^;
  744. if c=#0 then
  745. reload
  746. else
  747. inc(longint(inputpointer));
  748. if c in [#10,#13] then
  749. linebreak;
  750. until (found=2);
  751. end;
  752. end;
  753. procedure tscannerfile.readtoken;
  754. var
  755. code : integer;
  756. low,high,mid,
  757. l : longint;
  758. mac : pmacrosym;
  759. asciinr : string[3];
  760. label
  761. exit_label;
  762. begin
  763. { was the last character a point ? }
  764. { this code is needed because the scanner if there is a 1. found if }
  765. { this is a floating point number or range like 1..3 }
  766. if do_special>0 then
  767. begin
  768. gettokenpos;
  769. l:=do_special;
  770. do_special:=0;
  771. case l of
  772. 1 : begin { first char was a point }
  773. case c of
  774. '.' : begin
  775. readchar;
  776. token:=POINTPOINT;
  777. goto exit_label;
  778. end;
  779. ')' : begin
  780. readchar;
  781. token:=RECKKLAMMER;
  782. goto exit_label;
  783. end;
  784. end;
  785. token:=POINT;
  786. goto exit_label;
  787. end;
  788. 2 : begin { first char was a Caret }
  789. token:=CARET;
  790. readchar;
  791. goto exit_label;
  792. end;
  793. end;
  794. end;
  795. { Skip all spaces and comments }
  796. repeat
  797. case c of
  798. '{' : skipcomment;
  799. ' ',#9..#13 : skipspace;
  800. else
  801. break;
  802. end;
  803. until false;
  804. { Save current token position }
  805. gettokenpos;
  806. { Check first for a identifier/keyword, this is 20+% faster (PFV) }
  807. if c in ['_','A'..'Z','a'..'z'] then
  808. begin
  809. readstring;
  810. token:=ID;
  811. idtoken:=ID;
  812. { keyword or any other known token ? }
  813. if (length(pattern) in [2..tokenidlen]) then
  814. begin
  815. low:=ord(tokenidx[length(pattern)].first);
  816. high:=ord(tokenidx[length(pattern)].last);
  817. while low<high do
  818. begin
  819. mid:=(high+low+1) shr 1;
  820. if pattern<tokens[ttoken(mid)].str then
  821. high:=mid-1
  822. else
  823. low:=mid;
  824. end;
  825. if pattern=tokens[ttoken(high)].str then
  826. begin
  827. if tokens[ttoken(high)].keyword in aktmodeswitches then
  828. token:=ttoken(high);
  829. idtoken:=ttoken(high);
  830. end;
  831. end;
  832. { Only process identifiers and not keywords }
  833. if token=ID then
  834. begin
  835. { this takes some time ... }
  836. if (cs_support_macro in aktmoduleswitches) then
  837. begin
  838. mac:=pmacrosym(macros^.search(pattern));
  839. if assigned(mac) and (assigned(mac^.buftext)) then
  840. begin
  841. insertmacro(mac^.buftext,mac^.buflen);
  842. { handle empty macros }
  843. if c=#0 then
  844. reload;
  845. { play it again ... }
  846. inc(yylexcount);
  847. if yylexcount>16 then
  848. Message(scan_w_macro_deep_ten);
  849. readtoken;
  850. { that's all folks }
  851. dec(yylexcount);
  852. exit;
  853. end;
  854. end;
  855. end;
  856. { a following caret, then set special handling }
  857. if (c='^') then
  858. do_special:=2;
  859. { return token }
  860. goto exit_label;
  861. end
  862. else
  863. begin
  864. idtoken:=NOID;
  865. case c of
  866. '$' : begin
  867. readnumber;
  868. token:=INTCONST;
  869. goto exit_label;
  870. end;
  871. '%' : begin
  872. readnumber;
  873. token:=INTCONST;
  874. goto exit_label;
  875. end;
  876. '0'..'9' : begin
  877. readnumber;
  878. if (c in ['.','e','E']) then
  879. begin
  880. { first check for a . }
  881. if c='.' then
  882. begin
  883. readchar;
  884. if not(c in ['0'..'9']) then
  885. begin
  886. do_special:=1;
  887. token:=INTCONST;
  888. goto exit_label;
  889. end;
  890. pattern:=pattern+'.';
  891. while c in ['0'..'9'] do
  892. begin
  893. pattern:=pattern+c;
  894. readchar;
  895. end;
  896. end;
  897. { E can also follow after a point is scanned }
  898. if c in ['e','E'] then
  899. begin
  900. pattern:=pattern+'E';
  901. readchar;
  902. if c in ['-','+'] then
  903. begin
  904. pattern:=pattern+c;
  905. readchar;
  906. end;
  907. if not(c in ['0'..'9']) then
  908. Message(scan_f_illegal_char);
  909. while c in ['0'..'9'] do
  910. begin
  911. pattern:=pattern+c;
  912. readchar;
  913. end;
  914. end;
  915. token:=REALNUMBER;
  916. goto exit_label;
  917. end;
  918. token:=INTCONST;
  919. goto exit_label;
  920. end;
  921. ';' : begin
  922. readchar;
  923. token:=SEMICOLON;
  924. goto exit_label;
  925. end;
  926. '[' : begin
  927. readchar;
  928. token:=LECKKLAMMER;
  929. goto exit_label;
  930. end;
  931. ']' : begin
  932. readchar;
  933. token:=RECKKLAMMER;
  934. goto exit_label;
  935. end;
  936. '(' : begin
  937. readchar;
  938. case c of
  939. '*' : begin
  940. skipoldtpcomment;
  941. readtoken;
  942. exit;
  943. end;
  944. '.' : begin
  945. readchar;
  946. token:=LECKKLAMMER;
  947. goto exit_label;
  948. end;
  949. end;
  950. token:=LKLAMMER;
  951. goto exit_label;
  952. end;
  953. ')' : begin
  954. readchar;
  955. token:=RKLAMMER;
  956. goto exit_label;
  957. end;
  958. '+' : begin
  959. readchar;
  960. if (c='=') and (cs_support_c_operators in aktmoduleswitches) then
  961. begin
  962. readchar;
  963. token:=_PLUSASN;
  964. goto exit_label;
  965. end;
  966. token:=PLUS;
  967. goto exit_label;
  968. end;
  969. '-' : begin
  970. readchar;
  971. if (c='=') and (cs_support_c_operators in aktmoduleswitches) then
  972. begin
  973. readchar;
  974. token:=_MINUSASN;
  975. goto exit_label;
  976. end;
  977. token:=MINUS;
  978. goto exit_label;
  979. end;
  980. ':' : begin
  981. readchar;
  982. if c='=' then
  983. begin
  984. readchar;
  985. token:=ASSIGNMENT;
  986. goto exit_label;
  987. end;
  988. token:=COLON;
  989. goto exit_label;
  990. end;
  991. '*' : begin
  992. readchar;
  993. if (c='=') and (cs_support_c_operators in aktmoduleswitches) then
  994. begin
  995. readchar;
  996. token:=_STARASN;
  997. end
  998. else
  999. if c='*' then
  1000. begin
  1001. readchar;
  1002. token:=STARSTAR;
  1003. end
  1004. else
  1005. token:=STAR;
  1006. goto exit_label;
  1007. end;
  1008. '/' : begin
  1009. readchar;
  1010. case c of
  1011. '=' : begin
  1012. if (cs_support_c_operators in aktmoduleswitches) then
  1013. begin
  1014. readchar;
  1015. token:=_SLASHASN;
  1016. goto exit_label;
  1017. end;
  1018. end;
  1019. '/' : begin
  1020. skipdelphicomment;
  1021. readtoken;
  1022. exit;
  1023. end;
  1024. end;
  1025. token:=SLASH;
  1026. goto exit_label;
  1027. end;
  1028. '=' : begin
  1029. readchar;
  1030. token:=EQUAL;
  1031. goto exit_label;
  1032. end;
  1033. '.' : begin
  1034. readchar;
  1035. case c of
  1036. '.' : begin
  1037. readchar;
  1038. token:=POINTPOINT;
  1039. goto exit_label;
  1040. end;
  1041. ')' : begin
  1042. readchar;
  1043. token:=RECKKLAMMER;
  1044. goto exit_label;
  1045. end;
  1046. end;
  1047. token:=POINT;
  1048. goto exit_label;
  1049. end;
  1050. '@' : begin
  1051. readchar;
  1052. if c='@' then
  1053. begin
  1054. readchar;
  1055. token:=DOUBLEADDR;
  1056. end
  1057. else
  1058. token:=KLAMMERAFFE;
  1059. goto exit_label;
  1060. end;
  1061. ',' : begin
  1062. readchar;
  1063. token:=COMMA;
  1064. goto exit_label;
  1065. end;
  1066. '''','#','^' : begin
  1067. if c='^' then
  1068. begin
  1069. readchar;
  1070. c:=upcase(c);
  1071. if not(block_type=bt_type) and (c in ['A'..'Z']) then
  1072. begin
  1073. pattern:=chr(ord(c)-64);
  1074. readchar;
  1075. end
  1076. else
  1077. begin
  1078. token:=CARET;
  1079. goto exit_label;
  1080. end;
  1081. end
  1082. else
  1083. pattern:='';
  1084. repeat
  1085. case c of
  1086. '#' : begin
  1087. readchar; { read # }
  1088. if c='$' then
  1089. begin
  1090. readchar; { read leading $ }
  1091. asciinr:='$';
  1092. while (upcase(c) in ['A'..'F','0'..'9']) and (length(asciinr)<3) do
  1093. begin
  1094. asciinr:=asciinr+c;
  1095. readchar;
  1096. end;
  1097. end
  1098. else
  1099. begin
  1100. asciinr:='';
  1101. while (c in ['0'..'9']) and (length(asciinr)<3) do
  1102. begin
  1103. asciinr:=asciinr+c;
  1104. readchar;
  1105. end;
  1106. end;
  1107. valint(asciinr,l,code);
  1108. if (asciinr='') or (code<>0) or
  1109. (l<0) or (l>255) then
  1110. Message(scan_e_illegal_char_const);
  1111. pattern:=pattern+chr(l);
  1112. end;
  1113. '''' : begin
  1114. repeat
  1115. readchar;
  1116. case c of
  1117. #26 : Message(scan_f_end_of_file);
  1118. newline : Message(scan_f_string_exceeds_line);
  1119. '''' : begin
  1120. readchar;
  1121. if c<>'''' then
  1122. break;
  1123. end;
  1124. end;
  1125. pattern:=pattern+c;
  1126. until false;
  1127. end;
  1128. '^' : begin
  1129. readchar;
  1130. if c<#64 then
  1131. c:=chr(ord(c)+64)
  1132. else
  1133. c:=chr(ord(c)-64);
  1134. pattern:=pattern+c;
  1135. readchar;
  1136. end;
  1137. else
  1138. break;
  1139. end;
  1140. until false;
  1141. { strings with length 1 become const chars }
  1142. if length(pattern)=1 then
  1143. token:=CCHAR
  1144. else
  1145. token:=CSTRING;
  1146. goto exit_label;
  1147. end;
  1148. '>' : begin
  1149. readchar;
  1150. case c of
  1151. '=' : begin
  1152. readchar;
  1153. token:=GTE;
  1154. goto exit_label;
  1155. end;
  1156. '>' : begin
  1157. readchar;
  1158. token:=_SHR;
  1159. goto exit_label;
  1160. end;
  1161. '<' : begin { >< is for a symetric diff for sets }
  1162. readchar;
  1163. token:=SYMDIF;
  1164. goto exit_label;
  1165. end;
  1166. end;
  1167. token:=GT;
  1168. goto exit_label;
  1169. end;
  1170. '<' : begin
  1171. readchar;
  1172. case c of
  1173. '>' : begin
  1174. readchar;
  1175. token:=UNEQUAL;
  1176. goto exit_label;
  1177. end;
  1178. '=' : begin
  1179. readchar;
  1180. token:=LTE;
  1181. goto exit_label;
  1182. end;
  1183. '<' : begin
  1184. readchar;
  1185. token:=_SHL;
  1186. goto exit_label;
  1187. end;
  1188. end;
  1189. token:=LT;
  1190. goto exit_label;
  1191. end;
  1192. #26 : begin
  1193. token:=_EOF;
  1194. goto exit_label;
  1195. end;
  1196. else
  1197. begin
  1198. Message(scan_f_illegal_char);
  1199. end;
  1200. end;
  1201. end;
  1202. exit_label:
  1203. end;
  1204. function tscannerfile.readpreproc:ttoken;
  1205. begin
  1206. skipspace;
  1207. case c of
  1208. 'A'..'Z',
  1209. 'a'..'z',
  1210. '_','0'..'9' : begin
  1211. preprocpat:=readid;
  1212. readpreproc:=ID;
  1213. end;
  1214. '(' : begin
  1215. readchar;
  1216. readpreproc:=LKLAMMER;
  1217. end;
  1218. ')' : begin
  1219. readchar;
  1220. readpreproc:=RKLAMMER;
  1221. end;
  1222. '+' : begin
  1223. readchar;
  1224. readpreproc:=PLUS;
  1225. end;
  1226. '-' : begin
  1227. readchar;
  1228. readpreproc:=MINUS;
  1229. end;
  1230. '*' : begin
  1231. readchar;
  1232. readpreproc:=STAR;
  1233. end;
  1234. '/' : begin
  1235. readchar;
  1236. readpreproc:=SLASH;
  1237. end;
  1238. '=' : begin
  1239. readchar;
  1240. readpreproc:=EQUAL;
  1241. end;
  1242. '>' : begin
  1243. readchar;
  1244. if c='=' then
  1245. begin
  1246. readchar;
  1247. readpreproc:=GTE;
  1248. end
  1249. else
  1250. readpreproc:=GT;
  1251. end;
  1252. '<' : begin
  1253. readchar;
  1254. case c of
  1255. '>' : begin
  1256. readchar;
  1257. readpreproc:=UNEQUAL;
  1258. end;
  1259. '=' : begin
  1260. readchar;
  1261. readpreproc:=LTE;
  1262. end;
  1263. else readpreproc:=LT;
  1264. end;
  1265. end;
  1266. #26 : Message(scan_f_end_of_file);
  1267. else
  1268. begin
  1269. readpreproc:=_EOF;
  1270. end;
  1271. end;
  1272. end;
  1273. function tscannerfile.asmgetchar : char;
  1274. begin
  1275. if lastasmgetchar<>#0 then
  1276. begin
  1277. c:=lastasmgetchar;
  1278. lastasmgetchar:=#0;
  1279. end
  1280. else
  1281. readchar;
  1282. case c of
  1283. '{' : begin
  1284. skipcomment;
  1285. lastasmgetchar:=c;
  1286. asmgetchar:=';';
  1287. exit;
  1288. end;
  1289. '/' : begin
  1290. readchar;
  1291. if c='/' then
  1292. begin
  1293. skipdelphicomment;
  1294. asmgetchar:=';';
  1295. end
  1296. else
  1297. asmgetchar:='/';
  1298. lastasmgetchar:=c;
  1299. exit;
  1300. end;
  1301. '(' : begin
  1302. readchar;
  1303. if c='*' then
  1304. begin
  1305. skipoldtpcomment;
  1306. asmgetchar:=';';
  1307. end
  1308. else
  1309. asmgetchar:='(';
  1310. lastasmgetchar:=c;
  1311. exit;
  1312. end;
  1313. else
  1314. begin
  1315. asmgetchar:=c;
  1316. end;
  1317. end;
  1318. end;
  1319. begin
  1320. create_tokenidx;
  1321. end.
  1322. {
  1323. $Log$
  1324. Revision 1.56 1998-09-30 16:43:38 peter
  1325. * fixed unit interdependency with circular uses
  1326. Revision 1.55 1998/09/28 16:57:26 pierre
  1327. * changed all length(p^.value_str^) into str_length(p)
  1328. to get it work with and without ansistrings
  1329. * changed sourcefiles field of tmodule to a pointer
  1330. Revision 1.54 1998/09/26 17:45:41 peter
  1331. + idtoken and only one token table
  1332. Revision 1.53 1998/09/24 23:49:20 peter
  1333. + aktmodeswitches
  1334. Revision 1.52 1998/09/18 16:03:45 florian
  1335. * some changes to compile with Delphi
  1336. Revision 1.51 1998/09/16 16:41:49 peter
  1337. * merged fixes
  1338. Revision 1.50.2.1 1998/09/16 16:09:49 peter
  1339. * on/off support also for the local/module switches
  1340. Revision 1.50 1998/09/04 08:36:06 peter
  1341. + (. and .) which are equal to [ and ]
  1342. Revision 1.49 1998/09/03 11:24:03 peter
  1343. * moved more inputfile things from tscannerfile to tinputfile
  1344. * changed ifdef Sourceline to cs_asm_source
  1345. Revision 1.48 1998/09/01 12:51:02 peter
  1346. * close also resets lastlinepos
  1347. Revision 1.47 1998/09/01 09:01:52 peter
  1348. * initialize all object variables in .init
  1349. Revision 1.46 1998/08/29 13:49:00 peter
  1350. * fixed freemem calls which had the wrong size sometimes
  1351. Revision 1.45 1998/08/26 15:35:35 peter
  1352. * fixed scannerfiles for macros
  1353. + $I %<environment>%
  1354. Revision 1.44 1998/08/20 16:09:55 pierre
  1355. * tokenpos has to be restored also after
  1356. printstatus
  1357. Revision 1.43 1998/08/20 09:26:45 pierre
  1358. + funcret setting in underproc testing
  1359. compile with _dTEST_FUNCRET
  1360. Revision 1.42 1998/08/19 14:57:51 peter
  1361. * small fix for aktfilepos
  1362. Revision 1.41 1998/08/18 14:17:10 pierre
  1363. * bug about assigning the return value of a function to
  1364. a procvar fixed : warning
  1365. assigning a proc to a procvar need @ in FPC mode !!
  1366. * missing file/line info restored
  1367. Revision 1.40 1998/08/11 14:04:33 peter
  1368. * auto close an open file and better error msg
  1369. Revision 1.39 1998/08/10 14:50:26 peter
  1370. + localswitches, moduleswitches, globalswitches splitting
  1371. Revision 1.38 1998/08/10 10:18:34 peter
  1372. + Compiler,Comphook unit which are the new interface units to the
  1373. compiler
  1374. Revision 1.37 1998/07/23 12:40:41 michael
  1375. No nested comments in Delphi mode.
  1376. Revision 1.36 1998/07/20 22:17:17 florian
  1377. * hex constants in numeric char (#$54#$43 ...) are now allowed
  1378. * there was a bug in record_var_dec which prevents the used
  1379. of nested variant records (for example drivers.tevent of tv)
  1380. Revision 1.35 1998/07/14 21:38:13 peter
  1381. + support for with p^do constructs
  1382. Revision 1.34 1998/07/14 14:47:04 peter
  1383. * released NEWINPUT
  1384. Revision 1.33 1998/07/10 10:48:40 peter
  1385. * fixed realnumber scanning
  1386. * [] after asmblock was not uppercased anymore
  1387. Revision 1.31 1998/07/07 17:39:38 peter
  1388. * fixed $I with following eof
  1389. Revision 1.30 1998/07/07 12:32:55 peter
  1390. * status.currentsource is now calculated in verbose (more accurated)
  1391. Revision 1.29 1998/07/07 11:20:11 peter
  1392. + NEWINPUT for a better inputfile and scanner object
  1393. Revision 1.28 1998/07/01 15:26:57 peter
  1394. * better bufferfile.reset error handling
  1395. Revision 1.27 1998/06/25 08:48:19 florian
  1396. * first version of rtti support
  1397. Revision 1.26 1998/06/16 08:56:30 peter
  1398. + targetcpu
  1399. * cleaner pmodules for newppu
  1400. Revision 1.25 1998/06/13 00:10:15 peter
  1401. * working browser and newppu
  1402. * some small fixes against crashes which occured in bp7 (but not in
  1403. fpc?!)
  1404. Revision 1.24 1998/06/12 10:32:36 pierre
  1405. * column problem hopefully solved
  1406. + C vars declaration changed
  1407. Revision 1.23 1998/06/03 22:49:02 peter
  1408. + wordbool,longbool
  1409. * rename bis,von -> high,low
  1410. * moved some systemunit loading/creating to psystem.pas
  1411. Revision 1.21 1998/05/27 00:20:32 peter
  1412. * some scanner optimizes
  1413. * automaticly aout2exe for go32v1
  1414. * fixed dynamiclinker option which was added at the wrong place
  1415. Revision 1.20 1998/05/23 01:21:30 peter
  1416. + aktasmmode, aktoptprocessor, aktoutputformat
  1417. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  1418. + $LIBNAME to set the library name where the unit will be put in
  1419. * splitted cgi386 a bit (codeseg to large for bp7)
  1420. * nasm, tasm works again. nasm moved to ag386nsm.pas
  1421. Revision 1.19 1998/05/20 09:42:37 pierre
  1422. + UseTokenInfo now default
  1423. * unit in interface uses and implementation uses gives error now
  1424. * only one error for unknown symbol (uses lastsymknown boolean)
  1425. the problem came from the label code !
  1426. + first inlined procedures and function work
  1427. (warning there might be allowed cases were the result is still wrong !!)
  1428. * UseBrower updated gives a global list of all position of all used symbols
  1429. with switch -gb
  1430. Revision 1.18 1998/05/12 10:47:00 peter
  1431. * moved printstatus to verb_def
  1432. + V_Normal which is between V_Error and V_Warning and doesn't have a
  1433. prefix like error: warning: and is included in V_Default
  1434. * fixed some messages
  1435. * first time parameter scan is only for -v and -T
  1436. - removed old style messages
  1437. Revision 1.17 1998/05/06 08:38:47 pierre
  1438. * better position info with UseTokenInfo
  1439. UseTokenInfo greatly simplified
  1440. + added check for changed tree after first time firstpass
  1441. (if we could remove all the cases were it happen
  1442. we could skip all firstpass if firstpasscount > 1)
  1443. Only with ExtDebug
  1444. Revision 1.16 1998/05/04 17:54:28 peter
  1445. + smartlinking works (only case jumptable left todo)
  1446. * redesign of systems.pas to support assemblers and linkers
  1447. + Unitname is now also in the PPU-file, increased version to 14
  1448. Revision 1.15 1998/05/01 16:38:46 florian
  1449. * handling of private and protected fixed
  1450. + change_keywords_to_tp implemented to remove
  1451. keywords which aren't supported by tp
  1452. * break and continue are now symbols of the system unit
  1453. + widestring, longstring and ansistring type released
  1454. Revision 1.14 1998/04/30 15:59:42 pierre
  1455. * GDB works again better :
  1456. correct type info in one pass
  1457. + UseTokenInfo for better source position
  1458. * fixed one remaining bug in scanner for line counts
  1459. * several little fixes
  1460. Revision 1.13 1998/04/29 13:42:27 peter
  1461. + $IOCHECKS and $ALIGN to test already, other will follow soon
  1462. * fixed the wrong linecounting with comments
  1463. Revision 1.12 1998/04/29 10:34:04 pierre
  1464. + added some code for ansistring (not complete nor working yet)
  1465. * corrected operator overloading
  1466. * corrected nasm output
  1467. + started inline procedures
  1468. + added starstarn : use ** for exponentiation (^ gave problems)
  1469. + started UseTokenInfo cond to get accurate positions
  1470. Revision 1.11 1998/04/27 23:10:29 peter
  1471. + new scanner
  1472. * $makelib -> if smartlink
  1473. * small filename fixes pmodule.setfilename
  1474. * moved import from files.pas -> import.pas
  1475. }