@@ -0,0 +1,2521 @@
+/*%0A * Copyright 2012 Ivan Masmitj%C3%A0%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage net.compactsys.androlib.text;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.IOException;%0A%0Apublic final class SqlParser %7B%0A%0A    private SqlParser() %7B%0A    %7D%0A%0A    /**%0A     * Parses a SQL file and gets all SQL statements.%0A     *%0A     * @param sqlFile SQL File%0A     * @return Array of al SQL statements%0A     * @throws IOException%0A     */%0A    public static String%5B%5D parseSqlFile(BufferedReader sqlFile)%0A            throws IOException %7B%0A        String line;%0A        StringBuilder sql = new StringBuilder();%0A        String multiLineComment = null;%0A%0A        while ((line = sqlFile.readLine()) != null) %7B%0A            line = line.trim();%0A%0A            // Check for start of multi-line comment%0A            if (multiLineComment == null) %7B%0A                // Check for first multi-line comment type%0A                if (line.startsWith(%22/*%22)) %7B%0A                    if (!line.endsWith(%22*/%22)) %7B%0A                        multiLineComment = %22/*%22;%0A                    %7D%0A                    // Check for second multi-line comment type%0A                %7D else if (line.startsWith(%22%7B%22)) %7B%0A                    if (!line.endsWith(%22%7D%22)) %7B%0A                        multiLineComment = %22%7B%22;%0A                    %7D%0A                    // Append line if line is not empty or a single line comment%0A                %7D else if (!line.startsWith(%22--%22) && !line.equals(%22%22)) %7B%0A                    sql.append(%22 %22 + line);%0A                %7D // Check for matching end comment%0A            %7D else if (multiLineComment.equals(%22/*%22)) %7B%0A                if (line.endsWith(%22*/%22)) %7B%0A                    multiLineComment = null;%0A                %7D%0A                // Check for matching end comment%0A            %7D else if (multiLineComment.equals(%22%7B%22)) %7B%0A                if (line.endsWith(%22%7D%22)) %7B%0A                    multiLineComment = null;%0A                %7D%0A            %7D%0A        %7D%0A        sqlFile.close();%0A        return sql.toString().trim().split(%22%5C%5Cs*;%5C%5Cs*%22);%0A    %7D%0A%7D%0A

Add SqlParser