* @copyright 2010-2014 Justin Swanhart and André Rothe * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) * @version SVN: $Id$ * */ namespace PHPSQLParser\processors; use PHPSQLParser\utils\ExpressionType; /** * This class processes the statement options. * * @author André Rothe * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) * */ class OptionsProcessor extends AbstractProcessor { public function process($tokens) { $resultList = array(); foreach ($tokens as $token) { $tokenList = $this->splitSQLIntoTokens($token); $result = array(); foreach ($tokenList as $reserved) { $trim = trim($reserved); if ($trim === '') { continue; } $result[] = array('expr_type' => ExpressionType::RESERVED, 'base_expr' => $trim); } $resultList[] = array('expr_type' => ExpressionType::EXPRESSION, 'base_expr' => trim($token), 'sub_tree' => $result); } return $resultList; } } ?>