New: This release fixes some bugs with packrat parsing. Homepage: http://fdik.org/pyPEG Download: http://fdik.org/pyPEG/pyPEG.py
Python is a nice scripting language. It even gives you access to it's own parser and compiler. It also gives you access to different other parsers for special purposes like XML and string templates. But sometimes you may want to have your own parser. This is what's pyPEG for. And pyPEG supports Unicode. What is PEG? PEG means Parsing Expression Grammar. It's something like the idea of Regular Expressions for context free languages; a very clear explanation you'll find in the Wikipedia article about PEG. With PEGs you can describe the same languages like with BNF (and they're even similar). What is a Parser-Interpreter? Common parsers are not using PEGs and top-down parsing, but LR(n) or LL(n) and bottom-up parsing. This results in the idea of implementing parser generators. Because with LR(n) or LL(n) parsers you need to calculate out a DFA first, usually you let the parser generator do this for you. The result is a parser implementation for your BNF grammar, which was the input. One could call a parser generator a compiler from BNF to a parser implementation. A Parser-Interpreter does work as an interpreter instead of being such a compiler. Just give your grammar as input, and it parses the described language out of text. There will be no program generated. VB. -- Volker Birk, Nobelstrasse 32, D-88131 Lindau (Bodensee), EU, Erde, Solar-System, Orion Arm, Milchstrasse, Lokale Gruppe, Virgo-Superhaufen, Coma-Virgo-Filament. mailto:ding...@bumens.org http://fdik.org D-IRCNet fdik!v...@wallaby.dingens.org -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/