public String[] preprocess(String sourceCode) throws BadLabelFormatError {
        String[] lines = sourceCode.split("\\n");
        //ArrayList<String> newLines = new ArrayList(lines.length);
        Console.log("Preprocessing...", "info");
        labelTable = new Hashtable<String, Short>(20);
        short memoryPointer = 0;
        for (int i = 0; i < lines.length; i++) {
            String line = lines[i];
            line = Misc.deleteComment(line);
            int colonPos = line.indexOf(':');
            if (line.startsWith("\"") && line.endsWith("\"") && line.length() > 1) {
            	line.replaceAll("\\\"", "\"");
            	memoryPointer += line.length() - 1;
            } else
            if (colonPos != -1) {
                String label = line.substring(0, colonPos).trim().toLowerCase();
                if (label.matches("[\\w-]+")) {
                    if (!labelTable.containsKey(label)) {
                        labelTable.put(label, memoryPointer);
                        Console.log("New label: \"" + label + "\"\t found in line " + (i + 1) + ".");
                    } else {
                        Console.log("Warning: Duplicated label found in line " + (i + 1) + ": \"" + label + "\"\nwhich will be ignored.", "warning");
                    }
                    line = line.substring(colonPos + 1);
                    if (!line.matches("\\s*")) {
                        memoryPointer++;
                    }
                } else {
                    Console.log("Compile Error in line " + (i + 1) + ": \t" + line, "error");
                    throw new BadLabelFormatError(label);
                }
            } else {
                if (!line.matches("\\s*")) {
                    memoryPointer++;
                }
            }
            lines[i] = line.trim();
        }
        Console.log("Preprocessing finished.", "emphasis");
        return lines;
    }