ANTLR (?)

January 31, 2008 – 9:37 am

DrProject’s wiki parser has reached—in fact, passed—the point of no return. We tried replacing it a couple of years ago, but the results were disappointing. I’m now thinking about trying again using ANTLR to generate a (Python) parser. Yes, it means developers will have to use a Java tool in development, but (a) I hope that only a few people will ever need to muck with the parsing (we’ll check in the generated grammar), and (b) as far as I can tell,the pure-Python alternatives are not as well developed, documented, or supported. Plus, this gives me an excuse to do some coding—it’s been three and a half years, and I’d like to contribute something to DrProject besides bugs. I’m starting in on the documentation now; if you’re in Toronto, and consider yourself an ANTLR whiz, please drop me a line.

  1. 4 Responses to “ANTLR (?)”

  2. Oooooor parse the page as soon as it’s submitted and cache the result? I believe that’s how most modern wiki’s work.

    Although it wouldn’t hurt Dr. Project to adopt a more modern wiki syntax like markdown or something hip like that.

    By Andrey on Jan 31, 2008

  3. Well, I’m not an ANTLR whiz, but I’ld love to learn it. Perhaps a set of blog posts on the topic as you convert the code to Python would be a neat idea. (And if you had any questions, I’ld be happy to find the answers for you. It’s only fair, since rewriting the parser will save me time and frustration in the long run. ;)

    Also, is this a new template for the blog? It seems more… sterile, or something.

    By Blake Winton on Jan 31, 2008

  4. Following up on Andrey’s suggestion, I’m now looking at http://www.freewisdom.org/projects/python-markdown/ and http://code.google.com/p/python-markdown2/. The first is easier to read (since it’s not a direct translation from Perl); the second is faster and a little shorter (but does text-to-text, rather than text-to-DOM-to-text, which I’d prefer). Adopting either would require us to rewrite all our wiki pages, but on the other hand, it’d save us having to document our wiki syntax ourselves…

    By Greg Wilson on Feb 2, 2008

  1. 1 Trackback(s)

  2. Feb 12, 2008: The Third Bit » Blog Archive » Reviewing Markdown

Post a Comment