A simple driver

#!/opt/perl/bin/perl -ws

use strict;
use Parse::RecDescent;
use Math::BigInt;

die "Usage $0 <file>\n" unless @ARGV;

my $grammar  = do {local $/; <ARGV>};

$::RD_HINT   = 1;
$::RD_WARN   = 1;
$::RD_ERRORS = 1;

my $parser   = Parse::RecDescent -> new ($grammar)
               or die "Compilation error!\n";

for (my $i = 1, print "In [1] := "; $_ = <STDIN>;
     ++ $i,     print "In [$i] := ") {
    my $result = $parser -> start ($_);
    $result = "<<UNDEF>>"   unless defined $result;
    $result = "<<MATCHED>>" unless $result =~ /\S/;
    print "Out [$i] = $result\n";
}
print "\n";

__END__

[Prev] [Next] [Index]