port lang.ast to Scala