For a library for parsing programming languages, the strongest matches are lark-parser/lark (Lark is a robust parsing toolkit that provides the), racket/racket (Racket is a purpose-built language workbench designed specifically for) and tobymao/sqlglot (This tool provides a robust framework for parsing, manipulating). builderio/mitosis and tree-sitter/tree-sitter round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
Explore the best open-source programming language parsers. Compare top-rated tools by activity and features to find the best fit for your project.
Lark is a Python parsing toolkit used to define grammars and convert raw text into annotated parse trees. It serves as an abstract syntax tree generator and a grammar definition language for specifying language rules through terminals and regular expressions. The library provides two primary parsing implementations: an Earley parsing library capable of handling all context-free languages, including those with ambiguity and left-recursion, and a high-performance LALR parsing library designed for deterministic languages with low memory overhead. Beyond core parsing, the toolkit includes capabi
Lark is a robust parsing toolkit that provides the essential infrastructure for defining grammars and generating abstract syntax trees, making it a core component for building compilers and domain-specific languages.
Racket is a general-purpose, multi-paradigm programming language in the Lisp family designed for language creation. It functions as a language workbench, providing a platform for designing and implementing custom programming languages through a flexible system of macros and modules. The system distinguishes itself by offering a comprehensive suite for semantics engineering, allowing for the construction of specialized language subsets and educational layers. It includes tools for custom language design, such as lexer and parser generation, as well as the ability to define module expansion rul
Racket is a purpose-built language workbench designed specifically for creating, analyzing, and transforming programming languages, providing a robust ecosystem for parser generation, AST manipulation, and custom language implementation.
sqlglot is a SQL parser and transpiler that represents queries as abstract syntax trees to enable structural analysis, modification, and semantic transformation. It functions as a dialect translator and query optimizer, converting SQL code between different database engines and simplifying syntax trees through rule-based normalization. The project provides a framework for defining custom SQL dialects by overriding tokenizers, parsers, and generators. It includes a lineage analyzer to track data flow from source tables through complex queries to identify the origin of specific columns. Additi
This tool provides a robust framework for parsing, manipulating, and transpiling SQL via abstract syntax trees, making it a specialized but highly effective component for language engineering tasks focused on query languages.
Mitosis is a cross-framework compiler that transforms a single JSX-based source into native components for multiple frontend libraries simultaneously. It functions as a multi-target UI library builder, allowing developers to maintain a single source of truth for design systems while generating production-ready code for diverse environments including React, Vue, Angular, and Svelte. The system operates by parsing unified component code into an intermediate JSON representation, which serves as the foundation for all downstream framework generators. This architecture utilizes a visitor-based tra
Mitosis is a specialized compiler toolkit that parses JSX into an intermediate representation to generate code for multiple frontend frameworks, fitting the category by providing a structured pipeline for language transformation and AST manipulation.
Tree-sitter is a parsing system and incremental parsing framework designed to generate high-performance syntax trees from source code. It functions as a language parsing engine that compiles formal grammar definitions into portable code, which can then be integrated into text editors and development tools to facilitate structural analysis, code navigation, and syntax highlighting. The project distinguishes itself through its ability to maintain valid, usable syntax tree structures even when source code contains syntax errors or incomplete fragments. It utilizes a generalized parsing algorithm
Tree-sitter is a powerful incremental parsing system that provides the core foundation for language analysis and syntax tree construction, making it a highly effective tool for language engineering tasks.
PegJS is a parsing expression grammar tool and JavaScript parser generator. It functions as a grammar compiler that transforms formal grammar specifications into executable JavaScript code for analyzing structured text and processing complex input strings. The system generates deterministic parsers that avoid the ambiguity of context-free grammars. It utilizes a packrat parsing model with memoization to ensure linear time complexity and employs recursive descent parsing to process input in a top-down hierarchical manner. The toolset supports the implementation of domain-specific languages an
This tool provides a robust parser generator for creating custom grammars and processing structured text, serving as a foundational component for building domain-specific languages and language analysis tools.
jscodeshift is a JavaScript AST transformation toolkit and codemod engine designed for large-scale code refactoring and structural migrations. It provides a set of utilities to parse source code into abstract syntax trees, programmatically modify those trees, and convert them back into source text. The tool distinguishes itself by preserving original source formatting and stylistic properties during the transformation process. It utilizes a builder for generating structurally valid AST nodes and integrates interchangeable parsing engines to support different language standards and experimenta
This toolkit provides the core capabilities for parsing source code into abstract syntax trees and programmatically manipulating them, making it a specialized utility for language transformation and refactoring tasks.
PostCSS is a CSS post-processor and abstract syntax tree transformation tool that parses stylesheets into a structured tree for programmatic analysis and modification. It functions as a plugin-driven pipeline where JavaScript plugins can modify, insert, or delete nodes to transform styles. The project provides a framework for building a custom plugin ecosystem to extend the CSS language with non-standard features such as loops, conditionals, and shorthand properties. It supports multi-syntax parsing through pluggable parsers and stringifiers, allowing it to process various style formats and c
PostCSS provides a robust framework for parsing CSS into an abstract syntax tree and manipulating that tree via plugins, which directly facilitates the transformation and extension of a domain-specific language.
The project is a modular compiler infrastructure framework designed for building programming language toolchains, frontends, and backends. It provides a comprehensive suite of reusable libraries and tools that enable developers to transform source code into efficient native executables across diverse hardware architectures and operating systems. At its core, the system utilizes a language-agnostic intermediate representation bitcode, which serves as a unified format for code analysis, optimization, and machine-specific code generation. What distinguishes this framework is its highly decoupled
This is a comprehensive compiler infrastructure framework that provides the essential intermediate representation, optimization passes, and backend code generation tools required to build robust programming language toolchains.
ANTLR is a grammar-based code generator and multi-language parser generator used to design and implement custom languages. It functions as a toolkit for transforming formal language definitions into executable source code for processing structured text or binary files, while providing a framework for automatically constructing and traversing hierarchical parse trees. The project is distinguished by its ability to generate lexers and parsers in various target programming languages from a single shared grammar definition. It supports grammars containing direct left recursion and utilizes adapti
ANTLR is a comprehensive parser generator and language development toolkit that provides the essential infrastructure for defining grammars, generating lexers and parsers, and constructing abstract syntax trees for custom languages.
This project is a multi-language compiler collection and cross-platform toolchain used to translate source code from various programming languages into optimized machine code for different hardware architectures. It provides a suite of tools including an optimizing compiler backend, a machine code generator, and a comprehensive runtime library suite that implements necessary execution environments and support functions. The system utilizes a multi-pass compilation pipeline and pluggable language front-ends to process source code into intermediate representations. It distinguishes itself throu
GCC is a comprehensive compiler collection that provides the foundational infrastructure for language engineering, including front-end parsing, intermediate representation, and back-end code generation.
Semantic is a Haskell-based library and command-line tool designed for polyglot source code analysis. It functions as a static program analysis framework and a polyglot abstract syntax tree parser that converts multiple programming languages into structured syntax trees based on grammar definitions. The system distinguishes itself through a semantic code comparison engine that detects structural and meaningful changes between code versions rather than relying on textual differences. It further enables analysis across different programming syntaxes by translating surface languages into a unifi
Semantic is a powerful framework for parsing source code into abstract syntax trees and performing structural analysis, making it a highly relevant tool for language engineering tasks like code transformation and semantic comparison.
Binaryen is a WebAssembly compiler toolchain and optimizer designed to transform, validate, and shrink binary modules. It provides a comprehensive intermediate representation framework that converts binary code into a single-assignment form to enable advanced program analysis and code transformation. The project includes a specialized transformation engine that applies iterative optimization passes to increase execution speed and reduce binary size. Additionally, it functions as a transpiler that translates WebAssembly binary modules into executable JavaScript for environments that lack nativ
Binaryen provides a robust intermediate representation framework and optimization engine specifically designed for transforming and analyzing WebAssembly, making it a specialized tool for compiler engineering and binary-level language processing.
This project is a static analysis engine designed to identify patterns, enforce coding standards, and automate code quality improvements in software projects. By parsing source code into structured abstract syntax trees, it enables deep programmatic inspection and the automated remediation of identified programming issues. The engine functions as a pluggable linting framework, allowing developers to extend its core capabilities through a modular architecture. Users can inject custom rules, parsers, and processors to support non-standard file formats or domain-specific logic. This extensibilit
ESLint provides a robust infrastructure for parsing JavaScript into abstract syntax trees and performing programmatic code analysis, making it a practical tool for language-specific inspection and transformation tasks.
OCaml is a strongly typed functional language featuring a sophisticated type system and a focus on safety and expressiveness. It provides a comprehensive compiling toolchain that transforms source code into either portable bytecode or high-performance native binaries. The project is distinguished by a shared memory parallel runtime that executes computations across multiple processor cores using domains, and an algebraic effect system for managing side effects and control flow through execution context handlers. It also includes a dedicated parser generator to automatically create lexers and
OCaml is a high-level programming language that includes a robust compiler toolchain, a built-in parser generator, and native support for abstract syntax tree manipulation, making it a foundational tool for language engineering and compiler development.
The .NET Compiler Platform is a collection of open-source APIs for C# and Visual Basic that provides deep code analysis, refactoring, and automated source code generation. It serves as the core infrastructure for building development tools, offering a platform to inspect, modify, and understand source code through immutable syntax trees and semantic models. The platform distinguishes itself by providing full-fidelity syntax trees that preserve every character of source code, including whitespace and comments, alongside an incremental compilation pipeline that enables near-instant feedback dur
This is a comprehensive compiler infrastructure and API suite for C# and Visual Basic that provides the core capabilities for syntax tree manipulation, semantic analysis, and code transformation required for language engineering.
Grin is a compiler infrastructure designed for the translation and optimization of high-level functional languages. It functions as a graph-reduction compiler, transforming source code into a standardized intermediate representation that facilitates whole-program analysis and efficient execution across diverse hardware architectures. The project distinguishes itself through a modular backend infrastructure that separates intermediate representation management from target-specific code generation. By utilizing graph-based transformations, the system performs advanced optimizations such as valu
GRIN is a compiler back-end that provides intermediate representation and optimization capabilities for functional languages, serving as a specialized component within the broader language engineering and compiler construction pipeline.
Rector is an automated PHP refactoring and modernization tool designed to upgrade language versions and modernize syntax using predefined rules. It functions as a static analysis engine that inspects code structures and types to identify refactoring targets without executing the code. The project provides a framework for defining custom transformation logic to automate project-specific changes. It distinguishes itself by offering specialized capabilities for migrating legacy or custom frameworks to modern alternatives and converting docblock annotations into native language attributes. The s
Rector is a powerful static analysis and code transformation framework that uses AST manipulation to automate language refactoring, making it a highly relevant tool for language engineering tasks like syntax modernization and custom code transformations.
| Repository | Stele | Limbaj | Licență | Ultimul push |
|---|---|---|---|---|
| lark-parser/lark | 5.9K | Python | MIT | |
| racket/racket | 5.2K | Racket | NOASSERTION | |
| tobymao/sqlglot | 9.3K | Python | MIT | |
| builderio/mitosis | 13.9K | TypeScript | MIT | |
| tree-sitter/tree-sitter | 23.8K | Rust | mit | |
| pegjs/pegjs | 4.9K | JavaScript | MIT | |
| facebook/jscodeshift | 10K | JavaScript | mit | |
| postcss/postcss | 29K | TypeScript | MIT | |
| llvm/llvm-project | 38.8K | LLVM | NOASSERTION | |
| antlr/antlr4 | 18.9K | Java | BSD-3-Clause |