This is the core tree-sitter repository, providing a parser generator toolchain and an incremental parsing runtime library. In production, it consumes grammar definitions written in a JavaScript DSL or JSON format and generates standalone C parsers (or WebAssembly modules) that can parse source code incrementally at keystroke speed. The architecture comprises a minimal C library (`lib/src/`) that implements a GLR parser with error recovery, a Rust-based generator (`crates/generate/`) that compiles grammars into LR parse tables and emits C code, a CLI tool (`crates/cli/`) for developing/testing grammars and performing syntax highlighting/querying, and bindings for Rust, Node.js/TypeScript, and Web. The system is designed for integration into editors (e.g., VS Code, Neovim) and code analysis tools, offering incremental parsing, tree queries, syntax highlighting, and symbol tagging. External dependencies are minimal for the C core (none), while the Rust toolchain depends on wasmtime, QuickJS, and standard crates. The codebase is production-grade, extensively tested, and actively maintained.
The antlr/intellij-plugin-v4 repository is an IntelliJ IDEA plugin that provides comprehensive language support for ANTLR v4 grammar files (.g4). It offers syntax highlighting, real-time error checking, code navigation, refactoring capabilities (such as rule extraction and inlining), live parse tree preview, grammar profiling, and code generation. The plugin integrates deeply with the IntelliJ Platform SDK, implementing extension points like FileTypeFactory, ParserDefinition, SyntaxHighlighterFactory, ExternalAnnotator, StructureViewFactory, CompletionContributor, and custom tool windows. Its architecture follows a modular design where core functionality is separated into concerns such as parsing, preview, refactoring, and configuration, utilizing patterns like the adaptor pattern for ANTLR integration, background processing for UI responsiveness, and specialized token streams for incremental parsing.