sqlparser/sqlparser.cpp
// Append the range of tokens (inclusively)
Append the range of tokens (inclusively)
Append the range of tokens ( inclusively )
Token* SqlParser::AppendCopy(Token *token, Token *first, Token *last, bool append_removed)
{
	if(token == NULL || first == NULL)
		return NULL;
	Token *cur = first;
	Token *new_first = NULL;
    int cnt = 1000;
	while(cur != NULL && cnt != 0)
	{
		bool removed = cur->IsRemoved();
		if(removed == false || (removed == true && append_removed == true))
		{
			Token *append = AppendCopy(token, cur);
			if(new_first == NULL)
				new_first = append;
		}
		if(first == last || last == NULL)
			break;
		if(cur == last)
			break;
		cur = cur->next;
        cnt--;
	}
	return new_first;
}
Token * SqlParser :: AppendCopy ( Token * token , Token * first , Token * last , bool append_removed ) { if ( token == NULL || first == NULL ) return NULL ; Token * cur = first ; Token * new_first = NULL ; int cnt = 1000 ; while ( cur != NULL && cnt != 0 ) { bool removed = cur -> IsRemoved ( ) ; if ( removed == false || ( removed == true && append_removed == true ) ) { Token * append = AppendCopy ( token , cur ) ; if ( new_first == NULL ) new_first = append ; } if ( first == last || last == NULL ) break ; if ( cur == last ) break ; cur = cur -> next ; cnt -- ; } return new_first ; }
Append the range of tokens (inclusively)
Append the range of tokens ( inclusively )
// Check whether we need to skip already removed tokens // Append single token only // Tokens appended inclusively