# Usage: # util/compile_p6grammar.pl examples/langs2.grammar > Langs2.pm # perl -MLangs2 -e 'print My::VB->def("Dim a, b As double")->{"My::C.var_list"}, "\n"' # We use 'rule' instead of 'token' in this file # (compared to examples/langs.grammar) grammar My::C; rule def { ';' } token type { int | float | double | char } rule var_list { **{1} [ ',' ]* } grammar My::VB; rule def { 'Dim' [ 'As' ]? }