scandir.inc 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396
  1. {
  2. $Id$
  3. Copyright (c) 1998 by Peter Vreman
  4. This unit implements directive parsing for the scanner
  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. const
  19. directivelen=15;
  20. type
  21. directivestr=string[directivelen];
  22. tdirectivetoken=(
  23. _DIR_NONE,
  24. _DIR_ALIGN,_DIR_APPTYPE,_DIR_ASMMODE,_DIR_ASSERTIONS,
  25. _DIR_BOOLEVAL,
  26. _DIR_D,_DIR_DEBUGINFO,_DIR_DEFINE,_DIR_DESCRIPTION,
  27. _DIR_ELSE,_DIR_ENDIF,_DIR_ERROR,_DIR_EXTENDEDSYNTAX,
  28. _DIR_FATAL,
  29. _DIR_GOTO,
  30. _DIR_HINT,_DIR_HINTS,
  31. _DIR_I,_DIR_I386_ATT,_DIR_I386_DIRECT,_DIR_I386_INTEL,_DIR_IOCHECKS,
  32. _DIR_IF,_DIR_IFDEF,_DIR_IFNDEF,_DIR_IFOPT,_DIR_INCLUDE,_DIR_INCLUDEPATH,
  33. _DIR_INFO,_DIR_INLINE,
  34. _DIR_L,_DIR_LIBRARYPATH,_DIR_LINK,_DIR_LINKLIB,_DIR_LOCALSYMBOLS,
  35. _DIR_LONGSTRINGS,
  36. _DIR_M,_DIR_MACRO,_DIR_MEMORY,_DIR_MESSAGE,_DIR_MINENUMSIZE,_DIR_MMX,_DIR_MODE,
  37. _DIR_NOTE,_DIR_NOTES,
  38. _DIR_OBJECTPATH,_DIR_OPENSTRINGS,_DIR_OUTPUT_FORMAT,_DIR_OVERFLOWCHECKS,
  39. _DIR_PACKENUM,_DIR_PACKRECORDS,
  40. _DIR_R,_DIR_RANGECHECKS,_DIR_REFERENCEINFO,
  41. _DIR_SATURATION,_DIR_SMARTLINK,_DIR_STACKFRAMES,_DIR_STATIC,_DIR_STOP,
  42. _DIR_TYPEDADDRESS,_DIR_TYPEINFO,
  43. _DIR_UNDEF,_DIR_UNITPATH,
  44. _DIR_VARSTRINGCHECKS,
  45. _DIR_WAIT,_DIR_WARNING,_DIR_WARNINGS,
  46. _DIR_Z1,_DIR_Z2,_DIR_Z4
  47. );
  48. const
  49. firstdirective=_DIR_NONE;
  50. lastdirective=_DIR_Z4;
  51. directive:array[tdirectivetoken] of directivestr=(
  52. {12345678901234567890 (To determine longest string.)}
  53. '',
  54. 'ALIGN',
  55. 'APPTYPE',
  56. 'ASMMODE',
  57. 'ASSERTIONS',
  58. 'BOOLEVAL',
  59. 'D',
  60. 'DEBUGINFO',
  61. 'DEFINE',
  62. 'DESCRIPTION',
  63. 'ELSE',
  64. 'ENDIF',
  65. 'ERROR',
  66. 'EXTENDEDSYNTAX',
  67. 'FATAL',
  68. 'GOTO',
  69. 'HINT',
  70. 'HINTS',
  71. 'I',
  72. {12345678901234567890 (To determine longest string.)}
  73. 'I386_ATT',
  74. 'I386_DIRECT',
  75. 'I386_INTEL',
  76. 'IOCHECKS',
  77. 'IF',
  78. 'IFDEF',
  79. 'IFNDEF',
  80. 'IFOPT',
  81. 'INCLUDE',
  82. 'INCLUDEPATH',
  83. 'INFO',
  84. 'INLINE',
  85. 'L',
  86. 'LIBRARYPATH',
  87. 'LINK',
  88. 'LINKLIB',
  89. 'LOCALSYMBOLS',
  90. 'LONGSTRINGS',
  91. 'M',
  92. {12345678901234567890 (To determine longest string.)}
  93. 'MACRO',
  94. 'MEMORY',
  95. 'MESSAGE',
  96. 'MINENUMSIZE',
  97. 'MMX',
  98. 'MODE',
  99. 'NOTE',
  100. 'NOTES',
  101. 'OBJECTPATH',
  102. 'OPENSTRINGS',
  103. 'OUTPUT_FORMAT',
  104. 'OVERFLOWCHECKS',
  105. 'PACKENUM',
  106. 'PACKRECORDS',
  107. 'R',
  108. 'RANGECHECKS',
  109. 'REFERENCEINFO',
  110. 'SATURATION',
  111. 'SMARTLINK',
  112. {12345678901234567890 (To determine longest string.)}
  113. 'STACKFRAMES',
  114. 'STATIC',
  115. 'STOP',
  116. 'TYPEDADDRESS',
  117. 'TYPEINFO',
  118. 'UNDEF',
  119. 'UNITPATH',
  120. 'VARSTRINGCHECKS',
  121. 'WAIT',
  122. 'WARNING',
  123. 'WARNINGS',
  124. 'Z1',
  125. 'Z2',
  126. 'Z4'
  127. );
  128. function Get_Directive(const hs:string):tdirectivetoken;
  129. var
  130. i : tdirectivetoken;
  131. begin
  132. for i:=firstdirective to lastdirective do
  133. if directive[i]=hs then
  134. begin
  135. Get_Directive:=i;
  136. exit;
  137. end;
  138. Get_Directive:=_DIR_NONE;
  139. end;
  140. {-------------------------------------------
  141. IF Conditional Handling
  142. -------------------------------------------}
  143. var
  144. preprocpat : string;
  145. preproc_token : ttoken;
  146. procedure preproc_consume(t : ttoken);
  147. begin
  148. if t<>preproc_token then
  149. Message(scan_e_preproc_syntax_error);
  150. preproc_token:=current_scanner^.readpreproc;
  151. end;
  152. function read_expr : string;forward;
  153. function read_factor : string;
  154. var
  155. hs : string;
  156. mac : pmacrosym;
  157. len : byte;
  158. begin
  159. if preproc_token=_ID then
  160. begin
  161. if preprocpat='NOT' then
  162. begin
  163. preproc_consume(_ID);
  164. hs:=read_expr;
  165. if hs='0' then
  166. read_factor:='1'
  167. else
  168. read_factor:='0';
  169. end
  170. else
  171. begin
  172. mac:=pmacrosym(macros^.search(hs));
  173. hs:=preprocpat;
  174. preproc_consume(_ID);
  175. if assigned(mac) then
  176. begin
  177. if mac^.defined and assigned(mac^.buftext) then
  178. begin
  179. if mac^.buflen>255 then
  180. begin
  181. len:=255;
  182. Message(scan_w_marco_cut_after_255_chars);
  183. end
  184. else
  185. len:=mac^.buflen;
  186. {$ifndef TP}
  187. {$ifopt H+}
  188. setlength(hs,len);
  189. {$else}
  190. hs[0]:=char(len);
  191. {$endif}
  192. {$else}
  193. hs[0]:=char(len);
  194. {$endif}
  195. move(mac^.buftext^,hs[1],len);
  196. end
  197. else
  198. read_factor:='';
  199. end
  200. else
  201. read_factor:=hs;
  202. end
  203. end
  204. else if preproc_token=_LKLAMMER then
  205. begin
  206. preproc_consume(_LKLAMMER);
  207. read_factor:=read_expr;
  208. preproc_consume(_RKLAMMER);
  209. end
  210. else
  211. Message(scan_e_error_in_preproc_expr);
  212. end;
  213. function read_term : string;
  214. var
  215. hs1,hs2 : string;
  216. begin
  217. hs1:=read_factor;
  218. while true do
  219. begin
  220. if (preproc_token=_ID) then
  221. begin
  222. if preprocpat='AND' then
  223. begin
  224. preproc_consume(_ID);
  225. hs2:=read_factor;
  226. if (hs1<>'0') and (hs2<>'0') then
  227. hs1:='1';
  228. end
  229. else
  230. break;
  231. end
  232. else
  233. break;
  234. end;
  235. read_term:=hs1;
  236. end;
  237. function read_simple_expr : string;
  238. var
  239. hs1,hs2 : string;
  240. begin
  241. hs1:=read_term;
  242. while true do
  243. begin
  244. if (preproc_token=_ID) then
  245. begin
  246. if preprocpat='OR' then
  247. begin
  248. preproc_consume(_ID);
  249. hs2:=read_term;
  250. if (hs1<>'0') or (hs2<>'0') then
  251. hs1:='1';
  252. end
  253. else
  254. break;
  255. end
  256. else
  257. break;
  258. end;
  259. read_simple_expr:=hs1;
  260. end;
  261. function read_expr : string;
  262. var
  263. hs1,hs2 : string;
  264. b : boolean;
  265. t : ttoken;
  266. w : integer;
  267. l1,l2 : longint;
  268. begin
  269. hs1:=read_simple_expr;
  270. t:=preproc_token;
  271. if not(t in [_EQUAL,_UNEQUAL,_LT,_GT,_LTE,_GTE]) then
  272. begin
  273. read_expr:=hs1;
  274. exit;
  275. end;
  276. preproc_consume(t);
  277. hs2:=read_simple_expr;
  278. if is_number(hs1) and is_number(hs2) then
  279. begin
  280. valint(hs1,l1,w);
  281. valint(hs2,l2,w);
  282. case t of
  283. _EQUAL : b:=l1=l2;
  284. _UNEQUAL : b:=l1<>l2;
  285. _LT : b:=l1<l2;
  286. _GT : b:=l1>l2;
  287. _GTE : b:=l1>=l2;
  288. _LTE : b:=l1<=l2;
  289. end;
  290. end
  291. else
  292. begin
  293. case t of
  294. _EQUAL : b:=hs1=hs2;
  295. _UNEQUAL : b:=hs1<>hs2;
  296. _LT : b:=hs1<hs2;
  297. _GT : b:=hs1>hs2;
  298. _GTE : b:=hs1>=hs2;
  299. _LTE : b:=hs1<=hs2;
  300. end;
  301. end;
  302. if b then
  303. read_expr:='1'
  304. else
  305. read_expr:='0';
  306. end;
  307. {-------------------------------------------
  308. Directives
  309. -------------------------------------------}
  310. function is_conditional(t:tdirectivetoken):boolean;
  311. begin
  312. is_conditional:=(t in [_DIR_ENDIF,_DIR_IFDEF,_DIR_IFNDEF,_DIR_IFOPT,_DIR_IF,_DIR_ELSE]);
  313. end;
  314. procedure dir_conditional(t:tdirectivetoken);
  315. var
  316. hs : string;
  317. mac : pmacrosym;
  318. found : boolean;
  319. state : char;
  320. oldaktfilepos : tfileposinfo;
  321. begin
  322. oldaktfilepos:=aktfilepos;
  323. while true do
  324. begin
  325. current_scanner^.gettokenpos;
  326. case t of
  327. _DIR_ENDIF : begin
  328. current_scanner^.poppreprocstack;
  329. end;
  330. _DIR_ELSE : begin
  331. current_scanner^.elsepreprocstack;
  332. end;
  333. _DIR_IFDEF : begin
  334. current_scanner^.skipspace;
  335. hs:=current_scanner^.readid;
  336. mac:=pmacrosym(macros^.search(hs));
  337. if assigned(mac) then
  338. mac^.is_used:=true;
  339. current_scanner^.addpreprocstack(pp_ifdef,assigned(mac) and mac^.defined,hs,scan_c_ifdef_found);
  340. end;
  341. _DIR_IFOPT : begin
  342. current_scanner^.skipspace;
  343. hs:=current_scanner^.readid;
  344. if (length(hs)>1) then
  345. Message(scan_w_illegal_switch)
  346. else
  347. begin
  348. state:=current_scanner^.ReadState;
  349. if state in ['-','+'] then
  350. found:=CheckSwitch(hs[1],state);
  351. end;
  352. current_scanner^.addpreprocstack(pp_ifopt,found,hs,scan_c_ifopt_found);
  353. end;
  354. _DIR_IF : begin
  355. current_scanner^.skipspace;
  356. { start preproc expression scanner }
  357. preproc_token:=current_scanner^.readpreproc;
  358. hs:=read_expr;
  359. current_scanner^.addpreprocstack(pp_if,hs<>'0',hs,scan_c_if_found);
  360. end;
  361. _DIR_IFNDEF : begin
  362. current_scanner^.skipspace;
  363. hs:=current_scanner^.readid;
  364. mac:=pmacrosym(macros^.search(hs));
  365. if assigned(mac) then
  366. mac^.is_used:=true;
  367. current_scanner^.addpreprocstack(pp_ifndef,not(assigned(mac) and mac^.defined),hs,scan_c_ifndef_found);
  368. end;
  369. end;
  370. { accept the text ? }
  371. if (current_scanner^.preprocstack=nil) or current_scanner^.preprocstack^.accept then
  372. break
  373. else
  374. begin
  375. current_scanner^.gettokenpos;
  376. Message(scan_c_skipping_until);
  377. repeat
  378. current_scanner^.skipuntildirective;
  379. t:=Get_Directive(current_scanner^.readid);
  380. until is_conditional(t);
  381. current_scanner^.gettokenpos;
  382. Message1(scan_d_handling_switch,'$'+directive[t]);
  383. end;
  384. end;
  385. oldaktfilepos:=aktfilepos;
  386. end;
  387. procedure dir_define(t:tdirectivetoken);
  388. var
  389. hs : string;
  390. mac : pmacrosym;
  391. macropos : longint;
  392. macrobuffer : pmacrobuffer;
  393. begin
  394. current_scanner^.skipspace;
  395. hs:=current_scanner^.readid;
  396. mac:=pmacrosym(macros^.search(hs));
  397. if not assigned(mac) then
  398. begin
  399. mac:=new(pmacrosym,init(hs));
  400. mac^.defined:=true;
  401. Message1(parser_m_macro_defined,mac^.name);
  402. macros^.insert(mac);
  403. end
  404. else
  405. begin
  406. Message1(parser_m_macro_defined,mac^.name);
  407. mac^.defined:=true;
  408. { delete old definition }
  409. if assigned(mac^.buftext) then
  410. begin
  411. freemem(mac^.buftext,mac^.buflen);
  412. mac^.buftext:=nil;
  413. end;
  414. end;
  415. mac^.is_used:=true;
  416. if (cs_support_macro in aktmoduleswitches) then
  417. begin
  418. { key words are never substituted }
  419. if is_keyword(hs) then
  420. Message(scan_e_keyword_cant_be_a_macro);
  421. { !!!!!! handle macro params, need we this? }
  422. current_scanner^.skipspace;
  423. { may be a macro? }
  424. if c=':' then
  425. begin
  426. current_scanner^.readchar;
  427. if c='=' then
  428. begin
  429. new(macrobuffer);
  430. macropos:=0;
  431. { first char }
  432. current_scanner^.readchar;
  433. while (c<>'}') do
  434. begin
  435. macrobuffer^[macropos]:=c;
  436. current_scanner^.readchar;
  437. if c=#26 then Message(scan_f_end_of_file);
  438. inc(macropos);
  439. if macropos>maxmacrolen then
  440. Message(scan_f_macro_buffer_overflow);
  441. end;
  442. { free buffer of macro ?}
  443. if assigned(mac^.buftext) then
  444. freemem(mac^.buftext,mac^.buflen);
  445. { get new mem }
  446. getmem(mac^.buftext,macropos);
  447. mac^.buflen:=macropos;
  448. { copy the text }
  449. move(macrobuffer^,mac^.buftext^,macropos);
  450. dispose(macrobuffer);
  451. end;
  452. end;
  453. end;
  454. end;
  455. procedure dir_undef(t:tdirectivetoken);
  456. var
  457. hs : string;
  458. mac : pmacrosym;
  459. begin
  460. current_scanner^.skipspace;
  461. hs:=current_scanner^.readid;
  462. mac:=pmacrosym(macros^.search(hs));
  463. if not assigned(mac) then
  464. begin
  465. mac:=new(pmacrosym,init(hs));
  466. Message1(parser_m_macro_undefined,mac^.name);
  467. mac^.defined:=false;
  468. macros^.insert(mac);
  469. end
  470. else
  471. begin
  472. Message1(parser_m_macro_undefined,mac^.name);
  473. mac^.defined:=false;
  474. { delete old definition }
  475. if assigned(mac^.buftext) then
  476. begin
  477. freemem(mac^.buftext,mac^.buflen);
  478. mac^.buftext:=nil;
  479. end;
  480. end;
  481. mac^.is_used:=true;
  482. end;
  483. procedure dir_message(t:tdirectivetoken);
  484. var
  485. w : tmsgconst;
  486. begin
  487. case t of
  488. _DIR_STOP,
  489. _DIR_FATAL : w:=scan_f_user_defined;
  490. _DIR_ERROR : w:=scan_e_user_defined;
  491. _DIR_WARNING : w:=scan_w_user_defined;
  492. _DIR_HINT : w:=scan_h_user_defined;
  493. _DIR_NOTE : w:=scan_n_user_defined;
  494. _DIR_MESSAGE,
  495. _DIR_INFO : w:=scan_i_user_defined;
  496. end;
  497. current_scanner^.skipspace;
  498. Message1(w,current_scanner^.readcomment);
  499. end;
  500. procedure dir_moduleswitch(t:tdirectivetoken);
  501. var
  502. sw : tmoduleswitch;
  503. state : char;
  504. begin
  505. sw:=cs_modulenone;
  506. case t of
  507. _DIR_GOTO : sw:=cs_support_goto;
  508. _DIR_MACRO : sw:=cs_support_macro;
  509. _DIR_INLINE : sw:=cs_support_inline;
  510. _DIR_SMARTLINK : sw:=cs_create_smart;
  511. _DIR_STATIC : sw:=cs_static_keyword;
  512. end;
  513. state:=current_scanner^.readstate;
  514. if (sw<>cs_modulenone) and (state in ['-','+']) then
  515. begin
  516. if state='-' then
  517. aktmoduleswitches:=aktmoduleswitches-[sw]
  518. else
  519. aktmoduleswitches:=aktmoduleswitches+[sw];
  520. end;
  521. end;
  522. procedure dir_localswitch(t:tdirectivetoken);
  523. var
  524. sw : tlocalswitch;
  525. state : char;
  526. begin
  527. sw:=cs_localnone;
  528. {$ifdef SUPPORT_MMX}
  529. case t of
  530. _DIR_MMX : sw:=cs_mmx;
  531. _DIR_SATURATION : sw:=cs_mmx_saturation;
  532. end;
  533. {$endif}
  534. state:=current_scanner^.readstate;
  535. if (sw<>cs_localnone) and (state in ['-','+']) then
  536. begin
  537. if state='-' then
  538. aktlocalswitches:=aktlocalswitches-[sw]
  539. else
  540. aktlocalswitches:=aktlocalswitches+[sw];
  541. end;
  542. end;
  543. procedure dir_include(t:tdirectivetoken);
  544. var
  545. hs : string;
  546. path : dirstr;
  547. name : namestr;
  548. ext : extstr;
  549. hp : pinputfile;
  550. i : longint;
  551. found : boolean;
  552. begin
  553. current_scanner^.skipspace;
  554. hs:=current_scanner^.readcomment;
  555. i:=length(hs);
  556. while (i>0) and (hs[i]=' ') do
  557. dec(i);
  558. Delete(hs,i+1,length(hs)-i);
  559. if hs='' then
  560. exit;
  561. if (hs[1]='%') then
  562. begin
  563. { case insensitive }
  564. hs:=upper(hs);
  565. { remove %'s }
  566. Delete(hs,1,1);
  567. if hs[length(hs)]='%' then
  568. Delete(hs,length(hs),1);
  569. { save old }
  570. path:=hs;
  571. { first check for internal macros }
  572. if hs='TIME' then
  573. hs:=gettimestr
  574. else
  575. if hs='DATE' then
  576. hs:=getdatestr
  577. else
  578. if hs='FILE' then
  579. hs:=current_module^.sourcefiles^.get_file_name(aktfilepos.fileindex)
  580. else
  581. if hs='LINE' then
  582. hs:=tostr(aktfilepos.line)
  583. else
  584. if hs='FPCVERSION' then
  585. hs:=version_string
  586. else
  587. if hs='FPCTARGET' then
  588. hs:=target_cpu_string
  589. else
  590. hs:=getenv(hs);
  591. if hs='' then
  592. Message1(scan_w_include_env_not_found,path);
  593. { make it a stringconst }
  594. hs:=''''+hs+'''';
  595. current_scanner^.insertmacro(@hs[1],length(hs));
  596. end
  597. else
  598. begin
  599. hs:=FixFileName(hs);
  600. fsplit(hs,path,name,ext);
  601. { look for the include file
  602. 1. specified path,path of current inputfile,current dir
  603. 2. local includepath
  604. 3. global includepath }
  605. found:=false;
  606. path:=search(name+ext,path+';'+current_scanner^.inputfile^.path^+';.',found);
  607. if (not found) and assigned(current_module^.localincludesearchpath) then
  608. path:=search(name+ext,current_module^.localincludesearchpath^,found);
  609. if (not found) then
  610. path:=search(name+ext,includesearchpath,found);
  611. { shutdown current file }
  612. current_scanner^.tempcloseinputfile;
  613. { load new file }
  614. hp:=new(pinputfile,init(path+name+ext));
  615. current_scanner^.addfile(hp);
  616. if not current_scanner^.openinputfile then
  617. Message1(scan_f_cannot_open_includefile,hs);
  618. Message1(scan_t_start_include_file,current_scanner^.inputfile^.path^+current_scanner^.inputfile^.name^);
  619. current_scanner^.reload;
  620. { register for refs }
  621. current_module^.sourcefiles^.register_file(hp);
  622. end;
  623. end;
  624. procedure dir_description(t:tdirectivetoken);
  625. begin
  626. end;
  627. procedure dir_linkobject(t:tdirectivetoken);
  628. var
  629. s : string;
  630. begin
  631. current_scanner^.skipspace;
  632. s:=AddExtension(FixFileName(current_scanner^.readcomment),target_info.objext);
  633. current_module^.linkotherofiles.insert(s,link_allways);
  634. end;
  635. procedure dir_resource(t:tdirectivetoken);
  636. var
  637. s : string;
  638. begin
  639. current_scanner^.skipspace;
  640. s:=AddExtension(FixFileName(current_scanner^.readcomment),target_info.resext);
  641. if target_info.res<>res_none then
  642. current_module^.resourcefiles.insert(FixFileName(s))
  643. else
  644. Message(scan_e_resourcefiles_not_supported);
  645. end;
  646. procedure dir_linklib(t:tdirectivetoken);
  647. begin
  648. current_scanner^.skipspace;
  649. current_scanner^.readstring;
  650. current_module^.linkOtherSharedLibs.insert(orgpattern,link_allways);
  651. end;
  652. procedure dir_outputformat(t:tdirectivetoken);
  653. begin
  654. if not current_module^.in_global then
  655. Message(scan_w_switch_is_global)
  656. else
  657. begin
  658. current_scanner^.skipspace;
  659. if set_string_asm(current_scanner^.readid) then
  660. aktoutputformat:=target_asm.id
  661. else
  662. Message(scan_w_illegal_switch);
  663. end;
  664. end;
  665. procedure dir_unitpath(t:tdirectivetoken);
  666. begin
  667. if not current_module^.in_global then
  668. Message(scan_w_switch_is_global)
  669. else
  670. begin
  671. current_scanner^.skipspace;
  672. if assigned(current_module^.localunitsearchpath) then
  673. stringdispose(current_module^.localunitsearchpath);
  674. current_module^.localunitsearchpath:=stringdup(current_scanner^.readcomment);
  675. end;
  676. end;
  677. procedure dir_includepath(t:tdirectivetoken);
  678. begin
  679. if not current_module^.in_global then
  680. Message(scan_w_switch_is_global)
  681. else
  682. begin
  683. current_scanner^.skipspace;
  684. if assigned(current_module^.localincludesearchpath) then
  685. stringdispose(current_module^.localincludesearchpath);
  686. current_module^.localincludesearchpath:=stringdup(current_scanner^.readcomment);
  687. end;
  688. end;
  689. procedure dir_librarypath(t:tdirectivetoken);
  690. begin
  691. if not current_module^.in_global then
  692. Message(scan_w_switch_is_global)
  693. else
  694. begin
  695. current_scanner^.skipspace;
  696. if assigned(current_module^.locallibrarysearchpath) then
  697. stringdispose(current_module^.locallibrarysearchpath);
  698. current_module^.locallibrarysearchpath:=stringdup(current_scanner^.readcomment);
  699. end;
  700. end;
  701. procedure dir_objectpath(t:tdirectivetoken);
  702. begin
  703. if not current_module^.in_global then
  704. Message(scan_w_switch_is_global)
  705. else
  706. begin
  707. current_scanner^.skipspace;
  708. if assigned(current_module^.localobjectsearchpath) then
  709. stringdispose(current_module^.localobjectsearchpath);
  710. current_module^.localobjectsearchpath:=stringdup(current_scanner^.readcomment);
  711. end;
  712. end;
  713. procedure dir_mode(t:tdirectivetoken);
  714. begin
  715. if not current_module^.in_global then
  716. Message(scan_w_switch_is_global)
  717. else
  718. begin
  719. current_scanner^.skipspace;
  720. current_scanner^.readstring;
  721. if pattern='DEFAULT' then
  722. aktmodeswitches:=initmodeswitches
  723. else
  724. if pattern='DELPHI' then
  725. aktmodeswitches:=delphimodeswitches
  726. else
  727. if pattern='TP' then
  728. aktmodeswitches:=tpmodeswitches
  729. else
  730. if pattern='FPC' then
  731. aktmodeswitches:=fpcmodeswitches
  732. else
  733. if pattern='OBJFPC' then
  734. aktmodeswitches:=objfpcmodeswitches
  735. else
  736. if pattern='GPC' then
  737. aktmodeswitches:=gpcmodeswitches
  738. else
  739. Message(scan_w_illegal_switch);
  740. end;
  741. end;
  742. procedure dir_packrecords(t:tdirectivetoken);
  743. var
  744. hs : string;
  745. begin
  746. current_scanner^.skipspace;
  747. if not(c in ['0'..'9']) then
  748. begin
  749. hs:=current_scanner^.readid;
  750. if (hs='C') then
  751. aktpackrecords:=packrecord_C
  752. else
  753. if (hs='NORMAL') or (hs='DEFAULT') then
  754. aktpackrecords:=packrecord_2
  755. else
  756. Message(scan_w_only_pack_records);
  757. end
  758. else
  759. begin
  760. case current_scanner^.readval of
  761. 1 : aktpackrecords:=packrecord_1;
  762. 2 : aktpackrecords:=packrecord_2;
  763. 4 : aktpackrecords:=packrecord_4;
  764. 8 : aktpackrecords:=packrecord_8;
  765. 16 : aktpackrecords:=packrecord_16;
  766. 32 : aktpackrecords:=packrecord_32;
  767. else
  768. Message(scan_w_only_pack_records);
  769. end;
  770. end;
  771. end;
  772. procedure dir_packenum(t:tdirectivetoken);
  773. var
  774. hs : string;
  775. begin
  776. if t in [_DIR_Z1,_DIR_Z2,_DIR_Z4] then
  777. begin
  778. aktpackenum:=ord(pattern[2])-ord('0');
  779. exit;
  780. end;
  781. current_scanner^.skipspace;
  782. if not(c in ['0'..'9']) then
  783. begin
  784. hs:=current_scanner^.readid;
  785. if (hs='NORMAL') or (hs='DEFAULT') then
  786. aktpackenum:=4
  787. else
  788. Message(scan_w_only_pack_enum);
  789. end
  790. else
  791. begin
  792. case current_scanner^.readval of
  793. 1 : aktpackenum:=1;
  794. 2 : aktpackenum:=2;
  795. 4 : aktpackenum:=4;
  796. else
  797. Message(scan_w_only_pack_enum);
  798. end;
  799. end;
  800. end;
  801. procedure dir_apptype(t:tdirectivetoken);
  802. var
  803. hs : string;
  804. begin
  805. if target_info.target<>target_i386_win32 then
  806. Message(scan_w_app_type_not_support);
  807. if not current_module^.in_global then
  808. Message(scan_w_switch_is_global)
  809. else
  810. begin
  811. current_scanner^.skipspace;
  812. hs:=current_scanner^.readid;
  813. if hs='GUI' then
  814. apptype:=at_gui
  815. else if hs='CONSOLE' then
  816. apptype:=at_cui
  817. else
  818. Message1(scan_w_unsupported_app_type,hs);
  819. end;
  820. end;
  821. procedure dir_wait(t:tdirectivetoken);
  822. var had_info : boolean;
  823. begin
  824. had_info:=(status.verbosity and V_Info)<>0;
  825. { this message should allways appear !! }
  826. status.verbosity:=status.verbosity or V_Info;
  827. Message(scan_i_press_enter);
  828. readln;
  829. If not(had_info) then
  830. status.verbosity:=status.verbosity and (not V_Info);
  831. end;
  832. procedure dir_asmmode(t:tdirectivetoken);
  833. var
  834. s : string;
  835. begin
  836. If Inside_asm_statement then
  837. Message1(scan_w_no_asm_reader_switch_inside_asm,s);
  838. current_scanner^.skipspace;
  839. s:=current_scanner^.readid;
  840. if s='DEFAULT' then
  841. aktasmmode:=initasmmode
  842. else
  843. if not set_string_asmmode(s,aktasmmode) then
  844. Message1(scan_w_unsupported_asmmode_specifier,s);
  845. end;
  846. procedure dir_oldasmmode(t:tdirectivetoken);
  847. begin
  848. If Inside_asm_statement then
  849. Message1(scan_w_no_asm_reader_switch_inside_asm,directive[t]);
  850. {$ifdef i386}
  851. case t of
  852. _DIR_I386_ATT : aktasmmode:=asmmode_i386_att;
  853. _DIR_I386_DIRECT : aktasmmode:=asmmode_i386_direct;
  854. _DIR_I386_INTEL : aktasmmode:=asmmode_i386_intel;
  855. end;
  856. {$endif i386}
  857. end;
  858. procedure dir_delphiswitch(t:tdirectivetoken);
  859. var
  860. sw,state : char;
  861. begin
  862. case t of
  863. _DIR_ALIGN : sw:='A';
  864. _DIR_ASSERTIONS : sw:='C';
  865. _DIR_BOOLEVAL : sw:='B';
  866. _DIR_DEBUGINFO : sw:='D';
  867. _DIR_IOCHECKS : sw:='I';
  868. _DIR_LOCALSYMBOLS : sw:='L';
  869. _DIR_LONGSTRINGS : sw:='H';
  870. _DIR_OPENSTRINGS : sw:='P';
  871. _DIR_OVERFLOWCHECKS : sw:='Q';
  872. _DIR_RANGECHECKS : sw:='R';
  873. _DIR_REFERENCEINFO : sw:='Y';
  874. _DIR_STACKFRAMES : sw:='W';
  875. _DIR_TYPEDADDRESS : sw:='T';
  876. _DIR_TYPEINFO : sw:='M';
  877. _DIR_VARSTRINGCHECKS : sw:='V';
  878. else
  879. exit;
  880. end;
  881. { c contains the next char, a + or - would be fine }
  882. state:=current_scanner^.readstate;
  883. if state in ['-','+'] then
  884. HandleSwitch(sw,state);
  885. end;
  886. procedure dir_memory(t:tdirectivetoken);
  887. var
  888. l : longint;
  889. begin
  890. current_scanner^.skipspace;
  891. l:=current_scanner^.readval;
  892. if l>1024 then
  893. stacksize:=l;
  894. current_scanner^.skipspace;
  895. if c=',' then
  896. begin
  897. current_scanner^.readchar;
  898. current_scanner^.skipspace;
  899. l:=current_scanner^.readval;
  900. if l>1024 then
  901. heapsize:=l;
  902. end;
  903. if c=',' then
  904. begin
  905. current_scanner^.readchar;
  906. current_scanner^.skipspace;
  907. l:=current_scanner^.readval;
  908. { Ignore this value, because the limit is set by the OS
  909. info and shouldn't be changed by the user (PFV) }
  910. end;
  911. end;
  912. procedure dir_setverbose(t:tdirectivetoken);
  913. var
  914. flag,
  915. state : char;
  916. begin
  917. case t of
  918. _DIR_HINTS : flag:='H';
  919. _DIR_WARNINGS : flag:='W';
  920. _DIR_NOTES : flag:='N';
  921. else
  922. exit;
  923. end;
  924. { support ON/OFF }
  925. state:=current_scanner^.ReadState;
  926. SetVerbosity(flag+state);
  927. end;
  928. type
  929. tdirectiveproc=procedure(t:tdirectivetoken);
  930. const
  931. directiveproc:array[tdirectivetoken] of tdirectiveproc=(
  932. {_DIR_NONE} nil,
  933. {_DIR_ALIGN} dir_delphiswitch,
  934. {_DIR_APPTYPE} dir_apptype,
  935. {_DIR_ASMMODE} dir_asmmode,
  936. {_DIR_ASSERTION} dir_delphiswitch,
  937. {_DIR_BOOLEVAL} dir_delphiswitch,
  938. {_DIR_D} dir_description,
  939. {_DIR_DEBUGINFO} dir_delphiswitch,
  940. {_DIR_DEFINE} dir_define,
  941. {_DIR_DESCRIPTION} dir_description,
  942. {_DIR_ELSE} dir_conditional,
  943. {_DIR_ENDIF} dir_conditional,
  944. {_DIR_ERROR} dir_message,
  945. {_DIR_EXTENDEDSYNTAX} dir_delphiswitch,
  946. {_DIR_FATAL} dir_message,
  947. {_DIR_GOTO} dir_moduleswitch,
  948. {_DIR_HINT} dir_message,
  949. {_DIR_HINTS} dir_setverbose,
  950. {_DIR_I} dir_include,
  951. {_DIR_I386_ATT} dir_oldasmmode,
  952. {_DIR_I386_DIRECT} dir_oldasmmode,
  953. {_DIR_I386_INTEL} dir_oldasmmode,
  954. {_DIR_IOCHECKS} dir_delphiswitch,
  955. {_DIR_IF} dir_conditional,
  956. {_DIR_IFDEF} dir_conditional,
  957. {_DIR_IFNDEF} dir_conditional,
  958. {_DIR_IFOPT} dir_conditional,
  959. {_DIR_INCLUDE} dir_include,
  960. {_DIR_INCLUDEPATH} dir_includepath,
  961. {_DIR_INFO} dir_message,
  962. {_DIR_INLINE} dir_moduleswitch,
  963. {_DIR_L} dir_linkobject,
  964. {_DIR_LIBRARYPATH} dir_librarypath,
  965. {_DIR_LINK} dir_linkobject,
  966. {_DIR_LINKLIB} dir_linklib,
  967. {_DIR_LOCALSYMBOLS} dir_delphiswitch,
  968. {_DIR_LONGSTRINGS} dir_delphiswitch,
  969. {_DIR_M} dir_memory,
  970. {_DIR_MACRO} dir_moduleswitch,
  971. {_DIR_MEMORY} dir_memory,
  972. {_DIR_MESSAGE} dir_message,
  973. {_DIR_MINENUMSIZE} dir_packenum,
  974. {_DIR_MMX} dir_localswitch,
  975. {_DIR_MODE} dir_mode,
  976. {_DIR_NOTE} dir_message,
  977. {_DIR_NOTES} dir_setverbose,
  978. {_DIR_OBJECTPATH} dir_objectpath,
  979. {_DIR_OPENSTRINGS} dir_delphiswitch,
  980. {_DIR_OUTPUT_FORMAT} dir_outputformat,
  981. {_DIR_OVERFLOWCHECKS} dir_delphiswitch,
  982. {_DIR_PACKENUM} dir_packenum,
  983. {_DIR_PACKRECORDS} dir_packrecords,
  984. {_DIR_R} dir_resource,
  985. {_DIR_RANGECHECKS} dir_delphiswitch,
  986. {_DIR_REFERENCEINFO} dir_delphiswitch,
  987. {_DIR_SATURATION} dir_localswitch,
  988. {_DIR_SMARTLINK} dir_moduleswitch,
  989. {_DIR_STACKFRAMES} dir_delphiswitch,
  990. {_DIR_STATIC} dir_moduleswitch,
  991. {_DIR_STOP} dir_message,
  992. {_DIR_TYPEDADDRESS} dir_delphiswitch,
  993. {_DIR_TYPEINFO} dir_delphiswitch,
  994. {_DIR_UNDEF} dir_undef,
  995. {_DIR_UNITPATH} dir_unitpath,
  996. {_DIR_VARSTRINGCHECKS} dir_delphiswitch,
  997. {_DIR_WAIT} dir_wait,
  998. {_DIR_WARNING} dir_message,
  999. {_DIR_WARNINGS} dir_setverbose,
  1000. {_DIR_Z1} dir_packenum,
  1001. {_DIR_Z2} dir_packenum,
  1002. {_DIR_Z4} dir_packenum
  1003. );
  1004. {-------------------------------------------
  1005. Main switches handling
  1006. -------------------------------------------}
  1007. procedure handledirectives;
  1008. var
  1009. t : tdirectivetoken;
  1010. p : tdirectiveproc;
  1011. hs : string;
  1012. begin
  1013. current_scanner^.gettokenpos;
  1014. current_scanner^.readchar; {Remove the $}
  1015. hs:=current_scanner^.readid;
  1016. Message1(scan_d_handling_switch,'$'+hs);
  1017. if hs='' then
  1018. Message1(scan_w_illegal_switch,'$'+hs);
  1019. { Check for compiler switches }
  1020. while (length(hs)=1) and (c in ['-','+']) do
  1021. begin
  1022. HandleSwitch(hs[1],c);
  1023. current_scanner^.readchar; {Remove + or -}
  1024. if c=',' then
  1025. begin
  1026. current_scanner^.readchar; {Remove , }
  1027. { read next switch, support $v+,$+}
  1028. hs:=current_scanner^.readid;
  1029. if (hs='') then
  1030. begin
  1031. if (c='$') and (m_fpc in aktmodeswitches) then
  1032. begin
  1033. current_scanner^.readchar; { skip $ }
  1034. hs:=current_scanner^.readid;
  1035. end;
  1036. if (hs='') then
  1037. Message1(scan_w_illegal_directive,'$'+c);
  1038. end
  1039. else
  1040. Message1(scan_d_handling_switch,'$'+hs);
  1041. end
  1042. else
  1043. hs:='';
  1044. end;
  1045. { directives may follow switches after a , }
  1046. if hs<>'' then
  1047. begin
  1048. t:=Get_Directive(hs);
  1049. if t<>_DIR_NONE then
  1050. begin
  1051. p:=directiveproc[t];
  1052. {$ifndef TP}
  1053. if assigned(p) then
  1054. {$else}
  1055. if @p<>nil then
  1056. {$endif}
  1057. p(t);
  1058. end
  1059. else
  1060. Message1(scan_w_illegal_directive,'$'+hs);
  1061. { conditionals already read the comment }
  1062. if (current_scanner^.comment_level>0) then
  1063. current_scanner^.readcomment;
  1064. { we've read the whole comment }
  1065. aktcommentstyle:=comment_none;
  1066. end;
  1067. end;
  1068. {
  1069. $Log$
  1070. Revision 1.63 1999-09-20 16:39:02 peter
  1071. * cs_create_smart instead of cs_smartlink
  1072. * -CX is create smartlink
  1073. * -CD is create dynamic, but does nothing atm.
  1074. Revision 1.62 1999/09/03 10:00:49 peter
  1075. * included the 1.60 version of Pierre which was lost !
  1076. Revision 1.61 1999/09/02 18:47:46 daniel
  1077. * Could not compile with TP, some arrays moved to heap
  1078. * NOAG386BIN default for TP
  1079. * AG386* files were not compatible with TP, fixed.
  1080. Revision 1.60 1999/08/31 15:55:45 pierre
  1081. + tmacrosym.is_used set
  1082. Revision 1.59 1999/08/05 16:53:10 peter
  1083. * V_Fatal=1, all other V_ are also increased
  1084. * Check for local procedure when assigning procvar
  1085. * fixed comment parsing because directives
  1086. * oldtp mode directives better supported
  1087. * added some messages to errore.msg
  1088. Revision 1.58 1999/08/04 13:03:03 jonas
  1089. * all tokens now start with an underscore
  1090. * PowerPC compiles!!
  1091. Revision 1.57 1999/07/26 14:55:36 florian
  1092. * $mode gives now a warning if an unknown mode keyword follows
  1093. Revision 1.56 1999/07/23 16:05:27 peter
  1094. * alignment is now saved in the symtable
  1095. * C alignment added for records
  1096. * PPU version increased to solve .12 <-> .13 probs
  1097. Revision 1.55 1999/07/16 10:04:36 peter
  1098. * merged
  1099. Revision 1.54 1999/07/03 00:29:58 peter
  1100. * new link writing to the ppu, one .ppu is needed for all link types,
  1101. static (.o) is now always created also when smartlinking is used
  1102. Revision 1.53.2.1 1999/07/16 09:53:06 peter
  1103. * ignore maxheapsize
  1104. Revision 1.53 1999/06/02 22:44:18 pierre
  1105. * previous wrong log corrected
  1106. Revision 1.52 1999/06/02 22:25:48 pierre
  1107. * changed $ifdef FPC @ into $ifndef TP
  1108. Revision 1.51 1999/04/07 14:36:45 pierre
  1109. + better preproc stack checking and report
  1110. Revision 1.50 1999/03/31 13:55:20 peter
  1111. * assembler inlining working for ag386bin
  1112. Revision 1.49 1999/03/26 00:05:44 peter
  1113. * released valintern
  1114. + deffile is now removed when compiling is finished
  1115. * ^( compiles now correct
  1116. + static directive
  1117. * shrd fixed
  1118. Revision 1.48 1999/03/25 16:55:34 peter
  1119. + unitpath,librarypath,includepath,objectpath directives
  1120. Revision 1.47 1999/02/22 13:07:05 pierre
  1121. + -b and -bl options work !
  1122. + cs_local_browser ($L+) is disabled if cs_browser ($Y+)
  1123. is not enabled when quitting global section
  1124. * local vars and procedures are not yet stored into PPU
  1125. Revision 1.46 1999/02/05 08:51:16 pierre
  1126. * $L default extension from resext to objext
  1127. Revision 1.45 1998/12/28 23:26:25 peter
  1128. + resource file handling ($R directive) for Win32
  1129. Revision 1.44 1998/12/15 10:23:29 peter
  1130. + -iSO, -iSP, -iTO, -iTP
  1131. Revision 1.43 1998/11/16 15:41:43 peter
  1132. * tp7 didn't like my ifopt H+ :(
  1133. Revision 1.42 1998/11/16 12:18:04 peter
  1134. * H+ fixes
  1135. Revision 1.41 1998/10/22 17:54:08 florian
  1136. + switch $APPTYPE for win32 added
  1137. Revision 1.40 1998/10/21 20:16:04 peter
  1138. * beter line info for conditionals
  1139. Revision 1.39 1998/10/13 16:50:21 pierre
  1140. * undid some changes of Peter that made the compiler wrong
  1141. for m68k (I had to reinsert some ifdefs)
  1142. * removed several memory leaks under m68k
  1143. * removed the meory leaks for assembler readers
  1144. * cross compiling shoud work again better
  1145. ( crosscompiling sysamiga works
  1146. but as68k still complain about some code !)
  1147. Revision 1.38 1998/10/13 13:10:28 peter
  1148. * new style for m68k/i386 infos and enums
  1149. Revision 1.37 1998/10/08 23:29:04 peter
  1150. * -vu shows unit info, -vt shows tried/used files
  1151. Revision 1.36 1998/10/08 17:17:29 pierre
  1152. * current_module old scanner tagged as invalid if unit is recompiled
  1153. + added ppheap for better info on tracegetmem of heaptrc
  1154. (adds line column and file index)
  1155. * several memory leaks removed ith help of heaptrc !!
  1156. Revision 1.35 1998/10/08 13:44:39 peter
  1157. * fixed $I %date% not in uppercase
  1158. Revision 1.34 1998/09/28 16:57:24 pierre
  1159. * changed all length(p^.value_str^) into str_length(p)
  1160. to get it work with and without ansistrings
  1161. * changed sourcefiles field of tmodule to a pointer
  1162. Revision 1.33 1998/09/26 17:45:40 peter
  1163. + idtoken and only one token table
  1164. Revision 1.32 1998/09/24 23:49:19 peter
  1165. + aktmodeswitches
  1166. Revision 1.31 1998/09/18 16:03:44 florian
  1167. * some changes to compile with Delphi
  1168. Revision 1.30 1998/09/16 16:41:47 peter
  1169. * merged fixes
  1170. Revision 1.28.2.1 1998/09/16 16:09:51 peter
  1171. * on/off support also for the local/module switches
  1172. Revision 1.29 1998/09/11 09:19:53 daniel
  1173. * Removed tabs.
  1174. Revision 1.28 1998/09/10 15:25:36 daniel
  1175. + Added maxheapsize.
  1176. * Corrected semi-bug in calling the assembler and the linker
  1177. Revision 1.27 1998/09/09 15:33:59 peter
  1178. * removed warnings
  1179. Revision 1.26 1998/09/03 11:24:02 peter
  1180. * moved more inputfile things from tscannerfile to tinputfile
  1181. * changed ifdef Sourceline to cs_asm_source
  1182. Revision 1.25 1998/09/02 15:13:31 peter
  1183. * fixed typo in directive table
  1184. Revision 1.24 1998/09/01 12:52:06 peter
  1185. + a lot of delphi switches
  1186. Revision 1.23 1998/08/26 15:35:34 peter
  1187. * fixed scannerfiles for macros
  1188. + $I %<environment>%
  1189. Revision 1.22 1998/08/19 14:57:50 peter
  1190. * small fix for aktfilepos
  1191. Revision 1.20 1998/08/18 15:11:52 peter
  1192. * recompiles again
  1193. Revision 1.19 1998/08/18 09:24:44 pierre
  1194. * small warning position bug fixed
  1195. * support_mmx switches splitting was missing
  1196. * rhide error and warning output corrected
  1197. Revision 1.18 1998/08/10 14:50:25 peter
  1198. + localswitches, moduleswitches, globalswitches splitting
  1199. Revision 1.17 1998/08/10 09:56:04 peter
  1200. * path to the include file is also written to the debug output
  1201. Revision 1.16 1998/08/04 22:03:44 michael
  1202. + fixed dir_include search() call
  1203. Revision 1.15 1998/07/14 21:46:55 peter
  1204. * updated messages file
  1205. Revision 1.14 1998/07/14 14:47:03 peter
  1206. * released NEWINPUT
  1207. Revision 1.13 1998/07/07 12:32:54 peter
  1208. * status.currentsource is now calculated in verbose (more accurated)
  1209. Revision 1.12 1998/07/07 11:20:10 peter
  1210. + NEWINPUT for a better inputfile and scanner object
  1211. Revision 1.11 1998/06/04 23:51:59 peter
  1212. * m68k compiles
  1213. + .def file creation moved to gendef.pas so it could also be used
  1214. for win32
  1215. Revision 1.10 1998/05/30 14:31:10 peter
  1216. + $ASMMODE
  1217. Revision 1.9 1998/05/23 01:21:28 peter
  1218. + aktasmmode, aktoptprocessor, aktoutputformat
  1219. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  1220. + $LIBNAME to set the library name where the unit will be put in
  1221. * splitted cgi386 a bit (codeseg to large for bp7)
  1222. * nasm, tasm works again. nasm moved to ag386nsm.pas
  1223. Revision 1.8 1998/05/11 13:07:57 peter
  1224. + $ifdef NEWPPU for the new ppuformat
  1225. + $define GDB not longer required
  1226. * removed all warnings and stripped some log comments
  1227. * no findfirst/findnext anymore to remove smartlink *.o files
  1228. Revision 1.7 1998/05/08 09:21:20 michael
  1229. * Added missing -Fl message to messages file.
  1230. * Corrected mangling of file names when doing Linklib
  1231. * -Fl now actually WORKS.
  1232. * Librarysearchpath is now a field in linker object.
  1233. Revision 1.6 1998/05/04 17:54:28 peter
  1234. + smartlinking works (only case jumptable left todo)
  1235. * redesign of systems.pas to support assemblers and linkers
  1236. + Unitname is now also in the PPU-file, increased version to 14
  1237. Revision 1.5 1998/04/30 15:59:42 pierre
  1238. * GDB works again better :
  1239. correct type info in one pass
  1240. + UseTokenInfo for better source position
  1241. * fixed one remaining bug in scanner for line counts
  1242. * several little fixes
  1243. Revision 1.4 1998/04/29 13:42:27 peter
  1244. + $IOCHECKS and $ALIGN to test already, other will follow soon
  1245. * fixed the wrong linecounting with comments
  1246. Revision 1.3 1998/04/28 11:45:53 florian
  1247. * make it compilable with TP
  1248. + small COM problems solved to compile classes.pp
  1249. Revision 1.2 1998/04/28 10:09:54 pierre
  1250. * typo error in asm style reading corrected
  1251. Revision 1.1 1998/04/27 23:13:53 peter
  1252. + the new files for the scanner
  1253. }