Lark 是一个 Python 解析工具包,用于定义语法并将原始文本转换为带注释的解析树。它作为一个抽象语法树生成器和语法定义语言,用于通过终结符和正则表达式指定语言规则。
lark-parser/lark 的主要功能包括:Parsing Toolkits, AST Generators, Parsing and Grammars, Custom Language Definitions, Grammar Rule Specification, Context-Free Grammar Frameworks, Formal Grammar Specifications, Annotated Parse Trees。
lark-parser/lark 的开源替代品包括: ohmjs/ohm — Ohm is a formal grammar parser generator and domain-specific language framework. It provides a system for defining… hardmath123/nearley — Nearley is a JavaScript parser toolkit used to define context-free grammars and generate corresponding parsers. It… kach/nearley — Nearley is a JavaScript parser toolkit and context-free grammar compiler. It functions as an Earley parser generator… harc/ohm — Ohm is a compiler construction toolkit and parser combinator library used to build parsers, interpreters, and… commonmark/commonmark-spec — This project is a formal markdown specification standard that provides a detailed markup syntax definition and a… dtolnay/syn — syn is a Rust syntax tree parser and token stream converter. It serves as a toolkit for procedural macro development,…
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
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
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
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