Exemple #1
0
 /**
  * Parses a query string.
  * 
  * @return ParserResult
  */
 public function parse()
 {
     // Parse & build AST
     $AST = $this->_QueryLanguage();
     // Check for end of string
     if ($this->_lexer->lookahead !== null) {
         //var_dump($this->_lexer->lookahead);
         $this->syntaxError('end of string');
     }
     // Create SqlWalker who creates the SQL from the AST
     $sqlWalker = new SqlWalker($this->_query, $this->_parserResult, $this->_queryComponents);
     // Assign an SQL executor to the parser result
     $this->_parserResult->setSqlExecutor(Exec\AbstractExecutor::create($AST, $sqlWalker));
     return $this->_parserResult;
 }