awesome-repositories.com
博客
MCP
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目MCP 服务器关于排名机制媒体报道
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·

19 个仓库

Awesome GitHub RepositoriesFormal Grammar Parser Generators

Tools that generate parsers based on formal grammar specifications to extract structured data from text.

Distinct from Grammar-Based Parsers: Unlike Grammar-Based Parsers [f6_mt2] which are the resulting parsers, this refers to the generator tool itself.

Explore 19 awesome GitHub repositories matching software engineering & architecture · Formal Grammar Parser Generators. Refine with filters or upvote what's useful.

Awesome Formal Grammar Parser Generators GitHub Repositories

用 AI 发现最棒的仓库。我们将通过 AI 为您搜索最匹配的仓库。
  • antlr/antlr4antlr 的头像

    antlr/antlr4

    18,928在 GitHub 上查看↗

    ANTLR 是一个基于语法的代码生成器和多语言解析器生成器,用于设计和实现自定义语言。它作为一个工具包,用于将形式语言定义转换为可执行的源代码,以处理结构化文本或二进制文件,同时提供了一个用于自动构建和遍历层级解析树的框架。 该项目以其能够从单个共享语法定义生成多种目标编程语言的词法分析器和解析器的能力而著称。它支持包含直接左递归的语法,并利用自适应预测来优化解析速度,同时保持灵活性。 该系统涵盖了广泛的能力,包括词法分析、通过谓词评估进行的语义检查以及层级数据管理。它通过基于路径的查询和访问者-监听器遍历模式提供了解析树分析工具,以将语法逻辑与应用程序操作解耦。 命令行实用程序可用于测试语法定义和调试逻辑,并且该工具可以在 Docker 容器中执行以避免本地安装。

    Generates lexer and parser source code for multiple target programming languages from a single grammar definition.

    Java
    在 GitHub 上查看↗18,928
  • github/semanticgithub 的头像

    github/semantic

    9,041在 GitHub 上查看↗

    Semantic 是一个基于 Haskell 的库和命令行工具,专为多语言源代码分析而设计。它作为一个静态程序分析框架和多语言抽象语法树解析器,能够根据语法定义将多种编程语言转换为结构化的语法树。 该系统通过一个语义代码比较引擎脱颖而出,该引擎检测代码版本之间的结构和意义变化,而不是依赖文本差异。它进一步通过将表面语言转换为统一的多语言中间表示,实现了跨不同编程语法的分析。 该框架为解析 Rust、Go、Python、Ruby、PHP、TypeScript 和 TSX 等语言提供了广泛的功能。它涵盖了通过代码作用域映射、符号提取和语义图生成的语义分析,以及用于模式分析和程序行为评估的工具。 该工具集还包括用于标准化 Haskell 源代码文件布局的命令行实用程序。

    Produces strongly typed abstract syntax trees by applying formal language grammar definitions to raw source text.

    Haskell
    在 GitHub 上查看↗9,041
  • ocaml/ocamlocaml 的头像

    ocaml/ocaml

    6,514在 GitHub 上查看↗

    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

    Includes a dedicated parser generator to automatically create lexers and parsers from formal grammar specifications.

    OCamlcompilerfunctional-languageocaml
    在 GitHub 上查看↗6,514
  • lark-parser/larklark-parser 的头像

    lark-parser/lark

    5,914在 GitHub 上查看↗

    Lark 是一个 Python 解析工具包,用于定义语法并将原始文本转换为带注释的解析树。它作为一个抽象语法树生成器和语法定义语言,用于通过终结符和正则表达式指定语言规则。 该库提供两种主要的解析实现:一种是能够处理所有上下文无关语言(包括具有歧义和左递归的语言)的 Earley 解析库;另一种是专为具有低内存开销的确定性语言设计的高性能 LALR 解析库。 除了核心解析外,该工具包还包括模块化语法组合、基于规则的树转换以及源位置坐标跟踪功能。它还支持将 LALR 语法序列化为独立的解析器模块。

    Automatically generates hierarchical abstract syntax trees by matching input tokens against defined grammar rules.

    Pythoncykearleygrammar
    在 GitHub 上查看↗5,914
  • harc/ohmharc 的头像

    harc/ohm

    5,530在 GitHub 上查看↗

    Ohm is a compiler construction toolkit and parser combinator library used to build parsers, interpreters, and compilers. It provides a formal grammar language for specifying the structural rules of data formats to ensure precise parsing of input strings. The project functions as a parsing debugging tool and program execution visualizer. It generates text traces and graphical visualizations to show the step-by-step logic used during parsing and renders runtime state changes and method call hierarchies. The toolkit covers custom parser development and the construction of compilers and interpre

    Enables the definition of formal grammars to create structured representations of text input.

    JavaScript
    在 GitHub 上查看↗5,530
  • chai2010/go-ast-bookchai2010 的头像

    chai2010/go-ast-book

    5,510在 GitHub 上查看↗

    go-ast-book 是一系列专注于抽象语法树(AST)分析、编译器开发和静态代码验证的教育和技术资源。它提供了解析、遍历和分析 Go 源代码以提取语义含义的指南和手册。 该项目作为构建编译器前端的参考,涵盖了将高级代码转换为中间表示和静态单赋值形式的过程。它还提供了使用这些技术开发语言工具和执行静态代码分析的说明。 这些资源涵盖了广泛的静态分析能力,包括词法标记化、表达式和声明的结构化解析,以及源文件的坐标跟踪。它还详细介绍了语义分析过程,如标识符解析、类型正确性验证,以及针对并发和延迟执行的控制流分析。

    Translates Go language constructs such as selector expressions and slice operations into AST structures.

    Go
    在 GitHub 上查看↗5,510
  • ohmjs/ohmohmjs 的头像

    ohmjs/ohm

    5,471在 GitHub 上查看↗

    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

    Provides a tool for defining custom languages using formal grammars to parse, validate, and extract data.

    JavaScriptcompilergrammarsjavascript
    在 GitHub 上查看↗5,471
  • pest-parser/pestpest-parser 的头像

    pest-parser/pest

    5,355在 GitHub 上查看↗

    Pest 是一个 Rust 解析库和自动解析器生成器,可将形式语法定义转换为功能性解析器。它专注于解析表达式语法(PEG)以识别和结构化复杂的文本模式,提供了一个用于上下文无关语法解析的系统。 该库实现了零拷贝标记化和静态语法编译,以减少运行时开销。它支持 no-std 运行时兼容性,允许解析器在没有标准库的嵌入式或裸机环境中编译。 该项目涵盖了一系列解析功能,包括嵌套标记对的提取和自动语法验证。它用于实现领域特定语言(DSL)、自定义语言解析和数学表达式求值。它还提供自动错误报告以识别意外标记或缺失输入。

    Automatically generates a functional parser implementation and error reporting from a defined formal grammar.

    Rust
    在 GitHub 上查看↗5,355
  • racket/racketracket 的头像

    racket/racket

    5,157在 GitHub 上查看↗

    Racket 是一种通用的、多范式编程语言,属于 Lisp 家族,专为语言创建而设计。它作为一个语言工作台,通过灵活的宏和模块系统,为设计和实现自定义编程语言提供了一个平台。 该系统的特色在于提供了一套全面的语义工程套件,允许构建专门的语言子集和教育层。它包括用于自定义语言设计的工具,如词法分析器和解析器生成,以及在读取时定义模块扩展规则和动态语言选择的能力。 该项目提供了一个集成开发环境,内置编辑器、可视化调试器和软件包管理器。其功能范围扩展到涵盖 2D 图形渲染、二进制数据处理、SQL 和演绎数据库集成以及图形用户界面构建的通用标准库。 该环境支持将源代码编译为独立的二进制可执行文件以进行分发。

    Produces lexers and parsers from formal grammar specifications to convert token streams into structured representations.

    Racketracket
    在 GitHub 上查看↗5,157
  • pegjs/pegjspegjs 的头像

    pegjs/pegjs

    4,908在 GitHub 上查看↗

    PegJS 是一个解析表达式语法(PEG)工具和 JavaScript 解析器生成器。它作为一个语法编译器,将形式语法规范转换为可执行的 JavaScript 代码,用于分析结构化文本和处理复杂的输入字符串。 该系统生成确定性解析器,避免了上下文无关语法的歧义。它利用带有记忆功能的 Packrat 解析模型来确保线性时间复杂度,并采用递归下降解析以自顶向下的层级方式处理输入。 该工具集支持领域特定语言(DSL)的实现和自定义语言开发。它包括递归语法规则定义、用于将匹配文本转换为结构化数据的内联语义动作,以及用于条件匹配的语义谓词的能力。 生成引擎包含配置选项,以平衡生成的解析器的执行速度与最终输出的代码大小。

    Functions as a tool that generates executable JavaScript parsers from formal grammar specifications.

    JavaScript
    在 GitHub 上查看↗4,908
  • google/wuffsgoogle 的头像

    google/wuffs

    4,773在 GitHub 上查看↗

    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

    A feature that translates a domain-specific language into executable code for other target environments such as Go or Rust.

    Ccodecmemory-safetyparsing
    在 GitHub 上查看↗4,773
  • zesterer/chumskyzesterer 的头像

    zesterer/chumsky

    4,545在 GitHub 上查看↗

    Chumsky 是一个解析器组合子(parser combinator)库,用于通过将小的解析函数组合成复杂的语法来构建高性能解析器。它提供了多种解析引擎,包括用于解决数学和逻辑表达式中运算顺序的递归下降和优先级爬升实现。 该库的独特之处在于其零拷贝(zero-copy)文本解析,它最大限度地减少了内存分配以提高吞吐量,并且能够在没有标准库的情况下运行,以用于嵌入式或资源受限的环境。它还具有一个错误恢复解析器,可以识别格式错误的输入并恢复处理,从而在单次传递中报告多个语法错误。 该框架涵盖了广泛的功能,包括上下文敏感的状态管理、递归语法支持以及正则表达式模式的集成。它包括用于解析器结构分析、节点检查和结果缓存的工具,以支持回溯和左递归。 该库支持自定义语言开发、数据格式解析和编程语言工具的构建。

    Supports the development of custom parsers by defining formal grammars to derive structured representations of text.

    Rustcontext-free-grammarerrorslexing
    在 GitHub 上查看↗4,545
  • zaach/jisonzaach 的头像

    zaach/jison

    4,385在 GitHub 上查看↗

    Jison 是一个实现 LALR 解析算法的 JavaScript 解析器生成器。它通过将结构化输入转换为标记(tokens)和树,创建用于分析自定义编程语言的工具。 该项目作为一个与 Bison 兼容的生成器,接受与 Bison 解析器生成器格式兼容的语法,以生成 JavaScript 解析器。 它涵盖了编译器前端开发的需求,包括领域特定语言的实现和语法分析工具。其功能扩展到自定义语言解析以及通过命令行界面生成解析器。

    Provides a tool that transforms formal grammar specifications into a functional JavaScript parser.

    JavaScript
    在 GitHub 上查看↗4,385
  • kach/nearleykach 的头像

    kach/nearley

    3,740在 GitHub 上查看↗

    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

    Transforms modular BNF-like language descriptions into functional parsers that handle recursive grammars.

    JavaScript
    在 GitHub 上查看↗3,740
  • hardmath123/nearleyHardmath123 的头像

    Hardmath123/nearley

    3,740在 GitHub 上查看↗

    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

    Compiles grammar definitions into typed languages to provide annotations and flexibility for post-processors.

    JavaScript
    在 GitHub 上查看↗3,740
  • eliben/pycparsereliben 的头像

    eliben/pycparser

    3,473在 GitHub 上查看↗

    pycparser is a C99 parser library that converts C source code into an abstract syntax tree consisting of Python objects. It functions as an abstract syntax tree generator, transforming preprocessed C code into a structured hierarchy for programmatic analysis and transformation. The library integrates with a C preprocessor to handle directives before parsing. It also features a stub header parser, which uses minimal mock headers to allow the parsing of C code without requiring a full system C library installation. The project provides tools for static code analysis, C program analysis, and so

    Implements a C99 parsing engine generated from a formal grammar using the Python Lex-Yacc (PLY) framework.

    Python
    在 GitHub 上查看↗3,473
  • hyperjumptech/grule-rule-enginehyperjumptech 的头像

    hyperjumptech/grule-rule-engine

    2,505在 GitHub 上查看↗

    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

    Generates parsers from formal grammar definitions to translate rule syntax into executable logic.

    Gogolanghacktoberfesthacktoberfest2021
    在 GitHub 上查看↗2,505
  • tabatkins/railroad-diagramstabatkins 的头像

    tabatkins/railroad-diagrams

    1,744在 GitHub 上查看↗

    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.

    Provides a utility for replacing dense BNF notation or regular expressions with clear, readable flowcharts.

    Python
    在 GitHub 上查看↗1,744
  • blazegraph/databaseblazegraph 的头像

    blazegraph/database

    985在 GitHub 上查看↗

    This project is a high-performance semantic graph database engine designed for storing and querying massive RDF datasets. It functions as a specialized platform for managing linked data and complex relationship models, utilizing standard semantic web protocols to integrate and analyze distributed information sources. The system distinguishes itself through its use of B-Tree indexing to enable rapid traversal of relationships within large-scale datasets and its support for the Triple Pattern Fragments protocol to facilitate scalable web-based access. It provides automated tools for transformin

    Transforms formal grammar definitions into executable source code to enable the parsing and processing of semantic queries.

    Javablazegraphgraph-databaserdf
    在 GitHub 上查看↗985
  1. Home
  2. Software Engineering & Architecture
  3. Trees
  4. Syntax Tree Construction
  5. Formal Grammar Parser Generators

探索子标签

  • AST GeneratorsTools that generate strongly typed abstract syntax trees based on formal grammar specifications. **Distinct from Formal Grammar Parser Generators:** Focuses on the resulting AST structure for analysis rather than general parser generation logic.
  • Bison-Compatible GeneratorsParser generators that accept grammars in the Bison format. **Distinct from Formal Grammar Parser Generators:** Specifically targets compatibility with the Bison grammar format, unlike general formal grammar generators.
  • Compiler Front-End GenerationUsing parser generators to build the initial stages of compilers, including lexing and parsing. **Distinct from Formal Grammar Parser Generators:** Distinct from Formal Grammar Parser Generators: focuses on the application of the generator to create compiler front-ends.
  • Custom Parser DevelopmentDefining formal grammars to match input strings and derive structured representations of text. **Distinct from Formal Grammar Parser Generators:** Focuses on the process of developing the parser logic using the generator, rather than just the generator tool itself.
  • LALR ParsersParsers generated from grammars using look-ahead left-to-right shift-reduce algorithms. **Distinct from Formal Grammar Parser Generators:** Specifically refers to the resulting LALR parser implementation generated by PLY, rather than the generator tool itself
  • Multi-Language Parser GenerationThe capability of a generator to target multiple different programming languages for parser output. **Distinct from Formal Grammar Parser Generators:** Distinct from Formal Grammar Parser Generators: emphasizes the multi-target output capability.
  • Multi-Target Code GenerationGenerating parser source code for multiple target programming languages from a single grammar. **Distinct from Formal Grammar Parser Generators:** Distinct from Formal Grammar Parser Generators: specifically targets the ability to produce code for multiple target languages.
  • Typed Code GenerationGeneration of type-annotated parser code from formal grammar specifications. **Distinct from Formal Grammar Parser Generators:** Distinct from general Formal Grammar Parser Generators by focusing on the type-safety of the generated output code.