public Calculator(String exp) {
        Stack<AbstractExpression> stack = new Stack<AbstractExpression>();
        char chArray[] = exp.toCharArray();
        AbstractExpression left = null;
        AbstractExpression right = null;
        for (int i = 0; i < chArray.length; ++i) {
            switch (chArray[i]) {
                case '+':
                    left = stack.pop();
                    right = new NonterminalExpression(String.valueOf(chArray[++i]));
                    stack.push(new AddExpression(left, right));
                    break;
                case '-':
                default:
                    stack.push(new NonterminalExpression(String.valueOf(chArray[i])));
            }
        }
        this.expression = stack.pop();
    }