Dropping byacc support; bison now required.

This commit is contained in:
Jon Siwek 2010-10-19 09:50:32 -05:00
parent 02808b0a92
commit 79754bf6f8
4 changed files with 1 additions and 1353 deletions

View file

@ -54,7 +54,7 @@ flex_target(REScanner re-scan.l ${CMAKE_CURRENT_BINARY_DIR}/re-scan.cc
COMPILE_FLAGS "-Pre_") COMPILE_FLAGS "-Pre_")
add_flex_bison_dependency(REScanner REParser) add_flex_bison_dependency(REScanner REParser)
bison_target(Parser parse.bison.y bison_target(Parser parse.y
${CMAKE_CURRENT_BINARY_DIR}/p.cc ${CMAKE_CURRENT_BINARY_DIR}/p.cc
HEADER ${CMAKE_CURRENT_BINARY_DIR}/broparse.h HEADER ${CMAKE_CURRENT_BINARY_DIR}/broparse.h
COMPILE_FLAGS "-t") COMPILE_FLAGS "-t")

View file

@ -1,44 +0,0 @@
#
# Generate the yacc/bison grammar file parse.y from parse.in
#
# Importantly, it will eliminate the dependence on the internal location stack
# if it is not supported.
#
use strict;
# figure out which yacc-like thing is used
# ### Kind of a hack since it uses the Makefile
my $srcdir = $ARGV[0];
my $builddir = $ARGV[1];
my $yacc = $ARGV[2];
my $is_bison = ($yacc =~ /bison/);
if ($is_bison)
{
system ("cp $srcdir/parse.in $builddir/parse.y") == 0 or die "Could not make parse.y: $!\n";
}
else
{
make_parser();
}
sub make_parser
{
open PARSE_OUT, ">$builddir/parse.y" or die "Could not open $builddir/parse.y: $!";
open PARSE_IN, "$srcdir/parse.in" or die "Could not open $srcdir/parse.in: $!";
while (<PARSE_IN>)
{
$_ =~ s/\@\d+/GetCurrentLocation\(\)/g;
print PARSE_OUT $_;
}
# yylloc needs to be non-extern for non-bison systems, so stick it here
print PARSE_OUT "\n/* Non-extern yylloc needed for non-bison system */\n",
"YYLTYPE yylloc;\n"
}

File diff suppressed because it is too large Load diff