java,parsing,parser-generator,parboiled
Came up with an answer. Including it here for any other parboiled newbie who may struggle with the same issue. The problem was that any access to the variable's content must happen in a parser action to ensure that it takes place in the parse-phase, rather than in the rule...
The error is due to the presence of dcevm.jar present in my jre\lib\ext folder. The jdk which I have used for the project contains the dcevm.jar file and that this jar contains the package org.objectweb.asm.tree which containsClassNodewith no constructor like ClassNode(int). The jvm is using this jar instead of the...
scala,sbt,spray,sbt-assembly,parboiled
The same answer as for Scala 2.11 should work here as well: replace spray-routing with spray-routing-shapeless2.
scala,sbt,spray,sbt-assembly,parboiled
If you want to use shapeless2 you need to depend on spray-routing-shapeless2 instead of spray-routing. See the example dependency declaration: https://github.com/spray/spray-template/blob/on_spray-can_1.3_shapeless2_scala-2.11/build.sbt...
scala,peg,parboiled,parboiled2
I think that the following should work for your problem description: def noColons = rule { zeroOrMore(noneOf(":")) } def colonWithNext = rule { ':' ~ &(noColons ~ ':') } def address = rule { capture(oneOrMore(noColons).separatedBy(colonWithNext)) ~ ':' } The problem with your code was the usage of the ~ combinator,...
I've done this for CSV files of over 1 million records, in a project that requires high speed and low resources, and I find it works well to instantiate a new parser for each line. I tried this approach after I noticed that the parboiled2 readme mentions that the parsers...
scala,parsing,parboiled,parboiled2
This is expected behavior. parboiled2 is a PEG parser, and as described in the Common Mistakes section in the documentation, it eats everything it can find. To avoid such a problem, make sure that you expect the end-of-input symbol at the end of your string: def Expr: Rule1[Int] = rule...
scala,unicode,character-encoding,peg,parboiled
Take a look at https://github.com/sirthias/parboiled2/blob/master/parboiled-core/src/main/scala/org/parboiled2/CharPredicate.scala#L112 - it is very easy to do your own predicates, for instance: val latinSupplementCharsPredicate = CharPredicate('\u00c0' to '\u00dc') ++ CharPredicate('\u00e0' to '\u00fd') ...