Skip to content

Dependent parsing combinators #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ptal opened this issue Sep 21, 2015 · 1 comment
Open

Dependent parsing combinators #72

ptal opened this issue Sep 21, 2015 · 1 comment

Comments

@ptal
Copy link
Owner

ptal commented Sep 21, 2015

Dependent parsing allows semantic attribute to control the parsing. For example a new combinator #e expects a synthesized argument of type integer and repeat e exactly this number of times.

@ptal
Copy link
Owner Author

ptal commented Sep 21, 2015

Here a non-exhaustive list of combinators that should be present for dependent-parsing:

  • Cardinality combinator: #e, expects integer as parameter. Use case: binary protocol, unknown field size.
  • Equality combinator: =e, expects parameter and the result of e to be of comparable type. Succeeds if they are equals. Use case: html/xml tags.
  • Constraint combinator: express constraint on the parsing such as bounds on integer ranges.

See papers:

  • Jim, Mandelbaum, and Walker, “Semantics and Algorithms for Data-Dependent Grammars.”
  • Atkey, “The Semantics of Parsing with Semantic Actions.”
  • Thielecke, “Functional Semantics of Parsing Actions, and Left Recursion Elimination as Continuation Passing.”
  • Jim and Mandelbaum, “A New Method for Dependent Parsing.”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant