datalust / superpower

A C# parser construction toolkit with high-quality error reporting
Apache License 2.0
1.06k stars 98 forks source link

Custom parser usage #60

Closed dhowe closed 5 years ago

dhowe commented 5 years ago

I find several examples of custom tokenizers (here for example), but none of custom (procedural) parsers. Is there an example somewhere, or is this a bad idea?

nblumhardt commented 5 years ago

Hi! I'm not 100% sure I'm on the same page, but I think that most of the combinators in https://github.com/datalust/superpower/blob/dev/src/Superpower/Combinators.cs, and the implementation of all of the parsers under the /Parsers folder, qualify as custom procedural parsers. There's not much general structure to them, because by their nature, the things that can't be implemented nicely/efficiently by combining other parsers all look pretty different.

HTH!

dhowe commented 5 years ago

Right, I guess I meant procedurally-structured, like the FilterExpressionTokenizer in serilog, rather than LINQ-query style

nblumhardt commented 5 years ago

Closing this one as stale, hope you found some examples to unblock this 👍