25 projects tagged "General"
PyBison is a sophisticated yet easy-to-use parser creation toolkit for Python that interfaces directly to Bison (yacc)-based parsers. It provides full LALR(1) grammar support, allowing for simple parsing tasks through to writing compilers for high-level languages. Parser code is automatically generated from rules within user-created Parser classes (written in Python), and then, compiled, yacc'ed and linked into a shared library, which is loaded into the running process. All this happens automatically. When the parser runs, it connects directly with the yyparse() routine, and takes event callbacks upon parse targets being reached.
LEPL is a recursive descent parser library written in Python. It is based on parser combinator libraries popular in functional programming, but also exploits Python language features. Operators provide a friendly syntax, and the consistent use of generators supports full backtracking and resource management. Backtracking implies that a wide variety of grammars are supported; appropriate memoisation ensures that even left-recursive grammars terminate.
OOoPy is a Python library for modifying OpenOffice.org documents. It provides a set of transformations on the OOo XML format using the ElementTree XML Library. Transformations included are a mail merge application and the concatenation of documents with formatting intact. The framework supports easy creation of new transformations.
Lindenmayer Systems in Python provides a simple implementation of Lindenmayer systems (also called "L-systems" or "substitution systems"). In basic form, a Lindenmayer system consists of a starting string of symbols from an alphabet which has repeated transitions applied to it, specified by a list of transition search-and-replace rules. In addition to the standard formulation, two alternative implementations are included: sequential systems (in which at most one rule is applied) and tag systems (in which the transition only takes place at the beginning and end of the string). Despite being implemented entirely in Python, for reasonable rules on a modern machine, the system is capable of running thousands of generations per second. Lindenmayer systems are found in artificial intelligence and artificial life and can be used to generate fractal patterns (usually via mapping symbols from the alphabet to turtle commands), organic-looking patterns that can simulate plants or other living things, or even music.
Document Library is a Web application for document management in larger organizations with a lot of documents. It supports a workflow for the submission and publication of documents. It also supports the automatic conversion of document formats on the server, such as Word to PDF. All metadata about documents can be harvested using the standard OAI-PMH protocol, thus allowing the integration of Document Library with other applications, such as Web CMSs.
Yappy provides a lexical analyser and a LR parser generator for Python applications. Currently it builds SLR, LR(1), and LALR(1) parsing tables. Tables are kept in Python shelves for use in parsing. Some ambiguous grammars can be handled if priority and associativity information is provided.