import java.util.*;

public class MathsParser
{
    public MathsParser (boolean debug)
    {
        _debug = debug;
    }

    public long parse (Vector<String> data)
    {
        long finalResult = 0;

        for (int i = 0; i < data.size(); i++)
        {
            String currentLine = data.elementAt(i);
            long currentResult = 0;
            Stack<Character> operators = new Stack<Character>();
            Stack<Long> values = new Stack<Long>();
            char[] lineArray = currentLine.trim().toCharArray();
        }

        return finalResult;
    }

    private boolean _debug;
}
@@ -113,24 +113,149 @@
 bug;%0A    %7D%0A%0A
+    /**%0A     * All numbers within expressions are single digit so we can continue to use them as%0A     * characters.%0A     */%0A%0A
     public l
@@ -320,16 +320,17 @@
 sult = 0
+L
 ;%0A%0A     
@@ -466,16 +466,17 @@
 sult = 0
+L
 ;%0A      
@@ -640,21 +640,2495 @@
 m().
-toCharArray()
+replaceAll(%22%5C%5Cs%22, %22%22).toCharArray(); // remove all spaces%0A            char operator = Tokens.SPACE;%0A%0A            for (int j = 0; j %3C lineArray.length; j++)%0A            %7B%0A                switch (lineArray%5Bj%5D)%0A                %7B%0A                    case Tokens.PLUS:%0A                    case Tokens.MULTIPLY:%0A                    %7B%0A                        operator = lineArray%5Bj%5D;%0A                    %7D%0A                    break;%0A                    case Tokens.OPEN_BRACE:%0A                    %7B%0A                        operators.push(operator);%0A                        operator = Tokens.SPACE;%0A%0A                        values.push(currentResult);%0A                        currentResult = 0L;%0A                    %7D%0A                    break;%0A                    case Tokens.CLOSE_BRACE:%0A                    %7B%0A                        switch (operators.pop())%0A                        %7B%0A                            case Tokens.PLUS:%0A                            %7B%0A                                currentResult += values.pop();%0A                            %7D%0A                            break;%0A                            case Tokens.MULTIPLY:%0A                            %7B%0A                                currentResult *= values.pop();%0A                            %7D%0A                            break;%0A                            default:%0A                            %7B%0A                                currentResult = values.pop();%0A                            %7D%0A                            break;%0A                        %7D%0A                    %7D%0A                    break;%0A                    default:%0A                    %7B%0A                        switch (operator)%0A                        %7B%0A                            case Tokens.PLUS:%0A                            %7B%0A                                currentResult += Character.getNumericValue(lineArray%5Bj%5D);%0A                            %7D%0A                            break;%0A                            case Tokens.MULTIPLY:%0A                            %7B%0A                                currentResult *= Character.getNumericValue(lineArray%5Bj%5D);%0A                            %7D%0A                            break;%0A                            default:%0A                            %7B%0A                                currentResult = Character.getNumericValue(lineArray%5Bj%5D);%0A                            %7D%0A                            break;%0A                        %7D%0A                    %7D%0A                %7D%0A            %7D%0A%0A            finalResult += currentResult
 ;%0A  

Update MathsParser.java