python-pyparsing

Alternative to creating and executing simple grammars - Python 2.7
  https://github.com/pyparsing/pyparsing/
  1
  1 review



The parsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions. The parsing module provides a library of classes that client code uses to construct the grammar directly in Python code.

Here's an example:

from pyparsing import Word, alphas
greet = Word(alphas) + "," + Word(alphas) + "!"
hello = "Hello, World!"
print hello, "->", greet.parseString(hello)
This package contains the Python 2.7 module.
Latest reviews
4
blueXrider 12 years ago

quite nice