Compiler codebase is quite big, and I can’t wrap my head around it all at once 🙂
Currently, I just want to get ASTs after “typer” phase from it. Is there a way to do it?
I run the compiler the following way:
val settings = new Settings
settings.classpath.value = ...
val compiler = new Global(settings, new ConsoleReporter(settings))
new compiler.Run() {
override def stopPhase(name: String) = name == "superaccessors"
} compileSources files
Use
-Xprint:typer(to dump trees after typer) together with-Yshow-trees-compact(to dump the trees in raw AST format). If you also use-Yshow-trees-stringified, ASTs will be additionally dumped as pseudo Scala code (note: the last two options require 2.10.0).