# whitequark/parser

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/whitequark-parser).**

1,642 stars · 204 forks · Yacc · NOASSERTION

## Links

- GitHub: https://github.com/whitequark/parser
- awesome-repositories: https://awesome-repositories.com/repository/whitequark-parser.md

## Description

Parser is a Ruby source code parser that converts raw source text into structured abstract syntax trees for static analysis and code manipulation. It features dynamic dispatch mechanisms that select specific grammar and tokeniser implementations at runtime, supporting both the executing interpreter version and explicitly targeted language specification versions. 

The library constructs abstract syntax tree nodes as frozen, immutable objects while tracking exact source file coordinates and character ranges for each node. Developers can supply custom builder objects to control how tree nodes are instantiated and structured. Additionally, the library includes diagnostics and error reporting utilities that collect and display syntax warnings and parsing errors encountered during source analysis.

## Tags

### Programming Languages & Runtimes

- [Ruby Source Code Parsers](https://awesome-repositories.com/f/programming-languages-runtimes/programming-utilities/data-structure-type-helpers/data-structures/hierarchical-tree-structures/source-code-abstract-syntax-trees/java-source-code-analyzers/ruby-source-code-parsers.md) — Converts Ruby source code into an abstract syntax tree representation to analyze and inspect code structure. ([source](https://github.com/whitequark/parser/blob/master/README.md))
- [Ruby Source Code Analysis](https://awesome-repositories.com/f/programming-languages-runtimes/programming-utilities/data-structure-type-helpers/data-structures/hierarchical-tree-structures/source-code-abstract-syntax-trees/java-source-code-analyzers/ruby-source-code-analysis.md) — Parses Ruby source code into abstract syntax trees to inspect, transform, or analyze underlying code structures.
- [Ruby Source Code Parsers](https://awesome-repositories.com/f/programming-languages-runtimes/ruby-parsers/ruby-source-code-parsers.md) — Transforms Ruby source code into abstract syntax trees with exact location tracking and diagnostic reporting.
- [Source Coordinate Tracking](https://awesome-repositories.com/f/programming-languages-runtimes/source-coordinate-tracking.md) — Tracks exact source file coordinates and character ranges for nodes within the generated syntax tree. ([source](https://github.com/whitequark/parser#readme))
- [Language Version Dispatch Mechanisms](https://awesome-repositories.com/f/programming-languages-runtimes/language-version-dispatch-mechanisms.md) — Dynamically selects specific grammar and tokeniser implementations at runtime to support multiple distinct language specification versions.

### Software Engineering & Architecture

- [Abstract Syntax Tree Generators](https://awesome-repositories.com/f/software-engineering-architecture/abstract-syntax-tree-parsing/abstract-syntax-tree-generators.md) — Converts raw source code into structured tree representations that expose underlying grammar for analysis. ([source](https://github.com/whitequark/parser#readme))
- [Immutable Nodes](https://awesome-repositories.com/f/software-engineering-architecture/abstract-syntax-tree-parsing/abstract-syntax-tree-generators/immutable-nodes.md) — Constructs abstract syntax tree nodes as frozen, immutable objects that eliminate concurrency risks. ([source](https://whitequark.github.io/ast/))
- [Runtime-Specific Code Parsing](https://awesome-repositories.com/f/software-engineering-architecture/abstract-syntax-tree-parsing/runtime-specific-code-parsing.md) — Transforms source code into abstract syntax trees using the exact language version of the interpreter currently executing. ([source](https://github.com/whitequark/parser/blob/master/doc/PRISM_TRANSLATION.md))
- [Version-Specific Code Parsing](https://awesome-repositories.com/f/software-engineering-architecture/specification-versioning/version-specific-code-parsing.md) — Transforms source code into abstract syntax trees by selecting the appropriate implementation for a specific target language version. ([source](https://github.com/whitequark/parser/blob/master/doc/PRISM_TRANSLATION.md))
- [Custom Builders](https://awesome-repositories.com/f/software-engineering-architecture/trees/syntax-tree-construction/custom-builders.md) — Allows supplying custom builder objects to control how abstract syntax tree nodes are instantiated and structured. ([source](https://github.com/whitequark/parser/blob/master/doc/PRISM_TRANSLATION.md))

### Development Tools & Productivity

- [Syntax Diagnostics Collection](https://awesome-repositories.com/f/development-tools-productivity/json-syntax-repair/syntax-error-diagnostics/syntax-diagnostics-collection.md) — Gathers syntax warnings and parsing errors during the analysis of source code input. ([source](https://github.com/whitequark/parser#readme))
- [Source Code Diagnostics Collectors](https://awesome-repositories.com/f/development-tools-productivity/source-code-diagnostics-collectors.md) — Gathers and outputs syntax warnings and parsing errors encountered during code analysis.

### System Administration & Monitoring

- [Parser Diagnostics Reporting](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/diagnostic-error-reporting/parser-diagnostics-reporting.md) — Collects and displays error messages and warnings encountered during the parsing process to identify syntax issues. ([source](https://github.com/whitequark/parser/blob/master/README.md))

### Testing & Quality Assurance

- [Source Code](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-checks/php-language-standards/syntax-checking/source-code.md) — Collects and reports syntax errors and warnings from source files to identify code issues early.
