chomsky

1.0.2 BSD License    
  UNRATED

  248 downloads

Another language grammar parser

description

download

specs

chomsky is yet another language grammar parser, inspired by modgrammar and pyparsing.

Developer comments

I needed a language grammar parser for the plywood_ project, and modgrammar_ looked like it would be perfect, except I couldn't get the simplest of grammars to work. pyparsing_ is excellent, but doesn't give me objects back, only lists and strings - I need more than that. I would recommend pyparsing_ for *your* project. Unless you really want objects, or if you are doing a language (chomsky_ has lots of built-in stuff for making programming language grammars).

Besides, I like writing parsers, and I know how I want this one to work, so screw it, I'll do it myself!

INSTALLATION

 pip install chomsky

USAGE

Matchers

``Matcher`` objects are the most basic building blocks.  They are not smart,
they return only strings and lists, and they make no assumptions about what you
might be trying to build.  For instance, the ``Word`` Matcher does not assume
that you want to consume whitespace.

``Matcher`` objects are great for building a small parsing language for
consistent data, where ``Grammar`` objects are not needed.  But for building a
language parser, you will probably use the more heavy-duty Grammar building
blocks.
read more   
Last updated on August 22nd, 2012

#language grammar #grammar parser #language #grammar #parser #Python

0 User reviews so far.

SUBMIT