How to build Abstract Syntax Trees from grammar specification in Haskell?
I'm working on a project which involves optimizing certain constructs in a
very small subset of Java, formalized in BNF.
If I were to do this in Java, I would use a combination of JTB and JavaCC
which builds an AST. Visitors are then used to manipulate the tree. But,
given the vast libraries for parsing in Haskell (parsec, happy, alex etc),
I'm a bit confused in chossing the appropriate library.
So, simply put, when a language is specified in BNF, which library offers
the easiest means to build an AST? And what is the best way to go about
modifying this tree in idiomatic Haskell?