domacro.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Id$ */
  6. /* PREPROCESSOR: CONTROLLINE INTERPRETER */
  7. #include "interface.h"
  8. #include "arith.h"
  9. #include "LLlex.h"
  10. #include "Lpars.h"
  11. #include "debug.h"
  12. #include "idf.h"
  13. #include "input.h"
  14. #include "nopp.h"
  15. #include "lint.h"
  16. #ifndef NOPP
  17. #include "ifdepth.h"
  18. #include "botch_free.h"
  19. #include "nparams.h"
  20. #include "parbufsize.h"
  21. #include "textsize.h"
  22. #include "idfsize.h"
  23. #include "assert.h"
  24. #include <alloc.h>
  25. #include "class.h"
  26. #include "macro.h"
  27. #include "dbsymtab.h"
  28. #ifdef DBSYMTAB
  29. #include <stb.h>
  30. #include <em.h>
  31. int IncludeLevel = 0;
  32. extern char options[];
  33. #endif
  34. IMPORT char **inctable; /* list of include directories */
  35. IMPORT char *getwdir();
  36. PRIVATE char ifstack[IFDEPTH]; /* if-stack: the content of an entry is */
  37. /* 1 if a corresponding ELSE has been */
  38. /* encountered. */
  39. int nestlevel = -1;
  40. PRIVATE do_include();
  41. PRIVATE ifexpr();
  42. PRIVATE do_define();
  43. PRIVATE push_if();
  44. PRIVATE do_elif();
  45. PRIVATE do_else();
  46. PRIVATE do_endif();
  47. PRIVATE do_if();
  48. PRIVATE do_ifdef();
  49. PRIVATE do_undef();
  50. PRIVATE int getparams();
  51. PRIVATE char *get_text();
  52. PRIVATE int macroeq();
  53. PRIVATE SkipRestOfLine();
  54. PRIVATE do_line();
  55. struct idf *
  56. GetIdentifier()
  57. {
  58. /* returns a pointer to the descriptor of the identifier that is
  59. read from the input stream. A null-pointer is returned if
  60. the input does not contain an identifier.
  61. The substitution of macros is disabled.
  62. */
  63. int tok;
  64. struct token tk;
  65. ReplaceMacros = 0;
  66. tok = GetToken(&tk);
  67. ReplaceMacros = 1;
  68. return tok == IDENTIFIER ? tk.tk_idf : (struct idf *)0;
  69. }
  70. /* domacro() is the control line interpreter. The '#' has already
  71. been read by the lexical analyzer by which domacro() is called.
  72. The token appearing directly after the '#' is obtained by calling
  73. the basic lexical analyzing function GetToken() and is interpreted
  74. to perform the action belonging to that token.
  75. An error message is produced when the token is not recognized,
  76. i.e. it is not one of "define" .. "undef" , integer or newline.
  77. */
  78. EXPORT
  79. domacro()
  80. {
  81. struct token tk; /* the token itself */
  82. EoiForNewline = 1;
  83. SkipEscNewline = 1;
  84. switch(GetToken(&tk)) { /* select control line action */
  85. case IDENTIFIER: /* is it a macro keyword? */
  86. switch (tk.tk_idf->id_resmac) {
  87. case K_DEFINE: /* "define" */
  88. do_define();
  89. break;
  90. case K_ELIF: /* "elif" */
  91. do_elif();
  92. break;
  93. case K_ELSE: /* "else" */
  94. do_else();
  95. break;
  96. case K_ENDIF: /* "endif" */
  97. do_endif();
  98. break;
  99. case K_IF: /* "if" */
  100. do_if();
  101. break;
  102. case K_IFDEF: /* "ifdef" */
  103. do_ifdef(1);
  104. break;
  105. case K_IFNDEF: /* "ifndef" */
  106. do_ifdef(0);
  107. break;
  108. case K_INCLUDE: /* "include" */
  109. do_include();
  110. break;
  111. case K_LINE: /* "line" */
  112. /* set LineNumber and FileName according to
  113. the arguments.
  114. */
  115. if (GetToken(&tk) != INTEGER) {
  116. lexerror("#line without linenumber");
  117. SkipRestOfLine();
  118. }
  119. else
  120. do_line((unsigned int)tk.tk_ival);
  121. break;
  122. case K_UNDEF: /* "undef" */
  123. do_undef();
  124. break;
  125. case K_PRAGMA: /* "pragma" */
  126. /* ignore for now
  127. */
  128. SkipRestOfLine();
  129. break;
  130. default:
  131. /* invalid word seen after the '#' */
  132. lexerror("%s: unknown control", tk.tk_idf->id_text);
  133. SkipRestOfLine();
  134. }
  135. break;
  136. case INTEGER: /* # <integer> [<filespecifier>]? */
  137. do_line((unsigned int)tk.tk_ival);
  138. break;
  139. case EOI: /* only `#' on this line: do nothing, ignore */
  140. break;
  141. default: /* invalid token following '#' */
  142. lexerror("illegal # line");
  143. SkipRestOfLine();
  144. }
  145. EoiForNewline = 0;
  146. SkipEscNewline = 0;
  147. }
  148. #ifdef LINT
  149. int lint_skip_comment;
  150. #endif
  151. PRIVATE
  152. skip_block(to_endif)
  153. {
  154. /* skip_block() skips the input from
  155. 1) a false #if, #ifdef, #ifndef or #elif until the
  156. corresponding #elif (resulting in true), #else or
  157. #endif is read.
  158. 2) a #else corresponding to a true #if, #ifdef,
  159. #ifndef or #elif until the corresponding #endif is
  160. seen.
  161. */
  162. register int ch;
  163. register int skiplevel = nestlevel; /* current nesting level */
  164. struct token tk;
  165. #ifdef LINT
  166. lint_skip_comment++;
  167. #endif
  168. NoUnstack++;
  169. for (;;) {
  170. LoadChar(ch); /* read first character after newline */
  171. if (ch != '#') {
  172. if (ch == EOI) {
  173. NoUnstack--;
  174. #ifdef LINT
  175. lint_skip_comment--;
  176. #endif
  177. return;
  178. }
  179. SkipRestOfLine();
  180. continue;
  181. }
  182. if (GetToken(&tk) != IDENTIFIER) {
  183. SkipRestOfLine();
  184. continue;
  185. }
  186. /* an IDENTIFIER: look for #if, #ifdef and #ifndef
  187. without interpreting them.
  188. Interpret #else, #elif and #endif if they occur
  189. on the same level.
  190. */
  191. switch(tk.tk_idf->id_resmac) {
  192. default:
  193. SkipRestOfLine();
  194. break;
  195. case K_IF:
  196. case K_IFDEF:
  197. case K_IFNDEF:
  198. push_if();
  199. SkipRestOfLine();
  200. break;
  201. case K_ELIF:
  202. if (ifstack[nestlevel])
  203. lexwarning("#elif without corresponding #if");
  204. if (! to_endif && nestlevel == skiplevel) {
  205. nestlevel--;
  206. push_if();
  207. if (ifexpr()) {
  208. NoUnstack--;
  209. #ifdef LINT
  210. lint_skip_comment--;
  211. #endif
  212. return;
  213. }
  214. }
  215. else SkipRestOfLine();
  216. break;
  217. case K_ELSE:
  218. if (ifstack[nestlevel])
  219. lexwarning("#else without corresponding #if");
  220. SkipRestOfLine();
  221. if (! to_endif) {
  222. ++(ifstack[nestlevel]);
  223. if (nestlevel == skiplevel) {
  224. NoUnstack--;
  225. #ifdef LINT
  226. lint_skip_comment--;
  227. #endif
  228. return;
  229. }
  230. }
  231. break;
  232. case K_ENDIF:
  233. ASSERT(nestlevel > nestlow);
  234. SkipRestOfLine();
  235. if (nestlevel == skiplevel) {
  236. nestlevel--;
  237. NoUnstack--;
  238. #ifdef LINT
  239. lint_skip_comment--;
  240. #endif
  241. return;
  242. }
  243. nestlevel--;
  244. break;
  245. }
  246. }
  247. }
  248. PRIVATE
  249. ifexpr()
  250. {
  251. /* ifexpr() returns whether the restricted constant
  252. expression following #if or #elif evaluates to true. This
  253. is done by calling the LLgen generated subparser for
  254. constant expressions. The result of this expression will
  255. be given in the extern long variable "ifval".
  256. */
  257. IMPORT arith ifval;
  258. int errors = err_occurred;
  259. ifval = (arith)0;
  260. AccDefined = 1;
  261. UnknownIdIsZero = 1;
  262. PushLex(); /* NEW parser */
  263. If_expr(); /* invoke constant expression parser */
  264. PopLex(); /* OLD parser */
  265. AccDefined = 0;
  266. UnknownIdIsZero = 0;
  267. return (errors == err_occurred) && (ifval != (arith)0);
  268. }
  269. PRIVATE
  270. do_include()
  271. {
  272. /* do_include() performs the inclusion of a file.
  273. */
  274. char *filenm;
  275. char *result;
  276. int tok;
  277. struct token tk;
  278. AccFileSpecifier = 1;
  279. if (((tok = GetToken(&tk)) == FILESPECIFIER) || tok == STRING)
  280. filenm = tk.tk_bts;
  281. else {
  282. lexerror("bad include syntax");
  283. filenm = (char *)0;
  284. }
  285. AccFileSpecifier = 0;
  286. SkipRestOfLine();
  287. inctable[0] = WorkingDir;
  288. if (filenm) {
  289. if (!InsertFile(filenm, &inctable[tok==FILESPECIFIER],&result)){
  290. fatal("cannot open include file \"%s\"", filenm);
  291. }
  292. else {
  293. add_dependency(result);
  294. WorkingDir = getwdir(result);
  295. File_Inserted = 1;
  296. FileName = result;
  297. LineNumber = 0;
  298. nestlow = nestlevel;
  299. #ifdef DBSYMTAB
  300. IncludeLevel++;
  301. if (options['g']) {
  302. C_ms_stb_cst(FileName, N_BINCL, 0, (arith) 0);
  303. }
  304. #endif /* DBSYMTAB */
  305. }
  306. }
  307. }
  308. PRIVATE
  309. do_define()
  310. {
  311. /* do_define() interprets a #define control line.
  312. */
  313. struct idf *id; /* the #defined identifier's descriptor */
  314. int nformals = -1; /* keep track of the number of formals */
  315. char *formals[NPARAMS]; /* pointers to the names of the formals */
  316. char parbuf[PARBUFSIZE]; /* names of formals */
  317. char *repl_text; /* start of the replacement text */
  318. int length; /* length of the replacement text */
  319. register ch;
  320. /* read the #defined macro's name */
  321. if (!(id = GetIdentifier())) {
  322. lexerror("#define: illegal macro name");
  323. SkipRestOfLine();
  324. return;
  325. }
  326. /* there is a formal parameter list if the identifier is
  327. followed immediately by a '('.
  328. */
  329. LoadChar(ch);
  330. if (ch == '(') {
  331. if ((nformals = getparams(formals, parbuf)) == -1) {
  332. SkipRestOfLine();
  333. return; /* an error occurred */
  334. }
  335. LoadChar(ch);
  336. }
  337. /* read the replacement text if there is any */
  338. ch = skipspaces(ch,0); /* find first character of the text */
  339. ASSERT(ch != EOI);
  340. if (class(ch) == STNL) {
  341. /* Treat `#define something' as `#define something ""'
  342. */
  343. repl_text = "";
  344. length = 0;
  345. }
  346. else {
  347. PushBack();
  348. repl_text = get_text((nformals > 0) ? formals : 0, &length);
  349. }
  350. macro_def(id, repl_text, nformals, length, NOFLAG);
  351. LineNumber++;
  352. }
  353. PRIVATE
  354. push_if()
  355. {
  356. if (nestlevel >= IFDEPTH)
  357. fatal("too many nested #if/#ifdef/#ifndef");
  358. else
  359. ifstack[++nestlevel] = 0;
  360. }
  361. PRIVATE
  362. do_elif()
  363. {
  364. if (nestlevel <= nestlow || (ifstack[nestlevel])) {
  365. lexerror("#elif without corresponding #if");
  366. SkipRestOfLine();
  367. }
  368. else { /* restart at this level as if a #if is detected. */
  369. nestlevel--;
  370. push_if();
  371. skip_block(1);
  372. }
  373. }
  374. PRIVATE
  375. do_else()
  376. {
  377. SkipRestOfLine();
  378. if (nestlevel <= nestlow || (ifstack[nestlevel]))
  379. lexerror("#else without corresponding #if");
  380. else { /* mark this level as else-d */
  381. ++(ifstack[nestlevel]);
  382. skip_block(1);
  383. }
  384. }
  385. PRIVATE
  386. do_endif()
  387. {
  388. SkipRestOfLine();
  389. if (nestlevel <= nestlow) {
  390. lexerror("#endif without corresponding #if");
  391. }
  392. else nestlevel--;
  393. }
  394. PRIVATE
  395. do_if()
  396. {
  397. push_if();
  398. if (!ifexpr()) /* a false #if/#elif expression */
  399. skip_block(0);
  400. }
  401. PRIVATE
  402. do_ifdef(how)
  403. {
  404. register struct idf *id;
  405. /* how == 1 : ifdef; how == 0 : ifndef
  406. */
  407. push_if();
  408. if (!(id = GetIdentifier()))
  409. lexerror("illegal #ifdef construction");
  410. /* The next test is a shorthand for:
  411. (how && !id->id_macro) || (!how && id->id_macro)
  412. */
  413. if (how ^ (id && id->id_macro != 0))
  414. skip_block(0);
  415. else
  416. SkipRestOfLine();
  417. }
  418. PRIVATE
  419. do_undef()
  420. {
  421. register struct idf *id;
  422. /* Forget a macro definition. */
  423. if (id = GetIdentifier()) {
  424. if (id->id_macro) { /* forget the macro */
  425. free_macro(id->id_macro);
  426. id->id_macro = (struct macro *) 0;
  427. } /* else: don't complain */
  428. }
  429. else
  430. lexerror("illegal #undef construction");
  431. SkipRestOfLine();
  432. }
  433. PRIVATE int
  434. getparams(buf, parbuf)
  435. char *buf[];
  436. char parbuf[];
  437. {
  438. /* getparams() reads the formal parameter list of a macro
  439. definition.
  440. The number of parameters is returned.
  441. As a formal parameter list is expected when calling this
  442. routine, -1 is returned if an error is detected, for
  443. example:
  444. #define one(1), where 1 is not an identifier.
  445. Note that the '(' has already been eaten.
  446. The names of the formal parameters are stored into parbuf.
  447. */
  448. register char **pbuf = &buf[0];
  449. register int c;
  450. register char *ptr = &parbuf[0];
  451. register char **pbuf2;
  452. LoadChar(c);
  453. c = skipspaces(c,0);
  454. if (c == ')') { /* no parameters: #define name() */
  455. *pbuf = (char *) 0;
  456. return 0;
  457. }
  458. for (;;) { /* eat the formal parameter list */
  459. if (class(c) != STIDF) { /* not an identifier */
  460. lexerror("#define: bad formal parameter");
  461. return -1;
  462. }
  463. *pbuf = ptr; /* name of the formal */
  464. *ptr++ = c;
  465. if (ptr >= &parbuf[PARBUFSIZE])
  466. fatal("formal parameter buffer overflow");
  467. do { /* eat the identifier name */
  468. LoadChar(c);
  469. *ptr++ = c;
  470. if (ptr >= &parbuf[PARBUFSIZE])
  471. fatal("formal parameter buffer overflow");
  472. } while (in_idf(c));
  473. *(ptr - 1) = '\0'; /* mark end of the name */
  474. /* Check if this formal parameter is already used.
  475. Usually, macros do not have many parameters, so ...
  476. */
  477. for (pbuf2 = pbuf - 1; pbuf2 >= &buf[0]; pbuf2--) {
  478. if (!strcmp(*pbuf2, *pbuf)) {
  479. warning("formal parameter \"%s\" already used",
  480. *pbuf);
  481. }
  482. }
  483. pbuf++;
  484. c = skipspaces(c,0);
  485. if (c == ')') { /* end of the formal parameter list */
  486. *pbuf = (char *) 0;
  487. return pbuf - buf;
  488. }
  489. if (c != ',') {
  490. lexerror("#define: bad formal parameter list");
  491. return -1;
  492. }
  493. LoadChar(c);
  494. c = skipspaces(c,0);
  495. }
  496. /*NOTREACHED*/
  497. }
  498. EXPORT
  499. macro_def(id, text, nformals, length, flags)
  500. register struct idf *id;
  501. char *text;
  502. {
  503. register struct macro *newdef = id->id_macro;
  504. /* macro_def() puts the contents and information of a macro
  505. definition into a structure and stores it into the symbol
  506. table entry belonging to the name of the macro.
  507. A warning is given if the definition overwrites another.
  508. */
  509. if (newdef) { /* is there a redefinition? */
  510. if (macroeq(newdef->mc_text, text))
  511. return;
  512. lexwarning("redefine \"%s\"", id->id_text);
  513. }
  514. else
  515. id->id_macro = newdef = new_macro();
  516. newdef->mc_text = text; /* replacement text */
  517. newdef->mc_nps = nformals; /* nr of formals */
  518. newdef->mc_length = length; /* length of repl. text */
  519. newdef->mc_flag = flags; /* special flags */
  520. newdef->mc_count = 0;
  521. }
  522. PRIVATE int
  523. find_name(nm, index)
  524. char *nm, *index[];
  525. {
  526. /* find_name() returns the index of "nm" in the namelist
  527. "index" if it can be found there. 0 is returned if it is
  528. not there.
  529. */
  530. register char **ip = &index[0];
  531. while (*ip)
  532. if (strcmp(nm, *ip++) == 0)
  533. return ip - &index[0];
  534. /* arrived here, nm is not in the name list. */
  535. return 0;
  536. }
  537. PRIVATE char *
  538. get_text(formals, length)
  539. char *formals[];
  540. int *length;
  541. {
  542. /* get_text() copies the replacement text of a macro
  543. definition with zero, one or more parameters, thereby
  544. substituting each formal parameter by a special character
  545. (non-ascii: 0200 & (order-number in the formal parameter
  546. list)) in order to substitute this character later by the
  547. actual parameter. The replacement text is copied into
  548. itself because the copied text will contain fewer or the
  549. same amount of characters. The length of the replacement
  550. text is returned.
  551. Implementation:
  552. finite automaton : we are only interested in
  553. identifiers, because they might be replaced by some actual
  554. parameter. Other tokens will not be seen as such.
  555. */
  556. register int c;
  557. register int text_size;
  558. char *text = Malloc(text_size = ITEXTSIZE);
  559. register int pos = 0;
  560. LoadChar(c);
  561. while ((c != EOI) && (class(c) != STNL)) {
  562. if (c == '\\') { /* check for "\\\n" */
  563. LoadChar(c);
  564. if (c == '\n') {
  565. /* More than one line is used for the
  566. replacement text.
  567. Replace "\\\n" by " ".
  568. */
  569. text[pos++] = ' ';
  570. ++LineNumber;
  571. LoadChar(c);
  572. }
  573. else
  574. text[pos++] = '\\';
  575. if (pos == text_size)
  576. text = Srealloc(text, text_size += RTEXTSIZE);
  577. }
  578. else
  579. if ( c == '/') {
  580. LoadChar(c);
  581. if (c == '*') {
  582. skipcomment();
  583. /* text[pos++] = ' '; ??? Why ??? */
  584. LoadChar(c);
  585. }
  586. else
  587. text[pos++] = '/';
  588. if (pos == text_size)
  589. text = Srealloc(text, text_size += RTEXTSIZE);
  590. }
  591. else
  592. if (formals && class(c) == STIDF) {
  593. char id_buf[IDFSIZE + 1];
  594. register id_size = 0;
  595. register n;
  596. /* read identifier: it may be a formal parameter */
  597. id_buf[id_size++] = c;
  598. do {
  599. LoadChar(c);
  600. if (id_size <= IDFSIZE)
  601. id_buf[id_size++] = c;
  602. } while (in_idf(c));
  603. id_buf[--id_size] = '\0';
  604. if (n = find_name(id_buf, formals)) {
  605. /* construct the formal parameter mark */
  606. text[pos++] = FORMALP | (char) n;
  607. if (pos == text_size)
  608. text = Srealloc(text,
  609. text_size += RTEXTSIZE);
  610. }
  611. else {
  612. register char *ptr = &id_buf[0];
  613. while (pos + id_size >= text_size)
  614. text = Srealloc(text,
  615. text_size += RTEXTSIZE);
  616. while (text[pos++] = *ptr++) ;
  617. pos--;
  618. }
  619. }
  620. else {
  621. text[pos++] = c;
  622. if (pos == text_size)
  623. text = Srealloc(text, text_size += RTEXTSIZE);
  624. LoadChar(c);
  625. }
  626. }
  627. text[pos++] = '\0';
  628. *length = pos - 1;
  629. return text;
  630. }
  631. #define BLANK(ch) ((ch == ' ') || (ch == '\t'))
  632. /* macroeq() decides whether two macro replacement texts are
  633. identical. This version compares the texts, which occur
  634. as strings, without taking care of the leading and trailing
  635. blanks (spaces and tabs).
  636. */
  637. PRIVATE int
  638. macroeq(s, t)
  639. register char *s, *t;
  640. {
  641. /* skip leading spaces */
  642. while (BLANK(*s)) s++;
  643. while (BLANK(*t)) t++;
  644. /* first non-blank encountered in both strings */
  645. /* The actual comparison loop: */
  646. while (*s && *s == *t)
  647. s++, t++;
  648. /* two cases are possible when arrived here: */
  649. if (*s == '\0') { /* *s == '\0' */
  650. while (BLANK(*t)) t++;
  651. return *t == '\0';
  652. }
  653. else { /* *s != *t */
  654. while (BLANK(*s)) s++;
  655. while (BLANK(*t)) t++;
  656. return (*s == '\0') && (*t == '\0');
  657. }
  658. }
  659. #else /* NOPP */
  660. EXPORT
  661. domacro()
  662. {
  663. int tok;
  664. struct token tk;
  665. EoiForNewline = 1;
  666. SkipEscNewline = 1;
  667. if ((tok = GetToken(&tk)) == IDENTIFIER) {
  668. if (strcmp(tk.tk_idf->id_text, "line") != 0) {
  669. error("illegal # line");
  670. SkipRestOfLine();
  671. return;
  672. }
  673. tok = GetToken(&tk);
  674. }
  675. if (tok != INTEGER) {
  676. error("illegal # line");
  677. SkipRestOfLine();
  678. return;
  679. }
  680. do_line((unsigned int) tk.tk_ival);
  681. EoiForNewline = 0;
  682. SkipEscNewline = 0;
  683. }
  684. #endif /* NOPP */
  685. PRIVATE
  686. SkipRestOfLine()
  687. {
  688. /* we do a PushBack because we don't want to skip the next line
  689. if the last character was a newline
  690. */
  691. PushBack();
  692. skipline();
  693. }
  694. PRIVATE
  695. do_line(l)
  696. unsigned int l;
  697. {
  698. struct token tk;
  699. int t = GetToken(&tk);
  700. SkipRestOfLine();
  701. LineNumber = l; /* the number of the next input line */
  702. if (t == STRING) { /* is there a filespecifier? */
  703. #ifdef DBSYMTAB
  704. if (options['g'] && strcmp(FileName, tk.tk_bts) != 0) {
  705. C_ms_std(tk.tk_bts, N_SOL, 0);
  706. }
  707. #endif /* DBSYMTAB */
  708. FileName = tk.tk_bts;
  709. }
  710. }