parzec
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Parser Combinators for Typescript

Build status Version

Parzec is a parser combinator library adapted from Haskell's famous Parsec library. A parser combinator library consist of higher order functions which make it easy to build recursive descent parsers. Parsers composed from Parzec's combinators can recognize languages in the PEG class of grammars. PEG grammars can be context-sensitive, so the parsers have infinite lookahead and backtracking capabilities.

Parzec also supports efficient parsing of LL(1) grammars by enabling the backtracking only when a special combinator is used. Also, to improve performance, some combinators have been inlined rather than built from lower level combinators.

Parzec's input is represented by an abstract interface. Consequently, the parsers' input can be anything from simple strings to files, or even tokenized data streams. Parzec includes functionality to create lexical analyzers or lexers from regular expressions. The lexer converts input strings into tokens, and makes the parsing simpler and more efficient.

Package Sidebar

Install

npm i parzec

Weekly Downloads

21

Version

1.1.0

License

MPL-2.0

Unpacked Size

4.72 MB

Total Files

84

Last publish

Collaborators

  • johtela