Questions tagged [parboiled2]

parboiled2 is a Scala 2.10.3+ library enabling lightweight and easy-to-use, yet powerful, fast and elegant parsing of arbitrary input text.

parboiled2 is a Scala 2.10.3+ library enabling lightweight and easy-to-use, yet powerful, fast and elegant parsing of arbitrary input text. It implements a macro-based parser generator for Parsing Expression Grammars (PEGs), which runs at compile time and translates a grammar rule definition (written in an internal Scala DSL) into corresponding JVM bytecode.

parboiled2 is the successor of parboiled 1.x , which provides a similar capability (for Scala as well as Java) but does not actually generate a parser. Rather parboiled 1.x interprets a rule tree structure (which is also created via an internal DSL) against the input, which results in a much lower parsing performance.

18 questions
1
vote
1 answer

String ending with character in parboiled2, when the string can contain that character

I've come across a tricky problem writing a parboiled2 parser, which is that I need to match a portion of a line which is a string which has its end marked by a : character. This would be easy enough, except that the string can contain the :…
Greg Beech
  • 133,383
  • 43
  • 204
  • 250
0
votes
0 answers

A way to pass cursor position to parboiled2 generated ast

I 'm just wondering if it's possible to pass a Position of the cursor to AST. I have a strong feeling that it might be possible inside the rule macro but at the quick glace haven't found anything. I need this to give more valuable error reporting on…
ppopoff
  • 658
  • 7
  • 17
0
votes
1 answer

Pure Functional Programming with Path Dependent Types (Parsers) in Scala?

So when using Scala Parsers one may have: case class MyParser(foos: List[String]) extends Parsers { val bars: List[Parser[String]] = foos.map(parserFromString) // Expensive function def parserFromString(s: String): Parser[String] =…
samthebest
  • 30,803
  • 25
  • 102
  • 142
1
2