The main goal is, of course, to be able to convert wikitext to as many output formats as possible. That is why I'll first try to write a parser function to return me the document tree I would be able to parse.
So I sat down for half an hour and tried to identify each and every entity wikitext might consist of.
The results are available here: http://docs.linux.org.ua/~jaroslaw/?p=8
If anyone is interested in this, I encourage to comment on this table, especially if I've got something wrong, or the table is not complete.