parrotcode: compiler for Perl 6 grammars | |
Contents | Libraries |
Perl6Grammar - compiler for Perl 6 grammars
Command-line:
parrot Perl6Grammar.pir [options] file ...
From PIR: .local string grammar_source .local pmc pgc
pgc = compreg 'PGE::Perl6Grammar'
# Compile grammar_source to PIR
$P1 = pgc(grammar_source, 'target' => 'PIR')
# Compile and install grammar_source
$P1 = pgc(grammar_source)
This program takes a set of parser rules (i.e., a parser grammar) specified in the input FILE
s, and compiles it into the PIR code needed to execute the grammar. This PIR code is then suitable for inclusion or compilation into other larger programs.
main(PMC args)
|