parzec
v1.1.0
Published
Parser combinators for Typescript
Downloads
41
Readme
Parser Combinators for Typescript
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.