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
acornjs avatar

acornjs/acorn

0
View on GitHub↗
11,402 stars·1,034 forks·JavaScript·16 views

Acorn

Acorn is a JavaScript parser that converts source text into a structured abstract syntax tree. It follows the ESTree specification to produce a standardized JSON tree format, enabling consistent analysis of code structure and language versions.

The project features a plugin-based grammar extension system that allows the base parser to be extended with custom rules for experimental or non-standard language features. It also includes syntax error recovery, which inserts placeholder nodes into the tree when encountering invalid code to allow parsing to continue.

The toolset covers static analysis and compiler tooling, providing capabilities to traverse syntax trees, track node ancestry, and map tree elements back to their original line and column positions in the source code.

A command line interface is available to process source files and output the resulting syntax tree.

Features

  • JavaScript Source Parsers - Provides a high-performance parser that converts JavaScript source code into structured ESTree-compliant data.
  • ESTree AST Parsing - Implements a high-performance parser that converts JavaScript source code into abstract syntax trees following the ESTree specification.
  • Recursive Descent Parsers - Employs a recursive descent parsing algorithm to transform source code into a structured syntax tree.
  • JavaScript Parsers - Provides the underlying parsing engine required for static analysis of JavaScript program logic and architecture.
  • Lexical Tokenizers - Includes a lexical tokenizer that converts raw source text into a sequential stream of discrete tokens.
  • Grammar Extensions - Offers a modular system for extending the base parser with custom grammar rules to support experimental language features.
  • Parser Rule Extensions - Allows adding custom parsing rules via a plugin system to support non-standard syntax and specialized language patterns.
  • Visitor Pattern Traversers - Implements a visitor-pattern walker to trigger specific actions when encountering predefined node types during tree traversal.
  • Node Metadata Attachments - Attaches line and column metadata to every AST node to map elements back to their original source locations.
  • AST Node Location - Allows identifying specific nodes within an AST based on their character offsets or spanning positions.
  • Source Text Mapping - Provides mapping of AST nodes back to their exact character offsets and line numbers in the original source text.
  • AST Node Location Mapping - Tracks character offsets and line numbers on every tree node to link parsed elements back to the original source text.
  • Parsing Recovery - Implements mechanisms to maintain valid syntax tree structures by inserting placeholder nodes when parsing malformed source code.
  • Parse Error Reporters - Generates detailed error objects including exact character offsets and line positions for syntax errors.
  • Structural Syntax Recovery - Inserts placeholder nodes into the syntax tree when encountering invalid code to allow parsing to continue.
  • Syntax Traversal - Provides tools for navigating and inspecting nodes and tokens within a generated syntax tree.
  • AST & Language Tools - Small, fast JavaScript parser.
  • AST Parsers - Tiny and fast JavaScript parser.

Star history

Star history chart for acornjs/acornStar history chart for acornjs/acorn

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. 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

Projects sharing features with Acorn

These projects share indexed features with Acorn. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • dtolnay/syndtolnay avatar

    dtolnay/syn

    3,292View on GitHub↗

    syn is a Rust syntax tree parser and token stream converter. It serves as a toolkit for procedural macro development, providing a framework to parse Rust source code into structured syntax trees for analysis and transformation. The project enables the manipulation of Rust abstract syntax trees through specialized visitor and folder patterns for traversing and mutating nodes. It provides a bidirectional mapping that allows developers to convert token streams into structured trees and print those trees back into tokens for code generation. The library covers a broad range of syntax analysis ca

    Rustproc-macro
    View on GitHub↗3,292
  • boa-dev/boaboa-dev avatar

    boa-dev/boa

    6,884View on GitHub↗

    Boa is a high-performance JavaScript engine and parser designed to execute JavaScript code and analyze source code structure. It functions as a runtime environment for executing scripts to automate tasks or process data, providing both a command-line JavaScript interpreter and a tool for converting source code into abstract syntax trees. The engine is capable of compiling to WebAssembly, allowing the runtime to be deployed and executed within web browser environments. It includes an interactive read-eval-print loop for real-time logic testing and snippet execution via a terminal. The system

    Rustecmascripthacktoberfestinterpreter
    View on GitHub↗6,884
  • xoofx/markdigxoofx avatar

    xoofx/markdig

    5,127View on GitHub↗

    Markdig is a markdown parser library that converts text into structured HTML, plain text, or other formats using a configurable pipeline. It functions as a CommonMark compliant parser and an abstract syntax tree generator that transforms markdown into a hierarchical tree of block and inline nodes with precise source location mapping. The project is distinguished by a decoupled renderer architecture that separates parsing logic from output generation, enabling the transformation of the syntax tree into non-HTML formats such as LaTeX or XAML. It also serves as a lossless markdown processor by t

    C#commonmarkcommonmark-parsingcsharp
    View on GitHub↗5,127
  • jquery/esprimajquery avatar

    jquery/esprima

    7,139View on GitHub↗

    Esprima is a JavaScript parser that converts source code into a structured abstract syntax tree. It implements a specification-driven grammar to ensure compliance with ECMAScript standards, enabling the programmatic analysis and transformation of JavaScript programs. The project provides capabilities for lexical tokenization to break source code into individual symbols and static syntax validation to verify that scripts are well-formed without executing the code. Its functional surface covers JavaScript static analysis, lexical analysis, and the generation of abstract syntax trees.

    TypeScript
    View on GitHub↗7,139
Compare all 30 related projects→

Frequently asked questions

What does acornjs/acorn do?

Acorn is a JavaScript parser that converts source text into a structured abstract syntax tree. It follows the ESTree specification to produce a standardized JSON tree format, enabling consistent analysis of code structure and language versions.

What are the main features of acornjs/acorn?

The main features of acornjs/acorn are: JavaScript Source Parsers, ESTree AST Parsing, Recursive Descent Parsers, JavaScript Parsers, Lexical Tokenizers, Grammar Extensions, Parser Rule Extensions, Visitor Pattern Traversers.

Which projects share features with acornjs/acorn?

Projects with overlapping indexed features include: dtolnay/syn — syn is a Rust syntax tree parser and token stream converter. It serves as a toolkit for procedural macro development,… boa-dev/boa — Boa is a high-performance JavaScript engine and parser designed to execute JavaScript code and analyze source code… xoofx/markdig — Markdig is a markdown parser library that converts text into structured HTML, plain text, or other formats using a… jquery/esprima — Esprima is a JavaScript parser that converts source code into a structured abstract syntax tree. It implements a… babel/babel — Babel is a pluggable JavaScript compiler and transpiler that converts modern ECMAScript syntax into… babel/minify — This project is an AST-based code optimizer and compressor for modern ECMAScript, JSX, and TypeScript source code. It…