Single header Parser Combinators for C

(github.com)

35 points | by steve-chavez 6 hours ago

3 comments

  • sph 3 hours ago
    Beautiful work! I'm not even gonna wonder if any of it was AI-generated, because the code is clearly crafted meticulously by an experienced C engineer, very readable, and shorter than I expected.
  • zombot 47 minutes ago
    So many parser combinators operate on bytes assuming ASCII input only. I'd be more interested in a parser combinator lib that has UTF-8 decoding already abstracted away, operating on `wchar_t`, or even polymorphic input stream element types.
    • lokeg 28 minutes ago
      Isn't working with the utf8 stream sufficient? Especially if you only have ASCII keywords/operators/brackets, I feel a ASCII parser should work with utf8 out of the box
  • RossBencina 46 minutes ago
    Now all it needs is a parser in 'examples/' that parses EBNF grammars and emits a parser in terms of these combinators.