Perl 6 Compiler Design and Implementation of the Perl 6 Compiler #18

Grammars

PGE provides a shortcut for compiling a rule into a grammar:

$P2 = p6rule("<[$@%&]>", "MyGrammar", "sigil")
$P2 = p6rule("<sigil> <ident>", "MyGrammar", "var")

$P2 = p6rule("my <MyGrammar::var> = (\d+)")
# ...
Copyright © 2005 Patrick R. Michaud