TDParser

This is a top-down parser combinator library for Ruby (LL(k) parser), and is a successor of TDP4R.

Description

TDParser is a Ruby library that helps us to construct a top-down parser using recursive method calls, that is also called a recursive descendent parser. The main features are

  1. constructing a parser using combinators as in Parsec (Daan Leijen: Parsec (Monadic Parser Combinator Library for Haskell), www.cs.uu.nl/~daan/parsec.html),

  2. backtracking parse algorithm with unlimited lookahead (Bryan Ford: “Packrat Parsing: Simple, Powerful, Lazy, Linear Time”, ICFP, 2002.), and

  3. writing EBNF grammars using Ruby’s objects.

The feature of (1) enables us to change some production rules in a grammar at runtime and componentize a set of production rules. From the feature of (2), we need not consider how to prevent conflicts among production rules. In addition, TDParser can be viewed as an internal DSL for writing LL(k) grammars because of (3).

Repository is located at:

License

Copyright(C) 2003, 2004, 2005, 2006 Takaaki Tateishi <ttate@ttsky.net>
Copyright(C) 2024                   gemmaro          <gemmaro.dev@gmail.com>

See COPYING.