- Add a new port: devel/py-funcparserlib
Parser combinators are just higher-order functions that take parsers as their arguments and return them as result values. Parser combinators are: * First-class values * Extremely composable * Tend to make the code quite compact * Resemble the readable notation of xBNF grammars Parsers made with funcparserlib are pure-Python LL(*) parsers. It means that it's very easy to write them without thinking about look-aheads and all that hardcore parsing stuff. But the recursive descent parsing is a rather slow method compared to LL(k) or LR(k) algorithms. So the primary domain for funcparserlib is parsing little languages or external DSLs (domain specific languages). The library itself is very small. Its source code is only 0.5 KLOC, with lots of comments included. It features the longest parsed prefix error reporting, as well as a tiny lexer generator for token position tracking. WWW: http://code.google.com/p/funcparserlib/
This commit is contained in:
parent
6e4e0d5b6d
commit
d0bf10ed20
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=278964
5 changed files with 82 additions and 0 deletions
|
@ -2910,6 +2910,7 @@
|
|||
SUBDIR += py-fortran
|
||||
SUBDIR += py-freebsd
|
||||
SUBDIR += py-fudge
|
||||
SUBDIR += py-funcparserlib
|
||||
SUBDIR += py-fusefs
|
||||
SUBDIR += py-game
|
||||
SUBDIR += py-gamin
|
||||
|
|
45
devel/py-funcparserlib/Makefile
Normal file
45
devel/py-funcparserlib/Makefile
Normal file
|
@ -0,0 +1,45 @@
|
|||
# New ports collection makefile for: py-funcparserlib
|
||||
# Date created: 2011-08-02
|
||||
# Whom: TAKATSU Tomonari <tota@FreeBSD.org>
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= funcparserlib
|
||||
PORTVERSION= 0.3.5
|
||||
CATEGORIES= devel python
|
||||
MASTER_SITES= CHEESESHOP
|
||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||
|
||||
MAINTAINER= tota@FreeBSD.org
|
||||
COMMENT= Recurisve descent parsing library based on functional combinators
|
||||
|
||||
LICENSE= MIT
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
|
||||
USE_PYTHON= yes
|
||||
USE_PYDISTUTILS= yes
|
||||
|
||||
DOCSDIR= ${PREFIX}/share/doc/${UNIQUENAME}
|
||||
EXAMPLESDIR= ${PREFIX}/share/examples/${UNIQUENAME}
|
||||
|
||||
PORTDOCS= README
|
||||
PORTEXAMPLES= *
|
||||
|
||||
post-install:
|
||||
.if !defined(NOPORTDOCS)
|
||||
@${MKDIR} ${DOCSDIR}
|
||||
@${INSTALL_DATA} ${INSTALL_WRKSRC}/${PORTDOCS} ${DOCSDIR}
|
||||
.endif
|
||||
.if !defined(NOPORTEXAMPLES)
|
||||
@${MKDIR} ${EXAMPLESDIR}
|
||||
@(cd ${INSTALL_WRKSRC}/examples; ${COPYTREE_SHARE} . ${EXAMPLESDIR})
|
||||
.endif
|
||||
|
||||
x-generate-plist:
|
||||
${FIND} ${PYTHON_SITELIBDIR}/${PORTNAME} -type f | ${SORT} | \
|
||||
${SED} -e 's,${PYTHON_SITELIBDIR},%%PYTHON_SITELIBDIR%%,' > pkg-plist.new
|
||||
${FIND} ${PYTHON_SITELIBDIR}/${PORTNAME} -type d -depth | ${SORT} -r | \
|
||||
${SED} -e 's,${PYTHON_SITELIBDIR},@dirrm %%PYTHON_SITELIBDIR%%,' >> pkg-plist.new
|
||||
|
||||
.include <bsd.port.mk>
|
2
devel/py-funcparserlib/distinfo
Normal file
2
devel/py-funcparserlib/distinfo
Normal file
|
@ -0,0 +1,2 @@
|
|||
SHA256 (funcparserlib-0.3.5.tar.gz) = 26df79cc5f119ffc467798df5abe20518c0b9c1bba558f8ee518f08bece37cb5
|
||||
SIZE (funcparserlib-0.3.5.tar.gz) = 33117
|
21
devel/py-funcparserlib/pkg-descr
Normal file
21
devel/py-funcparserlib/pkg-descr
Normal file
|
@ -0,0 +1,21 @@
|
|||
Parser combinators are just higher-order functions that take parsers as
|
||||
their arguments and return them as result values. Parser combinators are:
|
||||
|
||||
* First-class values
|
||||
* Extremely composable
|
||||
* Tend to make the code quite compact
|
||||
* Resemble the readable notation of xBNF grammars
|
||||
|
||||
Parsers made with funcparserlib are pure-Python LL(*) parsers. It means that
|
||||
it's very easy to write them without thinking about look-aheads and all that
|
||||
hardcore parsing stuff. But the recursive descent parsing is a rather slow
|
||||
method compared to LL(k) or LR(k) algorithms.
|
||||
|
||||
So the primary domain for funcparserlib is parsing little languages or external
|
||||
DSLs (domain specific languages).
|
||||
|
||||
The library itself is very small. Its source code is only 0.5 KLOC, with lots
|
||||
of comments included. It features the longest parsed prefix error reporting,
|
||||
as well as a tiny lexer generator for token position tracking.
|
||||
|
||||
WWW: http://code.google.com/p/funcparserlib/
|
13
devel/py-funcparserlib/pkg-plist
Normal file
13
devel/py-funcparserlib/pkg-plist
Normal file
|
@ -0,0 +1,13 @@
|
|||
%%PYTHON_SITELIBDIR%%/funcparserlib/__init__.py
|
||||
%%PYTHON_SITELIBDIR%%/funcparserlib/__init__.pyc
|
||||
%%PYTHON_SITELIBDIR%%/funcparserlib/__init__.pyo
|
||||
%%PYTHON_SITELIBDIR%%/funcparserlib/lexer.py
|
||||
%%PYTHON_SITELIBDIR%%/funcparserlib/lexer.pyc
|
||||
%%PYTHON_SITELIBDIR%%/funcparserlib/lexer.pyo
|
||||
%%PYTHON_SITELIBDIR%%/funcparserlib/parser.py
|
||||
%%PYTHON_SITELIBDIR%%/funcparserlib/parser.pyc
|
||||
%%PYTHON_SITELIBDIR%%/funcparserlib/parser.pyo
|
||||
%%PYTHON_SITELIBDIR%%/funcparserlib/util.py
|
||||
%%PYTHON_SITELIBDIR%%/funcparserlib/util.pyc
|
||||
%%PYTHON_SITELIBDIR%%/funcparserlib/util.pyo
|
||||
@dirrm %%PYTHON_SITELIBDIR%%/funcparserlib
|
Loading…
Reference in a new issue