scandir.inc 41 KB

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