scandir.inc 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391
  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_smartlink;
  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.62 1999-09-03 10:00:49 peter
  1071. * included the 1.60 version of Pierre which was lost !
  1072. Revision 1.61 1999/09/02 18:47:46 daniel
  1073. * Could not compile with TP, some arrays moved to heap
  1074. * NOAG386BIN default for TP
  1075. * AG386* files were not compatible with TP, fixed.
  1076. Revision 1.60 1999/08/31 15:55:45 pierre
  1077. + tmacrosym.is_used set
  1078. Revision 1.59 1999/08/05 16:53:10 peter
  1079. * V_Fatal=1, all other V_ are also increased
  1080. * Check for local procedure when assigning procvar
  1081. * fixed comment parsing because directives
  1082. * oldtp mode directives better supported
  1083. * added some messages to errore.msg
  1084. Revision 1.58 1999/08/04 13:03:03 jonas
  1085. * all tokens now start with an underscore
  1086. * PowerPC compiles!!
  1087. Revision 1.57 1999/07/26 14:55:36 florian
  1088. * $mode gives now a warning if an unknown mode keyword follows
  1089. Revision 1.56 1999/07/23 16:05:27 peter
  1090. * alignment is now saved in the symtable
  1091. * C alignment added for records
  1092. * PPU version increased to solve .12 <-> .13 probs
  1093. Revision 1.55 1999/07/16 10:04:36 peter
  1094. * merged
  1095. Revision 1.54 1999/07/03 00:29:58 peter
  1096. * new link writing to the ppu, one .ppu is needed for all link types,
  1097. static (.o) is now always created also when smartlinking is used
  1098. Revision 1.53.2.1 1999/07/16 09:53:06 peter
  1099. * ignore maxheapsize
  1100. Revision 1.53 1999/06/02 22:44:18 pierre
  1101. * previous wrong log corrected
  1102. Revision 1.52 1999/06/02 22:25:48 pierre
  1103. * changed $ifdef FPC @ into $ifndef TP
  1104. Revision 1.51 1999/04/07 14:36:45 pierre
  1105. + better preproc stack checking and report
  1106. Revision 1.50 1999/03/31 13:55:20 peter
  1107. * assembler inlining working for ag386bin
  1108. Revision 1.49 1999/03/26 00:05:44 peter
  1109. * released valintern
  1110. + deffile is now removed when compiling is finished
  1111. * ^( compiles now correct
  1112. + static directive
  1113. * shrd fixed
  1114. Revision 1.48 1999/03/25 16:55:34 peter
  1115. + unitpath,librarypath,includepath,objectpath directives
  1116. Revision 1.47 1999/02/22 13:07:05 pierre
  1117. + -b and -bl options work !
  1118. + cs_local_browser ($L+) is disabled if cs_browser ($Y+)
  1119. is not enabled when quitting global section
  1120. * local vars and procedures are not yet stored into PPU
  1121. Revision 1.46 1999/02/05 08:51:16 pierre
  1122. * $L default extension from resext to objext
  1123. Revision 1.45 1998/12/28 23:26:25 peter
  1124. + resource file handling ($R directive) for Win32
  1125. Revision 1.44 1998/12/15 10:23:29 peter
  1126. + -iSO, -iSP, -iTO, -iTP
  1127. Revision 1.43 1998/11/16 15:41:43 peter
  1128. * tp7 didn't like my ifopt H+ :(
  1129. Revision 1.42 1998/11/16 12:18:04 peter
  1130. * H+ fixes
  1131. Revision 1.41 1998/10/22 17:54:08 florian
  1132. + switch $APPTYPE for win32 added
  1133. Revision 1.40 1998/10/21 20:16:04 peter
  1134. * beter line info for conditionals
  1135. Revision 1.39 1998/10/13 16:50:21 pierre
  1136. * undid some changes of Peter that made the compiler wrong
  1137. for m68k (I had to reinsert some ifdefs)
  1138. * removed several memory leaks under m68k
  1139. * removed the meory leaks for assembler readers
  1140. * cross compiling shoud work again better
  1141. ( crosscompiling sysamiga works
  1142. but as68k still complain about some code !)
  1143. Revision 1.38 1998/10/13 13:10:28 peter
  1144. * new style for m68k/i386 infos and enums
  1145. Revision 1.37 1998/10/08 23:29:04 peter
  1146. * -vu shows unit info, -vt shows tried/used files
  1147. Revision 1.36 1998/10/08 17:17:29 pierre
  1148. * current_module old scanner tagged as invalid if unit is recompiled
  1149. + added ppheap for better info on tracegetmem of heaptrc
  1150. (adds line column and file index)
  1151. * several memory leaks removed ith help of heaptrc !!
  1152. Revision 1.35 1998/10/08 13:44:39 peter
  1153. * fixed $I %date% not in uppercase
  1154. Revision 1.34 1998/09/28 16:57:24 pierre
  1155. * changed all length(p^.value_str^) into str_length(p)
  1156. to get it work with and without ansistrings
  1157. * changed sourcefiles field of tmodule to a pointer
  1158. Revision 1.33 1998/09/26 17:45:40 peter
  1159. + idtoken and only one token table
  1160. Revision 1.32 1998/09/24 23:49:19 peter
  1161. + aktmodeswitches
  1162. Revision 1.31 1998/09/18 16:03:44 florian
  1163. * some changes to compile with Delphi
  1164. Revision 1.30 1998/09/16 16:41:47 peter
  1165. * merged fixes
  1166. Revision 1.28.2.1 1998/09/16 16:09:51 peter
  1167. * on/off support also for the local/module switches
  1168. Revision 1.29 1998/09/11 09:19:53 daniel
  1169. * Removed tabs.
  1170. Revision 1.28 1998/09/10 15:25:36 daniel
  1171. + Added maxheapsize.
  1172. * Corrected semi-bug in calling the assembler and the linker
  1173. Revision 1.27 1998/09/09 15:33:59 peter
  1174. * removed warnings
  1175. Revision 1.26 1998/09/03 11:24:02 peter
  1176. * moved more inputfile things from tscannerfile to tinputfile
  1177. * changed ifdef Sourceline to cs_asm_source
  1178. Revision 1.25 1998/09/02 15:13:31 peter
  1179. * fixed typo in directive table
  1180. Revision 1.24 1998/09/01 12:52:06 peter
  1181. + a lot of delphi switches
  1182. Revision 1.23 1998/08/26 15:35:34 peter
  1183. * fixed scannerfiles for macros
  1184. + $I %<environment>%
  1185. Revision 1.22 1998/08/19 14:57:50 peter
  1186. * small fix for aktfilepos
  1187. Revision 1.20 1998/08/18 15:11:52 peter
  1188. * recompiles again
  1189. Revision 1.19 1998/08/18 09:24:44 pierre
  1190. * small warning position bug fixed
  1191. * support_mmx switches splitting was missing
  1192. * rhide error and warning output corrected
  1193. Revision 1.18 1998/08/10 14:50:25 peter
  1194. + localswitches, moduleswitches, globalswitches splitting
  1195. Revision 1.17 1998/08/10 09:56:04 peter
  1196. * path to the include file is also written to the debug output
  1197. Revision 1.16 1998/08/04 22:03:44 michael
  1198. + fixed dir_include search() call
  1199. Revision 1.15 1998/07/14 21:46:55 peter
  1200. * updated messages file
  1201. Revision 1.14 1998/07/14 14:47:03 peter
  1202. * released NEWINPUT
  1203. Revision 1.13 1998/07/07 12:32:54 peter
  1204. * status.currentsource is now calculated in verbose (more accurated)
  1205. Revision 1.12 1998/07/07 11:20:10 peter
  1206. + NEWINPUT for a better inputfile and scanner object
  1207. Revision 1.11 1998/06/04 23:51:59 peter
  1208. * m68k compiles
  1209. + .def file creation moved to gendef.pas so it could also be used
  1210. for win32
  1211. Revision 1.10 1998/05/30 14:31:10 peter
  1212. + $ASMMODE
  1213. Revision 1.9 1998/05/23 01:21:28 peter
  1214. + aktasmmode, aktoptprocessor, aktoutputformat
  1215. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  1216. + $LIBNAME to set the library name where the unit will be put in
  1217. * splitted cgi386 a bit (codeseg to large for bp7)
  1218. * nasm, tasm works again. nasm moved to ag386nsm.pas
  1219. Revision 1.8 1998/05/11 13:07:57 peter
  1220. + $ifdef NEWPPU for the new ppuformat
  1221. + $define GDB not longer required
  1222. * removed all warnings and stripped some log comments
  1223. * no findfirst/findnext anymore to remove smartlink *.o files
  1224. Revision 1.7 1998/05/08 09:21:20 michael
  1225. * Added missing -Fl message to messages file.
  1226. * Corrected mangling of file names when doing Linklib
  1227. * -Fl now actually WORKS.
  1228. * Librarysearchpath is now a field in linker object.
  1229. Revision 1.6 1998/05/04 17:54:28 peter
  1230. + smartlinking works (only case jumptable left todo)
  1231. * redesign of systems.pas to support assemblers and linkers
  1232. + Unitname is now also in the PPU-file, increased version to 14
  1233. Revision 1.5 1998/04/30 15:59:42 pierre
  1234. * GDB works again better :
  1235. correct type info in one pass
  1236. + UseTokenInfo for better source position
  1237. * fixed one remaining bug in scanner for line counts
  1238. * several little fixes
  1239. Revision 1.4 1998/04/29 13:42:27 peter
  1240. + $IOCHECKS and $ALIGN to test already, other will follow soon
  1241. * fixed the wrong linecounting with comments
  1242. Revision 1.3 1998/04/28 11:45:53 florian
  1243. * make it compilable with TP
  1244. + small COM problems solved to compile classes.pp
  1245. Revision 1.2 1998/04/28 10:09:54 pierre
  1246. * typo error in asm style reading corrected
  1247. Revision 1.1 1998/04/27 23:13:53 peter
  1248. + the new files for the scanner
  1249. }