The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
%{

=head1 SYNOPSIS 

A deliberately confusing example

Almost quoting Pete Jinks at L<http://www.cs.man.ac.uk/~pjj/cs2121/ho/node19.html>:

The following grammar would confuse any LR(n) or LL(n) parser with a fixed amount of look-ahead:

  A : B C d | E C f ;
  B : x y ;
  E : x y ;
  C : /* empty */ | C c ;

As usual, one of the simplest solutions is to rewrite the grammar 
to unify the common prefix e.g.:

  A    : BorE C d | BorE C f ;
  BorE : x y ;
  C    : /* empty */ | C c ;

The grammar would confuse any LR(n) or LL(n) parser with a fixed amount of look-ahead

See a solution in file: C<lr_1_grammar.eyp>

=head1 SEE ALSO

This grammar is a variation of one seen at Pete Jinks page:
L<http://www.cs.man.ac.uk/~pjj>

Files

  lr_1_grammar.eyp 

=cut 

%}

%%
A: 
    B C 'd' 
  | E C 'f' 
;
B: 
    'x' 'y' 
;
E:
    'x' 'y' 
;
C: 
    /* empty */
  | C 'c' 
;
%%