browser/docs/html_grammar.txt

16 lines
405 B
Plaintext
Raw Normal View History

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