# Yantra - LALR(1) parser generator for C++

Original title: Show HN: Yantra – an LALR(1) parser generator for C++

> Hacker News story 49916997 · language: en · submitted 2026-10-01
> Web version: https://zeli.app/story/49916997
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 33 · by [renjipanicker](<https://news.ycombinator.com/user?id=renjipanicker>) · 💬 17
[original](<https://github.com/TantrixAuto/yantra>) · [HN discussion](<https://news.ycombinator.com/item?id=49916997>)

## Summary

Yantra is a powerful LALR(1) parser generator for C++ that integrates a lexer, parser, and AST builder into one tool. It builds a full AST first, then walks it top-down, enabling parent actions before children. Features include UTF-8 support, multi-mode lexer, and optional amalgamated output. With no dependencies beyond the C++ standard library, it's easy to build and use. Ideal for compiler and language tooling, Yantra offers a fresh alternative to Bison and ANTLR.

## Key quote

> Yantra always builds the full AST first, then walks it top-down in a separate pass, so a parent rule's action can run before its children are visited.

## HN discussion (17 comments)

### [MichaelMoser123](<https://news.ycombinator.com/item?id=49919407>)

> 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.

### [mingodad](<https://news.ycombinator.com/item?id=49918212>)

> 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 .

### [userbinator](<https://news.ycombinator.com/item?id=49917666>)

> 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.)

---

## Cite

- Page: https://zeli.app/story/49916997
- Date: 2026-10-01
- Source: github.com (https://github.com/TantrixAuto/yantra)
- Hacker News: https://news.ycombinator.com/item?id=49916997

## Other languages

- zh: https://zeli.app/zh/story/49916997 · markdown: https://zeli.app/zh/story/49916997.md
- ja: https://zeli.app/ja/story/49916997 · markdown: https://zeli.app/ja/story/49916997.md
- ko: https://zeli.app/ko/story/49916997 · markdown: https://zeli.app/ko/story/49916997.md
- de: https://zeli.app/de/story/49916997 · markdown: https://zeli.app/de/story/49916997.md
- es: https://zeli.app/es/story/49916997 · markdown: https://zeli.app/es/story/49916997.md
- ru: https://zeli.app/ru/story/49916997 · markdown: https://zeli.app/ru/story/49916997.md
