Friday, March 27, 2026

PEG: Parsing Expression Grammar, peggy.js

For parsing programming languages we need tools and techniques.

One of popular techniques is PEG, and tool peggy.js

Parsing expression grammar - Wikipedia

In computer science, a parsing expression grammar (PEG) is a type of analytic formal grammar, i.e. it describes a formal language in terms of a set of rules for recognizing strings in the language.

Peggy – Parser Generator for JavaScript

Peggy is a simple parser generator for JavaScript that produces fast parsers with excellent error reporting. You can use it to process complex data or computer languages and build transformers, interpreters, compilers and other tools easily.

Online Version » Peggy – Parser Generator for JavaScript

Documentation » Peggy – Parser Generator for JavaScript

peggyjs/peggy: Peggy: Parser generator for JavaScript @GitHub

JS/TS, MIT

Peggy is a simple parser generator for JavaScript that produces fast parsers with excellent error reporting. You can use it to process complex data or computer languages and build transformers, interpreters, compilers and other tools easily.

Peggy is the successor of PEG.js.



introToPeg



A Peggy.js Tutorial - Strumenta

Peggy is the successor of peg.js, an open-source library for writing parsers in JavaScript. It’s based on parsing expression grammars or PEGs, hence the name. PEGs are a powerful parsing formalism with a gentler learning curve than many alternatives, so Peggy is particularly well suited for developers with little experience with parsers.

Strumenta/article-peggy @GitHub


No comments: