mini\Html\CssSelectorParser
class
Documentation
CSS Selector Parser — lexer + recursive descent parser.
Supports: tag, #id, .class, [attr], [attr="value"], *, descendant (space), child (>), and selector lists (comma). Throws on unsupported syntax.
Grammar: selectorList = complexSelector (',' complexSelector)* complexSelector = compoundSelector (combinator compoundSelector)* combinator = '>' | WS compoundSelector = simpleSelector+ simpleSelector = '*' | IDENT | HASH | '.' IDENT | '[' IDENT ('=' (STRING | IDENT))? ']'
Constants (12)
| Name | Value |
|---|---|
T_IDENT |
'IDENT' |
T_HASH |
'HASH' |
T_DOT |
'DOT' |
T_LBRACKET |
'LBRACKET' |
T_RBRACKET |
'RBRACKET' |
T_EQUALS |
'EQUALS' |
T_STRING |
'STRING' |
T_COMMA |
'COMMA' |
T_GT |
'GT' |
T_STAR |
'STAR' |
T_WS |
'WS' |
T_EOF |
'EOF' |
Properties (4)
private
static
string $pattern
private
string $selector
private
array $tokens
private
int $cursor
Methods (11)
Documentation missing
Parse a CSS selector string.
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing
Documentation missing