Browsable MediaWiki Grammar

CC-BY

Grammar connected by Vadim Zaytsev, see the Grammar Zoo entry for details: doc/wiki/mediawiki/ebnf/connected
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)? end_link 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 ::=
	line_break " " text
nowiki ::=
	"<nowiki>" text "</nowiki>"
unordered_list ::=
	"*" text
continue_unordered_list ::=
	(unordered_list | continue_unordered_list | ":" | "*" | "#") line_break unordered_list
ordered_list ::=
	"#" text
continue_ordered_list ::=
	(ordered_list | continue_ordered_list | ":" | "*" | "#") line_break ordered_list
definition_list ::=
	text? ":" text
continue_definition_list ::=
	(definition_list | continue_definition_list | ":" | "*" | "#") line_break 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 | line_break)* "__TOC__" (whitespace | line_break)*
force_TOC ::=
	(whitespace | line_break)* "__FORCETOC__" (whitespace | line_break)*
disable_TOC ::=
	(whitespace | line_break)* "__NOTOC__" (whitespace | line_break)*
disable_section_edit ::=
	(whitespace | line_break)* "__NOEDITSECTION__" (whitespace | line_break)*
table_start ::=
	"{|" (style | whitespace)* line_break
table_end ::=
	"|}"
table_header ::=
	"|+" text line_break
table_header_cell ::=
	line_break "!" (style | whitespace)* text
	table_cell ("!!" | "||") (style | whitespace)* text
table_cell ::=
	line_break "|" (style | whitespace)* text
	table_cell "||" (style | whitespace)* text
table_row ::=
	line_break "|-" "-"* (style | whitespace)* line_break
table_body ::=
	(table_header_cell | table_cell) (table_row (table_header_cell | table_cell))*
table ::=
	table_start table_header? table_row? table_body table_end
Unicode_char ::=
	α
header ::=
	header1
	header2
	header3
	header4
	header5
	header6

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