Pratt Parser
JSON →`pratt-parser` is a JavaScript/TypeScript library that implements a Top Down Operator Precedence (TDOP) parser, commonly known as a Pratt parser. It draws inspiration from both the general TDOP concept and specific implementations like Douglas Crockford's TDOP work. The library enables developers to construct custom parsers for various syntaxes, such as mathematical expressions or domain-specific languages, by defining tokens, null denotation (nud) functions for prefix operators, and left denotation (led) functions for infix operators, along with their respective precedences. The current stable version is 12.0.6, indicating active maintenance and frequent, albeit minor, updates. Major versions introduce breaking changes primarily related to API refinement and Node.js compatibility. It provides comprehensive TypeScript type definitions, making it suitable for modern TypeScript projects seeking a robust and extensible parsing solution.
Traffic · last 30 days ↓83% vs prev 7d
top countries 🇺🇸 United States · 🇫🇷 France · 🇨🇦 Canada · 🇩🇪 Germany · 🇪🇸 Spain