scanner.pas 48 KB

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