#!/usr/bin/perl

# taken from
# https://rt.cpan.org/Ticket/Attachment/735088/379845/build-grammar.pl
# and
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=569404#17

use Parse::RecDescent;
use CSS::Parse::PRDGrammar;

$Parse::RecDescent::skip = '';
$::RD_AUTOACTION         = 'print "token: ".shift @item; print " : @item\n"';
Parse::RecDescent->Precompile( $CSS::Parse::PRDGrammar::GRAMMAR,
    "CSS::Parse::CompiledGrammar" )
    or die("precompile failed");
rename( "CompiledGrammar.pm", "CSS/Parse/CompiledGrammar.pm" )
    or die("rename failed: $!");
