O'Reilly logo

Beginning Scala by David Pollak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Parsers—Because BNF Is Not Just for Academics Anymore

We've covered a lot of ground so far, but most of the examples have been one or two lines of code. Sure, the control structures are helpful, and of course most of our programming projects pit dragons and bunnies in battle, but one of the biggest challenges we face is dealing with real-world data. If we're lucky, the real-world data will be well formed in XML. But sometimes we're not so lucky. Sometimes we're handed a spec for a wire format or a text file format and told to "deal with it." Good news: Scala is very good at helping you deal with it.

Scala comes with a parser combinator library that makes writing parsers simple. Furthermore, because your parser is written in Scala, there's ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required