3 ms·
You should check out the Parser package in the scala standard lib. I maintain a few DSLs using this and it's an absolute dream. https://wiki.scala-lang.org/di
by rco8786 11y ago
You should check out the Parser package in the scala standard lib. I maintain a few DSLs using this and it's an absolute dream.
https://wiki.scala-lang.org/display/SW/Parser+Combinators--Getting+Started https://wiki.scala-lang.org/display/SW/Parser+Combinators--G...
Code looks solid otherwise...at least where I work the style would be to favor functional idioms over for loops but I think that's just personal preference.
- joostdevries 11y agoThe Parboiled2 framework is often used for building parsers.
- kodablah 11y agoThat has been removed from the Scala standard lib and is now distributed separately. I am unsure how well it will be maintained by the community. As the other commenter said, parboiled2 is a good choice using macros and it is lightning fast. A lighter weight, runtime choice that was released recently is fastparse[0]. 0 - https://github.com/lihaoyi/fastparse https://github.com/lihaoyi/fastparse
- rco8786 11y agoOh wow very good to know. We're just now looking to get to 2.11(very large codebase, upgrades are hard) so will definitely need to keep this in mind.