I am currently implementing a small compiler in Scala and while I was doing the component for context analysis I discovered the trait Binders in package scala.util.parsing.ast (I am using Scala 2.9 RC
Trying out a simple parser combinator, I\'m running into compilation errors. I would like to parse -- \"Smith, Joe\" into its Name object like Name(Joe, Smith). Simple enough, I guess.
I read the tutorial on parser co开发者_如何转开发mbinators for Scala, and I was wondering if there\'s something as \"magical\" for Java. The best thing I could find was JParsec.JParsec seems to do the
My question is about the Scala Parsers: Which ones are available (in the Standard library and outside),
I\'ve been working with FParsec lately and I found that the lack of generic parsers is a major stopping point for me. My goal for this little library is simplicity as well as support for generic input
Meaning, I want to match: $10 or $ but not this: ${name} or: $image{http://wrfgadgadga.com/gadgad.png} I also want to match everything else... normal characters, symbols, numbers, etc.
Im trying to create a parser for a small language with commands including labels and goto: ... lazy val cmds= opt(\"{\")~>rep(cmd<~opt(\";\"))<~opt(\"}\") ^^ {...}
I have the following code being compiled against scala 2.8.0: import scala.util.parsing.combinator.{syntacti开发者_C百科cal,PackratParsers}
I\'ve coded a parser based on Scala parser combinators: class SxmlParser extends RegexParsers with ImplicitConversions with PackratParsers {
I\'m trying to get this to work: def emptyCond: Parser[Cond] = (\"if\" ~ \"(\") ~> regularStr <~ \")\" ^^ { case s => Cond(\"\",Nil,Nil) }