Parrot Compiler Tools Parrot Compiler Tools #46

Sneak peek: transformation rules using NQP #3

For expressions:

method expression($/, $key) {
    my $past := PAST::Op.new( node => $/, 
                              name => $<top><type>,
                              pirop => $<top><pirop>,
                              pasttype => $<top><pasttype>,
                            );
    # add children asts
    for @($/) {
        $past.push( $($_) );
    }
    return $past;
}
Copyright © 2007 Patrick Michaud