BSD Ports

devel/py-funcparserlib 1.0.1_1 DragonFly

Recursive descent parsing library based on functional combinators

System
DragonFly
Repository
DPorts
Maintainer
[email protected] (as in FreeBSD)
License
MIT
Categories
devel, python
Package size
24.1 KiB, 135.7 KiB installed

Description

The primary focus of funcparserlib is parsing little languages or external DSLs (domain specific languages).

Parsers made with funcparserlib are pure-Python LL(*) parsers. It means that it's very easy to write parsers without thinking about lookaheads and other hardcore parsing stuff. However, recursive descent parsing is a rather slow method compared to LL(k) or LR(k) algorithms. Still, parsing with funcparserlib is at least twice faster than PyParsing, a very popular library for Python.

The source code of funcparserlib is only 1.2K lines of code, with lots of comments. Its API is fully type hinted. It features the longest parsed prefix error reporting, as well as a tiny lexer generator for token position tracking.

The idea of parser combinators used in funcparserlib comes from the Introduction to Functional Programming course. We have converted it from ML into Python.

In the other systems

SystemPortVersion
DragonFlydevel/py-funcparserlib1.0.1_1
FreeBSDdevel/py-funcparserlib1.0.1_1
NetBSDdevel/py-funcparserlib1.0.1
HardenedBSDdevel/py-funcparserlib1.0.1_1
GhostBSDdevel/py-funcparserlib1.0.1_1

Install

Binary package:

pkg install py311-funcparserlib

From DPorts:

cd /usr/dports/devel/py-funcparserlib && make install clean

Dependencies

Run dependencies 1