Perl 6 Compiler Perl 6 Compiler Status and the Parrot Compiler Toolkit #28

Performing the parse

The grammar rules and operator tokens are stored in the grammar_rules.pg and grammar_optok.pg files.

The "parse grammar compiler" (pgc.pir) component of PGE compiles these into PIR subroutines for parsing by Parrot.

The parse component of the compiler is just:

.local string code                           ## perl 6 code to be parsed
.local pmc parser, match
parser = find_global 'Perl6::Grammar', 'program'
match = parser(code, 'grammar'=>'Perl6::Grammar', 'pos'=>0)
Copyright © 2006 Patrick Michaud