30 open-source projects similar to antlr/antlr4, ranked by how many features they have in common. Compare stars, activity and what each one does to find the best Antlr4 alternative.
Nearley is a JavaScript parser toolkit and context-free grammar compiler. It functions as an Earley parser generator that transforms BNF-like grammar definitions into executable code capable of analyzing text and generating abstract syntax trees. The project is distinguished by its ability to handle any context-free grammar, including those with left recursion and ambiguity, by maintaining multiple valid derivations for a single input. It further supports incremental parsing, allowing input strings to be processed in chunks to provide partial results and real-time feedback. Beyond core parsi
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
Ohm is a formal grammar parser generator and domain-specific language framework. It provides a system for defining custom languages to parse, validate, and extract data from input text, transforming raw strings into hierarchical abstract syntax trees based on specified formal rules. The project utilizes an Earley parsing algorithm, which allows it to support all context-free grammars, including those with left recursion and ambiguity, without requiring predefined operator precedence. It also includes a dedicated debugging toolkit for tracing and visualizing the step-by-step state transitions
Pest is a Rust parsing library and automatic parser generator that transforms formal grammar definitions into functional parsers. It specializes in Parsing Expression Grammar to recognize and structure complex text patterns, providing a system for context-free grammar parsing. The library implements zero-copy tokenization and static grammar compilation to reduce runtime overhead. It supports no-std runtime compatibility, allowing the parser to be compiled for embedded or bare-metal environments where a standard library is unavailable. The project covers a range of parsing capabilities, inclu
Jison is a JavaScript parser generator that implements the LALR parsing algorithm. It creates tools to analyze custom programming languages by converting structured input into tokens and trees. The project functions as a Bison-compatible generator, accepting grammars in a format compatible with the Bison parser generator to produce JavaScript parsers. It covers the requirements for compiler frontend development, including the implementation of domain-specific languages and syntax analysis tooling. Its capabilities extend to custom language parsing and the generation of parsers via a command
Participle is a Go parser generator and toolkit for building language frontends. It provides a declarative grammar framework that uses reflection and struct tags to map input patterns directly into typed data structures. The library features a stateful lexical analyzer that employs state machines to handle nested or modal patterns. It includes a lexer code generator to produce optimized code, reducing runtime memory allocations and increasing throughput. The project covers recursive descent parsing with support for union types via sealed interfaces and custom parsing logic through interface-
Unified is a syntax tree processing engine and content ecosystem designed to parse, transform, and serialize text content. It functions as a plugin-based content pipeline that converts raw text into structured abstract syntax trees using plain JavaScript objects for programmatic inspection and modification. The project distinguishes itself through a modular architecture that enables cross-ecosystem translation, allowing syntax trees to be converted between different specifications such as HTML and Markdown. It utilizes a system of immutable processor cloning and shared state containers, ensur
Bhai-lang is a TypeScript-based toy programming language and custom syntax interpreter. It functions as an educational language implementation designed to demonstrate core concepts of variable management, conditional logic, and execution flow. The project provides a custom command line interface and an interactive code playground for writing and testing scripts. It serves as a framework for programming language prototyping, allowing for the definition of custom syntax and execution logic. The system covers the full interpreter pipeline, including lexical analysis, recursive descent parsing,
Grule is a business rule engine for Go that decouples complex decision-making logic from core application code. It provides a framework for defining, versioning, and executing business rules through a domain-specific language, allowing logic to be managed independently of the underlying software implementation. The engine distinguishes itself by utilizing a formal grammar-based parser and a Rete-inspired pattern matching algorithm to evaluate logic against data facts efficiently. It supports dynamic system modeling by enabling runtime updates to policies and providing thread-safe knowledge ba
Wuffs is a toolset for generating memory-safe, sandboxed parsers and decoders from domain-specific language specifications. It functions as a compiler that transforms these specifications into executable code for C, Go, or Rust, specifically designed to decode untrusted file formats while preventing buffer and integer overflows. The project employs a sandboxed execution model that prohibits system calls and manual memory management to ensure computations are side-effect free. It utilizes a refined type system and compile-time constraint verification to enforce memory safety, alongside saturat
This project is a framework for building, manipulating, and analyzing abstract syntax trees. It provides a toolkit for defining, traversing, and validating syntax trees that are compatible with the Mozilla Parser API, serving as a foundation for static code inspection and automated transformation tasks. The library distinguishes itself through a declarative type system that enforces structural integrity across node hierarchies. By wrapping raw syntax nodes in context-aware objects, it enables developers to track parent relationships and ancestor chains without modifying the underlying tree st
Recast is a JavaScript AST parser and printer designed for automated code refactoring. It converts source code into abstract syntax trees that can be modified and then printed back into source code. The project focuses on formatting-preserving transformations, storing original whitespace and indentation metadata within syntax tree nodes to reconstruct code without losing its original layout. It also generates character-level source maps to maintain precise correspondences between original input and transformed output. The toolkit includes utilities for syntax tree manipulation using a visito
Nearley is a JavaScript parser toolkit used to define context-free grammars and generate corresponding parsers. It features an EBNF grammar compiler that transforms language definitions written in extended Backus-Naur Form into executable JavaScript code, utilizing an Earley parser implementation to process any context-free grammar. The toolkit distinguishes itself by its ability to handle left-recursion and ambiguity without failing, allowing it to identify and return multiple valid derivations for a single input string. It also includes a grammar fuzzing generator to produce random strings
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
DBML is a domain-specific language and schema definition language used for documenting database architecture and design. It provides a human-readable text format for defining database tables, columns, and relationships in a standardized way. The project functions as a relational schema parser and SQL schema generator. It transforms declarative design specifications into an abstract syntax tree for programmatic manipulation and converts these definitions into executable SQL statements across various database dialects. The system covers relational data modeling, database schema design, and arc
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
php-token-stream is a lexical analysis tool and tokenizer wrapper for PHP. It functions as a source code streamer that reads tokens one by one, preventing the need to load entire source files into memory. The project provides memory-efficient parsing by wrapping the native PHP tokenizer extension. This allows for the sequential processing of source code tokens to analyze structural components and syntax. The tool is designed for static code analysis and the development of compiler tooling. It supports linear token processing and sequential traversal to examine language constructs and project
TrumpScript is a Python-based domain specific language and compiler extension that wraps the Python runtime to enforce custom grammar and vocabulary rules. It transforms a specialized, case-insensitive vocabulary and natural speech patterns into executable Python instructions. The implementation distinguishes itself through strict constraints on source code, including a variable name system that restricts identifiers to a predefined whitelist and a numeric parser that rejects any integer not exceeding one million. It further utilizes a token-filtering preprocessor to remove filler words and n
Railroad-diagrams is a utility for generating visual representations of formal grammars and language structures. It functions as a library that transforms dense notation systems, such as Backus-Naur Form or regular expressions, into readable flowcharts. The tool utilizes a coordinate-based layout engine and recursive component composition to construct diagrams as hierarchical trees. By separating geometric calculation logic from the output layer, it supports rendering through Scalable Vector Graphics or Unicode text, ensuring diagrams remain clear and scalable across different environments.
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
InfluxDB is a specialized time series database platform engineered for the high-speed ingestion, compression, and retrieval of timestamped data at scale. It functions as a distributed metrics platform, providing the infrastructure necessary to organize and analyze massive volumes of time-stamped information to identify trends, patterns, and anomalies within complex data streams. The platform distinguishes itself through a functional dataflow engine that utilizes a specialized programming language for complex analytical transformations and automated tasks. This architecture is supported by a p
Taichi is a domain-specific programming language embedded in Python designed for high-performance numerical computing and computer graphics. It functions as a parallel compiler that translates high-level mathematical expressions into optimized machine instructions, enabling developers to write compute-intensive algorithms that execute across diverse hardware architectures, including CPUs, GPUs, and specialized accelerators. The project distinguishes itself through a hardware-agnostic execution layer that maps parallel operations to multiple backends such as CUDA, Metal, and Vulkan. By utilizi
Sonic Pi is a live coding music environment and algorithmic composition tool. It functions as a Ruby-based audio engine that allows users to compose and perform audio in real-time through a programmable interface. The software serves as interactive music education software, designed to teach computer science fundamentals and introductory programming concepts through the immediate feedback of sound generation. The system provides capabilities for real-time audio synthesis and the creation of complex musical patterns and sequences. It enables the generation of audio and the execution of music
Kaitai Struct is a framework for declarative binary specification that provides automated parser and serializer generation across multiple programming languages. It uses a portable, domain-specific language to describe the layout of binary files and network packets, converting these specifications into source code for reading and writing binary data. The system enables cross-language data processing by translating a single structural definition into native source code for languages including C++, C#, Go, Java, JavaScript, Python, and Rust. This approach allows the same binary data specificati
This project is a C language interpreter and a practical implementation of a programming language. It parses and executes C source code directly, removing the requirement for a separate compilation step. The interpreter is designed for self-hosting, meaning it is capable of interpreting its own source code to demonstrate recursive language processing and execution. The system covers the primary stages of language processing, including lexical analysis, recursive descent parsing, and tree-walk interpretation using an abstract syntax tree. It manages memory and scope through a dynamic symbol t
Alda is a text-based music programming language and command-line tool for composing, playing, and live-coding musical scores. It functions as a MIDI composition engine that renders plain-text scores into audio output, and as a live coding environment where code entered in a read-eval-print loop produces real-time playback without restarting the interpreter. The system distinguishes itself through an event-driven playback engine that schedules timed note events, an instrument-attribute inheritance model that cascades properties like volume and tempo from global defaults to individual parts, an
Streem is a stream-based programming language and data pipeline orchestrator. It provides a domain-specific language for defining concurrent data flows, allowing users to link data sources to destinations through a sequence of operations that transform and filter individual stream elements. The system uses a custom script syntax to define data-flow connections and pipeline definitions. This allows for the orchestration of concurrent data processing where multiple pipeline stages execute simultaneously to move data elements through the system. The platform covers functional data transformatio
Mint is a front-end programming language and compiled web framework designed for building interactive user interfaces. It functions as a transpiler that converts a specialized domain-specific language into standard JavaScript and CSS for execution in a web browser. The toolchain enables type-safe UI development by utilizing static type analysis to validate data structures during the build phase. It organizes web interface logic into a component-based architecture, where encapsulated units synchronize internal state with the rendered view. The system covers a full compiled web toolchain, incl
Accelerate is a framework for high-performance array computing that provides a domain-specific language for expressing complex mathematical and parallel computations. By utilizing a declarative programming interface, it allows users to define high-level array transformations that are automatically translated into optimized machine code for diverse hardware architectures. The system distinguishes itself through a modular architecture that decouples high-level array operations from hardware-specific instructions. It employs just-in-time compilation and kernel fusion to transform programs into e
Cake is a cross-platform build automation system and scripting framework that allows users to define software build pipelines using C# scripts. It functions as a CI/CD pipeline orchestrator and build runner, providing a strongly-typed domain-specific language to simplify the orchestration of compilation, testing, and packaging processes across Windows, Linux, and macOS. The system ensures reproducible build environments by pinning the versions of build tools, modules, and dependencies. It distinguishes itself by enabling a C# scripting workflow with full IDE support, including autocomplete, s