Parser
Parser
class Parser implements ParserInterface
CSS selector parser.
This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect.
Methods
__construct(Tokenizer $tokenizer = null) Constructor. | ||
SelectorNode[] | parse(string $source) Parses given selector source into an array of tokens. | |
static array | parseSeries(array $tokens) Parses the arguments for ":nth-child()" and friends. |
Details
__construct(Tokenizer $tokenizer = null)
Constructor.
Parameters
Tokenizer | $tokenizer |
SelectorNode[] parse(string $source)
Parses given selector source into an array of tokens.
Parameters
string | $source |
Return Value
SelectorNode[] |
static array parseSeries(array $tokens)
Parses the arguments for ":nth-child()" and friends.
Parameters
array | $tokens |
Return Value
array |
Exceptions
SyntaxErrorException |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.3/Symfony/Component/CssSelector/Parser/Parser.html