Is there a Scala library that parses Scala and creates an Abstract Syntax Tree (AST)?
Ideally I am interested in a Scala library. Plan B would be a Java library.
(I know I could leverage the EBNF from the Scala Syntax Summary.)
I would think the best way to access the AST is with a compiler plugin. You should read a soft introduction before diving in deep.
A few existing parsers:
PsiBuilder
API.Be cautious if using the EBNF from the spec, there are apparently:
"mismatches between the appendix and the inline grammar, and mismatches between the language compiled by scalac (and utilized in the scala sources) and the language claimed by the grammar" -- Scala Trac bug #1826.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With