ht.eval; end
end
FunCall = Struct.new(:name, :args) do
  def eval; p args.map { |s| s.eval }; end
end

class MiniT &lt; Parslet::Transform
  rule(:int =&gt; simple(:int))        { IntLit.new(int) }
  rule(
    :left =&gt; simple(:left), 
    :right =&gt; simple(:right), 
    :op =&gt; '+')                     { Addition.new(left, right) }
  rule(
    :funcall =&gt; 'puts', 
    :arglist =&gt; subtree(:arglist))  { FunCall.new('puts', arglist) }
end

parser = MiniP.new
transf = MiniT.new

ast = transf.apply(