yieldparser
parser-combinators
yieldparser | parser-combinators | |
---|---|---|
1 | 1 | |
69 | 6 | |
- | - | |
7.3 | 3.4 | |
3 months ago | about 1 year ago | |
TypeScript | TypeScript | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
yieldparser
-
Casual Parsing in JavaScript
I’ve found generator functions work great for parsers. You yield the tokens you expect to be next. The token could be a string, a regular expression to be matched, or another generator function.
The library is open source here, contributions welcome: https://github.com/RoyalIcing/yieldparser
Generator functions have great support in modern browsers (not IE) and Node.js.
For example here’s a simple v4 IP address parser:
import { parse, mustEnd } from 'yieldparser';
function* Digit() {
parser-combinators
-
Casual Parsing in JavaScript
Parser combinators [0] are great for quick parsing, usage from typescript is very neat. You can collapse tokenisation, parsing and some evaluation for simple grammars (they appear in production from time to time) into single parser combinator phase (there’s nothing else) where you get desired, typed result.
[0] https://github.com/appliedblockchain/parser-combinators
What are some alternatives?
hyperformula - HyperFormula is an open-source headless spreadsheet for business web apps. It comes with over 400 formulas, CRUD operations, undo-redo, clipboard support, and sorting. Built in TypeScript, supported by the Handsontable Team.
instaparse
pattern-grab - 🤛🏻 Regular Expression Data Grabber
parser - String parser combinators
three-pass-compiler - Solution to the Three Pass Compiler kata on CodeWars, parsing and manipulating a very simple AST
umbrella - ⛱ Broadly scoped ecosystem & mono-repository of 192 TypeScript projects (and 157 examples) for general purpose, functional, data driven development
reco - Regular Expression COmpiler - Compile a regex ahead of time to code