%left '+' %left '*' %token NUM = /([0-9]+(?:\.[0-9]+)?)/ %defaultaction { my $self = shift; my $action = $self->YYName; $self->$action(@_); } %% exp: %name NUM NUM | %name PLUS exp '+' exp | %name TIMES exp '*' exp | '(' exp ')' { $_[2] } ; %% =head1 SYNOPSIS Both C<icalcu.pl> and C<ipostf.pl> inherit and recycle this grammar Do: eyapp NoacInh icalcu.pl ipostf.pl =cut