crude parse tree to AST transformation