thehardwarestore.ai

where AI agents shop for the right tools

── 99153 repos indexed ── | filtered by tag: #parser
babel/babel ★ 44043 5991 APPLICATION

Babel is a production-grade JavaScript/TypeScript compiler toolchain organized as a large monorepo of npm packages. In production it parses modern and experimental ECMAScript (plus JSX, Flow, and TypeScript), transforms it through a plugin/preset system, and emits backward-compatible JavaScript with source maps. The core pipeline is: babel-parser produces an AST, babel-traverse walks and mutates it using plugin-defined visitors, babel-types provides builders/validators, babel-helpers injects runtime helper functions, and babel-generator prints the final code. Primary entry points are @babel/core's transform/transformFile/parse APIs, the babel-cli, babel-register's require hook, babel-node, and babel-standalone for in-browser use. Its configuration system is notably sophisticated: babel-core resolves babel.config.*, .babelrc, and package.json config, validates options, caches them, merges plugins/presets, and unifies sync/async behavior via gensync. External dependencies include browserslist/compat-data for target-aware transforms and standard Node infrastructure; it also integrates with ESLint, bundlers, and major frameworks. This is not a data/research repository; the massive fixture corpus is regression-test data, not analytical data. The codebase is actively maintained, with ongoing Babel 8 work visible through BABEL_8_BREAKING conditionals and migration scripts. Overall craftsmanship is exceptional: visitor merging, scope analysis, helper injection, and plugin factories are carefully factored into reusable, well-isolated helper packages.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 3 reusable components found
tree-sitter/tree-sitter ★ 27161 2959 APPLICATION

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.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
ruby/ruby ★ 23769 5656 APPLICATION

This is the official reference implementation of the Ruby programming language (CRuby/MRI). It is a monolithic interpreter written primarily in C, with Rust-based JIT compilers (YJIT and ZJIT) and a new parser (Prism). The repository contains the core runtime (VM, garbage collector, threading, coroutines), the standard library (both pure Ruby and C extensions), package management tools (RubyGems and Bundler), a comprehensive test suite (MSpec, Test::Unit, bootstraptests), benchmarks, and build infrastructure. The architecture is centered around a bytecode VM that executes compiled Ruby source, with optional just-in-time compilation. Key entry points include the `ruby` CLI binary, the `gem` and `bundle` commands, and the C extension API. The codebase demonstrates exceptional engineering craftsmanship with clean abstractions (e.g., platform-agnostic coroutine context, encoding system, digest metadata pattern) and extensive cross-platform support. It is actively maintained with frequent commits, CI pipelines, and security fixes.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
tobymao/sqlglot ★ 9682 1334 APPLICATION

SQLGlot is a pure-Python SQL parser, transpiler, optimizer, lineage analyzer, diff engine, and in-process executor with support for 30+ SQL dialects including Snowflake, BigQuery, DuckDB, Spark, Trino, Postgres, and MySQL. The core pipeline tokenizes SQL source, parses it into a rich expression AST, applies optimizer passes such as column qualification, predicate pushdown, subquery decorrelation, type annotation, and simplification, then generates dialect-specific SQL. It also includes a planner/executor for running queries against Python data structures and a CLI for transpilation and tokenization. Despite the breadth of dialect coverage, the architecture centralizes shared language machinery in base tokenizer/parser/generator classes, with dialects as declarative overrides, and the library has zero required runtime dependencies.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 6 reusable components found
mvdan/sh ★ 9130 457 APPLICATION

mvdan/sh is a comprehensive Go library and CLI toolchain for parsing, formatting, and interpreting shell scripts. It supports POSIX Shell, Bash, mksh, Zsh (experimental), and Bats dialects. The architecture is modular: the `syntax` package provides a lexer, parser, AST, pretty-printer, and simplifier; the `interp` package implements a shell interpreter with extensible handler middleware; the `expand` package handles parameter, arithmetic, brace, and glob expansion; and the `pattern` package converts shell patterns to regular expressions. Two CLI tools are built on top: `shfmt` (a shell formatter with EditorConfig support, JSON AST output, and minification) and `gosh` (a proof-of-concept interactive shell). The library is designed for embedding shell execution in Go programs, with platform-specific support for Unix, Windows, and js/wasm. The codebase is exceptionally well-tested, with thousands of table-driven tests, fuzz testing, and conformance checks against real shells (bash, dash, mksh, zsh). It demonstrates high craftsmanship in parser design, error recovery, streaming APIs, and middleware patterns. The project is actively maintained with regular releases and a clear v4 roadmap.

RATING: 9.8/10 MAINT: active DRIFT: low
▸ 4 reusable components found
cheeriojs/cheerio ★ 30514 1726 APPLICATION

Cheerio is a fast, flexible, and elegant library for parsing and manipulating HTML and XML on the server side (Node.js). It provides a jQuery-like API for traversing and manipulating the DOM of parsed documents, designed for web scraping, data extraction, and HTML transformation tasks. The library abstracts away the underlying parser (htmlparser2 for speed, parse5 for standards compliance) via a factory pattern, offering a consistent Cheerio API regardless of parser choice. Key entry points include the main `load` function that converts HTML strings or buffers into a Cheerio instance, static methods like `html`, `xml`, `text`, and `parseHTML`, and utility functions for CSS handling, form serialization, and attribute manipulation. External dependencies include cheerio-select for CSS selector parsing, domutils for core DOM traversal, and optional HTTP fetching via undici for live URL parsing.

RATING: 9.6/10 MAINT: active DRIFT: low
▸ 2 reusable components found
sqlfluff/sqlfluff ★ 9948 1211 APPLICATION

SQLFluff is a mature, actively maintained SQL linter and auto-formatter with production scope far beyond a simple style checker. It exposes both a Click-based CLI and a Python API (lint, fix, parse, list_rules, list_dialects) and supports over 30 SQL dialects, including ANSI, BigQuery, Snowflake, Postgres, T-SQL, Oracle, Databricks, ClickHouse, and DuckDB. The core pipeline discovers files, optionally expands Jinja/dbt/SQLMesh templating, lexes and parses SQL into a segment tree, then applies configurable rule crawlers that emit lint violations and in many cases generate auto-fixes. The implementation is layered: a public API and CLI wrap a core linter, a grammar-combinator parser, a rule framework with fix primitives, a hierarchical config system, and a pluggy-based plugin host. A Rust workspace (sqlfluffrs) provides an optional high-performance lexer/parser and partial Rust-native rule detection, with extensive Python/Rust parity tests to keep behavior aligned.

RATING: 9.6/10 MAINT: active DRIFT: low
▸ 4 reusable components found
jstedfast/MimeKit ★ 2001 390 APPLICATION

MimeKit is a mature, high-performance .NET library for creating, parsing, and manipulating MIME messages (email). It provides comprehensive support for all standard MIME structures (multipart, message/rfc822, content-transfer encodings), internationalized headers (RFC 2047/2231), and email security features including S/MIME, OpenPGP, DKIM, and ARC signing/verification. The library also includes a full HTML5 tokenizer, TNEF (Outlook Transport Neutral Encapsulation Format) reader, text format converters (HTML, flowed, plain), and a stream filter pipeline for encoding/decoding and line-ending normalization. The codebase is well-architected with clean abstractions (visitor pattern, filter chain, encoder/decoder interfaces), extensive unit tests, and benchmarks demonstrating 25x–75x faster parsing than competing .NET MIME libraries. It is distributed as NuGet packages (MimeKit, MimeKitLite) and is a .NET Foundation project. The repository also includes sample applications for Windows Forms, iOS, and Android, and a DKIM verifier sample.

RATING: 9.6/10 MAINT: active DRIFT: low
▸ 5 reusable components found
koalaman/shellcheck ★ 40098 1951 APPLICATION

ShellCheck is a static analysis tool for shell scripts, written in Haskell. It parses shell scripts (Bash, sh, dash, ksh, busybox) into an Abstract Syntax Tree (AST), constructs a Control Flow Graph (CFG), and performs Data Flow Analysis (DFA) to detect syntax errors, semantic bugs, security vulnerabilities, and portability issues. The tool operates as a CLI executable with a modular architecture that separates parsing, analysis, and output formatting. It integrates into CI/CD pipelines and editor plugins via standardized output formats (JSON, GCC, CheckStyle, Diff). The core logic is encapsulated in the ShellCheck library, allowing reuse in other tools or environments. The architecture follows a functional programming paradigm, leveraging Haskell's type system and monads for state management during analysis. The data flow is linear: source text -> Parser (AST) -> CFG Builder -> Data Flow Analysis -> Checker (Rules) -> Formatter (Output). External dependencies are primarily Haskell ecosystem packages (Parsec, aeson, QuickCheck, regex-tdfa). The tool supports configuration via `.shellcheckrc` files and inline directives, enabling customization of checks and shell dialects. ShellCheck is widely adopted in the DevOps and SRE communities, evidenced by its high star count and active issue tracking. It is designed for automation, with non-interactive parsing and configuration-driven behavior. The codebase demonstrates high craftsmanship in its handling of complex shell syntax and stateful analysis, though it maintains some legacy patterns like manual ST monad state management for performance optimization.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 3 reusable components found
terser/terser ★ 9347 477 APPLICATION

Terser is a JavaScript parser, mangler/compressor, and beautifier toolkit for ES6+ code. It functions as a minifier that transforms JavaScript source code into an equivalent but smaller representation through a pipeline of parsing, compression, mangling, and code generation. The architecture is modular and library-based, with a CLI entry point (bin/terser) and programmatic API (main.js). Key data flows involve: input JavaScript → AST generation (lib/parse.js) → compression passes (lib/compress/) → variable/property mangling (lib/scope.js, lib/propmangle.js) → output code generation (lib/output.js) with optional source map handling (lib/sourcemap.js). External dependencies include @jridgewell/source-map for source maps and yargs for CLI argument parsing, with internal implementations for parsing and AST transformations.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 2 reusable components found
fb55/htmlparser2 ★ 4789 402 APPLICATION

htmlparser2 is a fast, forgiving HTML/XML parser for Node.js and browsers, written in TypeScript. It provides a low-level streaming tokenizer (Tokenizer) that feeds events to a higher-level Parser, which handles tag matching, implicit closing, foreign content (SVG/MathML), and entity decoding. The library also includes Node.js WritableStream and Web Streams API WritableStream adapters for piping data directly into the parser. It is the foundation for cheerio and other DOM manipulation libraries. The codebase is well-structured, thoroughly tested, and actively maintained, with a focus on performance and spec compliance for real-world HTML.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 3 reusable components found
zesterer/chumsky ★ 4538 212 APPLICATION

Chumsky is a Rust parser-combinator library rather than a standalone application. It exposes a `Parser` trait with primitive and combinator layers for building recursive-descent/PEG parsers, featuring zero-copy parsing, context-sensitive grammars, Pratt operator precedence, and configurable error recovery. The architecture is organized around composable abstractions: `Input`/`ValueInput`/`BorrowInput` for source handling, `Span` and `Error` traits for positions and diagnostics, `ParserExtra` for parser state/context, and `Container`/`Seq` traits for generic output collection. The main entry points are the public API in `src/lib.rs` and modules such as `primitive`, `combinator`, `text`, `stream`, `recursive`, `recovery`, `pratt`, and `debug`; included examples demonstrate full interpreters for JSON, Brainfuck, mini-ML, and a nano-Rust-like language.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 5 reusable components found
mermaid-js/mermaid ★ 90505 9318 APPLICATION

Mermaid is a mature, browser-oriented TypeScript monorepo that renders Markdown-like text definitions into SVG diagrams. In production it supports over 20 diagram families (flowchart, sequence, class, state, gantt, mindmap, pie, git, ER, C4, sankey, block, agentflow, and more), with a pipeline that detects diagram type from text, lazily loads a parser, builds a diagram-specific data model, and renders through a shared rendering-util layer. Parsing is split across Langium, Chevrotain, and legacy JISON grammars; layout is provided by dagre, ELK, a custom swimlane/orthogonal router, and tidy-tree plugins. The public API (initialize/run/parse/registerExternalDiagrams) makes this a plugin-extensible library rather than a standalone application, though it also ships a local editor, dev-explorer, and extensive e2e tooling. The codebase shows high engineering craft: CI is extensive with Vitest, Playwright visual regression, code coverage, security scanning, dependency automation, and changesets for versioning. Accessibility, XSS sanitization, and config validation are treated as first-class concerns. The theme system is particularly well-structured, managing multiple looks and color palettes through a centralized color-theme gate. The primary weaknesses are scale-driven: mixed parser ecosystems, a very large config surface, many beta diagram types, and highly intricate layout code that is expensive to change. It is neither a data-research repository nor a service; its research-like components are the layout algorithms and geometry validation, which remain embedded in a library architecture.

RATING: 9.3/10 MAINT: active DRIFT: medium
▸ 4 reusable components found
markedjs/marked ★ 37219 3741 APPLICATION

marked is a high-performance Markdown parser and compiler written in TypeScript, designed for speed and extensibility. It converts Markdown text into HTML, supporting the CommonMark specification and GitHub Flavored Markdown (GFM) extensions such as tables, task lists, strikethrough, and autolinks. The library is used both as a Node.js package (ESM and UMD builds) and as a command-line tool (bin/marked). Its architecture is modular, consisting of a Lexer (tokenization), Parser (AST construction), Renderer (HTML output), and an extension system via Hooks and custom tokenizers. The core entry point is the `marked()` function, which accepts a Markdown string and options, and returns HTML. The library also exposes a `Marked` class for more control, including async parsing, token walking, and plugin integration. marked does not sanitize output HTML, leaving XSS prevention to downstream consumers. The project includes an extensive test suite with over 600 CommonMark spec examples, GFM spec tests, and custom regression/performance tests (including ReDoS mitigation). The CLI supports stdin, file input, and config files, making it suitable for scripting and build pipelines.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 2 reusable components found
remarkjs/remark ★ 9013 389 APPLICATION

This repository is the remark markdown ecosystem monorepo. It ships four npm packages: remark-parse (markdown to mdast AST), remark-stringify (mdast AST to markdown), remark (a preconfigured unified processor with both), and remark-cli (a terminal interface). In practice, these packages are thin adapter plugins for unified: they attach parser/compiler functions to a unified processor, merge user settings from processor data, and expose extension hooks that other plugins use to add syntax support. The heavy CommonMark parsing and serialization is delegated to mdast-util-from-markdown and mdast-util-to-markdown, so the code here is intentionally small and focused on clean integration rather than reimplementation. The architecture is a workspace-based monorepo of ESM-only packages. Entry points are `remark()`, `unified().use(remarkParse)`, `unified().use(remarkStringify)`, and the `remark` CLI binary. The primary data flow is: markdown text -> unified parse -> mdast tree -> plugin transformations -> unified compile -> markdown text. Extension mechanisms use processor data fields (`micromarkExtensions`, `fromMarkdownExtensions`, `toMarkdownExtensions`), which keeps core packages stable while allowing the plugin ecosystem to grow without coupling. Maintenance is active: CI runs against multiple Node versions, tests downstream packages as canaries, and the codebase enforces strict TypeScript coverage. Technical drift is low: the packages target maintained Node versions, use current unified/micromark-based dependencies, and follow modern ESM conventions. The design is a strong example of building a stable, plugin-driven toolchain around an AST-processing core.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 4 reusable components found
zeux/pugixml ★ 4631 808 APPLICATION

pugixml is a lightweight, high-performance C++ XML processing library that provides a DOM-like interface, a fast non-validating parser, and XPath 1.0 support. It is designed for embedding into other applications and is used widely in game development, desktop applications, and embedded systems. The library is distributed as a single source file (`pugixml.cpp`) and header (`pugixml.hpp`), with optional header-only mode and extensive compile-time configuration via `pugiconfig.hpp`. It supports automatic encoding detection (UTF-8, UTF-16, UTF-32, Latin1), BOM handling, and full Unicode conversion. The architecture is monolithic but well-organized: the core parser uses recursive descent with custom memory pooling (page-based allocator) for fast DOM construction. The DOM tree is exposed through lightweight handle classes (`xml_node`, `xml_attribute`, `xml_text`) with iterator support for children and attributes. XPath queries are compiled into an internal representation and evaluated against the tree with full axis, function, and predicate support. Output is handled via an abstract `xml_writer` interface, allowing custom sinks. The library has zero external dependencies beyond the C++ standard library. Key entry points include `xml_document::load_file`, `load_buffer`, `load_string`, and `save_file`. Data flows involve loading XML from files, memory buffers, or streams into an in-memory DOM, then performing traversal, modification, or XPath queries, and finally saving the modified document. The library is used in production for parsing configuration files, serializing data, and processing XML messages in network protocols. It has an extensive test suite covering parsing edge cases, XPath compliance (W3C and Xalan), memory stress tests, and fuzzing harnesses. The codebase demonstrates strong craftsmanship: template-based parser specializations avoid runtime branching, memory management hooks allow custom allocators, and the compact mode reduces footprint for constrained environments. The library is well-maintained with active CI (GitHub Actions, AppVeyor), fuzz testing, and support for many compilers and platforms. The only notable technical drift is the continued support for legacy compilers (MSVC6, Borland), which adds preprocessor complexity but does not affect modern usage.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 4 reusable components found
pelletier/go-toml ★ 1980 250 APPLICATION

This repository provides a Go library (`github.com/pelletier/go-toml/v2`) for reading and writing TOML documents, conforming to TOML v1.1.0. It offers a two-phase architecture: a low-level iterative AST parser in the `unstable` package, and higher-level `Marshal`/`Unmarshal` functions with configurable streaming `Encoder`/`Decoder` that support strict mode, custom marshalers, and struct tags. The library is dependency-free (only standard library) and includes three CLI tools: `tomll` (formatter), `tomljson` (TOML to JSON), and `jsontoml` (JSON to TOML). The codebase demonstrates strong engineering practices: pooled encoder/decoder states, cached struct plans via `sync.Map`, word-at-a-time scanning for performance, a fused generic decode path, and comprehensive test coverage including auto-generated conformance tests from the upstream toml-test suite. It also includes an experimental document-editing package (`unstable/edit`) that preserves comments and layout via byte-range indexing and splice-based mutations.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 3 reusable components found
microsoft/tsdoc ★ 4974 165 APPLICATION

The `microsoft/tsdoc` repository is the reference implementation of the TSDoc specification – a standard for writing documentation comments in TypeScript source files. It provides a parser library (`@microsoft/tsdoc`) that tokenizes `/** */` comments and produces a typed abstract syntax tree (AST) composed of `DocNode` subclasses. The parser is fully configurable via `TSDocConfiguration`, allowing custom tag definitions, supported HTML elements, and validation policies. A companion package (`@microsoft/tsdoc-config`) loads and validates `tsdoc.json` configuration files, supporting inheritance via `extends`. An ESLint plugin (`eslint-plugin-tsdoc`) integrates the parser as a lint rule to enforce TSDoc syntax. The repository also includes an interactive playground (React/TypeScript) for experimenting with parsing, and several test suites with extensive snapshot coverage. Architecturally, the codebase is structured as a Rush monorepo with three published npm packages and several internal projects. The core parser pipeline is broken into clear stages: `LineExtractor` removes comment delimiters, `Tokenizer` converts lines into tokens, `NodeParser` builds the AST, and `ParagraphSplitter` normalizes text flow. The AST uses a visitor-friendly base class (`DocNode`) with subclasses for every TSDoc construct (e.g., `DocCodeSpan`, `DocLinkTag`, `DocParamBlock`). Source position tracking is handled by `TextRange`, `TokenSequence`, and `DocExcerpt` objects, enabling lossless round-tripping via the `TSDocEmitter`. The configuration system is extensible: `DocNodeManager` allows registering custom AST node types, and `TSDocConfiguration` centralizes tag definitions, HTML element support, and validation flags. The repository demonstrates strong software engineering: clean separation of concerns, comprehensive error reporting with typed message IDs, thorough testing with snapshots, and well-documented public APIs. While some components are tightly coupled to the parser pipeline (e.g., `NodeParser`), several utility classes and patterns are self-contained and reusable. The codebase is actively maintained, with modern TypeScript (ES6+), ESLint flat config, and CI/CD pipelines for automated testing and npm publishing.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 2 reusable components found
postcss/postcss ★ 28975 1648 APPLICATION

This repository contains the core PostCSS library, a programmatic CSS transformation tool. It functions as a parser, an AST manipulator, and a stringifier. Its primary production use is as a library dependency in web development build pipelines (e.g., integrated via webpack, Gulp, or used directly by tools like Autoprefixer and Stylelint) to automate CSS transformations such as adding vendor prefixes, linting, or transpiling future CSS syntax. The architecture is a classic pipeline: CSS text is tokenized and parsed into a tree of Node objects (Root, Rule, Declaration, etc.). A Processor runs an ordered list of plugins, each of which can traverse and modify the tree using a visitor pattern. The modified tree is then stringified back to CSS, with optional source map generation. The core processing engine in `lib/lazy-result.js` is a sophisticated implementation of the visitor pattern, handling synchronous and asynchronous plugins, event filtering, and safe tree mutation. The codebase is well-structured with clear separation of concerns. Several components, such as the input handler (`lib/input.js`), error reporter (`lib/css-syntax-error.js`), value splitter (`lib/list.js`), and source map handler (`lib/previous-map.js`), are isolated, well-crafted, and reusable in other projects. The library is actively maintained, has a comprehensive test suite with fuzzing, and a formal security model. The primary technical debt is the tight coupling between the parser and the specific AST node classes, which makes extracting the parser alone difficult, and the transitional state of supporting both CommonJS and ES modules.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 5 reusable components found
antlr/intellij-plugin-v4 ★ 495 112 APPLICATION

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.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 4 reusable components found
$ loading more...
$ submit: