Generate a Java or Python parser for SQL, C++, or another listed language using an existing grammar file.
Build a code analysis or transformation tool without writing your own grammar rules from scratch.
Add syntax validation for a configuration file format by adapting an existing grammar as a starting point.
Requires installing ANTLR v4 and a JVM to generate parsers from the grammar files.
This repository is a large collection of grammar files written for ANTLR v4. ANTLR is a tool that reads formal grammar descriptions and generates code capable of parsing text written in that language. A grammar file describes the rules of a language: what tokens are valid, how statements are structured, and how different constructs nest inside each other. Once you have a grammar, ANTLR can produce a parser in Java, Python, C#, or several other target languages. The grammars in this collection cover a wide range of programming languages and file formats: Java, C, C++, C#, Python, SQL dialects, configuration formats, and many others. Each grammar lives in its own directory named after the language it describes, all in lowercase. The stated goal is that the grammars contain no embedded actions, meaning they are pure structural descriptions without language-specific code mixed in. This makes them easier to reuse across different ANTLR target languages. This collection is maintained under the ANTLR organization on GitHub, which is the same group behind the ANTLR parser generator itself. If you are building a tool that needs to read or analyze source code in an existing language, starting from one of these grammars saves considerable time compared to writing the grammar rules from scratch. Contributors can add new grammars or improve existing ones following the project's house rules. The README itself is minimal and points to a project Wiki for frequently asked questions and contribution guidelines. Beyond the directory structure and a continuous integration badge, the repository speaks through its grammar files rather than detailed documentation.
← antlr on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.