Browsable MediaWiki Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: doc/wiki/mediawiki/ebnf/extracted
Source used for this grammar: MediaWiki, Markup spec/EBNF, Revision 335623, 5 July 2010 [Page]

Summary

Syntax

digit ::=
	"1"
	"2"
	"3"
	"4"
	"5"
	"6"
	"7"
	"8"
	"9"
	"0"
URL ::=
	ASCII_letter* "://" URL_char*
ASCII_letter ::=
	"a"
	"b"
	"c"
	"d"
	"e"
	"f"
	"g"
	"h"
	"i"
	"j"
	"k"
	"l"
	"m"
	"n"
	"o"
	"p"
	"q"
	"r"
	"s"
	"t"
	"u"
	"v"
	"w"
	"x"
	"y"
	"z"
	"A"
	"B"
	"C"
	"D"
	"E"
	"F"
	"G"
	"H"
	"I"
	"J"
	"K"
	"L"
	"M"
	"N"
	"O"
	"P"
	"Q"
	"R"
	"S"
	"T"
	"U"
	"V"
	"W"
	"X"
	"Y"
	"Z"
URL_char ::=
	ASCII_letter
	digit
	"-"
	"_"
	"."
	"~"
	"!"
	"*"
	"'"
	"("
	")"
	";"
	":"
	"@"
	"&"
	"="
	"+"
	"$"
	","
	"/"
	"?"
	"%"
	"#"
	"["
	"]"
text ::=
	Unicode_char*
full_pagename ::=
	(namespace ":" | ":")? pagename
namespace ::=
	Unicode_char Unicode_char*
pagename ::=
	Unicode_char Unicode_char*
start_link ::=
	"[["
end_link ::=
	"]]"
internal_link ::=
	start_link full_pagename ("|" label)? end_link label_extension
external_link ::=
	URL
	start_link URL whitespace_Label? endLink label_extension
redirect ::=
	"#REDIRECT" internal_link
header_link ::=
	"/*" text "*/"
ISBN_link ::=
	digit ("-" | " ")? digit digit digit ("-" | " ")? digit digit digit digit digit (("-" | " ") (digit | "X" | "x"))?
header_end ::=
	whitespace? line_break
header6 ::=
	line_break "======" whitespace? text whitespace? "======" header_end
header5 ::=
	line_break "=====" whitespace? text whitespace? "=====" header_end
header4 ::=
	line_break "====" whitespace? text whitespace? "====" header_end
header3 ::=
	line_break "===" whitespace? text whitespace? "===" header_end
header2 ::=
	line_break "==" whitespace? text whitespace? "==" header_end
header1 ::=
	line_break "=" whitespace? text whitespace? "=" header_end
comment ::=
	"<!--" Text? "-->"
Commentary ::=
	"<comment" Text? ">" Text? "</comment>"
horizontal_rule ::=
	"----" "-"*
bold_italic_text ::=
	"'''''" text "'''''"
bold_text ::=
	"'''" text "'''"
italic_text ::=
	"''" text "''"
code_line ::=
	linebreak " " text
nowiki ::=
	"<nowiki>" text "</nowiki>"
unordered_list ::=
	"*" text
continue_unordered_list ::=
	(unordered_list | continue_unordered_list | ":" | "*" | "#") linebreak unordered_list
ordered_list ::=
	"#" text
continue_ordered_list ::=
	(ordered_list | continue_ordered_list | ":" | "*" | "#") linebreak ordered_list
definition_list ::=
	text? ":" text
continue_definition_list ::=
	(definition_list | continue_definition_list | ":" | "*" | "#") linebreak definition_list
user_signature ::=
	"~~~"
user_signature_with_date ::=
	"~~~~"
current_date ::=
	"~~~~~"
include ::=
	template
	tplarg
template ::=
	"{{" title ("|" part)* "}}"
tplarg ::=
	"{{{" title ("|" part)* "}}}"
part ::=
	(name "=")? value
title ::=
	balanced_text
name ::=
	balanced_text
value ::=
	balanced_text
balanced_text ::=
	text_without_consecutive_equal_braces (include text_without_consecutive_equal_braces)*
place_TOC ::=
	(whitespace | linebreak)* "__TOC__" (whitespace | linebreak)*
force_TOC ::=
	(whitespace | linebreak)* "__FORCETOC__" (whitespace | linebreak)*
disable_TOC ::=
	(whitespace | linebreak)* "__NOTOC__" (whitespace | linebreak)*
disable_section_edit ::=
	(whitespace | linebreak)* "__NOEDITSECTION__" (whitespace | linebreak)*
table_start ::=
	"{|" (style | whitespace)* linebreak
table_end ::=
	"|}"
table_header ::=
	"|+" text linebreak
table_header_cell ::=
	linebreak "!" (style | whitespace)* text
	tablecell ("!!" | "||") (style | whitespace)* text
table_cell ::=
	linebreak "|" (style | whitespace)* text
	table_cell "||" (Style | WhiteSpace)* text
table_row ::=
	linebreak "|-" "-"* (style | whitespace)* linebreak
table_body ::=
	(table_header_cell | table_cell) (table_row (table_header_cell | table_cell))*
table ::=
	table_start table_row? table_body table_end
Unicode_char ::=
	α

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []