HTML BNF
HTML
{Document} := [<HTML>] {Head} {Body} [</HTML>]
{Head} := [<HEAD>] {Head-Elements} [</HEAD>]
{Body} := [<BODY>] {Body-Elements} [</BODY>]
{Script} := [<SCRIPT>] {Script-Source} [</SCRIPT>]
{Style} := [<STYLE>] {Style-Sheet} [</STYLE>]
{Head-Elements} := <TITLE> {Title-Text} </TITLE>
:= <META HTTP-HEADER={Attr-Value} CONTENT={Attr-Value}>
:= {Script}
:= {Style}
{Body-Elements} := {block}
TAGS
{Html-Tag} := {tag-open} [/] {Tag-Name} {Tag-Attributes} {tag-close}
{Tag-Name} := {Item-Name}
{Tag-Attributes} := NULL | {S} {Tag-Attribute}
{Tag-Attribute} := {Attr-Name} [ [{S}] = [{S}] {Attr-Value}]
{Attr-Name} := {Item-Name}
{Attr-Value} := {text}
:= {DQ}{text-SQ}{DQ}
:= {SQ}{text-DQ}{SQ}
{Item-Name} := {alpha-char}{chars}
{tag-open} := <
{tag-close} := >
BASICS
{text-DQ} := NULL | {text} [{S}|{DQ}] {text-DQ}
{text-SQ} := NULL | {text} [{S}|{SQ}] {text-SQ}
{text} := NULL | {chars}
{chars} := {char} {chars}
{char} := {digit} | {alpha}
{digits} := {digit}{digits}
{digit} := 0-9
{alpha} := {alpha-upper} | {alpha-lower}
{alpha-upper} := A-Z
{alpha-lower} := a-z
{DQ} := "
{SQ} := '
{S} := BLANK | {S} BLANK