User:Stevage

See en:User:Stevage.

The preprocessor does:


 * 1) Strip (hooks before/after)
 * 2) Remove HTML comments
 * 3) Replace variables
 * 4) Subst
 * 5) MSG, MSGNW, RAW
 * 6) Parser functions
 * 7) Templates

The parser does:


 * 1) Strip (hooks before, after)
 * 2) Internal parse
 * 3) Noinclude/onlyinclude/includeonly sections
 * 4) Remove HTML tags
 * 5) Replace variables
 * 6) Hooks: Internalparsebeforelinks
 * 7) Tables
 * 8) Strip TOC
 * 9) Strip no gallery ( __NOGALLERY__ )
 * 10) do headings
 * 11) Do dynamic dates
 * 12) Do quotes (  and ' )
 * 13) Replace internal links
 * 14) Replace external links
 * 15) Re-replace masked internal links
 * 16) Do magic links (ISBN, RFC...)
 * 17) Format headings ( __NEWSECTIONLINK__, ...)
 * 18) Unstrip general
 * 19) Fix tags (french spaces, guillemet)
 * 20) Blocks (lists etc)
 * 21) Replace link holders
 * 22) Parser convert
 * 23) Unstrip no wiki
 * 24) Extra tags and params
 * 25) User funcs?
 * 26) Un strip general
 * 27) Normalise char references
 * 28) Tidy + hook

The save parser does:
 * 1) Convert newlines
 * 2) Strips
 * 3) Pass 2
 * 4) Substs
 * 5) Strip again? gallery something.
 * 6) Signatures
 * 7) Pipe tricks
 * 8) Trim trailing whitespace
 * 9) Unstrips

Antlr
grammar Para;

@header { package test; import java.util.HashMap; }

@lexer::header {package test;}

@members { /** Map variable name to Integer object holding value */ HashMap memory = new HashMap; }

//article	:	(para ((specialblock NEWLINE*)| NEWLINE+))* EOF; article	:	(sp | ps)* EOF;

ps	:	para (specialblock| NEWLINE) NEWLINE*; sp	:	specialblock (para | NEWLINE) NEWLINE*;

para:  line+ ; specialblock:	 specialline +;

specialline :	 SPECIAL char* NEWLINE;

line:	 NONSPECIAL char* NEWLINE;

break	:	 NEWLINE NEWLINE; NEWLINE:'\r'? '\n' ; SPECIAL	:	'*' | ';' | ':' | ' ' | '#' | '{|'; NONSPECIAL :		'a'..'z'|'A'..'Z'|'0'..'9'|'-' | '{'; char	:	 SPECIAL | NONSPECIAL;