finds.dev← search

// the find

antlr/antlr4

★ 19,025 · Java · BSD-3-Clause · updated Feb 2026

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.

ANTLR 4 takes a grammar file and generates a lexer and parser, plus listener and visitor interfaces, in one of ten target languages from the same tool release. It suits anyone building a language, a DSL, a config format, or a binary file reader who would otherwise hand-write a recursive descent parser.

The ALL(*) parser resolves most ambiguity with adaptive lookahead, and the tool rewrites left-recursive rules for you, so grammars can follow the shape of the language instead of being refactored into LL(1) form. One release ships the same version across the Cpp, CSharp, Dart, Java, JavaScript, PHP, Python3, Swift, TypeScript and Go runtimes, which matters when one grammar has to run in several languages. Generated listeners and visitors keep grammar actions out of the tree-walking code, and the linked grammars-v4 collection gives you working grammars for many common formats.

The versioning policy says minor releases can break generated code and that you should regenerate parsers on every release, so anyone who checks generated sources into a repo takes on regeneration churn. Keeping ten runtimes at parity is a large maintenance load, and a fix can reach Java well before it reaches Dart or PHP. Adaptive prediction can fall back to full-context lookahead on ambiguous or badly factored rules, and the cost of that is hard to see from the grammar alone, so a slow parser usually means profiling the generated code. The README is mostly a set of links to getting-started docs, the book, and a separate Go repo, and the master/dev branch split means the path from the README to a working build takes a few hops.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →