%{ =head1 SYNOPSIS This is an example of a non ambiguous grammar with a reduce-reduce conflict. Compile it with: eyapp -b '' rrconflictnamefirst.eyp run it with this options: ./rrconflictnamefirst.pm -t -i -m 1 -c 'a,b:c d:e,' See also: =over 2 =item * Files C<reducereduceconflict_fix1.eyp> and C<reducereduceconflict_fix2.eyp> offer other solutions to the problem. =item * Section "Reduce-Reduce Conflicts with Unambiguous Grammars" in Parse::Eyapp::debuggingtut =back =cut %} %lexer { m{\G([ \t\n]*(\#.*)?\s*)}gc and $self->tokenline($1 =~ tr/\n//); m{\G([0-9]+(?:\.[0-9]+)?)}gc and return ('NUM', $1); m{\G([A-Za-z][A-Za-z0-9_]*)}gc and return ('VAR', $1); m{\G(.)}gc and return ($1, $1); } %namingscheme { \&give_rhs_name } %tree %% def: param_spec return_spec ',' ; param_spec: type | name_list ':' type ; return_spec: type | name ':' type ; name: VAR ; type: VAR ; name_list: name | name ',' name_list ; %% __PACKAGE__->main('Try input "a,b:c d:e," then press CTRL-D (Unix) or CTRL-Z (Windows) to finish: ') unless caller();