I'm currently looking for a lexer/parser that generates Scala code from a BNF grammar (an ocamlyacc
file with precedence and associativity). I'm quite confused since I found almost nothing on how to do it.
For parsing, I found scala-bison
(that I have a lot of trouble to work with). All the other tools are just Java parsers imported into Scala (like ANTLR
).
For lexing, I found nothing.
I also found the famous parser combinators of Scala, but (correct me if I'm wrong), even if they are quite appealing, they consume a lot of time and memory, mainly due to backtracking.
So I have two main questions:
- Why do people only seem to concentrate on _parser combinators?
- What is your best lexer/parser generator suggestion to use with Scala?