Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > ddfdf0b0f2e10c06cbb5bbb1f4ee8dd8 > files > 392

perl-Parse-Eyapp-1.182.0-3.mga4.x86_64.rpm

#!/usr/bin/perl 
use warnings;

package Actions;
use base NoacInh;

sub NUM {
  return $_[1];
}

sub PLUS {
  "$_[1] $_[3] +";
}

sub TIMES {
  "$_[1] $_[3] *";
}

my $parser = __PACKAGE__->new();
$parser->slurp_file('', "Write an expression: ","\n"); 
my $t = $parser->Run();

print "$t\n" unless $parser->YYNberr;

=head1 SYNOPSIS

Both C<icalcu.pl> and C<ipostf.pl> inherit and recycle
the grammar in C<NoacInh.eyp>

Do:

       eyapp NoacInh
       icalcu.pl
       ipostf.pl