browser/docs/html_grammar.txt
2023-09-29 00:30:43 -04:00

16 lines
404 B
Plaintext

Defined Tokens
<str> => any text in quotes ex: "Hello World!"
<ident> => text not inside of quotes ex: h3
---
<doc> ::= [<doctype>] <elem>
<doctype> ::= "<" "!" "doctype" "html" ">"
<elem> ::=
| "<" <ident> <attr>* ">" (<elem> | <inner>)* "<" "/" <ident> ">"
| "<" <ident> <attr>* "/" ">"
<attr> ::= <ident> "=" <str>
<inner> ::= (<ident> | <dot> | <at> | <hash> | <num> | <comma> | <semi>)+