title: Scala Parser Issues
body: <p>I am having issues testing out the Scala Parser Combinator functionality for a simple Book DSL.</p>
  
  <p>Firstly there is a book class:</p>
  
  <pre><code>case class Book (name:String,isbn:String) {
  def getNiceName():String = name+" : "+isbn
  }
  </code></pre>
  
  <p>Next, there is the simple parser:</p>
  
  <pre><code>object BookParser extends StandardTokenParsers {
    lexical.reserved += ("book","has","isbn")
  
    def bookSpec  = "book" ~&gt; stringLit ~&gt; "has" ~&gt; "isbn" ~&gt; stringLit ^^ {
              case "book" ~ name ~ "has" ~ "isbn" ~ isbn =&gt; new Book(name,isbn) }
  
    def parse (s: String) = {
      val tokens = new lexical.Scanner(s)
      phrase(bookSpec)(tokens)
    }
  
    def test (exprString : String) = {
       parse (exprString) match {
           case Success(book) =&gt; println("Book"+book.getNiceName())
       }
    }
  
    def main (args: Array[String]) = {
       test ("book ABC has isbn DEF")
    }   
  }
  </code></pre>
  
  <p>I'm getting a range of errors trying to compile this - some which seem a strange to me when trying to deconstruct the other examples on the internet. For example, the bookSpec function appears nearly identical to the other examples? </p>
  
  <p>Is this the best way to build a simple parser like this?</p>
  
  <p>Thanks</p>