This lexer will let us to extract the relevant tokens from our input string: a CSS selector
| package |
Docxpresso |
|---|---|
| subpackage |
Parser |
__construct()
| access |
public |
|---|---|
_detectTokenType(string $tok, boolean $valXPath, string $previous = '') : string
| access |
private |
|---|
stringthe token that we wish to classify
booleanif true
string
stringpossible values are 'literal', 'tag', 'pseudoclass' and 'pseudoelement'
_meaningfulWhitespace(integer $k, string $selector) : boolean
| access |
private |
|---|
integerthe current char in the $selector
stringthe selector we are parsing
boolean
tokenize(string $selector, boolean $valXPath = false) : array|NULL
| access |
public |
|---|
string
booleanif true will check for non-aceptable XPath pesudoclass and pseudoelements
array|NULLan array with all tokens together with their types or NULL if $validXPathSelector has been set to true and the CSS selector has XPath equivalent