Translate AST into intermediate representation