The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
%token NUM = /(\d+)/
%token ID  = { /\G(\w+)/gc and return ('ID', $1); }
%whites  { /\G(\s*(?:#.*)?\s*)/gc and $self->tokenline($1 =~ tr{\n}{}) }

%%
A:   
      B
    | A B
;

B: 
      ID
    | a
    | NUM
;
%%