Parrot Compiler Tools Parrot Compiler Tools #43

Sneak peek: transformation rules using NQP #1

transform past (ABC::Grammar::term) :language('PIR') {
    $S0 = node.'text'()
    .local pmc termpast
    termpast = new 'PAST::Val'
    termpast.'init'('node'=>node, 'name'=>$S0, 'vtype'=>'.Integer')
    .return (termpast)
}

becomes...

continued...
Copyright © 2007 Patrick Michaud