I've got the above odd error message that I don't understand "value Parsers is not a member of package scala.util.parsing.combinator".
I'm trying to learn Parser combinators by writing a C parser step by step. I started at token, so I have the classes:
import util.parsing.combinator.JavaTokenParsers
object CeeParser extends JavaTokenParsers {
def token: Parser[CeeExpr] = ident ^^ (x => Token(x))
}
abstract class CeeExpr
case class Token(name: String) extends CeeExpr
This is as simple as I could make it.
The code below works fine, but if I uncomment the commented line I get the error message given above:
object Play {
def main(args: Array[String]) {
//val parser: _root_.scala.util.parsing.combinator.Parsers.Parser[CeeExpr] CeeParser.token
val x = CeeParser.token
print(x)
}
}
In case it is a problem with my setup, I'm using scala 2.7.6 via the scala-plugin for intellij. Can anyone shed any light on this? The message is wrong, Parsers
is a member of scala.util.parsing.combinator
.
--- Follow-up
This person http://www.scala-lang.org/node/5475 seems to have the same problem, but I don't understand the answer he was given. Can anyone explain it?