public function process($tokenList, $token_category = 'INSERT')
{
$table = '';
$cols = false;
$comments = array();
foreach ($tokenList as $key => &$token) {
if ($key == 'VALUES') {
continue;
}
foreach ($token as &$value) {
if ($this->isCommentToken($value)) {
$comments[] = parent::processComment($value);
$value = '';
}
}
}
$parsed = $this->processOptions($tokenList);
unset($tokenList['OPTIONS']);
list($table, $cols, $key) = $this->processKeyword('INTO', $tokenList);
$parsed = array_merge($parsed, $key);
unset($tokenList['INTO']);
if ($table === '' && in_array($token_category, array('INSERT', 'REPLACE'))) {
list($table, $cols, $key) = $this->processKeyword($token_category, $tokenList);
}
$parsed[] = array('expr_type' => ExpressionType::TABLE, 'table' => $table, 'no_quotes' => $this->revokeQuotation($table), 'alias' => false, 'base_expr' => $table);
$cols = $this->processColumns($cols);
if ($cols !== false) {
$parsed[] = $cols;
}
$parsed = array_merge($parsed, $comments);
$tokenList[$token_category] = $parsed;
return $tokenList;
}