#!/usr/bin/perl

use strict;
use warnings;
use lib qw(.);

use Benchmark;
use RecDescent;
use gramatica;

die "usage: bench.pl file [iter]\n" unless(@ARGV == 1 || @ARGV == 2);

my $time = $ARGV[1] || 100;

my $yapp = new gramatica();

timethese($time, { 
   RecDescent => sub { RecDescent::parse($ARGV[0]); print STDERR "."; },
   YAPP => sub { $yapp->parseFile($ARGV[0]); print STDERR "."; },
});
