mediawiki syntax is never converted to a parse tree
it’s a sequence of regular expression search and replace operations that convert it directly to HTML that are run repeatedly over each others output, plus a bunch more logic written directly in PHP.