parrotcode: A grammar for transforming the output of a PGE parse into | |
Contents | Language Implementations | Punie |
ASTGrammar -- A grammar for transforming the output of a PGE parse into an abstract syntax tree.
.sub _main :main
load_bytecode 'ASTGrammar.pir'
.local pmc grammar
grammar = new 'ASTGrammar'
# Construct the "AST"
load_bytecode "PAST.pbc"
.local pmc astbuilder
astbuilder = grammar.apply(match)
.local pmc ast
ast = astbuilder.get('result')
end
.end
Copyright (C) 2006, The Perl Foundation.
This is free software; you may redistribute it and/or modify it under the same terms as Parrot.
Allison Randal <allison@perl.org>
|