concept Scala parser combinator in category dsl

This is an excerpt from Manning's book DSLs in Action.
Scala offers a parser combinator library as part of its standard library. Using Scala’s power of higher-order functions, we can define combinators that make the parser DSL look like declarative EBNF production rules. Check out the following grammar that’s declared using Scala parser combinators. It defines the grammar for a small order-processing language using pure Scala.
We’ll start off with an introduction to what parser combinators are and how Scala implements them as a library on top of the core language. Then we’ll go into every detail of the Scala implementation, highlighting the features that make them exemplary for DSL design. After that, we’re going to design two external DSLs based on Scala parser combinators. Finally, I’ll introduce packrat parsers, which let you implement a class of grammars not possible with ordinary recursive descent parsers. Figure 8.1 is a roadmap of how the chapter progresses on our gradual journey to the world of designing DSLs using Scala parser combinators.