what is wrong: "value Parsers is not a member of package scala.util.parsing.combinator"?

Posted by Nick Fortescue on Stack Overflow See other posts from Stack Overflow or by Nick Fortescue
Published on 2010-03-27T13:15:01Z Indexed on 2010/03/27 13:23 UTC
Read the original article Hit count: 264

Filed under:
|

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
}

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.

© Stack Overflow or respective owner

Related posts about scala

Related posts about parser-combinators