Markup spec/ANTLR

From MediaWiki.org
Jump to: navigation, search

EBNF grammar project

Markup spec

I will henceforth be describing the wikitext grammar uniquely in ANTLR format, which has many advantages. Primarily it can be readily validated right now using ANTLR or ANTLRWorks.

  • /Images
  • /draft - Steve Bennett's horrible draft version of the grammar. Feel free to improve.

Status[edit | edit source]

Currently "promising vaporware".

  • Good: ANTLR grammar looks capable of describing much more of MediaWiki wikitext than EBNF.
  • Bad:
    • ANTLR doesn't yet render to PHP.
      • Will need someone to write the PHP generation target. Supposedly it is about a week's work for someone well versed in PHP.
    • ANTLR's generated Java is huge and slow.
      • I'm not certain it's that slow, and with a bit of fine tuning should be fast enough. It's certainly huge though. Best not to look at it before breakfast.
    • ANTLR is buggy.
      • I think many of the bugs I've seen are really ANTLRworks (the IDE) bugs, rather than ANTLR itself. It has some bugs, and is in active development. So, while the instability of the IDE is a bit of a pain for developing the grammar, once the grammar itself is stable, that shouldn't be a big problem.
Language: English