Generate IEEE1364-2000 line directives.

This commit is contained in:
steve 2001-10-30 21:53:27 +00:00
parent 40e7bc2450
commit 9505b586bf
2 changed files with 13 additions and 13 deletions

View File

@ -49,7 +49,7 @@ valid options include:
flags as needed.
-L
Generate #line directives. The ivl compiler understands
Generate `line directives. The ivl compiler understands
these directives and uses them to keep track of the
current line of the original source file. This makes error
messages more meaningful.
@ -89,17 +89,17 @@ proper will not reflect the actual line numbers in the source file.
To handle this situation, the preprocessor can generate line
directives. These directives are lines of the form:
#line <name> <num>
`line <num> <name> <level>
where <name> is the file name in double-quotes and <num> is the line
number in the file. The parser changes the filename and line number
counters in such a way that the next line is line number <num>+1 in
counters in such a way that the next line is line number <num> in
the file named <name>. For example:
#line "foo.vl" 5
`line 6 "foo.vl" 0
// I am on line 6 in file foo.vl.
The preprocessor generates a #line directive every time it switches
files. That includes starting an included file (#line "foo.vlh" 0) or
The preprocessor generates a `line directive every time it switches
files. That includes starting an included file (`line 1 "foo.vlh" 1) or
returning to the including file.

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: lexor.lex,v 1.26 2001/10/30 20:48:55 steve Exp $"
#ident "$Id: lexor.lex,v 1.27 2001/10/30 21:53:27 steve Exp $"
#endif
# include "config.h"
@ -495,7 +495,7 @@ static void def_undefine()
static void output_init()
{
if (line_direct_flag)
fprintf(yyout, "#line \"%s\" 0\n", istack->path);
fprintf(yyout, "`line 1 \"%s\" 0\n", istack->path);
}
static void include_filename()
@ -539,8 +539,8 @@ static void do_include()
yy_switch_to_buffer(yy_new_buffer(istack->file, YY_BUF_SIZE));
if (line_direct_flag && istack->path)
fprintf(yyout, "\n#line \"%s\" %u\n",
istack->path, istack->lineno);
fprintf(yyout, "\n`line %u \"%s\" 1\n",
istack->lineno+1, istack->path);
}
/*
@ -592,7 +592,7 @@ static int yywrap()
}
if (line_direct_flag)
fprintf(yyout, "\n#line \"%s\" 0\n", istack->path);
fprintf(yyout, "\n`line 1 \"%s\" 0\n", istack->path);
yyrestart(istack->file);
return 0;
@ -605,8 +605,8 @@ static int yywrap()
yy_switch_to_buffer(istack->yybs);
if (line_direct_flag && istack->path && !line_mask_flag)
fprintf(yyout, "\n#line \"%s\" %u\n",
istack->path, istack->lineno);
fprintf(yyout, "\n`line %u \"%s\" 2\n",
istack->lineno+1, istack->path);
return 0;
}