I got the odd error message above that I don’t understand. Parsers is not a member of the scala.util.parsing.combinator package. "
I am trying to learn Parser combinators by writing a C-parser C step by step. I started with a token, so I have 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
It is as simple as I could do it.
The code below works fine, but if I uncomment the commented line, I get the error message 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) } }
If this is a problem with my setup, I use scala 2.7.6 via scala -plugin for intellij. Can anyone shed some light on this? The message is incorrect, Parsers is a member of scala.util.parsing.combinator .
--- Following actions
This person http://www.scala-lang.org/node/5475 seems to have the same problem, but I don’t understand the answer I gave him. Can anyone explain this?
source share