FSK B

>b's weblog

News. Journal. Whatever.

Weil's aktueller ist denn jeFacebook-Aktie: “Das Geld dieser Leute ist nicht vom Himmel gefallen, es stammt von denen, die blöd genug waren, auf den Hype hereinzufallen.”

pyPEG 2.0 published

This time it's more a bigger thing. pyPEG didn't only move to Python 3.x. It's a complete rewrite, and it's more what pyPEG should have looked like from the beginning.

I'm now introducing the concept of an intrinsic parser interpreter. The point there is, that such an intrinsic parser integrates into the type and object system of the embedding programming language. For pyPEG 2.0 that means, it integrates into the type and object system of Python 3.x. This allows pyPEG not only to be used as a parser where semantic actions aren't needed any more. It is possible, too, to use it the other way around: as a code generator template framework. Of course there is some theory behind that. I didn't publish that yet. Actually, this work is not yet in a form I want to publish. But because I need this thing myself, I'm bringing forward the concrete result now. I hope this will not only help me ;-)

Because pyPEG 2.0 is now a more real thing, I switched to some better form of publishing. I uploaded to bitbucket. There is a PyPI entry for pyPEG2 now. And as usual, there is some documentation on the web, including a lot of sample code. I will continue to maintain pyPEG 1.x for Python 2.x. You can find it here.

If you have feedback or find bugs, please use the issue tracker of bitbucket. I will frequently read this and try to work on what's going in. Have fun with pyPEG ;-)

>>> from pypeg2 import *
>>> parse("hello, world", csl(Symbol))
[Symbol('hello'), Symbol('world')]
>>> compose([Symbol('hello'), Symbol('world')], csl(Symbol))
'hello, world'
publiziert Wed, 23 May 2012 14:28:59 +0200 #freesoftware #pyPEG #software

Zurück zum Blogindex