sqlparser/sqlparser.cpp
// Prepend the range of tokens (inclusively)
Prepend the range of tokens (inclusively)
Prepend the range of tokens ( inclusively )
Token* SqlParser::PrependCopy(Token *token, Token *first, Token *last, bool prepend_removed)
{
	if(token == NULL || first == NULL)
		return NULL;
	Token *cur = first;
	Token *last_added = NULL;
	while(cur != NULL)
	{
		bool removed = cur->IsRemoved();
		if(removed == false || (removed == true && prepend_removed == true))
			last_added = PrependCopy(token, cur);
		if(first == last || last == NULL)
			break;
		if(cur == last)
			break;
		cur = cur->next;
	}
	return last_added;
}
Token * SqlParser :: PrependCopy ( Token * token , Token * first , Token * last , bool prepend_removed ) { if ( token == NULL || first == NULL ) return NULL ; Token * cur = first ; Token * last_added = NULL ; while ( cur != NULL ) { bool removed = cur -> IsRemoved ( ) ; if ( removed == false || ( removed == true && prepend_removed == true ) ) last_added = PrependCopy ( token , cur ) ; if ( first == last || last == NULL ) break ; if ( cur == last ) break ; cur = cur -> next ; } return last_added ; }
Prepend the range of tokens (inclusively)
Prepend the range of tokens ( inclusively )
// Check whether we need to skip already removed tokens // Prepend single token only // Tokens prepended inclusively