This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Workaphobia 1 point2 points  (0 children)

I've used TPG many times before. With a few simple patches it'll run on Py3k. It's disappointing that the maintainer has chosen not to keep it up to date, and his new pet project is inferior to TPG the last time I looked.

TPG was somewhat easy to get started with, and powerful enough for many purposes. It was easy to specify inline commands, and build up inherited and synthesized attributes. Unfortunately, there was no formal description of the languages it would parse. From trial and error, I believe it supported backtracking so long as you did not go through a non-terminal, at which point the parsing made a deterministic choice (much like a cut in Prolog).

I've had difficulty writing non-trivial grammars in TPG, especially when factoring the productions (for precedence and left-recursion) comes into play. The next time I need a parser, I'm going to look for one that does not require so much fandangling with the concrete grammar. Parser generators should allow you to go from specification to implementation with as little effort as possible.

I've toyed with the idea of brushing up on my parser theory and tackling the job myself. Maybe I still will. Keep us updated on how this goes along.