Fix: Renamed yylineno to tjlineno to enable compilation on certain

flexes (reported by Andreas Heiduk)
This commit is contained in:
Thomas Jensen 2006-07-22 19:30:55 +00:00
parent 3089111594
commit b83ec23f56
2 changed files with 17 additions and 10 deletions

View File

@ -3,7 +3,7 @@
* File: lexer.l
* Date created: March 15, 1999 (Monday, 17:16h)
* Author: Copyright (C) 1999 Thomas Jensen <boxes@thomasjensen.com>
* Version: $Id: lexer.l,v 1.17 1999/08/20 19:51:12 tsjensen Exp tsjensen $
* Version: $Id: lexer.l,v 1.18 2006/07/07 07:24:17 tsjensen Exp tsjensen $
* Language: lex (ANSI C)
* Purpose: flex lexical analyzer for boxes configuration files
*
@ -25,6 +25,10 @@
* Revision History:
*
* $Log: lexer.l,v $
* Revision 1.18 2006/07/07 07:24:17 tsjensen
* Applied patch by Andreas Heiduk to facilitate compilation with
* present-day flexes
*
* Revision 1.17 1999/08/20 19:51:12 tsjensen
* Moved contents of YY_USER_INIT definition into a separate function which
* is now called by YY_USER_INIT (better readability)
@ -112,8 +116,8 @@
static const char rcsid_lexer_l[] =
"$Id: lexer.l,v 1.17 1999/08/20 19:51:12 tsjensen Exp tsjensen $";
int yylineno = 1;
"$Id: lexer.l,v 1.18 2006/07/07 07:24:17 tsjensen Exp tsjensen $";
int tjlineno = 1;
static int yyerrcnt = 0;
@ -156,7 +160,7 @@ SDELIM [\"~\'`!@\%\&\*=:;<>\?/|\.\\]
<DELWORD,SHAPES,ELASTIC,INITIAL>[ \r\t] /* ignore whitespace */
<DELWORD,SHAPES,ELASTIC,INITIAL>\n ++yylineno;
<DELWORD,SHAPES,ELASTIC,INITIAL>\n ++tjlineno;
<DELWORD>[^ \t\r\n]+ {
@ -233,7 +237,7 @@ Sample {
<SAMPLE>\n {
++yylineno;
++tjlineno;
if (yyleng > 1)
yymore();
}
@ -438,7 +442,7 @@ Delimiter|Delim {
BEGIN INITIAL;
}
<SPEEDMODE>\n ++yylineno;
<SPEEDMODE>\n ++tjlineno;
<SPEEDMODE>. /* ignore anything else */

View File

@ -3,7 +3,7 @@
* File: parser.y
* Date created: March 16, 1999 (Tuesday, 17:17h)
* Author: Copyright (C) 1999 Thomas Jensen <boxes@thomasjensen.com>
* Version: $Id: parser.y,v 1.22 1999-08-21 08:53:58-07 tsjensen Exp tsjensen $
* Version: $Id: parser.y,v 1.23 2006/07/12 05:31:25 tsjensen Exp tsjensen $
* Language: GNU bison (ANSI C)
* World Wide Web: http://boxes.thomasjensen.com/
* Purpose: Yacc parser for boxes configuration files
@ -24,6 +24,9 @@
* Revision History:
*
* $Log: parser.y,v $
* Revision 1.23 2006/07/12 05:31:25 tsjensen
* Updated email and web addresses in comment header
*
* Revision 1.22 1999-08-21 08:53:58-07 tsjensen
* Removed check for empty sample block, which is also done in lexer.l
*
@ -133,7 +136,7 @@
const char rcsid_parser_y[] =
"$Id: parser.y,v 1.22 1999-08-21 08:53:58-07 tsjensen Exp tsjensen $";
"$Id: parser.y,v 1.23 2006/07/12 05:31:25 tsjensen Exp tsjensen $";
static int pflicht = 0;
@ -852,7 +855,7 @@ block: YSAMPLE STRING YENDSAMPLE
perror (PROJECT);
YYABORT;
}
designs[design_idx].reprules[a].line = yylineno;
designs[design_idx].reprules[a].line = tjlineno;
designs[design_idx].reprules[a].mode = $2;
designs[design_idx].anz_reprules = a + 1;
}
@ -883,7 +886,7 @@ block: YSAMPLE STRING YENDSAMPLE
perror (PROJECT);
YYABORT;
}
designs[design_idx].revrules[a].line = yylineno;
designs[design_idx].revrules[a].line = tjlineno;
designs[design_idx].revrules[a].mode = $2;
designs[design_idx].anz_revrules = a + 1;
}