Yantra, an LALR(1) parser generator for C++.
Raw Developer Origin & Technical Request
Hacker News
Oct 1, 2026
Yantra is a C++ parser generator: lexer, parser, and AST walker all generated from one tool.
It builds the whole AST first, then walks it.Most LALR parser generators (Yacc, Bison, Lemon) run your semantic actions during parsing, as each rule reduces, bottom-up.That means at the time a rule's action runs, you don't yet know what its parent looks like. This pushes a lot of grammars toward hand-built AST classes and a separate walking pass whenever you need to look ahead into siblings or defer a decision until more context is available.On the other hand, Yantra always builds the whole AST first, then walks it top-down in a separate pass, calling your semantic actions as it goes. A parent rule's action can run before its children are visited.A single grammar can define more than one walker. For example, one that emits C++, another that emits Java, from the same parse. The AST and the walker classes are both generated for you.A small example (full version, with compile commands, in the README): start := expr;
expr := expr(a) PLUS expr(b)
%{
std::cout
Developer Debate & Comments
Frequently Asked Questions
Market intelligence mapped to Yantra, an LALR(1) parser generator for C++..
What is the technical positioning of Yantra, an LALR(1) parser generator for C++.?
Are engineers actively discussing Yantra, an LALR(1) parser generator for C++.?
What are the foundational technologies related to Yantra, an LALR(1) parser generator for C++.?
Engagement Signals
Cross-Market Term Frequency
Counts stored text matches for foundational terms like C++ and MIT licensed in analysed public discussions. These counts do not measure adoption.
Stored text matches, not adoption or market-share measurements.
- C++: 30 records
- MIT licensed: 18 records
- parser: 17 records
- parsing: 17 records
- grammar: 8 records
- lexer: 7 records
- top-down: 3 records
- children: 3 records
- bottom-up: 2 records
- C++23: 2 records
- LALR(1) parser generator: 1 records
- AST walker: 1 records
- semantic actions: 1 records
- rule reduces: 1 records
- hand-built AST classes: 1 records
- separate walking pass: 1 records
- look ahead into siblings: 1 records
- defer a decision: 1 records
- parent rule: 1 records
- integrated lexer: 1 records
- mode support: 1 records
- nested comments: 1 records
- amalgamated single-file output mode: 1 records
- generated main(): 1 records
SaaS Metrics