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 |
---|
string
the token that we wish to classify
boolean
if true
string
string
possible values are 'literal', 'tag', 'pseudoclass' and 'pseudoelement'
_meaningfulWhitespace(integer $k, string $selector) : boolean
access |
private |
---|
integer
the current char in the $selector
string
the selector we are parsing
boolean
tokenize(string $selector, boolean $valXPath = false) : array|NULL
access |
public |
---|
string
boolean
if true will check for non-aceptable XPath pesudoclass and pseudoelements
array|NULL
an array with all tokens together with their types or NULL if $validXPathSelector has been set to true and the CSS selector has XPath equivalent