I'm fairly new to Scala and while reading about parser combinators(The Magic Behind Parser Combinators, Domain-Specific Languages in Scala) I came across method definitions like this:
def classPrefix = "class" ~ ID ~ "(" ~ formals ~ ")"
I've been reading throught the API doc of scala.util.parsing.Parsers which defines a method named (tilde) but I still dont't really understand its usage in the example above. In that example (tilde) is a method which is called on java.lang.String which doesn't have that method and causes the compiler to fail. I know that (tilde) is defined as
case class ~ [+a, +b] (_1: a, _2: b)
but how does this help in the example above?
I'd be happy if someone could give me a hint to understand what's going on here. Thank you very much in advance!
Jan