%{ =head1 SYNOPSIS The main difference between this example and C is that the rules for C and C have been changed to be right recursives Compile it with eyapp -b '' typicalrr2 Execute it with: ./typicalrr2.pm -d -t Try inputs C<4 5>, C and C<4 5 a b>. =head1 SEE ALSO see typicalrr.eyp, correcttypicalrr.eyp and typicalrr_fixed.eyp =cut use base q{RRTail}; %} %token ID NUM %tree %% s: %name EMPTY /* empty */ | %name LIST s ws |%name LIST s ns ; ns: %name EMPTYNUM /* empty */ | %name NUMS NUM ns ; ws: %name EMPTYID /* empty */ | %name IDS ID ws ; %% unless (caller()) { my $prompt = 'Try "4 5 a b 2 3" '. '(press to finish): '; __PACKAGE__->main($prompt) }