You are here

public function CssParser::parse in QueryPath 7.2

Same name and namespace in other branches
  1. 6 QueryPath/CssParser.php \CssParser::parse()
  2. 7.3 QueryPath/CssParser.php \CssParser::parse()

File

QueryPath/CssParser.php, line 125

Class

CssParser

Code

public function parse() {
  $this->scanner
    ->nextToken();
  while ($this->scanner->token !== FALSE) {
    $position = $this->scanner
      ->position();
    if ($this->DEBUG) {
      print "PARSE " . $this->scanner->token . "\n";
    }
    $this
      ->selector();
    $finalPosition = $this->scanner
      ->position();
    if ($this->scanner->token !== FALSE && $finalPosition == $position) {
      throw new CssParseException('CSS selector is not well formed.');
    }
  }
}