Getting Started on Parboiled2

64 views
Skip to first unread message

dheeraj geetala

unread,
Oct 31, 2016, 5:21:17 PM10/31/16
to parboiled2.org User List
My team and I are new to parsing and we're currently writing a compiler for a simple language (for a learning exercise). We're currently looking at the parboiled library in order to do this but it's a bit advanced for us and we're finding it quite challenging to begin with. Essentially we were wondering if there exists a basic tutorial on how to get started with parboiled2. We understand the fundamental principles of recursive descent parsing and are now trying to put it into practice. 

Any help would be greatly appreciated. 

Mathias Doenitz

unread,
Oct 31, 2016, 5:23:32 PM10/31/16
to parboil...@googlegroups.com
From what you describe it sounds like fastparse might be the better choice for you.
It is more mature, almost equally fast and better documented.

Also, since it directly models Scala Parser Combinators it shouldn't be hard to find some good introductory material.

Cheers,
Mathias

---
mat...@parboiled.org
http://www.parboiled.org

> On 31.10.2016, at 20:40, dheeraj geetala <dgee...@gmail.com> wrote:
>
> My team and I are new to parsing and we're currently writing a compiler for a simple language (for a learning exercise). We're currently looking at the parboiled library in order to do this but it's a bit advanced for us and we're finding it quite challenging to begin with. Essentially we were wondering if there exists a basic tutorial on how to get started with parboiled2. We understand the fundamental principles of recursive descent parsing and are now trying to put it into practice.
>
> Any help would be greatly appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups "parboiled2.org User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to parboiled-use...@googlegroups.com.
> Visit this group at https://groups.google.com/group/parboiled-user.
> To view this discussion on the web visit https://groups.google.com/d/msgid/parboiled-user/950ee2a5-7633-442a-a166-6122c5a11c07%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

dheeraj geetala

unread,
Nov 1, 2016, 7:39:34 AM11/1/16
to parboiled2.org User List
Thank you, Mathias, for your fast reply. 

We had a look into fastparse as well but we were looking for a parser which can recover from an error (like recoveringparserunner in parboiled). This was the reason we were drawn to parboiled. Do you know of any other tools which (sort of) mimic parser combinators in design yet allow error recovery like recoveringparserrunner?

Mathias Doenitz

unread,
Nov 2, 2016, 4:09:38 AM11/2/16
to parboil...@googlegroups.com
Unfortunately parboiled2 doesn't come with the parse error recovery that was available on pb1.
It was planned but never implemented.

So, if you want parse error recovery you'll have to use parboiled 1.x, which is not really maintained anymore.
I don't know of any other parsing library in Scala that has that feature.

Next best alternative is probably a big gun like ANTLR.
> To view this discussion on the web visit https://groups.google.com/d/msgid/parboiled-user/93d14984-0516-4b27-91d8-4e2c1d6efd5c%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages