11.1K ·GitHub
What is this?
It is a large collection of formal grammars written for ANTLR v4, covering programming languages and file formats like Java, C++, C#, JSON and many others.
Is this a parser library or a collection of grammar files?
It is a collection of grammar definition files (.g4), one directory per language or format, meant to be fed into the ANTLR v4 tool to generate parsers in your target language.
How do I use a grammar from this repo?
Pick the directory for your language (e.g. java, cpp, csharp), then run the ANTLR v4 tool against its .g4 file to generate a lexer/parser in your target language.
Do I need the ANTLR v4 tool itself to use these grammars?
Yes, these are raw grammar sources meant to be processed with the ANTLR v4 generator, which isn't included in this repo.
Do these grammars include embedded code actions for my target language?
No, the project explicitly expects grammars to be free of actions, keeping them target-language agnostic rather than tied to a specific runtime.
How is performance tracked across grammars?
The repo maintains a sortable grammar performance table comparing parsing speed/metrics across the included grammars.
Are there automated builds for these grammars?
Yes, there are CI workflows for a main build, a weekly dev build, and a weekly jar build.
What are similar projects?
antlr4, nom, guidance, static-analysis, G2, awesome-mcp-servers, languagetool, roslyn
Which topics is it in?
grammar, tool-calling, parser, reference, java, hacktoberfest, resources, library, developer-tools, mit, open-source