scanner.pas 49 KB

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