1# This file is currently not used. 2# It was saved from the deleted directory 't/compilers/past-pm' 3 4grammar NoneGrammar is TGE::Grammar; 5 6transform past (ROOT) :language('PIR') { 7 .local pmc past 8 past = new 'PAST::Block' 9 .local pmc op, childpast 10 op = node['op'] 11 childpast = tree.'get'('past', op, 'op') 12 past.'push'(childpast) 13 .return (past) 14} 15transform past (op) :language('PIR') { 16 .local pmc past 17 past = new 'PAST::Op' 18 past.'init'('name'=>'test', 'pirop'=>'say') 19 .local pmc val, childpast 20 val = node['val'] 21 childpast = tree.'get'('past', val, 'val') 22 past.'push'(childpast) 23 .return (past) 24} 25transform past (val) :language('PIR') { 26 .local pmc past 27 $S0 = node 28 past = new 'PAST::Val' 29 past.'init'('vtype'=>'.String', 'name'=>$S0, 'ctype'=>'s~') 30 .return (past) 31} 32