text.The result of this stage is an AST which consists mostly of text nodes but also redirect links, transclusion nodes and the nodes of tag extensions. 3. Expansion Pages in a MediaWiki are often built using templates, magic words, parser functions and tag extensions. To use the AST in a WYSIWYG editor, one would leave out expansion to see the unexpanded transclusion statements and parser function calls in the original page. However, for rendering the content e.g. as HTML page these must be processed to get the complete output. Moreover, pages used as templates can themselves transclude other pages which makes expansion a recursive process. 4. Parsing Before parsing starts, the AST has to be converted back into Wikitext. Once this step is done, a PEG parser analyzes the text and generates an AST capturing the syntax and semantics of the wiki page. 5. Post-processing In this stage tags are matched to form whole output elements. Moreover, apostrophes are analyzed to decide which of them are real prose apostrophes and which have to be interpreted as markup for bold or italic font in Wikitext. The assembly of paragraphs is also handled in this step. Hereby, the AST is processed using a depth-first traversal on the tree structure. The rendering of the different kinds of output as well as the analyzing functions are realized as Visitors. This helps to separate the AST data structure from the algorithms that operate on the data. References Parsing MediaWiki Compiling tools Unix programming tools