pub enum Rule {
Show 15 variants
EOI,
html,
elements,
element,
opening_tag,
closing_tag,
self_closed_tag,
tag_name,
attribute_list,
attribute,
identifier,
quoted_string,
content,
text,
WHITESPACE,
}Variants§
EOI
End-of-input
html
The starting rule of the HTML parser.
It ensures that the input begins (SOI) and ends (EOI) correctly,
encapsulating all HTML elements.
elements
Represents a sequence of HTML elements.
It allows for zero or more (*) occurrences of either
a regular element or a self_closed_tag.
element
Defines a standard HTML element with an opening tag, content, and a corresponding closing tag.
opening_tag
Represents an opening HTML tag.
It consists of a <, followed by the tag_name,
an optional list of attributes (attribute_list),
and a closing >.
closing_tag
Represents a closing HTML tag.
It consists of </, followed by the tag_name,
and a closing >.
self_closed_tag
Represents a self-closing HTML tag.
It consists of a <, followed by the tag_name,
an optional list of attributes (attribute_list),
and a /> to indicate self-closing.
tag_name
Defines the structure of a tag name.
It must start with one or more ASCII alphabetic characters (ASCII_ALPHA+)
and can optionally be followed by a digit (ASCII_DIGIT?).
attribute_list
Represents a list of attributes within a tag.
It allows for zero or more (*) attribute entries.
attribute
Defines an individual attribute within a tag.
It consists of an identifier, an =, and a quoted_string.
identifier
Defines an identifier used for attribute names.
It must consist of one or more ASCII alphabetic characters (ASCII_ALPHA+).
quoted_string
Represents a quoted string value for an attribute.
It starts and ends with a double quote ("),
and contains zero or more characters that are not double quotes.
content
Defines the content within an HTML element.
It allows for zero or more (*) occurrences of either
another element, text, or a self_closed_tag.
text
Represents textual content within an HTML element.
It consists of one or more characters that are not <.
WHITESPACE
Defines the whitespace characters used in the grammar.
It includes space ( ), tab (\t), newline (\n), and carriage return (\r).