Skip to content

Support for mutually recursive parsers #213

@aryx

Description

@aryx

I see that for recursive parser, like when parsing JSON, you provide the fix combinator. What about mutually recursive
parsers, for example if I want to parse Java, there will be a parser for stmt, one for expr, but inside stmt you need to call expr and inside expr you also need to call stmt (for example Java support lambdas expressions, which themselves contain stmt).
Parsing a real programming language requires a ton of mutually recursive parsers.

The fastparse parser combinator library https://com-lihaoyi.github.io/fastparse/#GettingStarted allows for example to define those mutually recursive parsers.

BTW fastparse has also special support to skip whitespace by using Implicit. Is there something like that planned for angstrom too?
See https://com-lihaoyi.github.io/fastparse/#ExampleParsers and the NoWhitespace special import.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions