2006-08-26 11:35:28 +00:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
#$Id$
|
|
|
|
######################################################################
|
|
|
|
#
|
2007-01-02 22:06:40 +00:00
|
|
|
# Copyright 2002-2007 by Wilson Snyder.
|
2006-08-26 11:35:28 +00:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of either the GNU General Public License or the
|
|
|
|
# Perl Artistic License.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the Perl Artistic License
|
|
|
|
# along with this module; see the file COPYING. If not, see
|
|
|
|
# www.cpan.org
|
|
|
|
#
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
# DESCRIPTION: Edits flex output to get around Redhat 8.0 broken flex.
|
|
|
|
|
|
|
|
foreach my $line (<STDIN>) {
|
|
|
|
# Fix flex 2.5.4 namespace omission
|
|
|
|
$line =~ s/^class istream;/\#include <iostream>\nusing namespace std;\n/;
|
|
|
|
# Fix flex 2.5.31 redefinition
|
|
|
|
$line =~ s!(\#define\s+yyFlexLexer\s+yyFlexLexer)!//flexfix: $1!g;
|
|
|
|
# Fix flex 2.5.1 yytext_ptr undef
|
|
|
|
$line =~ s!(\#undef\s+yytext_ptr)!//flexfix: $1!g;
|
|
|
|
print "$line";
|
|
|
|
}
|