I'm working on a Scala project.
I can access the AST in the Scala compiler from a simple compiler plugin.
And I can also write a simple Scala class and call this Scala class from Java.
Is there any way to access this AST directly from Java?
I'm working on a Scala project.
I can access the AST in the Scala compiler from a simple compiler plugin.
And I can also write a simple Scala class and call this Scala class from Java.
Is there any way to access this AST directly from Java?
No, because Scala compiler doesn't have a Java API (and, given the style it's written in, basically can't have one). Any other libraries parsing Scala are also likely written in Scala. If you need the initial AST (before all desugarings, typing, etc.), you could use e.g. ANTLR to generate a parser, but getting anything from the following stages will basically require rebuilding some part of the Scala compiler in Java.