[openstack-dev] [all] parsing libraries

Eric K ekcs.openstack at gmail.com
Tue Feb 21 02:48:29 UTC 2017


Hi all,

In the congress project, we¹re looking to replace the antlr3-based parser
with a better maintained alternative. I see that pyparsing and Parsley are
used in some projects, could anyone share their experience with them and
potentially other parsing libraries?

The intended use is to parse input into abstract syntax trees according to
a grammar like this:
https://github.com/openstack/congress/blob/master/congress/datalog/Congress
.g

More specific questions:
- how would they do on a grammar that¹s slightly more complex than the
typical usage? e.g.,
https://github.com/openstack/congress/blob/master/congress/datalog/Congress
.g

- does anyone know if Parsley is well-maintained? Their repo seems to be
very quiet over the past 2 yrs
https://github.com/python-parsley/parsley/graphs/contributors?from=2015-02-
01&to=2017-02-20&type=c

- Any thoughts or comments on the other Other libraries I¹m considering?
(these are more geared toward larger grammars)
-- Grako https://pypi.python.org/pypi/grako/3.19.1

-- PLY https://pypi.python.org/pypi/ply/3.10
-- I have ³soft-rejected² Antlr4 because the AST feature has been removed.
If I have to put in non-trivial work anyway (to create the AST), I figure
I might as well invest the work into moving to a pure Python framework.
But would love to hear more if someone thinks it¹s the way to go!

Thanks so much!

Eric





More information about the OpenStack-dev mailing list