Implementing parser combinators in Scala

One of the advantages of a functional programming language like Scala, is that you can implement parser combinators easily. This is a quick introduction to the topic.

Intended audience

Scala beginners, especially those new to functional programming.

Basics

What are combinators?

Why parser combinators?

Top down parsing.. non-ambiguous, infinite look ahead

What makes Scala suited for implementing combinators?

The code

def test = {
   println("hello")
   def xyz[T](test) = println[T](test)
 }