5 use base qw(Module::Build);
11 # Generate the parser using yapp
12 my $grammar_module = File::Spec->catfile(qw(lib ExtUtils XSpp Grammar.pm));
13 if( !$self->up_to_date( [ 'XSP.yp' ],
14 [ $grammar_module ] ) ) {
15 $self->do_system( 'yapp', '-v', '-m', 'ExtUtils::XSpp::Grammar', '-s',
16 '-o', $grammar_module, 'XSP.yp' );
18 # Replace the copy Parse::Yapp::Driver with a package in
19 # our own namespace hierarchy
20 open my $fh, '+<', $grammar_module
21 or die "Could not open file '$grammar_module' for rw: $!";
23 s{(?<!Module )Parse::Yapp::Driver}
24 {ExtUtils::XSpp::Grammar::YappDriver}gx;
30 close $fh or die "Updating grammar module failed: $!";
33 $self->SUPER::ACTION_code;