Commit deade0bf authored by Michaël Cadilhac's avatar Michaël Cadilhac
Browse files

2005-06-09 Michael Cadilhac <michael.cadilhac@lrde.epita.fr>

	* parser.y: Add `#line' directives output on `%include', CODE and
	in `yyparsetail'.
	* monoburg.c: Add `#line' directives output just before the call to
	`yyparse'.
parent e0b4646c
2005-06-09 Michael Cadilhac <michael.cadilhac@lrde.epita.fr>
* parser.y: Add `#line' directives output on `%include', CODE and
in `yyparsetail'.
* monoburg.c: Add `#line' directives output just before the call to
`yyparse'.
2005-06-04 Michael Cadilhac <michael.cadilhac@lrde.epita.fr>
* config.h.in: New.
......
......@@ -1240,6 +1240,7 @@ main (int argc, char *argv [])
}
inputs[0].filename = infile;
output ("#line %d \"%s\"\n", 1, infile);
yyparse ();
reset_parser ();
......
......@@ -121,6 +121,9 @@ char *fgets_inc(char *s, int size)
return 0;
free (inputs[n_input].filename);
fclose (inputs[n_input--].fd);
fprintf (outputfd, "#line %d \"%s\"\n",
inputs[n_input].yylineno + 1,
inputs[n_input].filename);
return fgets_inc(s, size);
}
......@@ -139,6 +142,7 @@ char *fgets_inc(char *s, int size)
if (!(inputs[n_input + 1].fd = fopen (filename, "r")))
yyerror ("`%%include %s': %s",
filename, strerror(errno));
fprintf (outputfd, "#line %d \"%s\"\n", 1, filename);
inputs[++n_input].yylineno = 0;
inputs[n_input].filename = strdup (filename);
return fgets_inc(s, size);
......@@ -301,6 +305,8 @@ nextchar ()
void
yyparsetail (void)
{
fprintf (outputfd, "#line %d \"%s\"\n", inputs[n_input].yylineno,
inputs[n_input].filename);
fputs (input, outputfd);
while (fgets_inc (input, sizeof (input)))
fputs (input, outputfd);
......@@ -391,6 +397,8 @@ yylex (void)
unsigned i = 0, d = 1;
static char buf [100000];
i = sprintf (buf, "#line %d \"%s\"\n", inputs[n_input].yylineno,
inputs[n_input].filename);
while (d && (c = nextchar ())) {
buf [i++] = c;
assert (i < sizeof (buf));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment