Sophie

Sophie

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

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

%{
=head1 SYNOPSIS

This file is almost equal to C<default_naming_scheme.eyp>
but the (default) naming scheme is set explictly.

Compile it with:

  $ eyapp -C explicit_default_naming_scheme.eyp 

to run it, write:

 $ ./explicit_default_naming_scheme.pm -t -i -c '*a=b'


It will produce the same output than C<default_naming_scheme.eyp>:

  s_1(l_3(TERMINAL,r_5(l_4(TERMINAL[a]))),TERMINAL,r_5(l_4(TERMINAL[b]))

=cut
%}
%strict

%token ASSIGN  = /=/
%token POINTER = /\*/
%token NUM = /([0-9]+(?:\.[0-9]+)?)/
%token VAR = /([A-Za-z][A-Za-z0-9_]*)/


%namingscheme { \&give_default_name; }
%tree

%%
s:
    l ASSIGN r
  | r
;

l:
    POINTER r
  | VAR
;

r:
    l
;

%%