awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
lark-parser avatar

lark-parser/lark

0
View on GitHub↗
5,914 stars·484 forks·Python·MIT·25 views

Lark

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 capabilities for modular grammar composition, rule-based tree transformation, and coordinate tracking for source positions. It also supports the serialization of LALR grammars into standalone parser modules.

Features

  • Parsing Toolkits - Provides a comprehensive suite of parsing algorithms and grammar definition tools for transforming raw text into structured parse trees.
  • AST Generators - Acts as a toolkit for transforming raw input text into hierarchical abstract syntax trees based on predefined grammars.
  • Parsing and Grammars - Converts raw text into annotated parse trees based on user-defined grammar rules.
  • Custom Language Definitions - Enables the definition of custom language structures using grammar rules and regular expressions.
  • Grammar Rule Specification - Allows users to define the structure of a language using a high-level syntax for recursive rules and regular expressions.
  • Context-Free Grammar Frameworks - Implements a framework capable of parsing all context-free languages, including those with ambiguity and left-recursion.
  • Formal Grammar Specifications - Allows the definition of recursive rules and terminals using extended Backus-Naur Form (EBNF) syntax.
  • Annotated Parse Trees - Transforms raw text into hierarchical parse trees annotated with grammar rule matches and source positions.
  • Abstract Syntax Tree Parsing - Automatically generates a hierarchical tree representation of the input text based on the defined grammar.
  • Concrete Parse Tree Generation - Automatically builds full, annotated hierarchical parse trees based on the specified grammar structure.
  • AST Generators - Automatically generates hierarchical abstract syntax trees by matching input tokens against defined grammar rules.
  • LALR Parsers - Implements a high-performance LALR parser using look-ahead left-to-right shift-reduce algorithms for deterministic languages.
  • Earley Parser Implementations - Implements the Earley parsing algorithm to support all context-free languages, including those with left-recursion.
  • Earley Parsers - Implements the Earley parsing algorithm to handle all context-free grammars, including those with ambiguity and left-recursion.
  • Interactive Grammar Debugging - Offers tools to design and debug language grammars by inspecting parser decisions interactively.
  • Ambiguity Management - Supports marking multiple valid interpretations of a single input string when using the Earley parsing algorithm.
  • High-Performance Text Processing - Uses LALR algorithms to process large volumes of text with high efficiency and low memory usage.
  • Grammar Compositions - Provides the ability to import terminals and rules from multiple external grammar files to build complex parsing logic.
  • Domain Specific Language Parsers - Provides tools to build specialized parsers for custom data formats and complex recursive configuration languages.
  • Parsing Optimizations - Implements high-performance LALR parsing to increase execution speed and reduce memory overhead.
  • Source Coordinate Tracking - Provides line and column offset tracking for tokens to map parse tree nodes back to the original source code.
  • Standalone Parser Generators - Compiles LALR grammars into self-contained parser modules to remove dependencies on the full toolkit.
  • Coordinate Tracking - Tracks line and column numbers for every element in the parse tree to facilitate precise error reporting and debugging.
  • Grammar Extensions - Imports terminals and rules from external libraries to reuse common language patterns within a grammar.
  • Grammar Compositions - Supports importing and combining separate grammar definitions to build complex languages from reusable components.
  • Syntax Tree Transformers - Uses a visitor-pattern mechanism to transform parse trees into custom data structures via specific grammar branch mappings.

Star history

Star history chart for lark-parser/larkStar history chart for lark-parser/lark

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does lark-parser/lark do?

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.

What are the main features of lark-parser/lark?

The main features of lark-parser/lark are: Parsing Toolkits, AST Generators, Parsing and Grammars, Custom Language Definitions, Grammar Rule Specification, Context-Free Grammar Frameworks, Formal Grammar Specifications, Annotated Parse Trees.

What are some open-source alternatives to lark-parser/lark?

Open-source alternatives to lark-parser/lark include: 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,…

Open-source alternatives to Lark

Similar open-source projects, ranked by how many features they share with Lark.
  • ohmjs/ohmohmjs avatar

    ohmjs/ohm

    5,471View on 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

    JavaScriptcompilergrammarsjavascript
    View on GitHub↗5,471
  • hardmath123/nearleyHardmath123 avatar

    Hardmath123/nearley

    3,740View on 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

    JavaScript
    View on GitHub↗3,740
  • kach/nearleykach avatar

    kach/nearley

    3,740View on 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

    JavaScript
    View on GitHub↗3,740
  • harc/ohmharc avatar

    harc/ohm

    5,530View on 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

    JavaScript
    View on GitHub↗5,530
See all 30 alternatives to Lark→