From b83ec23f56bfa37486d74b81d8e64a3f2ae55348 Mon Sep 17 00:00:00 2001 From: Thomas Jensen Date: Sat, 22 Jul 2006 19:30:55 +0000 Subject: [PATCH] Fix: Renamed yylineno to tjlineno to enable compilation on certain flexes (reported by Andreas Heiduk) --- src/lexer.l | 16 ++++++++++------ src/parser.y | 11 +++++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/lexer.l b/src/lexer.l index 6e6bd05..ca979a5 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -3,7 +3,7 @@ * File: lexer.l * Date created: March 15, 1999 (Monday, 17:16h) * Author: Copyright (C) 1999 Thomas Jensen - * 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 [\"~\'`!@\%\&\*=:;<>\?/|\.\\] [ \r\t] /* ignore whitespace */ -\n ++yylineno; +\n ++tjlineno; [^ \t\r\n]+ { @@ -233,7 +237,7 @@ Sample { \n { - ++yylineno; + ++tjlineno; if (yyleng > 1) yymore(); } @@ -438,7 +442,7 @@ Delimiter|Delim { BEGIN INITIAL; } -\n ++yylineno; +\n ++tjlineno; . /* ignore anything else */ diff --git a/src/parser.y b/src/parser.y index 168b617..8f25b67 100644 --- a/src/parser.y +++ b/src/parser.y @@ -3,7 +3,7 @@ * File: parser.y * Date created: March 16, 1999 (Tuesday, 17:17h) * Author: Copyright (C) 1999 Thomas Jensen - * 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; }