This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Problem using ParseResult (from parsing combinators)

1 reply
sanjay_dasgupta
Joined: 2009-12-08,
User offline. Last seen 1 year 10 weeks ago.
I'm trying to create a parse-tree handler, like this ...
import scala.util.parsing.combinator.Parsers.ParseResult trait TreeHandler {  def onParse(tree: ParseResult[_]) {     // ...  }}
But the import (for ParseResult) just wont compile:
scala> import scala.util.parsing.combinator.Parsers.ParseResult<console>:5: error: value Parsers is not a member of package scala.util.parsing.combinator        import scala.util.parsing.combinator.Parsers.ParseResult                                            ^
How do I get this to work? 
I'm using the Scala nightly build from 2nd March '10, and JDK 1.6.0 update 18 on Windows-XP.
Thanks for any help.
- Sanjay
dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: Problem using ParseResult (from parsing combinators)
Parsers _is not_ part of scala.util.parsing.combinator. There's a Parser there, and if you have an instance of a Parser, you can create a Parsers from it.
Just follow the scaladoc.

On Wed, Mar 3, 2010 at 1:43 PM, Sanjay Dasgupta <sanjay [dot] dasgupta [at] gmail [dot] com> wrote:
I'm trying to create a parse-tree handler, like this ...
import scala.util.parsing.combinator.Parsers.ParseResult trait TreeHandler {  def onParse(tree: ParseResult[_]) {     // ...  }}
But the import (for ParseResult) just wont compile:
scala> import scala.util.parsing.combinator.Parsers.ParseResult<console>:5: error: value Parsers is not a member of package scala.util.parsing.combinator        import scala.util.parsing.combinator.Parsers.ParseResult                                            ^
How do I get this to work? 
I'm using the Scala nightly build from 2nd March '10, and JDK 1.6.0 update 18 on Windows-XP.
Thanks for any help.
- Sanjay



--
Daniel C. Sobral

I travel to the future all the time.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland