Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- Congratulations. We need more of these tools. I'll give it a try.by fithisux
- Good luck. I once knew how to fix shift/reduce reduce/reduce errors, but that was a long time ago. With recursive descent parser you need to check for left recursion, which is somewhat less tricky.by mm321
- isn't this close to what ragel does ?by signa11
- Sorry, but the explanation in your README of the example given here is wrong. This is right associative, not left associative as you claim. Looking at your docs, I think you need a %left PLUS; somewhere in there.
At least I think that's the case. Clarification appreciated.
by sxzygz - do you intend to add sth like python bindings, especially for the AST and walker classes?
then Yantra would become great to parse well-known structured data from python at low-level speed.
by froh - For people interested on this topic I strongly recommend to also look at Ben Hanson https://github.com/BenHanson/parsertl17 and based on it I've created an online LALR(1) playground here https://mingodad.github.io/parsertl-playground/playground/ where you have around 350 non trivial. grammars to experiment (select one from the `Examples` dropdown and then click `Parse` to see a parse tree for the input in `Input`, it also generates EBNF to generate nice navigable railroad diagrams on https://www.bottlecaps.de/rr/ui .by mingodad
- Yacc has mid-rule actions which can be used to propagate information from left siblings to right siblings, as well as to children (embedded nonterminal symbols).
Of course, it's not the same as having the parse tree all done from a previous pass and just walking it to do semantics.
by kazinator - It's a little surprising to see new parser generators being written, long after the vast majority of compilers have already settled on recursive descent / precedence climbing (including https://news.ycombinator.com/item?id=49913192 , which is currently nearby on the front page.)by userbinator